diff --git a/roles/forgejo.nix b/roles/forgejo.nix index 3c45c8e..7a9b338 100644 --- a/roles/forgejo.nix +++ b/roles/forgejo.nix @@ -69,17 +69,6 @@ }; }; - environment.persistence."/persistent" = { - directories = [ - # TODO: Backup onto CEPH cluster periodically. Or maybe move fully, if performance allows it. - { - directory = "/appdata/forgejo"; - user = "forgejo"; - mode = "0700"; - } - ]; - }; - environment.systemPackages = let forgejo-cli = pkgs.writeShellScriptBin "forgejo-cli" '' @@ -87,16 +76,20 @@ echo "No arguments supplied" exit 1 fi - sudo -u forgejo -- ${lib.getExe pkgs.forgejo} --config /appdata/forgejo/custom/conf/app.ini $@ + sudo -u forgejo -- ${lib.getExe pkgs.forgejo} --config /cephfs/appdata/forgejo/custom/conf/app.ini $@ ''; in [ forgejo-cli ]; + systemd.tmpfiles.rules = [ + "d /cephfs/appdata/forgejo - forgejo forgejo - -" + ]; + services.forgejo = { enable = true; - stateDir = "/appdata/forgejo"; + stateDir = "/cephfs/appdata/forgejo"; lfs.enable = true; database = { diff --git a/systems/base/fs.nix b/systems/base/fs.nix index 2c8f6b9..c63c78c 100644 --- a/systems/base/fs.nix +++ b/systems/base/fs.nix @@ -2,36 +2,47 @@ ... }: { - boot.supportedFilesystems = [ "btrfs" ]; + boot.supportedFilesystems = [ "btrfs" ]; - fileSystems."/" = { - device = "none"; - fsType = "tmpfs"; - options = [ "defaults" "mode=755" ]; - }; + fileSystems."/" = { + device = "none"; + fsType = "tmpfs"; + options = [ + "defaults" + "mode=755" + ]; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-label/boot"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + }; - fileSystems."/nix" = { - device = "/dev/disk/by-label/btrfs"; - fsType = "btrfs"; - options = [ "compress=zstd" "subvol=nix" "noatime" ]; - }; + fileSystems."/nix" = { + device = "/dev/disk/by-label/btrfs"; + fsType = "btrfs"; + options = [ + "compress=zstd" + "subvol=nix" + "noatime" + ]; + }; - fileSystems."/persistent" = { - device = "/dev/disk/by-label/btrfs"; - fsType = "btrfs"; - options = [ "compress=zstd" "subvol=persistent" "noatime" ]; - autoResize = true; - neededForBoot = true; - }; + fileSystems."/persistent" = { + device = "/dev/disk/by-label/btrfs"; + fsType = "btrfs"; + options = [ + "compress=zstd" + "subvol=persistent" + "noatime" + ]; + autoResize = true; + neededForBoot = true; + }; - fileSystems."/media" = { - device = "vm@b9b22d11-3492-49a6-92b7-b36cdf0161fe.cephfs=/media"; - fsType = "ceph"; - options = [ "nofail" ]; - }; + fileSystems."/cephfs" = { + device = "vm@b9b22d11-3492-49a6-92b7-b36cdf0161fe.cephfs=/"; + fsType = "ceph"; + options = [ "nofail" ]; + }; }