{ self, nixpkgs-unstable, ... } @ inputs: let inherit (nixpkgs-unstable.lib) forEach; mkTree = inputs.tree-input.tree; metaTree = mkTree ((import ../treeConfig.nix {}) // {inherit inputs;}); tree = metaTree.impure; patchedInputs = inputs // { # set these to the correct versions from inputs nixpkgs = inputs.nixpkgs-unstable; home-manager = inputs.home-manager-unstable; }; defaultSpecialArgs = { inherit self; tree = metaTree.impure; pureTree = metaTree.pure; inputs = patchedInputs; }; defaultModules = [ tree.profiles.base inputs.home-manager-unstable.nixosModules.home-manager inputs.nixos-wsl.nixosModules.default inputs.vaultui.nixosModules.default tree.modules.nixos.rcloneServe tree.modules.nixos.rcloneSync tree.modules.nixos.secrets tree.modules.nixos.postgreSQLRemoteBackup tree.modules.nixos.wslBuildTarballExt tree.modules.nixos.encryptedDrive ]; nixosUnstableSystem = nixpkgs-unstable.lib.nixosSystem; nixosX86_64LiveWithExtraDepsForMachines = machines: nixosUnstableSystem { specialArgs = defaultSpecialArgs // { hostPath = ./nixos-live; }; system = "x86_64-linux"; modules = defaultModules ++ [ ./nixos-live/nixos-live.nix ({...}: { system.extraDependencies = forEach machines (system: self.nixosConfigurations.${system}.config.system.build.toplevel); }) ]; }; in { lappy-t495 = nixosUnstableSystem { specialArgs = defaultSpecialArgs // { hostPath = ./lappy-t495; }; system = "x86_64-linux"; modules = defaultModules ++ [./lappy-t495/lappy-t495.nix ./lappy-t495/hardware.nix]; }; lappy-surface = nixosUnstableSystem { specialArgs = defaultSpecialArgs // { hostPath = ./lappy-surfacr; }; system = "x86_64-linux"; modules = defaultModules ++ [./lappy-surface/lappy-surface.nix ./lappy-surface/hardware.nix]; }; wsl = nixosUnstableSystem { specialArgs = defaultSpecialArgs // { hostPath = ./wsl; }; system = "x86_64-linux"; modules = defaultModules ++ [./wsl/wsl.nix]; }; hetzner-arm = nixosUnstableSystem { specialArgs = defaultSpecialArgs // { hostPath = ./hetzner-arm; }; system = "aarch64-linux"; modules = defaultModules ++ [./hetzner-arm/hetzner-arm.nix]; }; vault = nixosUnstableSystem { specialArgs = defaultSpecialArgs // { hostPath = ./vault; }; system = "aarch64-linux"; modules = defaultModules ++ [./vault/vault.nix]; }; # nix build .#nixosConfigurations.nixos-live-x86_64.config.system.build.isoImage nixos-live-x86_64 = nixosX86_64LiveWithExtraDepsForMachines ["lappy-t495"]; # nix --no-sandbox build .#nixosConfigurations.raspberry.config.system.build.sdImage raspberry = nixosUnstableSystem { specialArgs = defaultSpecialArgs // { hostPath = ./vault; }; system = "aarch64-linux"; modules = defaultModules ++ [./raspberry/raspberry.nix]; }; }