feat(nixos): pass hostName to nixosSystem, move hm modules

This commit is contained in:
Mohammad Rafiq 2025-07-07 06:48:19 +08:00
parent f7873d54d3
commit c26c432890
No known key found for this signature in database
4 changed files with 7 additions and 5 deletions

View file

@ -13,10 +13,13 @@ let
mkConfigurations =
class: hosts:
mapAttrs (
_: value:
name: value:
if class == "nixos" then
nixosSystem {
specialArgs = { inherit inputs; };
specialArgs = {
inherit inputs;
hostName = name;
};
modules = [
(flattenAttrs cfg.modules.nixos)
(value.extraCfg or { })

View file

@ -1,4 +1,3 @@
let
testCfg =
{ hostName, ... }:

View file

@ -2,12 +2,12 @@
let
hm = inputs.home-manager;
globalCfg = {
imports = [ hm.nixosModules.home-manager ];
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
};
in
{
imports = [ hm.flakeModules.home-manager ];
flake.modules.nixos.default = globalCfg;
flake.modules.nixos.default.imports = [ hm.nixosModules.home-manager ];
flake.modules.nixos.default.config = globalCfg;
}