diff --git a/flake.nix b/flake.nix index 76f73ce..9d0a2ef 100644 --- a/flake.nix +++ b/flake.nix @@ -175,7 +175,6 @@ ./hosts/hl-terra1.hardware-configuration.nix ]; }; - } - ; + }; }; } diff --git a/hosts/hl-fwdesk.nix b/hosts/hl-fwdesk.nix index 433bef2..a915ef8 100644 --- a/hosts/hl-fwdesk.nix +++ b/hosts/hl-fwdesk.nix @@ -17,7 +17,7 @@ in skyg = { user.enable = true; nixos = { - common.ssh-server.enable = true; + common.ssh-server.enable = true; common.hardware = { sound.enable = true; pipewire.enable = true; diff --git a/modules/lib.nix b/modules/lib.nix index 6aa8792..aff9222 100644 --- a/modules/lib.nix +++ b/modules/lib.nix @@ -11,6 +11,42 @@ }: let skygUtils = import ./skyg-utils.nix; + eachSystem = nixpkgs.lib.genAttrs (import systems); + allPkgs = eachSystem ( + system: + import nixpkgs { + system = system; + config = { + allowUnfree = true; + }; + } + ); + # makeHomeManagerUsers = + # { modules ? [ ] + # , homeManagerVersion + # , user + # , system ? "x86_64-linux" + # , + # }: + # let + # hm = ( + # import ./home { + # stateVersion = homeManagerVersion; + # }makeHLServices + # ); + # pkgs = allPkgs."${system}"; + # in + # home-manager.lib.homeManagerConfiguration { + # inherit pkgs; + # modules = [ + # (hm.makeCommonUser user) + # ] + # ++ modules; + # }; +in +{ + eachSystem = eachSystem; + pkgs = allPkgs; makeNixOs = { system ? "x86_64-linux" , hostName @@ -38,77 +74,35 @@ let }) ] ++ configuration; }; - eachSystem = nixpkgs.lib.genAttrs (import systems); - allPkgs = eachSystem ( - system: - import nixpkgs { - system = system; - config = { - allowUnfree = true; + makeDarwinModule = + { system ? "x86_64-darwin" + , user + , homeManagerVersion ? "25.11" + , systemStateVersion ? "25.11" + , hostName + , configuration ? [ ] + }: + nix-darwin.lib.darwinSystem { + inherit system; + specialArgs = specialArgs // { + inherit system skygUtils user; + unstablePkgs = nixpkgs-unstable.legacyPackages.${system}; }; - } - ); - # makeDarwinModule = - # { system ? "x86_64-darwin" - # , user - # , ... - # }@attrs: - # nix-darwin.lib.darwinSystem { - # modules = - # (makeImports { - # attrs = attrs; - # extraConfiguration = [ - # home-manager.darwinModules.home-manager - # stylix.darwinModules.stylix - # ]; - # }) - # ++ [ - # (import ./macos.nix { - # user = user; - # system = system; - # }) - # ]; - # }; - # makeHomeManagerUsers = - # { modules ? [ ] - # , homeManagerVersion - # , user - # , system ? "x86_64-linux" - # , - # }: - # let - # hm = ( - # import ./home { - # stateVersion = homeManagerVersion; - # }makeHLServices - # ); - # pkgs = allPkgs."${system}"; - # in - # home-manager.lib.homeManagerConfiguration { - # inherit pkgs; - # modules = [ - # (hm.makeCommonUser user) - # ] - # ++ modules; - # }; -in -{ - eachSystem = eachSystem; - pkgs = allPkgs; - makeNixOs = makeNixOs; - makeNixosConfigurations = - nodes: - builtins.listToAttrs ( - builtins.map - ({ hostName - , ... - }@attrs: { - name = hostName; - value = makeNixOs - { - inherit hostName; - } // attrs; + modules = [ + determinate.darwinModules.default + home-manager.darwinModules.home-manager + stylix.darwinModules.stylix + (import ./macos.nix { + user = user; + system = system; }) - nodes - ); + (import ./main.nix { + inherit + user + homeManagerVersion + hostName + systemStateVersion; + }) + ] ++ configuration; + }; } diff --git a/modules/macos.nix b/modules/macos.nix index e3481cb..7a8a8b9 100644 --- a/modules/macos.nix +++ b/modules/macos.nix @@ -1,8 +1,12 @@ { user, system }: -{ pkgs, ... }: { +{ ... }: { services.nix-daemon.enable = true; security.pam.enableSudoTouchIdAuth = true; users.users.${user.name}.home = user.homepath; users.users.root.home = "/var/root"; nixpkgs.hostPlatform = system; + nix.enable = false; + determinate-nix.customSettings = { + flake-registry = "/etc/nix/flake-registry.json"; + }; }