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,13 +25,8 @@
mountOptions = [ "umask=0077" ]; mountOptions = [ "umask=0077" ];
}; };
}; };
luks = { main = {
size = "100%"; size = "100%";
content = {
type = "luks";
name = "${config.networking.hostName}-disk";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = { content = {
type = "lvm_pv"; type = "lvm_pv";
vg = "${config.networking.hostName}"; vg = "${config.networking.hostName}";
@ -41,7 +36,6 @@
}; };
}; };
}; };
};
lvm_vg = { lvm_vg = {
"${config.networking.hostName}" = { "${config.networking.hostName}" = {
@ -59,7 +53,7 @@
}; };
"/prev" = { "/prev" = {
mountpoint = "/prev"; mountpoint = "/prev";
mountOptions = [ "compress=zstd" "noatime" "ssd" ]; mountOptions = [ "compress=zstd" "noatime" "ssd" "noexec" ];
}; };
"/nix" = { "/nix" = {
mountpoint = "/nix"; mountpoint = "/nix";
@ -78,7 +72,7 @@
}; };
}; };
swap = { swap = {
size = "4G"; size = "8G";
content = { content = {
type = "swap"; type = "swap";
discardPolicy = "both"; discardPolicy = "both";