Finalize this for some minimal headless VM somewhere down the road

This commit is contained in:
Bun 2025-03-24 03:44:28 -04:00
parent 8cf418ceca
commit 6b4722efe2
2 changed files with 13 additions and 18 deletions

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { modulesPath, ... }:
{ {
imports = [ imports = [
./boot ./boot
@ -6,6 +6,7 @@
./hardware ./hardware
./users ./users
../../modules/system ../../modules/system
(modulesPath + "/profiles/headless.nix")
]; ];
networking.hostName = "qemu"; networking.hostName = "qemu";

View file

@ -6,7 +6,7 @@
disk = { disk = {
"${config.networking.hostName}" = { "${config.networking.hostName}" = {
type = "disk"; type = "disk";
device = "/dev/vda"; device = "/dev/sda";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
@ -25,17 +25,11 @@
mountOptions = [ "umask=0077" ]; mountOptions = [ "umask=0077" ];
}; };
}; };
luks = { main = {
size = "100%"; size = "100%";
content = { content = {
type = "luks"; type = "lvm_pv";
name = "${config.networking.hostName}-disk"; vg = "${config.networking.hostName}";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
type = "lvm_pv";
vg = "${config.networking.hostName}";
};
}; };
}; };
}; };
@ -59,18 +53,18 @@
}; };
"/prev" = { "/prev" = {
mountpoint = "/prev"; mountpoint = "/prev";
mountOptions = [ "compress=zstd" "noatime" "ssd" ]; mountOptions = [ "compress=zstd" "noatime" "ssd" "noexec" ];
}; };
"/nix" = { "/nix" = {
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" "ssd" ]; mountOptions = [ "compress=zstd" "noatime" "ssd" ];
}; };
# Impermanence # Impermanence
"/persist" = { "/persist" = {
mountpoint = "/persist"; mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" "ssd" ]; mountOptions = [ "compress=zstd" "noatime" "ssd" ];
}; };
"/persist/.snapshots" = { }; "/persist/.snapshots" = { };
"/persist/home" = { }; "/persist/home" = { };
"/persist/home/.snapshots" = { }; "/persist/home/.snapshots" = { };
@ -78,7 +72,7 @@
}; };
}; };
swap = { swap = {
size = "4G"; size = "8G";
content = { content = {
type = "swap"; type = "swap";
discardPolicy = "both"; discardPolicy = "both";