|
45 | 45 | allowUnfree = true; |
46 | 46 | input-fonts.acceptLicense = true; |
47 | 47 | }; |
48 | | - nixSettings = { |
49 | | - nix.settings.experimental-features = [ |
50 | | - "nix-command" |
51 | | - "flakes" |
52 | | - ]; |
53 | | - }; |
54 | | - hostConfigurations = { |
55 | | - "volt-nixos" = { |
56 | | - hostname = "volt-nixos"; |
57 | | - username = "jeremy"; |
58 | | - }; |
59 | | - "zephyr" = { |
60 | | - hostname = "zephyr"; |
61 | | - username = "jeremy"; |
62 | | - }; |
63 | | - "work-macbook" = { |
64 | | - username = "jeremy"; |
65 | | - }; |
66 | | - }; |
| 48 | + username = "jeremy"; |
67 | 49 | in |
68 | 50 | { |
69 | 51 | nixosConfigurations = let |
|
73 | 55 | nixosConfig = { |
74 | 56 | nixosModule, |
75 | 57 | hostSpecificHomeManagerModule ? {}, |
76 | | - hostConfiguration, |
77 | | - }: |
| 58 | + hostname, |
| 59 | + }: let |
| 60 | + hostConfiguration = {inherit username hostname;}; |
| 61 | + in |
78 | 62 | inputs.nixpkgs.lib.nixosSystem { |
79 | 63 | specialArgs = {inherit pkgs-unstable hostConfiguration;}; |
80 | 64 | modules = [ |
81 | 65 | {nixpkgs.pkgs = pkgs;} |
82 | 66 | ./common/nixos.nix |
83 | | - nixSettings |
| 67 | + ./common/desktop-gnome.nix |
| 68 | + ./common/1password.nix |
| 69 | + ./common/nix-settings.nix |
84 | 70 | nixosModule |
85 | 71 | inputs.color-scheme-sync.nixosModules.default |
86 | 72 | inputs.home-manager.nixosModules.home-manager |
87 | 73 | { |
88 | | - home-manager.users.${hostConfiguration.username}.imports = [ |
| 74 | + home-manager.users.${username}.imports = [ |
89 | 75 | ./common/home-manager.nix |
90 | 76 | ./components/alacritty.nix |
91 | 77 | ./components/haskell.nix |
|
100 | 86 | in { |
101 | 87 | "volt-nixos" = nixosConfig { |
102 | 88 | nixosModule = ./volt/nixos-configuration.nix; |
103 | | - hostConfiguration = hostConfigurations.volt-nixos; |
| 89 | + hostname = "volt-nixos"; |
104 | 90 | hostSpecificHomeManagerModule = ./volt/home-manager.nix; |
105 | 91 | }; |
106 | 92 | "zephyr" = nixosConfig { |
107 | 93 | nixosModule = ./zephyr/nixos-configuration.nix; |
108 | | - hostConfiguration = hostConfigurations.zephyr; |
| 94 | + hostname = "zephyr"; |
109 | 95 | }; |
110 | 96 | }; |
111 | 97 |
|
112 | 98 | darwinConfigurations = let |
113 | 99 | system = "aarch64-darwin"; |
114 | 100 | pkgs = import inputs.nixpkgs {inherit system config;}; |
115 | 101 | pkgs-unstable = import inputs.nixpkgs-unstable {inherit system config;}; |
116 | | - hostConfiguration = hostConfigurations.work-macbook; |
| 102 | + hostConfiguration = {inherit username;}; |
117 | 103 | in { |
118 | 104 | "work-macbook" = inputs.darwin.lib.darwinSystem { |
119 | 105 | inherit system; |
|
125 | 111 | nodejs = prev.nodejs_22; |
126 | 112 | }) |
127 | 113 | ]; |
128 | | - } |
129 | | - nixSettings |
130 | | - { |
131 | | - nix.settings.trusted-users = [hostConfiguration.username]; |
132 | | - |
133 | | - nix.gc = { |
134 | | - automatic = true; |
135 | | - options = "--delete-older-than 14d"; |
136 | | - }; |
137 | | - |
138 | | - system.stateVersion = 4; |
139 | | - system.primaryUser = hostConfiguration.username; |
140 | | - ids.gids.nixbld = 350; |
141 | | - |
142 | 114 | nixpkgs.config = config; |
143 | | - environment.shells = [pkgs.zsh]; |
144 | | - programs.zsh.enable = true; |
145 | | - |
146 | | - services.tailscale.enable = true; |
147 | | - |
148 | | - users.users.${hostConfiguration.username}.home = "/Users/${hostConfiguration.username}"; |
149 | | - |
150 | | - fonts.packages = [pkgs.nerd-fonts.jetbrains-mono]; |
151 | | - |
152 | | - homebrew = { |
153 | | - enable = true; |
154 | | - casks = ["ghostty"]; |
155 | | - }; |
156 | 115 | } |
| 116 | + ./common/nix-settings.nix |
| 117 | + ./darwin-configuration.nix |
157 | 118 | inputs.home-manager.darwinModules.home-manager |
158 | | - { |
159 | | - home-manager = { |
160 | | - useGlobalPkgs = true; |
161 | | - useUserPackages = true; |
162 | | - users.${hostConfiguration.username}.imports = [ |
163 | | - ./common/home-manager.nix |
164 | | - ./components/dotnet.nix |
165 | | - ]; |
166 | | - extraSpecialArgs = {inherit pkgs-unstable hostConfiguration;}; |
167 | | - sharedModules = [inputs.mac-app-util.homeManagerModules.default]; |
168 | | - }; |
169 | | - |
170 | | - security.pam.services.sudo_local = { |
171 | | - enable = true; |
172 | | - reattach = true; |
173 | | - touchIdAuth = true; |
174 | | - watchIdAuth = true; |
175 | | - }; |
176 | | - } |
177 | 119 | ]; |
| 120 | + specialArgs = {inherit inputs hostConfiguration pkgs-unstable;}; |
178 | 121 | }; |
179 | 122 | }; |
180 | 123 | } |
|
0 commit comments