From 79eec8b97169356c8a22b2b8720452bb5f7edb1d Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Mon, 14 Jul 2025 00:01:11 +0800 Subject: [PATCH] refactor(nix): Use mkConfigurations for darwinConfigurations --- nix/configurations.nix | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/nix/configurations.nix b/nix/configurations.nix index e460cdd..04c1776 100644 --- a/nix/configurations.nix +++ b/nix/configurations.nix @@ -36,6 +36,23 @@ let (value.extraCfg or { }) ] ++ 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 { } ) hosts; @@ -43,21 +60,5 @@ in { imports = [ inputs.home-manager.flakeModules.home-manager ]; flake.nixosConfigurations = mkConfigurations "nixos" hosts.nixos; - flake.darwinConfigurations.venus = darwinSystem { - 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"; - } - ) - ]; - }; + flake.darwinConfigurations = mkConfigurations "darwin" hosts.darwin; }