add remote disko and some other things

This commit is contained in:
andromeda
2026-01-10 08:59:54 +01:00
parent aec328ce93
commit 411ee0c027
10 changed files with 106 additions and 58 deletions

View File

@@ -1,6 +1,5 @@
{
boot.loader.grub = {
devices = ["/dev/sda"];
efiSupport = true;
efiInstallAsRemovable = true;
};

View File

@@ -20,4 +20,7 @@
# disable lecture
security.sudo.extraConfig = ''Defaults lecture="never"'';
# make users immutable
users.mutableUsers = false;
}

View File

@@ -0,0 +1,64 @@
{
disko.devices = {
disk = {
disk1 = {
device = "/dev/sda";
type = "disk";
content = {
type = "gpt";
partitions = {
# legacy boot
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
# efi boot
esp = {
name = "ESP";
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
# btrfs
# root is on nodev
root = {
size = "100%";
content = {
extraArgs = ["-f"]; # internet told me to, works
type = "btrfs";
subvolumes = {
# nix store
"/nix" = {
mountpoint = "/nix";
};
# persistant directory
"/persist" = {
mountpoint = "/persist";
};
};
};
};
};
};
};
};
nodev = {
# root
"/" = {
fsType = "tmpfs";
mountOptions = [
"defaults"
"mode=755" # stops security complaints
];
};
};
};
}

View File

@@ -0,0 +1,4 @@
{
# ONLY include this module AFTER a machine has been provisioned
environment.persistence."/persist".directories = ["/etc/ssh"];
}

View File

@@ -7,7 +7,6 @@
"/var/log"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/ssh"
];
files = [
"/etc/machine-id"

View File

@@ -17,30 +17,6 @@
boot.kernelModules = [];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "tmpfs";
fsType = "tmpfs";
options = ["defaults" "mode=755"];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/3457e181-b01d-4712-809d-c8b65e863992";
fsType = "btrfs";
options = ["subvol=nix"];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/3457e181-b01d-4712-809d-c8b65e863992";
fsType = "btrfs";
options = ["subvol=persist"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/05FB-0941";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
swapDevices = [];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";