File tree Expand file tree Collapse file tree 1 file changed +56
-14
lines changed
Expand file tree Collapse file tree 1 file changed +56
-14
lines changed Original file line number Diff line number Diff line change 1- { modulesPath , ...} : {
1+ { inputs , modulesPath , ...} : {
22 imports = [
33 ../common/optional/ephemeral-btrfs.nix
44 ( modulesPath + "/profiles/qemu-guest.nix" )
5+ inputs . disko . nixosModules . disko
56 ] ;
67
8+ nixpkgs . hostPlatform . system = "aarch64-linux" ;
9+
710 # Slows down write operations considerably
811 nix . settings . auto-optimise-store = false ;
912
2629 extraModprobeConfig = "options kvm nested=1" ;
2730 } ;
2831
29- fileSystems = {
30- "/boot" = {
31- device = "/dev/disk/by-label/ESP" ;
32- fsType = "vfat" ;
32+ disko . devices . disk . main = {
33+ device = "/dev/vda" ;
34+ type = "disk" ;
35+ content = {
36+ type = "gpt" ;
37+ partitions = {
38+ esp = {
39+ name = "ESP" ;
40+ size = "512M" ;
41+ type = "EF00" ;
42+ content = {
43+ type = "filesystem" ;
44+ format = "vfat" ;
45+ mountpoint = "/boot" ;
46+ } ;
47+ } ;
48+ root = {
49+ size = "100%" ;
50+ content = {
51+ type = "btrfs" ;
52+ postCreateHook = ''
53+ MNTPOINT=$(mktemp -d)
54+ mount -t btrfs "$device" "$MNTPOINT"
55+ trap 'umount $MNTPOINT; rm -d $MNTPOINT' EXIT
56+ btrfs subvolume snapshot -r $MNTPOINT/root $MNTPOINT/root-blank
57+ '' ;
58+ subvolumes = {
59+ "/root" = {
60+ mountOptions = [ "compress=zstd" ] ;
61+ mountpoint = "/" ;
62+ } ;
63+ "/nix" = {
64+ mountOptions = [ "compress=zstd" "noatime" ] ;
65+ mountpoint = "/nix" ;
66+ } ;
67+ "/persist" = {
68+ mountOptions = [ "compress=zstd" ] ;
69+ mountpoint = "/persist" ;
70+ } ;
71+ "/swap" = {
72+ mountOptions = [ "compress=zstd" "noatime" ] ;
73+ mountpoint = "/swap" ;
74+ swap . swapfile = {
75+ size = "8196M" ;
76+ path = "swapfile" ;
77+ } ;
78+ } ;
79+ } ;
80+ } ;
81+ } ;
82+ } ;
3383 } ;
3484 } ;
35-
36- swapDevices = [
37- {
38- device = "/swap/swapfile" ;
39- size = 8196 ;
40- }
41- ] ;
42-
43- nixpkgs . hostPlatform . system = "aarch64-linux" ;
85+ fileSystems . "/persist" . neededForBoot = true ;
4486}
You can’t perform that action at this time.
0 commit comments