diff --git a/nixos/hosts/osaka-vultr-01/default.nix b/nixos/hosts/osaka-vultr-01/default.nix index 0d142f87..16dce01c 100644 --- a/nixos/hosts/osaka-vultr-01/default.nix +++ b/nixos/hosts/osaka-vultr-01/default.nix @@ -1,5 +1,7 @@ { config, lib, pkgs, modulesPath, desktop, username, ... }: { imports = [ + # This machine won't be using secureboot + ../../common/modules/boot.nix ./disks.nix ]; nixpkgs.config.allowUnfree = false; diff --git a/nixos/hosts/osaka-vultr-01/disks.nix b/nixos/hosts/osaka-vultr-01/disks.nix index d7fd7a88..916310b3 100644 --- a/nixos/hosts/osaka-vultr-01/disks.nix +++ b/nixos/hosts/osaka-vultr-01/disks.nix @@ -1,39 +1,57 @@ { boot.loader.grub.device = "/dev/vda"; boot.initrd.luks.devices."vda2".device = "/dev/vda2"; - disko.devices = { - disk = { - vda = { - type = "disk"; - device = "/dev/vda"; - content = { - type = "gpt"; - partitions = { - ESP = { - size = "100M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "crypted"; - extraOpenArgs = [ "--allow-discards" ]; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; + services.btrfs.autoScrub.enable = true; + services.btrfs.autoScrub.interval = "weekly"; + + disko.devices.disk.vda = { + device = "/dev/vda"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + name = "BOOT"; + start = "0%"; + end = "550MiB"; + bootable = true; + flags = [ "esp" ]; + fs-type = "fat32"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; }; - }; - }; - }; - }; -} \ No newline at end of file + } # partition 1 (ESP) + { + name = "LUKS"; + 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 + }; # subvolumes + }; # content.content + }; # content + } # partition 2 (/ BTRFS) + ]; # partitions + }; # content + }; # disko.devices.disk.vda +} # root \ No newline at end of file