feat(configurations): add darwin config support

This commit is contained in:
Mohammad Rafiq 2025-07-09 06:36:42 +08:00
parent c21f7efecd
commit 9cb4542b05
No known key found for this signature in database
4 changed files with 14 additions and 3 deletions

View file

@ -6,6 +6,7 @@
}:
let
inherit (lib) nixosSystem;
inherit (inputs.nix-darwin.lib) darwinSystem;
inherit (lib.lists) optional;
inherit (lib.attrsets) mapAttrs;
inherit (cfg.lib.modules) forAllUsers';
@ -35,6 +36,10 @@ let
(value.extraCfg or { })
] ++ optional value.graphical cfg.modules.nixos.graphical;
}
else if class == "darwin" then
darwinSystem {
modules = [ cfg.modules.darwin.default ];
}
else
{ }
) hosts;
@ -42,4 +47,5 @@ in
{
imports = [ inputs.home-manager.flakeModules.home-manager ];
flake.nixosConfigurations = mkConfigurations "nixos" hosts.nixos;
flake.darwinConfigurations = mkConfigurations "darwin" hosts.darwin;
}

View file

@ -7,6 +7,7 @@
shell = "fish";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILdsZyY3gu8IGB8MzMnLdh+ClDxQQ2RYG9rkeetIKq8n rafiq";
};
hosts.darwin.venus = { };
hosts.nixos = {
nemesis = {
graphical = true;

View file

@ -74,9 +74,12 @@ in
type = lazyAttrsOf userOpts;
default = { };
};
hosts = mkOption {
# hosts.nixos, hosts.darwin, etc.
type = lazyAttrsOf (lazyAttrsOf hostOpts);
hosts.nixos = mkOption {
type = lazyAttrsOf hostOpts;
default = { };
};
hosts.darwin = mkOption {
type = lazyAttrsOf raw;
default = { };
};
};

View file

@ -11,4 +11,5 @@
boot.kernelModules = [ "kvm-${platform}" ];
nixpkgs.hostPlatform = "${arch}-linux";
};
flake.modules.darwin.default.nixpkgs.hostPlatform = "x86_64-darwin";
}