feat(hostSpec): add extraCfg to hostSpec and imports to nixosSystem

This commit is contained in:
Mohammad Rafiq 2025-07-06 05:31:20 +08:00
parent 5ea055f053
commit 6a1aa5f30b
No known key found for this signature in database
2 changed files with 12 additions and 9 deletions

View file

@ -19,7 +19,8 @@ let
name = hostName; name = hostName;
value = lib.nixosSystem { value = lib.nixosSystem {
specialArgs = { inherit inputs hostName; }; specialArgs = { inherit inputs hostName; };
modules = [ value ]; #TODO: add profiles system
modules = [ value.extraCfg or { } ];
}; };
}; };
in in

View file

@ -1,15 +1,17 @@
{ config, ... }: { config, ... }:
{ {
flake.hostSpec.hosts = { flake.hostSpec.hosts = {
"nixos/test".imports = with config.flake.modules.nixos; [ networking ]; "nixos/test".extraCfg = {
"nixos/test".config = { imports = with config.flake.modules.nixos; [ networking ];
boot.loader.systemd-boot.enable = true; config = {
fileSystems."/" = { boot.loader.systemd-boot.enable = true;
device = "/dev/sda1"; fileSystems."/" = {
fsType = "ext4"; device = "/dev/sda1";
fsType = "ext4";
};
nixpkgs.hostPlatform = "x86_64-linux";
system.stateVersion = "25.05";
}; };
nixpkgs.hostPlatform = "x86_64-linux";
system.stateVersion = "25.05";
}; };
}; };
} }