persist: plaintext: consider "/mnt/persist/plaintext" as the logical root, and abstract away "/nix/persist"

This commit is contained in:
Colin 2024-02-23 04:16:17 +00:00
parent 0864790bb7
commit 80ecdcc4f9
3 changed files with 13 additions and 8 deletions

View File

@ -1,7 +1,7 @@
{ config, lib, pkgs, sane-lib, utils, ... }:
let
persist-base = config.sane.persist.stores."plaintext".origin;
persist-base = "/nix/persist";
device = config.sane.persist.stores."cryptClearOnBoot".origin;
key = "${device}.key";
underlying = sane-lib.path.concat [ persist-base "crypt/clearedonboot" ];

View File

@ -1,11 +1,15 @@
{ config, lib, ... }:
let
cfg = config.sane.persist;
in lib.mkIf cfg.enable {
sane.persist.stores."plaintext" = lib.mkDefault {
origin = "/nix/persist";
# TODO: parameterize!
persist-base = "/nix/persist";
plaintext-dir = config.sane.persist.stores."plaintext".origin;
plaintext-backing-dir = persist-base; #< TODO: scope this!
in lib.mkIf config.sane.persist.enable {
sane.persist.stores."plaintext" = {
origin = lib.mkDefault "/mnt/persist/plaintext";
};
# TODO: needed?
# sane.fs."/nix".mount = {};
# TODO: scope this!
sane.fs."${plaintext-dir}".mount.bind = plaintext-backing-dir;
}

View File

@ -1,7 +1,8 @@
{ config, lib, pkgs, sane-lib, utils, ... }:
let
persist-base = config.sane.persist.stores."plaintext".origin;
# TODO: parameterize!
persist-base = "/nix/persist";
private-dir = config.sane.persist.stores."private".origin;
private-backing-dir = sane-lib.path.concat [ persist-base private-dir ];
in