From 5a0cb28f369c104bb371974df876c8c705b0ee7e Mon Sep 17 00:00:00 2001 From: ene Date: Sat, 18 Mar 2023 16:21:45 +0100 Subject: Refactor: Use better file layout --- system/file_system_layouts/default.nix | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 system/file_system_layouts/default.nix (limited to 'system/file_system_layouts') diff --git a/system/file_system_layouts/default.nix b/system/file_system_layouts/default.nix new file mode 100644 index 0000000..9d03a05 --- /dev/null +++ b/system/file_system_layouts/default.nix @@ -0,0 +1,45 @@ +{ + modulesPath, + config, + lib, + ... +}: +with lib; let + cfg = config.system.fileSystemLayouts; +in { + options.system.fileSystemLayouts = { + mainDisk = mkOption { + type = lib.types.path; + example = literalExpression "/dev/disk/by-uuid/0442cb6d-f13a-4635-b487-fa76189774c5"; + description = lib.mdDoc "Path to the main disk"; + }; + }; + config = { + fileSystems = { + "/" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = ["defaults" "size=2G" "mode=755"]; + }; + "/nix" = { + device = cfg.mainDisk; + fsType = "btrfs"; + options = ["subvol=nix" "compress-force=zstd"]; + }; + "/srv" = { + device = cfg.mainDisk; + fsType = "btrfs"; + options = ["subvol=storage" "compress-force=zstd"]; + }; + "/boot" = { + device = cfg.mainDisk; + options = ["subvol=boot" "compress-force=zstd"]; + }; + + "/etc/nixos" = { + device = "/srv/nix-config"; + options = ["bind"]; + }; + }; + }; +} -- cgit 1.4.1 From ab3c9aa228ecaf79fae5cc1d2bdcb84f2e12951e Mon Sep 17 00:00:00 2001 From: sils Date: Mon, 20 Mar 2023 15:43:05 +0100 Subject: Fix(acme): Store certs permanently. Before, new certs were requested at every rebuild. This caused issues due to letsencrypt ratelimiting. --- system/file_system_layouts/default.nix | 4 ++++ system/mail/default.nix | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'system/file_system_layouts') diff --git a/system/file_system_layouts/default.nix b/system/file_system_layouts/default.nix index 9d03a05..31b0b0b 100644 --- a/system/file_system_layouts/default.nix +++ b/system/file_system_layouts/default.nix @@ -40,6 +40,10 @@ in { device = "/srv/nix-config"; options = ["bind"]; }; + "/var/lib/acme" = { + device = "/srv/acme"; + options = ["bind"]; + }; }; }; } diff --git a/system/mail/default.nix b/system/mail/default.nix index 7102958..d2fd55c 100644 --- a/system/mail/default.nix +++ b/system/mail/default.nix @@ -47,5 +47,4 @@ in { keyFile = "/var/lib/acme/server1.vhack.eu/key.pem"; certificateScheme = 1; certificateFile = "/var/lib/acme/server1.vhack.eu/fullchain.pem"; - } -- cgit 1.4.1