lilith-pad
This commit is contained in:
parent
3d1a754d06
commit
7c51db8359
6 changed files with 55 additions and 32 deletions
25
flake.nix
25
flake.nix
|
|
@ -56,21 +56,17 @@
|
|||
} @ inputs: let
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
systemFromHardwareConf =
|
||||
hostname:
|
||||
let
|
||||
hardware = import ./hosts/${hostname}/hardware-configuration.nix;
|
||||
args = builtins.functionArgs hardware // { lib.mkDefault = lib.id; };
|
||||
in
|
||||
systemFromHardwareConf = hostname: let
|
||||
hardware = import ./hosts/${hostname}/hardware-configuration.nix;
|
||||
args = builtins.functionArgs hardware // {lib.mkDefault = lib.id;};
|
||||
in
|
||||
(hardware args).nixpkgs.hostPlatform;
|
||||
|
||||
importNixpkgs = system: nixpkgs:
|
||||
let
|
||||
config.allowUnfreePredicate =
|
||||
pkg:
|
||||
builtins.elem (lib.getName pkg) (import ./unfree.nix).allowed;
|
||||
in
|
||||
import nixpkgs { inherit system config; };
|
||||
importNixpkgs = system: nixpkgs: let
|
||||
config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) (import ./unfree.nix).allowed;
|
||||
in
|
||||
import nixpkgs {inherit system config;};
|
||||
|
||||
makeHost = host: system:
|
||||
lib.nixosSystem {
|
||||
|
|
@ -83,14 +79,13 @@
|
|||
./system
|
||||
{networking.hostName = host;}
|
||||
|
||||
./home
|
||||
./home
|
||||
];
|
||||
};
|
||||
in {
|
||||
nixosConfigurations = lib.pipe ./hosts [
|
||||
builtins.readDir
|
||||
(lib.filterAttrs (_: type: type == "directory"))
|
||||
# (lib.filterAttrs (name: _: builtins.pathExists ./hosts/${name}/default.nix && builtins.pathExists ./hosts/${name}/hardware.nix && builtins.pathExists ./hosts/${name}/config.nix))
|
||||
(builtins.mapAttrs (name: _: makeHost name (systemFromHardwareConf name)))
|
||||
];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue