diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-07-21 07:31:45 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-07-21 08:13:11 -0700 |
| commit | 23f8df7396d35744069a4bda0d1d38a55ff64b79 (patch) | |
| tree | 772b5e72355e9ee5b3ae31aef37fe1d4508e8f30 /nix/lib/mkSystem.nix | |
| parent | add docker helpers and clean up some dependencies (diff) | |
| download | infra-23f8df7396d35744069a4bda0d1d38a55ff64b79.tar.gz | |
refactoring to use flake-parts and automatic imports of hosts
This is the first step in a large refactoring to use flake-parts, and to
automatically imports hosts based on paths.
Diffstat (limited to '')
| -rw-r--r-- | nix/lib/mkSystem.nix | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/nix/lib/mkSystem.nix b/nix/lib/mkSystem.nix deleted file mode 100644 index 41f4f3c..0000000 --- a/nix/lib/mkSystem.nix +++ /dev/null @@ -1,81 +0,0 @@ -# This function creates a NixOS system based on our VM setup for a -# particular architecture. -{ - self, - nixpkgs, - inputs, - overlays, -}: - -systemName: -{ - system, - user, - darwin ? false, -}: - -let - # The config files for this system. - machineConfig = ../machines/${systemName}; - userOSConfig = ../users/${user}/${if darwin then "darwin" else "nixos"}.nix; - userHMConfig = ../users/${user}/home-manager.nix; - - # NixOS vs nix-darwin functions - systemFunc = if darwin then inputs.darwin.lib.darwinSystem else nixpkgs.lib.nixosSystem; - home-manager = - if darwin then inputs.home-manager.darwinModules else inputs.home-manager.nixosModules; -in -systemFunc rec { - inherit system; - - modules = - [ - # Allow unfree packages. - { nixpkgs.config.allowUnfree = true; } - - # Add overlays - { nixpkgs.overlays = overlays; } - - machineConfig - userOSConfig - home-manager.home-manager - - inputs.agenix.nixosModules.default - ] - ++ nixpkgs.lib.optional (!darwin) [ - (import ../modules/fcuny-net.nix) - inputs.disko.nixosModules.disko - ] - ++ [ - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.sharedModules = [ - inputs.agenix.homeManagerModules.default - ]; - home-manager.users.${user} = import userHMConfig { - inherit - self - inputs - darwin - systemName - ; - }; - home-manager.extraSpecialArgs = { - inherit self inputs; - configPath = "${self}/configs/users/${user}"; - }; - } - - # We expose some extra arguments so that our modules can parameterize - # better based on these values. - { - config._module.args = { - currentSystem = system; - currentSystemName = systemName; - currentSystemUser = user; - inputs = inputs; - }; - } - ]; -} |
