Skip to content

Instantly share code, notes, and snippets.

@shlevy
Created April 15, 2018 13:19
Show Gist options
  • Save shlevy/febe235cc99919e78a4fdf38104d6a27 to your computer and use it in GitHub Desktop.
Save shlevy/febe235cc99919e78a4fdf38104d6a27 to your computer and use it in GitHub Desktop.
{ config, pkgs, ... }:
let subvol-mount = path: { name = path;
value = { fsType = "btrfs";
label = "root";
options = [ "defaults"
"subvol=${path}"
];
};
};
subvols = builtins.listToAttrs (map subvol-mount
[ "/etc-persistent"
"/home-persistent/shlevy"
"/nix"
"/var/lib/cups"
"/var/log"
"/var/lib/kanboard"
]);
in {
fileSystems =
({ "/" = { device = "tmpfs";
fsType = "tmpfs";
options = [ "defaults" "mode=755" ];
};
"/boot" = { label = "ESP";
fsType = "vfat";
};
} // subvols);
environment.etc =
{ systemd-mutable.source = "/etc-persistent/systemd-mutable";
"nixos/configuration.nix".text =
"import /etc-persistent/nixos/configuration.nix\n";
machine-id.text = "2c83968a55a1443c971598294d34f9ed\n";
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment