refactor(nix): Use mkConfigurations for darwinConfigurations

This commit is contained in:
Mohammad Rafiq 2025-07-14 00:01:11 +08:00
parent 1b3414549d
commit 79eec8b971
No known key found for this signature in database

View file

@ -36,6 +36,23 @@ let
(value.extraCfg or { }) (value.extraCfg or { })
] ++ optional value.graphical cfg.modules.nixos.graphical; ] ++ optional value.graphical cfg.modules.nixos.graphical;
} }
else if class == "darwin" then
darwinSystem {
specialArgs = { inherit (config.flake) self; };
modules = [
cfg.modules.darwin.default
(
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.vim ];
services.tailscale.enable = true;
nix.settings.experimental-features = "nix-command flakes";
nix.enable = false;
nixpkgs.hostPlatform = "x86_64-darwin";
}
)
];
}
else else
{ } { }
) hosts; ) hosts;
@ -43,21 +60,5 @@ in
{ {
imports = [ inputs.home-manager.flakeModules.home-manager ]; imports = [ inputs.home-manager.flakeModules.home-manager ];
flake.nixosConfigurations = mkConfigurations "nixos" hosts.nixos; flake.nixosConfigurations = mkConfigurations "nixos" hosts.nixos;
flake.darwinConfigurations.venus = darwinSystem { flake.darwinConfigurations = mkConfigurations "darwin" hosts.darwin;
specialArgs = { inherit (config.flake) self; };
modules = [
(
{ pkgs, self, ... }:
{
environment.systemPackages = [ pkgs.vim ];
services.tailscale.enable = true;
nix.settings.experimental-features = "nix-command flakes";
nix.enable = false;
system.configurationRevision = self.rev or self.dirtyRev or null;
system.stateVersion = 6;
nixpkgs.hostPlatform = "x86_64-darwin";
}
)
];
};
} }