aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2024-03-07 00:29:13 -0800
committerPreston Pan <preston@nullring.xyz>2024-03-07 00:29:13 -0800
commit53e1f570b2cd2df3f2c7994af93e09078267c77d (patch)
tree5f07041f20f0fee33d9c071edb3ef885d2b2f74e
parenta08061e975344f21805d115e01929566a36c8d05 (diff)
disk-config
-rw-r--r--disk-config.nix63
1 files changed, 63 insertions, 0 deletions
diff --git a/disk-config.nix b/disk-config.nix
new file mode 100644
index 0000000..c7a6dc4
--- /dev/null
+++ b/disk-config.nix
@@ -0,0 +1,63 @@
+{
+ disko.devices = {
+ disk = {
+ vdb = {
+ type = "disk";
+ device = "/dev/sda";
+ content = {
+ type = "gpt";
+ partitions = {
+ ESP = {
+ size = "512M";
+ type = "EF00";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ mountOptions = [
+ "defaults"
+ ];
+ };
+ };
+ luks = {
+ size = "100%";
+ content = {
+ type = "luks";
+ name = "crypted";
+ # disable settings.keyFile if you want to use interactive password entry
+ passwordFile = "/tmp/secret.key"; # Interactive
+ settings = {
+ allowDiscards = true;
+ #keyFile = "/tmp/secret.key";
+ };
+ #additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
+ content = {
+ type = "btrfs";
+ extraArgs = [ "-f" ];
+ subvolumes = {
+ "/root" = {
+ mountpoint = "/";
+ mountOptions = [ "compress=zstd" "noatime" ];
+ };
+ "/home" = {
+ mountpoint = "/home";
+ mountOptions = [ "compress=zstd" "noatime" ];
+ };
+ "/nix" = {
+ mountpoint = "/nix";
+ mountOptions = [ "compress=zstd" "noatime" ];
+ };
+ "/swap" = {
+ mountpoint = "/.swapvol";
+ swap.swapfile.size = "20M";
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+}