Update disk definitions for all machines using disko

This commit is contained in:
albert 2024-02-20 11:21:16 +09:00
parent c1adb6c4b7
commit 499b62f748
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
6 changed files with 50 additions and 137 deletions

View file

@ -12,26 +12,26 @@
services.btrfs.autoScrub.interval = "weekly";
disko.devices.disk.nvme0 = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "table";
format = "gpt";
partitions = [
{
partitions = {
BOOT = {
priority = 1;
name = "BOOT";
start = "0%";
end = "550MiB";
bootable = true;
flags = [ "esp" ];
fs-type = "fat32";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
# https://github.com/nix-community/disko/issues/527
mountOptions = [ "umask=0077" ];
mountpoint = "/boot";
};
} # partition 1 (ESP)
{
name = "LUKS";
}; # partition 1 (ESP)
LUKS-ROOT = {
start = "550MiB";
end = "100%";
content = {
@ -78,8 +78,8 @@
}; # subvolumes
}; # content.content
}; # content
} # partition 2 (/ BTRFS)
]; # partitions
}; # partition 2 (/ BTRFS)
}; # partitions
}; # content
}; # disko.devices.disk.nvme0
} # root

View file

@ -5,26 +5,26 @@
services.btrfs.autoScrub.interval = "weekly";
disko.devices.disk.nvme0 = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "table";
format = "gpt";
partitions = [
{
partitions = {
BOOT = {
priority = 1;
name = "BOOT";
start = "0%";
end = "550MiB";
bootable = true;
flags = [ "esp" ];
fs-type = "fat32";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
# https://github.com/nix-community/disko/issues/527
mountOptions = [ "umask=0077" ];
mountpoint = "/boot";
};
} # partition 1 (ESP)
{
name = "LUKS";
}; # partition 1 (ESP)
LUKS-ROOT = {
start = "550MiB";
end = "100%";
content = {
@ -47,10 +47,6 @@
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
}; # nix
"/games" = {
mountpoint = "/games";
mountOptions = [ "noatime" ];
}; # games
# SNAPSHOT SUBVOLS
"/root/.snapshots" = {
mountpoint = "/.snapshots";
@ -67,8 +63,8 @@
}; # subvolumes
}; # content.content
}; # content
} # partition 2 (/ BTRFS)
]; # partitions
}; # partition 2 (/ BTRFS)
}; # partitions
}; # content
}; # disko.devices.disk.nvme0
} # root

View file

@ -2,7 +2,7 @@
imports = [
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
(modulesPath + "/installer/scan/not-detected.nix")
./disks-gpt.nix
./disks.nix
./syncthing.nix
../../common/services/tailscale-autoconnect.nix
# ../../common/modules/secureboot.nix

View file

@ -1,79 +0,0 @@
{
imports = [ ../../common/services/snapper.nix ];
services.btrfs.autoScrub.enable = true;
services.btrfs.autoScrub.interval = "weekly";
boot.resumeDevice = "/dev/mapper/ROOT";
# https://sawyershepherd.org/post/hibernating-to-an-encrypted-swapfile-on-btrfs-with-nixos/
boot.kernelParams = [ "resume_offset=533760" ];
disko.devices.disk.nvme0n1 = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
BOOT = {
priority = 1;
name = "BOOT";
start = "0%";
end = "550MiB";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
# https://github.com/nix-community/disko/issues/527
mountOptions = [ "umask=0077" ];
mountpoint = "/boot";
};
}; # partition 1 (ESP)
LUKS-ROOT = {
start = "550MiB";
end = "100%";
content = {
type = "luks";
name = "ROOT";
extraOpenArgs = [ "--allow-discards" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
}; # root
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
}; # home
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
}; # nix
# SNAPSHOT SUBVOLS
"/root/.snapshots" = {
mountpoint = "/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
}; # root
"/home/.snapshots" = {
mountpoint = "/home/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
}; # home
"/nix/.snapshots" = {
mountpoint = "/nix/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
}; # nix
# Swap partition
"/swap" = {
mountpoint = "/swap";
swap.swapfile.size = "64G";
}; # swap
}; # subvolumes
}; # content.content
}; # content
}; # partition 2 (/ BTRFS)
}; # partitions
}; # content
}; # disko.devices.disk.nvme0
} # nix

View file

@ -1,28 +1,25 @@
{
imports = [ ../../common/services/snapper.nix ];
services.btrfs.autoScrub.enable = true;
services.btrfs.autoScrub.interval = "weekly";
boot.resumeDevice = "/dev/mapper/ROOT";
boot.kernelParams = [ "resume_offset=533760" ];
# https://sawyershepherd.org/post/hibernating-to-an-encrypted-swapfile-on-btrfs-with-nixos/
boot.kernelParams = [ "resume_offset=533760" ];
disko.devices.disk.nvme0 = {
disko.devices.disk.nvme0n1 = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "table";
format = "gpt";
partitions = [
{
type = "gpt";
partitions = {
BOOT = {
priority = 1;
name = "BOOT";
start = "0%";
end = "550MiB";
bootable = true;
flags = [ "esp" ];
fs-type = "fat32";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
@ -30,11 +27,10 @@
mountOptions = [ "umask=0077" ];
mountpoint = "/boot";
};
} # partition 1 (ESP)
{
name = "LUKS-ROOT";
}; # partition 1 (ESP)
LUKS-ROOT = {
start = "550MiB";
end = "-64GiB";
end = "100%";
content = {
type = "luks";
name = "ROOT";
@ -76,8 +72,8 @@
}; # subvolumes
}; # content.content
}; # content
} # partition 2 (/ BTRFS)
]; # partitions
}; # partition 2 (/ BTRFS)
}; # partitions
}; # content
}; # disko.devices.disk.nvme0
} # nix

View file

@ -5,26 +5,26 @@
services.btrfs.autoScrub.interval = "weekly";
disko.devices.disk.nvme0 = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "table";
format = "gpt";
partitions = [
{
partitions = {
BOOT = {
priority = 1;
name = "BOOT";
start = "0%";
end = "550MiB";
bootable = true;
flags = [ "esp" ];
fs-type = "fat32";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
# https://github.com/nix-community/disko/issues/527
mountOptions = [ "umask=0077" ];
mountpoint = "/boot";
};
} # partition 1 (ESP)
{
name = "LUKS";
}; # partition 1 (ESP)
LUKS-ROOT = {
start = "550MiB";
end = "100%";
content = {
@ -63,8 +63,8 @@
}; # subvolumes
}; # content.content
}; # content
} # partition 2 (/ BTRFS)
]; # partitions
}; # partition 2 (/ BTRFS)
}; # partitions
}; # content
}; # disko.devices.disk.nvme0
} # root