!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

862 Members
177 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
2 Dec 2024
@phaitonican:matrix.org@phaitonican:matrix.orgRedacted or Malformed Event13:33:16
6 Dec 2024
@rhelmot:matrix.orgrhelmot joined the room.04:36:51
@rhelmot:matrix.orgrhelmot

There must be something I'm not understanding about flake inputs - why does nix build github:Ma27/hydra/nix-perl-bindings-with-bugfix#hydra work perfectly, but nix build . with the following flake break with eval errors?

{
  inputs = {
    hydra.url = "github:Ma27/hydra/nix-perl-bindings-with-bugfix";
  };
  outputs = { hydra, ... }: {
    packages.x86_64-linux.default = hydra.packages.x86_64-linux.hydra;
  };
}
04:37:49
@rhelmot:matrix.orgrhelmotif I had to guess, it's using nixpkgs from my flake registry which is too far out of sync to build. How can I make it use the locked inputs from my dependency?04:38:32
@sandro:supersandro.deSandro 🐧it should be by default using the locked ones10:43:43
@sandro:supersandro.deSandro 🐧 you can check that with nix flake metadata 10:43:49
@sandro:supersandro.deSandro 🐧it could be that the flake.lock was not updated accordingly when changing inputs. Try nix flake update10:44:17
8 Dec 2024
@shawn8901:matrix.orgshawn8901 set a profile picture.19:21:34
@mwoodpatrickmx:matrix.orgmwoodpatrickmxI use a nix flake to rebuild my NixOS configuration which includes a configuration for Nginx. When I run: sudo nixos-rebuild -v test I don't see the generated nginx configuration file (nginx.conf) in the generated result directory: lrwxrwxrwx 1 root root 85 Dec 7 08:54 result -> /nix/store/xdc1ayh50k13x2mlk9199x4k88a10cds-nixos-system-nixos-24.11.20241203.b681065 What am I missing and how can I find the version that was built?20:17:01
@shawn8901:matrix.orgshawn8901 Where exactly do you look for the nginx.conf? It is not placed at /etc/nginx, but inside the /nix/store directly. When you look for the systemd unit, there should be referenced as passed via -c 20:28:02
@shawn8901:matrix.orgshawn8901 * Where exactly do you look for the nginx.conf? It is not placed at /etc/nginx, but inside the /nix/store directly. If you look for the systemd unit, there should be referenced as passed via -c 20:29:15
@mwoodpatrickmx:matrix.orgmwoodpatrickmxI can search the nix store and do find multiple versions of the file but since all dates in the nix store are the same how do I find the latest version generated. How does the nginx server determine the correct version to use. I was assuming that there would be a symbolic link pointing to the latest version from somewhere in the result directory generated by the rebuild.20:38:23
@shawn8901:matrix.orgshawn8901the systemd unit gets rebuild when the config changes.20:54:33
@shawn8901:matrix.orgshawn8901and it contains a reload config directive when the config file changes AFAIK20:58:26
@mwoodpatrickmx:matrix.orgmwoodpatrickmx Is this documented somewhere along with how to use this to determine my latest version of my nginx config file 21:17:40
@shawn8901:matrix.orgshawn8901i am not aware of that, to check the latest used i check the systemd unit with systemctl cat nginx21:19:53
@mwoodpatrickmx:matrix.orgmwoodpatrickmxThat worked21:39:49
9 Dec 2024
@bryan.bennett:matrix.orgBryan I just pgrep -fal nginx and grab the config from there. 14:03:05
10 Dec 2024
@mwoodpatrickmx:matrix.orgmwoodpatrickmx Many thanks🙂 00:32:26
@assert-inequality:matrix.orgAssertInequality Hi Everyone
I know flake-parts is the recommended way to modularize a flake, but I'm finding it a bit confusing. If the main purpose is to manage system, why can't perSystem take arbitrary options?
I'm trying to set a custom output called pkgs-unstable to be able to do nix run .#pkgs-unstable.hello along with nix run .#hello that pulls from nixos-stable
this seem to only be possible through flake = {} and not perSystem = {}? Which then defeats the purpose as I'd need to manually set the system of the unstable nixpkgs input.
19:52:37
@assert-inequality:matrix.orgAssertInequality is there a way to set arbitrary options on perSystem? 19:54:30
@assert-inequality:matrix.orgAssertInequality

Here are two examples:

Vanilla Flakes

{
  description = "Minimal multi-branch example";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs =
    inputs@{ self
    , nixpkgs
    , nixpkgs-unstable
    , flake-utils
    , ...
    }:
    let
      pkgs = import nixpkgs {
        system = "aarch64-darwin";
      };
    in
    {
      upkgs = import nixpkgs-unstable {
        system = "aarch64-darwin";
      };
      packages."aarch64-darwin" = pkgs;
    };
}

Flake Utils

{
  description = "Minimal multi-branch example";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs =
    inputs@{ self
    , nixpkgs
    , nixpkgs-unstable
    , flake-utils
    , ...
    }:
    let
      supportedSystems = [
        "x86_64-linux"
        "aarch64-linux"
        "aarch64-darwin"
      ];
    in
    flake-utils.lib.eachSystem supportedSystems
      (system:
      let
        pkgs = import nixpkgs {
          inherit system;
        };
      in
      {
        packages = pkgs;
      }) //
    flake-utils.lib.eachSystemPassThrough supportedSystems
      (system: {
        upkgs = import nixpkgs-unstable {
          inherit system;
        };
      });
}

In the Flake Util example, I'm able to build a multi-platform flake that exposes upkgs for each architecture.

Can anyone help me with recreating this minimal Flake Util setup in flake-parts ?

22:07:41
@assert-inequality:matrix.orgAssertInequality *

Here are two examples:

Vanilla Flakes

{
  description = "Minimal multi-branch example";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs =
    inputs@{ self
    , nixpkgs
    , nixpkgs-unstable
    , flake-utils
    , ...
    }:
    let
      pkgs = import nixpkgs {
        system = "aarch64-darwin";
      };
    in
    {
      upkgs = import nixpkgs-unstable {
        system = "aarch64-darwin";
      };
      packages."aarch64-darwin" = pkgs;
    };
}

Flake Utils

{
  description = "Minimal multi-branch example";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs =
    inputs@{ self
    , nixpkgs
    , nixpkgs-unstable
    , flake-utils
    , ...
    }:
    let
      supportedSystems = [
        "x86_64-linux"
        "aarch64-linux"
        "aarch64-darwin"
      ];
    in
    flake-utils.lib.eachSystem supportedSystems
      (system:
      let
        pkgs = import nixpkgs {
          inherit system;
        };
      in
      {
        packages = pkgs;
      }) //
    flake-utils.lib.eachSystemPassThrough supportedSystems
      (system: {
        upkgs = import nixpkgs-unstable {
          inherit system;
        };
      });
}

In the Flake Util example, I'm able to build a multi-platform flake that exposes upkgs for each architecture.

Can anyone help me with recreating this minimal Flake Util setup in flake-parts ?

22:08:07
@assert-inequality:matrix.orgAssertInequality *

Here are two examples:

Vanilla Flakes

{
  description = "Minimal multi-branch example";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs =
    inputs@{ self
    , nixpkgs
    , nixpkgs-unstable
    , flake-utils
    , ...
    }:
    let
      pkgs = import nixpkgs {
        system = "aarch64-darwin";
      };
    in
    {
      upkgs = import nixpkgs-unstable {
        system = "aarch64-darwin";
      };
      packages."aarch64-darwin" = pkgs;
    };
}

Flake Utils

{
  description = "Minimal multi-branch example";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs =
    inputs@{ self
    , nixpkgs
    , nixpkgs-unstable
    , flake-utils
    , ...
    }:
    let
      supportedSystems = [
        "x86_64-linux"
        "aarch64-linux"
        "aarch64-darwin"
      ];
    in
    flake-utils.lib.eachSystem supportedSystems
      (system:
      let
        pkgs = import nixpkgs {
          inherit system;
        };
      in
      {
        packages = pkgs;
      }) //
    flake-utils.lib.eachSystemPassThrough supportedSystems
      (system: {
        upkgs = import nixpkgs-unstable {
          inherit system;
        };
      });
}

In the Flake Util example, I'm able to build a multi-platform flake that exposes upkgs for each architecture.

Can anyone help me with recreating this minimal Flake Util setup in flake-parts ?

22:34:36
11 Dec 2024
@dminca:matrix.org@dminca:matrix.org left the room.14:19:07
@marijan:matrix.orgmarijan changed their profile picture.14:20:33
12 Dec 2024
@mrtni:matrix.orgmrtni joined the room.06:24:39

Show newer messages


Back to Room ListRoom Version: 6