···22# and may be overwritten by future invocations. Please make changes
33# to /etc/nixos/configuration.nix instead.
44{
55- config,
65 lib,
77- pkgs,
86 modulesPath,
97 ...
108}: {
+22-59
nix/nixos/configs/raspberrypi/storage.nix
···11-{pkgs, ...}: let
22- uefiFirmware = pkgs.fetchzip {
33- url = "https://github.com/pftf/RPi4/releases/download/v1.38/RPi4_UEFI_Firmware_v1.38.zip";
44- hash = "sha256-0axfcb5fhbhkqvfysy7xqk2xi8k3lsx4146nms5315r4ynhh897q=";
11+{
22+ fileSystems."/boot" = {
33+ device = "/dev/disk/by-uuid/12CE-A600";
44+ fsType = "vfat";
55+ options = ["fmask=0022" "dmask=0022"];
66+ };
77+88+ fileSystems."/" = {
99+ device = "/dev/disk/by-uuid/322a6d8e-f946-4d60-98a3-dd1af1373c79";
1010+ fsType = "btrfs";
1111+ options = ["subvol=@" "compress=zstd" "noatime"];
1212+ };
1313+1414+ fileSystems."/home" = {
1515+ device = "/dev/disk/by-uuid/322a6d8e-f946-4d60-98a3-dd1af1373c79";
1616+ fsType = "btrfs";
1717+ options = ["subvol=@home" "compress=zstd" "noatime"];
518 };
66-in {
77- disko.devices = {
88- disk = {
99- vdb = {
1010- device = "/dev/disk/by-uuid/322a6d8e-f946-4d60-98a3-dd1af1373c79";
1111- type = "disk";
1212- content = {
1313- type = "gpt";
1414- partitions = {
1515- ESP = {
1616- type = "EF00";
1717- size = "1GB";
1818- content = {
1919- type = "filesystem";
2020- format = "vfat";
2121- mountpoint = "/boot";
2222- postMountHook = ''
2323- cp -r ${uefiFirmware} /boot
2424- '';
2525- };
2626- };
2727- root = {
2828- size = "100%";
2929- content = {
3030- type = "btrfs";
3131- extraArgs = ["-f"]; # Override existing partition
3232- # Subvolumes must set a mountpoint in order to be mounted,
3333- # unless their parent is mounted
3434- subvolumes = {
3535- # Subvolume name is different from mountpoint
3636- "@" = {
3737- mountOptions = ["compress=zstd" "noatime"];
3838- mountpoint = "/";
3939- };
4040- # Subvolume name is the same as the mountpoint
4141- "@home" = {
4242- mountOptions = ["compress=zstd" "noatime"];
4343- mountpoint = "/home";
4444- };
4545- # Parent is not mounted so the mountpoint must be set
4646- "@nix" = {
4747- mountOptions = ["compress=zstd" "noatime"];
4848- mountpoint = "/nix";
4949- };
5050- "@swap" = {
5151- mountpoint = "/.swapvol";
5252- swap.swapfile.size = "4GB";
5353- };
5454- };
5555- };
5656- };
5757- };
5858- };
5959- };
6060- };
1919+2020+ fileSystems."/nix" = {
2121+ device = "/dev/disk/by-uuid/322a6d8e-f946-4d60-98a3-dd1af1373c79";
2222+ fsType = "btrfs";
2323+ options = ["subvol=@nix" "compress=zstd" "noatime"];
6124 };
6225}