refactor: use native NixOS to build host configs

instead of nixos-flake, now nixos-unified
This commit is contained in:
teutat3s 2024-10-07 17:00:27 +02:00
parent 151045ca8a
commit d4eaa00b81
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
4 changed files with 71 additions and 22 deletions

View file

@ -2,14 +2,35 @@
withSystem, withSystem,
self, self,
inputs, inputs,
config,
... ...
}: }:
{ {
flake = { flake = {
nixosConfigurations = { nixosModules = {
dumpyourvms = self.nixos-flake.lib.mkLinuxSystem { home-manager = {
nixpkgs.hostPlatform = "x86_64-linux";
imports = [ imports = [
inputs.home-manager.nixosModules.home-manager
({
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
flake = {
inherit self inputs config;
};
};
})
];
};
};
nixosConfigurations = {
dumpyourvms = self.inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
flake = {
inherit self inputs config;
};
};
modules = [
self.nixosModules.base self.nixosModules.base
./dumpyourvms ./dumpyourvms
self.nixosModules.teutat3s self.nixosModules.teutat3s
@ -24,9 +45,13 @@
]; ];
}; };
ryzensun = self.nixos-flake.lib.mkLinuxSystem { ryzensun = self.inputs.nixpkgs.lib.nixosSystem {
nixpkgs.hostPlatform = "x86_64-linux"; specialArgs = {
imports = [ flake = {
inherit self inputs config;
};
};
modules = [
self.nixosModules.base self.nixosModules.base
./ryzensun ./ryzensun
self.nixosModules.teutat3s self.nixosModules.teutat3s
@ -40,9 +65,13 @@
]; ];
}; };
fae = self.nixos-flake.lib.mkLinuxSystem { fae = self.inputs.nixpkgs.lib.nixosSystem {
nixpkgs.hostPlatform = "aarch64-linux"; specialArgs = {
imports = [ flake = {
inherit self inputs config;
};
};
modules = [
self.nixosModules.base self.nixosModules.base
inputs.nixos-hardware.nixosModules.raspberry-pi-4 inputs.nixos-hardware.nixosModules.raspberry-pi-4
./fae ./fae
@ -52,9 +81,13 @@
]; ];
}; };
#powder = self.nixos-flake.lib.mkLinuxSystem { #powder = self.inputs.nixpkgs.lib.nixosSystem {
# nixpkgs.hostPlatform = "aarch64-linux"; # specialArgs = {
# imports = [ # flake = {
# inherit self inputs config;
# };
# };
# modules = [
# self.nixosModules.base # self.nixosModules.base
# inputs.nixos-hardware.nixosModules.raspberry-pi-4 # inputs.nixos-hardware.nixosModules.raspberry-pi-4
# ./powder # ./powder
@ -65,9 +98,13 @@
# ]; # ];
#}; #};
iso = self.nixos-flake.lib.mkLinuxSystem { iso = self.inputs.nixpkgs.lib.nixosSystem {
nixpkgs.hostPlatform = "x86_64-linux"; specialArgs = {
imports = [ flake = {
inherit self inputs config;
};
};
modules = [
"${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" "${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
self.nixosModules.base self.nixosModules.base
./iso ./iso
@ -75,10 +112,13 @@
]; ];
}; };
iso-arm = self.nixos-flake.lib.mkLinuxSystem { iso-arm = self.inputs.nixpkgs.lib.nixosSystem {
nixpkgs.hostPlatform = "aarch64-linux"; specialArgs = {
nixpkgs.buildPlatform = "x86_64-linux"; flake = {
imports = [ inherit self inputs config;
};
};
modules = [
"${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" "${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
self.nixosModules.base self.nixosModules.base
./iso ./iso
@ -86,9 +126,13 @@
]; ];
}; };
iso-graphical = self.nixos-flake.lib.mkLinuxSystem { iso-graphical = self.inputs.nixpkgs.lib.nixosSystem {
nixpkgs.hostPlatform = "x86_64-linux"; specialArgs = {
imports = [ flake = {
inherit self inputs config;
};
};
modules = [
"${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" "${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
self.nixosModules.base self.nixosModules.base
./iso ./iso

View file

@ -43,4 +43,6 @@
size = 18432; size = 18432;
} }
]; ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
} }

View file

@ -4,4 +4,5 @@
isoImage.squashfsCompression = "gzip -Xcompression-level 1"; isoImage.squashfsCompression = "gzip -Xcompression-level 1";
systemd.services.sshd.wantedBy = lib.mkForce [ "multi-user.target" ]; systemd.services.sshd.wantedBy = lib.mkForce [ "multi-user.target" ];
networking.networkmanager.enable = false; networking.networkmanager.enable = false;
nixpkgs.hostPlatform = "x86_64-linux";
} }

View file

@ -36,4 +36,6 @@
}; };
swapDevices = [ ]; swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
} }