diff --git a/nix/configurations.nix b/nix/configurations.nix index e460cdd..66b9b83 100644 --- a/nix/configurations.nix +++ b/nix/configurations.nix @@ -36,6 +36,15 @@ 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 + inputs.home-manager.darwinModules.home-manager + { home-manager = globalCfg name value; } + ]; + } else { } ) hosts; @@ -43,21 +52,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; } diff --git a/nix/modules/graphical/stylix.nix b/nix/modules/graphical/stylix.nix index c4b3c65..c347b6a 100644 --- a/nix/modules/graphical/stylix.nix +++ b/nix/modules/graphical/stylix.nix @@ -9,4 +9,12 @@ stylix.enable = true; stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; }; + flake.modules.darwin.default = + { pkgs, ... }: + { + imports = [ inputs.stylix.darwinModules.stylix ]; + stylix.enable = true; + #TODO: move into manifest + stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; + }; } diff --git a/nix/modules/networking/tailscale.nix b/nix/modules/networking/tailscale.nix index ddf1b9a..8f2a000 100644 --- a/nix/modules/networking/tailscale.nix +++ b/nix/modules/networking/tailscale.nix @@ -14,4 +14,7 @@ in persistDirs = [ "/var/lib/tailscale" ]; sops.secrets."tailscale/client-secret".sopsFile = secrets + "/tailscale.yaml"; }; + flake.modules.darwin.default = { + services.tailscale.enable = true; + }; } diff --git a/nix/modules/system/system.nix b/nix/modules/system/system.nix index 9b50970..cee1df3 100644 --- a/nix/modules/system/system.nix +++ b/nix/modules/system/system.nix @@ -7,11 +7,7 @@ i18n.defaultLocale = "en_US.UTF-8"; system.stateVersion = "25.11"; }; - homeManager.default = - { osConfig, ... }: - { - home.stateVersion = osConfig.system.stateVersion; - }; + homeManager.default.home.stateVersion = "25.11"; darwin.default = { self, ... }: { diff --git a/nix/modules/system/users.nix b/nix/modules/system/users.nix index 5815089..c9f8768 100644 --- a/nix/modules/system/users.nix +++ b/nix/modules/system/users.nix @@ -31,4 +31,14 @@ in } ); }; + flake.modules.darwin.default = + { config, ... }: + { + home-manager.users = forAllUsers' ( + name: _: { + home.username = name; + home.homeDirectory = config.users.users.${name}.home; + } + ); + }; }