Compare commits
1 commit
7ad8bb3192
...
74ac2c76d3
| Author | SHA1 | Date | |
|---|---|---|---|
| 74ac2c76d3 |
3 changed files with 19 additions and 23 deletions
|
|
@ -1,9 +1,8 @@
|
||||||
{ nixosUsers ? {}, nixosGroups ? {}, nixosModules, hmModules ? { default = {}; }, ...}@flake: { ... }@inputs: { host, ... }@imports: let
|
{ nixosUsers ? {}, nixosGroups ? {}, nixosModules, hmModules ? { default = {}; }, ...}@flake: { nixpkgs, ... }@inputs: { host, ... }@imports: let
|
||||||
host' = name: snippets: let
|
system = hostname: { namespace?"fbs42" }: 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.home-manager.nixosModules.default ]
|
++ [ inputs.home-manager.nixosModules.default ]
|
||||||
++ [ { config.home-manager.sharedModules = [ hmModules.default ]; } ]
|
++ [ { config.home-manager.sharedModules = [ hmModules.default ]; } ]
|
||||||
|
|
@ -13,7 +12,4 @@
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
cfg = assert builtins.length snippets == 1; builtins.head snippets;
|
in builtins.mapAttrs (hostname: snippets: assert builtins.length snippets == 1; system hostname (builtins.head snippets)) host
|
||||||
in system cfg;
|
|
||||||
|
|
||||||
in builtins.mapAttrs host' host
|
|
||||||
|
|
|
||||||
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -38,16 +38,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751274312,
|
"lastModified": 1763966396,
|
||||||
"narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=",
|
"narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674",
|
"rev": "5ae3b07d8d6527c42f17c876e404993199144b6a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-24.11",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
hardware.url = "github:nixos/nixos-hardware";
|
hardware.url = "github:nixos/nixos-hardware";
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-24.11";
|
url = "github:nix-community/home-manager/release-24.11";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue