diff options
| author | seth <[email protected]> | 2023-08-13 15:18:07 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-08-13 15:18:07 -0400 |
| commit | 92f04aaeebdeea77adf1687328720d3583fa91f3 (patch) | |
| tree | 26f955d4c901b835fb76f07f88f380d8a0dbf4b3 | |
| parent | 547b88bfdd93a700636a1497878f2a082f95e765 (diff) | |
modules/nix+hosts: use all inputs across channels and registry
| -rw-r--r-- | hosts/profiles.nix | 21 | ||||
| -rw-r--r-- | modules/nixos/base/nix.nix | 14 |
2 files changed, 17 insertions, 18 deletions
diff --git a/hosts/profiles.nix b/hosts/profiles.nix index 149c69f..390e793 100644 --- a/hosts/profiles.nix +++ b/hosts/profiles.nix @@ -9,10 +9,12 @@ }; nix = { - registry = with inputs; { - getchoo.flake = getchoo; - nixpkgs.flake = nixpkgs; - }; + registry = + { + n.flake = inputs.nixpkgs; + } + // (builtins.mapAttrs (_: flake: {inherit flake;}) + (inputs.nixpkgs.lib.filterAttrs (n: _: n != "nixpkgs") inputs)); settings = { trusted-substituters = [ @@ -29,10 +31,13 @@ }; }; }; + + specialArgs = inputs // {inherit inputs;}; in { personal = { system = "x86_64-linux"; builder = inputs.nixpkgs.lib.nixosSystem; + inherit specialArgs; modules = with inputs; [ common @@ -58,12 +63,11 @@ in { system.stateVersion = "23.11"; } ]; - - specialArgs = inputs; }; personal-darwin = { builder = inputs.darwin.lib.darwinSystem; + inherit specialArgs; modules = with inputs; [ common home-manager.darwinModules.home-manager @@ -79,12 +83,11 @@ in { system.stateVersion = 4; } ]; - - specialArgs = inputs; }; server = { builder = inputs.nixpkgs-stable.lib.nixosSystem; + inherit specialArgs; modules = with inputs; [ ragenix.nixosModules.default @@ -121,7 +124,5 @@ in { system.stateVersion = "23.05"; } ]; - - specialArgs = inputs; }; } diff --git a/modules/nixos/base/nix.nix b/modules/nixos/base/nix.nix index 3f2bcd3..947f086 100644 --- a/modules/nixos/base/nix.nix +++ b/modules/nixos/base/nix.nix @@ -1,7 +1,7 @@ { config, lib, - pkgs, + inputs, ... }: let cfg = config.getchoo.base.nix-settings; @@ -15,7 +15,8 @@ in { ]; config = let - channelPath = "/etc/nix/channels/nixpkgs"; + channelPath = i: "/etc/nix/channels/${i}"; + mapInputs = fn: builtins.map fn (builtins.attrNames inputs); in mkIf cfg.enable { nix = { @@ -30,13 +31,10 @@ in { experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"]; }; - nixPath = [ - "nixpkgs=${channelPath}" - ]; + nixPath = mapInputs (i: "${i}=${channelPath i}"); }; - systemd.tmpfiles.rules = [ - "L+ ${channelPath} - - - - ${pkgs.path}" - ]; + systemd.tmpfiles.rules = + mapInputs (i: "L+ ${channelPath i} - - - - ${inputs.${i}.outPath}"); }; } |
