refactor: Move user config into modules/

This commit is contained in:
Madeleine Sydney
2025-03-13 11:14:32 -06:00
parent 257f011a99
commit fb3299d89c
85 changed files with 597 additions and 542 deletions

View File

@@ -0,0 +1,25 @@
{ config, lib, pkgs, ... }:
let
mutableSymlink = config.lib.file.mkOutOfStoreSymlink;
cfg = config.sydnix.users.crumb.age;
in
{
options.sydnix.users.crumb.age.enable = lib.mkEnableOption "Age, à la crumb";
config = lib.mkIf cfg.enable {
home.packages = [
# Rage supports pinentry while Age does not.
pkgs.rage
];
# We use a mutable symlink to avoid placing the key inside the
# world-readable store.
home.file."private-keys/age/${config.home.username}.age".source =
mutableSymlink "/persist/private-keys/age/${config.home.username}.age";
home.file."public-keys/age/${config.home.username}.pub".source =
../../../../public-keys/age/${config.home.username}.pub;
};
}