add a function to the flake to create a computer

credits to @christianharke
This commit is contained in:
Andreas Zweili 2022-01-03 19:30:38 +01:00
parent 44ae2dcdca
commit 957fde671a
2 changed files with 77 additions and 65 deletions

View File

@ -39,9 +39,23 @@
overlay-unstable
];
};
mkComputer = configurationNix: extraModules: nixpkgs.lib.nixosSystem {
inherit system pkgs;
specialArgs = { inherit system inputs; };
modules = (
[
# System configuration for this host
configurationNix
# Common configuration
./modules/common.nix
] ++ extraModules
);
};
in
{
nixosConfigurations.gwyn = nixpkgs.lib.nixosSystem {
nixosConfigurations = {
gwyn = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
./systems/gwyn/configuration.nix
@ -58,7 +72,7 @@
}
];
};
nixosConfigurations.staubfinger = nixpkgs.lib.nixosSystem {
staubfinger = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
./systems/staubfinger/configuration.nix
@ -75,7 +89,7 @@
}
];
};
nixosConfigurations.nixos-vm = nixpkgs.lib.nixosSystem {
nixos-vm = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
./systems/vm/configuration.nix
@ -90,10 +104,11 @@
}
];
};
nixosConfigurations.nixos-test-vm = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
nixos-test-vm = mkComputer
./systems/proxmox-vm/configuration.nix
[
./modules/docker.nix
./modules/code-server
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;

View File

@ -4,9 +4,6 @@
imports =
[
# Include the results of the hardware scan.
../../modules/common.nix
../../modules/docker.nix
../../modules/code-server
./hardware-configuration.nix
];