diff --git a/disko/pennsardin.nix b/disko/pennsardin.nix new file mode 100644 index 0000000..3f1e614 --- /dev/null +++ b/disko/pennsardin.nix @@ -0,0 +1,185 @@ +{ ... }: { + disko.devices = { + disk.main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "512MiB"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot/efi"; + mountOptions = [ "umask=0077" "noauto" ]; + }; + }; + + rescue = { + size = "8GiB"; + type = "8300"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/rescue"; + mountOptions = [ "nofail" "noauto" "nosuid" "nodev" "noexec" ]; + }; + }; + + root = { + size = "100%"; + type = "8e00"; # LVM partition + content = { + type = "lvm_pv"; + vg = "vg-main"; + }; + }; + }; + }; + }; + + lvm_vg."vg-main" = { + type = "lvm_vg"; + lvs = { + # -- Système principal -- + lv-root = { + size = "100G"; + content = { + type = "btrfs"; + mountpoint = "/"; + mountOptions = [ "compress=zstd:3" "noatime" "space_cache=v2" "discard=async" ]; + }; + }; + + lv-home = { + size = "100G"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + mountpoint = "/home"; + mountOptions = [ + "compress=zstd:3" + "noatime" + "nodev" + "nosuid" + "space_cache=v2" + "discard=async" + ]; + subvolumes = { + "@homebin" = { + mountpoint = "/home/dunoz/bin"; + mountOptions = [ + "compress=zstd:3" + "noatime" + "nodev" + "nosuid" + "space_cache=v2" + "discard=async" + "subvol=@homebin" + ]; + }; + }; + }; + }; + + lv-nix = { + size = "80G"; + content = { + type = "btrfs"; + mountpoint = "/nix"; + mountOptions = [ "compress=zstd:3" "noatime" "space_cache=v2" "discard=async" ]; + }; + }; + + lv-var = { + size = "50G"; + content = { + type = "btrfs"; + mountpoint = "/var"; + mountOptions = [ "compress=zstd:3" "noatime" "nodev" "nosuid" "space_cache=v2" "discard=async" ]; + }; + }; + + # -- Données & builds (no COW) -- + lv-work = { + size = "100G"; + content = { + type = "btrfs"; + mountpoint = "/home/dunoz/Work"; + mountOptions = [ "nodatacow" "noatime" "nodev" "space_cache=v2" "discard=async" ]; + }; + }; + + lv-games = { + size = "200G"; + content = { + type = "btrfs"; + mountpoint = "/home/dunoz/.local/share/Steam"; + mountOptions = [ "nodatacow" "noatime" "nodev" "space_cache=v2" "discard=async" ]; + }; + }; + + lv-qemu = { + size = "200G"; + content = { + type = "btrfs"; + mountpoint = "/var/lib/libvirt/images"; + mountOptions = [ "nodatacow" "noatime" "nodev" "nosuid" "space_cache=v2" "discard=async" ]; + }; + }; + + lv-container = { + size = "20G"; + content = { + type = "btrfs"; + mountpoint = "/var/lib/machines"; + mountOptions = [ "nodatacow" "noatime" "nodev" "nosuid" "space_cache=v2" "discard=async" ]; + }; + }; + }; + }; + + filesystem.raid = { + type = "filesystem"; + device = "/dev/md0"; + format = "btrfs"; + mountpoint = "/srv/raid"; + mountOptions = [ "compress=zstd:3" "noatime" "nofail" "noexec" "nodev" "nosuid" "space_cache=v2" "discard=async" ]; + }; + + bindmounts = { + docs = { + device = "/srv/raid/home-data/Documents"; + mountpoint = "/home/dunoz/Documents"; + options = [ "bind" "nofail" "nosuid" "nodev" "noexec" ]; + }; + images = { + device = "/srv/raid/home-data/Images"; + mountpoint = "/home/dunoz/Images"; + options = [ "bind" "nofail" "nosuid" "nodev" "noexec" ]; + }; + music = { + device = "/srv/raid/home-data/Musique"; + mountpoint = "/home/dunoz/Musique"; + options = [ "bind" "nofail" "nosuid" "nodev" "noexec" ]; + }; + downloads = { + device = "/srv/raid/home-data/Téléchargements"; + mountpoint = "/home/dunoz/Téléchargements"; + options = [ "bind" "nofail" "nosuid" "nodev" "noexec" ]; + }; + videos = { + device = "/srv/raid/home-data/Vidéos"; + mountpoint = "/home/dunoz/Vidéos"; + options = [ "bind" "nofail" "nosuid" "nodev" "noexec" ]; + }; + config = { + device = "/srv/raid/home-data/nixos-config"; + mountpoint = "/home/dunoz/nixos-config"; + options = [ "bind" "nofail" "nosuid" "nodev" ]; + }; + }; + }; +}