diff --git a/flake.lock b/flake.lock index 4e17655..5f20c7e 100644 --- a/flake.lock +++ b/flake.lock @@ -53,11 +53,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1675454231, - "narHash": "sha256-5rgcWq1nFWlbR3NsLqY7i/7358uhkSeMQJ/LEHk3BWA=", + "lastModified": 1675545634, + "narHash": "sha256-TbQeQcM5TA/wIho6xtzG+inUfiGzUXi8ewwttiQWYJE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "06999209d7a0043d4372e38f57cffae00223d592", + "rev": "0591d6b57bfeb55dfeec99a671843337bc2c3323", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f4ad932..cc3d837 100644 --- a/flake.nix +++ b/flake.nix @@ -49,7 +49,7 @@ gerg-desktop = lib.nixosSystem { inherit system pkgs; specialArgs = { - inherit inputs; + inherit inputs self; settings = { username = "gerg"; version = "23.05"; @@ -66,7 +66,7 @@ game-laptop = lib.nixosSystem { inherit system pkgs; specialArgs = { - inherit inputs; + inherit inputs self; settings = { username = "games"; version = "23.05"; @@ -82,7 +82,7 @@ moms-laptop = lib.nixosSystem { inherit system pkgs; specialArgs = { - inherit inputs; + inherit inputs self; settings = { username = "jo"; version = "23.05"; diff --git a/nix.nix b/nix.nix index 086fb9c..459da26 100644 --- a/nix.nix +++ b/nix.nix @@ -2,25 +2,29 @@ inputs, lib, config, + self, ... }: { nix = { - nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; - #automatically get registry from input flakes registry = - lib.attrsets.mapAttrs ( - _: source: { - flake = source; - } - ) ( - lib.attrsets.filterAttrs ( - _: source: ( - !(lib.attrsets.hasAttrByPath ["flake"] source) || source.flake == false + ( + lib.attrsets.mapAttrs ( + _: value: { + flake = value; + } + ) ( + lib.attrsets.filterAttrs ( + _: value: ( + !(lib.attrsets.hasAttrByPath ["flake"] value) || value.flake == false + ) ) + inputs ) - inputs - ); + ) + // {system = {flake = self;};}; + #automatically add registry entries to nixPath + nixPath = (lib.mapAttrsToList (name: value: name + "=" + value) inputs) ++ [("system=" + ./.)]; settings = { experimental-features = ["nix-command" "flakes" "repl-flake"]; auto-optimise-store = true; @@ -31,4 +35,5 @@ keep-derivations = false ''; }; + environment.etc."booted-system".source = self; }