{ 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.vaultui.nixosModules.default inputs.gitlab_artifacts_sync.nixosModules.default inputs.piped-flake.nixosModules.default tree.modules.nixos.rclone-serve tree.modules.nixos.rclone-sync tree.modules.nixos.secrets tree.modules.nixos.cockroachdb-bin ]; 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]; }; hetzner-vm = nixosUnstableSystem { specialArgs = defaultSpecialArgs // { hostPath = ./hetzner-vm; }; system = "x86_64-linux"; modules = defaultModules ++ [./hetzner-vm/hetzner-vm.nix]; }; # hetzner-arm-installer.nix is generic, this just is for the machine hetzner-arm # add hostname and IPs to serverIPs.nix hetzner-arm-installer = nixosUnstableSystem { specialArgs = defaultSpecialArgs // { hostPath = ./hetzner-arm-installer; }; system = "aarch64-linux"; # a more minimal module set modules = with tree; [ profiles.base.hardware profiles.base.terminals profiles.base.nix ./hetzner-arm-installer/hetzner-arm-installer.nix presets.nixos.serverHetzner ({...}: { networking.hostName = "hetzner-arm"; }) ]; }; 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 []; nixos-live-x86_64-laptops = nixosX86_64LiveWithExtraDepsForMachines ["lappy-t495"]; nixos-live-x86_64-servers = nixosX86_64LiveWithExtraDepsForMachines ["hetzner-vm" "vault"]; nixos-live-x86_64-all = nixosX86_64LiveWithExtraDepsForMachines ["lappy-t495" "vault" "hetzner-vm"]; # nix --no-sandbox build .#nixosConfigurations.raspberry.config.system.build.sdImage raspberry = nixosUnstableSystem { specialArgs = defaultSpecialArgs; system = "aarch64-linux"; modules = defaultModules ++ [./raspberry/raspberry.nix]; }; }