kardorf: use disko to prepare for hardware change
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
{
|
||||
pwd,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
inputs.disko.nixosModules.disko
|
||||
|
||||
./disko.nix
|
||||
./hardware-configuration.nix
|
||||
|
||||
"${pwd}/features-nixos/global"
|
||||
@@ -33,9 +37,6 @@
|
||||
networking.hostName = "kardorf";
|
||||
system.stateVersion = "22.11";
|
||||
|
||||
# Not using the drivers leads to way better results
|
||||
# services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
programs.ausweisapp.enable = true;
|
||||
programs.ausweisapp.openFirewall = true; # for pairing with smartphone
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
# https://github.com/nix-community/disko/blob/master/example/btrfs-subvolumes.nix
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-diskseq/1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
priority = 1;
|
||||
name = "ESP";
|
||||
start = "1M";
|
||||
end = "128M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = ["umask=0077"];
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = ["-f"]; # Override existing partition
|
||||
# Subvolumes must set a mountpoint in order to be mounted,
|
||||
# unless their parent is mounted
|
||||
subvolumes = {
|
||||
"/rootfs" = {
|
||||
mountpoint = "/";
|
||||
};
|
||||
"/home" = {
|
||||
mountOptions = ["compress=zstd"];
|
||||
mountpoint = "/home";
|
||||
};
|
||||
"/nix" = {
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
# Subvolume for the swapfile
|
||||
"/swap" = {
|
||||
mountpoint = "/.swapvol";
|
||||
swap = {
|
||||
swapfile.size = "20M";
|
||||
swapfile2.size = "20M";
|
||||
swapfile2.path = "rel-path";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
mountpoint = "/partition-root";
|
||||
swap = {
|
||||
swapfile = {
|
||||
size = "20M";
|
||||
};
|
||||
swapfile1 = {
|
||||
size = "20M";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user