lilith-pad

This commit is contained in:
Spectre 2025-03-16 00:08:37 +01:00
parent 3d1a754d06
commit 7c51db8359
6 changed files with 55 additions and 32 deletions

View file

@ -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)))
];
};