remove nixpkgs overwrite #7

Merged
nonapode merged 1 commit from nonapode/remove-nixpkgs-overwrite into main 2025-11-26 18:47:32 +01:00
3 changed files with 18 additions and 63 deletions

View file

@ -1,9 +1,8 @@
{ nixosUsers ? {}, nixosGroups ? {}, nixosModules, hmModules ? { default = {}; }, ...}@flake: { ... }@inputs: { host, ... }@imports: let { nixosUsers ? {}, nixosGroups ? {}, nixosModules, hmModules ? { default = {}; }, ...}@flake: { ... }@inputs: { host, ... }@imports: let
host' = name: snippets: let system = hostname: { namespace ? "fbs42", nixpkgs ? "nixpkgs" }: inputs.${nixpkgs}.lib.nixosSystem {
system = { namespace?"fbs42", nixpkgs?"nixpkgs" }: inputs.${nixpkgs}.lib.nixosSystem {
specialArgs = { inherit inputs flake namespace; }; specialArgs = { inherit inputs flake namespace; };
modules = builtins.concatLists (map (base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${name}"; })) flake.lib.schema.base) modules = builtins.concatLists (map (base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${hostname}"; })) flake.lib.schema.base)
++ [ { config.networking.hostName = name; } ] ++ [ { config.networking.hostName = hostname; } ]
++ [ nixosModules.default ] ++ [ nixosModules.default ]
++ inputs.${nixpkgs}.lib.optional (inputs ? home-manager) { ++ inputs.${nixpkgs}.lib.optional (inputs ? home-manager) {
imports = [ inputs.home-manager.nixosModules.default ]; imports = [ inputs.home-manager.nixosModules.default ];
@ -17,7 +16,4 @@
; ;
}; };
cfg = assert builtins.length snippets == 1; builtins.head snippets; in builtins.mapAttrs (name: value: assert builtins.length value == 1; system name (builtins.head value)) host
in system cfg;
in builtins.mapAttrs host' host

38
flake.lock generated
View file

@ -1,42 +1,6 @@
{ {
"nodes": { "nodes": {
"hardware": { "root": {}
"locked": {
"lastModified": 1764080039,
"narHash": "sha256-b1MtLQsQc4Ji1u08f+C6g5XrmLPkJQ1fhNkCt+0AERQ=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "da17006633ca9cda369be82893ae36824a2ddf1a",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1751274312,
"narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"hardware": "hardware",
"nixpkgs": "nixpkgs"
}
}
}, },
"root": "root", "root": "root",
"version": 7 "version": 7

View file

@ -1,8 +1,3 @@
{ {
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
hardware.url = "github:nixos/nixos-hardware";
};
outputs = { self, ... }@inputs: import ./lib/flake.nix inputs ./.; outputs = { self, ... }@inputs: import ./lib/flake.nix inputs ./.;
} }