forked from Fachschaft/nixConfig
Add Nodens, a VM to install NixOS VMs
This commit is contained in:
parent
ac85711356
commit
e3fe4e656c
2 changed files with 49 additions and 0 deletions
16
nixos/machines/nodens/configuration.nix
Normal file
16
nixos/machines/nodens/configuration.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
../../roles
|
||||||
|
../../roles/vm.nix
|
||||||
|
../../modules/vmNetwork.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# System configuration here
|
||||||
|
|
||||||
|
systemPackages = [pkgs.git];
|
||||||
|
|
||||||
|
networking.hostName = "nodens";
|
||||||
|
vmNetwork.ipv4 = "192.168.0.18";
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
}
|
33
nixos/machines/nodens/hardware-configuration.nix
Normal file
33
nixos/machines/nodens/hardware-configuration.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [];
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "root";
|
||||||
|
fsType = "tmpfs";
|
||||||
|
options = ["size=1G" "mode=755"];
|
||||||
|
};
|
||||||
|
# Different than usual names in order to automount other VMs
|
||||||
|
fileSystems."/persist" = {
|
||||||
|
device = "/dev/disk/by-label/nixosNodens";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = ["subvol=persist"];
|
||||||
|
neededForBoot = true;
|
||||||
|
};
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "/dev/disk/by-label/bootNodens";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
fileSystems."/nix" = {
|
||||||
|
device = "/dev/disk/by-label/nixosNodens";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = ["subvol=nix"];
|
||||||
|
};
|
||||||
|
|
||||||
|
# swapDevices = [{device = "/dev/disk/by-uuid/TODO";}];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue