From cf9558f166a40c4a46cec920787355866e8ee831 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 1 Sep 2023 00:35:43 +0000 Subject: [PATCH] WIP: sftp: define playground as a btrfs subvolume --- hosts/by-name/servo/services/ftp/default.nix | 35 ++++++++++++-------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/hosts/by-name/servo/services/ftp/default.nix b/hosts/by-name/servo/services/ftp/default.nix index ccc820cf..ee6d0903 100644 --- a/hosts/by-name/servo/services/ftp/default.nix +++ b/hosts/by-name/servo/services/ftp/default.nix @@ -14,7 +14,7 @@ # - sane.persist API could expose a `subvolume` option to make this feel natural -{ lib, pkgs, sane-lib, ... }: +{ config, lib, pkgs, sane-lib, ... }: let # user permissions: # - see @@ -177,19 +177,28 @@ in device = "/var/lib/uninsane/media"; options = [ "rbind" ]; }; - sane.persist.sys.plaintext = [ - { user = "sftpgo"; group = "sftpgo"; path = "/var/lib/sftpgo/export/playground"; } - ]; - sane.fs."/var/lib/sftpgo/export/playground/README.md" = { - wantedBy = [ "sftpgo.service" ]; - file.text = '' - this directory is intentionally read+write by anyone. - there are no rules, except a server-level quota: - - share files - - write poetry - - be a friendly troll - ''; + # sane.persist.sys.plaintext = [ + # { user = "sftpgo"; group = "sftpgo"; path = "/var/lib/sftpgo/export/playground"; } + # ]; + fileSystems."/var/lib/sftpgo/export/playground" = { + device = config.fileSystems."/mnt/persist/ext".device; + fsType = "btrfs"; + options = [ + "subvol=export-playground" + "compress=zstd" + "defaults" + ]; }; + # sane.fs."/var/lib/sftpgo/export/playground/README.md" = { + # wantedBy = [ "sftpgo.service" ]; + # file.text = '' + # this directory is intentionally read+write by anyone. + # there are no rules, except a server-level quota: + # - share files + # - write poetry + # - be a friendly troll + # ''; + # }; sane.fs."/var/lib/sftpgo/export/README.md" = { wantedBy = [ "sftpgo.service" ]; file.text = ''