nixfiles/hosts/nixos.nix

108 lines
2.6 KiB
Nix
Raw Normal View History

{
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;
};
2022-03-02 17:36:42 +00:00
defaultSpecialArgs = {
inherit self;
tree = metaTree.impure;
pureTree = metaTree.pure;
inputs = patchedInputs;
};
defaultModules = [
tree.profiles.base
inputs.home-manager-unstable.nixosModules.home-manager
2022-11-11 16:32:26 +00:00
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
2023-09-18 03:56:58 +01:00
tree.modules.nixos.cockroachdb-bin
];
nixosUnstableSystem = nixpkgs-unstable.lib.nixosSystem;
2023-09-18 03:56:58 +01:00
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);
})
];
};
2022-03-02 17:36:42 +00:00
in {
2023-07-21 11:48:07 +01:00
lappy-t495 = nixosUnstableSystem {
2023-09-18 03:56:58 +01:00
specialArgs =
defaultSpecialArgs
// {
hostPath = ./lappy-t495;
};
2023-07-21 11:48:07 +01:00
system = "x86_64-linux";
modules = defaultModules ++ [./lappy-t495/lappy-t495.nix ./lappy-t495/hardware.nix];
};
2022-11-10 11:25:33 +00:00
2022-03-02 17:36:42 +00:00
hetzner-vm = nixosUnstableSystem {
2023-09-18 03:56:58 +01:00
specialArgs =
defaultSpecialArgs
// {
hostPath = ./hetzner-vm;
};
2022-03-02 17:36:42 +00:00
system = "x86_64-linux";
modules = defaultModules ++ [./hetzner-vm/hetzner-vm.nix];
2022-03-02 17:36:42 +00:00
};
2022-11-02 10:24:47 +00:00
vault = nixosUnstableSystem {
2023-09-18 03:56:58 +01:00
specialArgs =
defaultSpecialArgs
// {
hostPath = ./vault;
};
2023-09-20 15:46:20 +01:00
system = "aarch64-linux";
modules = defaultModules ++ [./vault/vault.nix];
2022-11-02 10:24:47 +00:00
};
2022-11-02 09:05:24 +00:00
# nix build .#nixosConfigurations.nixos-live-x86_64.config.system.build.isoImage
nixos-live-x86_64 = nixosX86_64LiveWithExtraDepsForMachines ["lappy-t495"];
2022-03-02 17:36:42 +00:00
# nix --no-sandbox build .#nixosConfigurations.raspberry.config.system.build.sdImage
raspberry = nixosUnstableSystem {
2023-09-20 18:44:24 +01:00
specialArgs =
defaultSpecialArgs
// {
hostPath = ./vault;
};
2022-03-02 17:36:42 +00:00
system = "aarch64-linux";
modules = defaultModules ++ [./raspberry/raspberry.nix];
2022-03-02 17:36:42 +00:00
};
}