sops key working

This commit is contained in:
John Lancaster
2025-07-28 19:20:40 -05:00
parent 29a1ee26cf
commit e31c9b911d
3 changed files with 15 additions and 18 deletions

View File

@@ -4,6 +4,8 @@ let
inherit (lib) mkEnableOption mkOption mkPackageOption mkIf types;
cfg = config.programs.resticprofile;
yamlFormat = pkgs.formats.yaml { };
baseProfile = import ./profiles/base.nix { inherit lib config; };
profiles = lib.recursiveUpdate baseProfile cfg.profiles;
in {
options.programs.resticprofile = {
enable = mkEnableOption "Enable resticprofile (Restic backup profile manager)";
@@ -17,8 +19,6 @@ in {
description = ''
Multiple configuration files for resticprofile. Each attribute name
becomes a YAML file under `$XDG_CONFIG_HOME/resticprofile/`.
This allows creating multiple files that can reference each other.
The contents of each profile will be merged with the base profile using `lib.mkMerge`.
'';
example = {
common = {
@@ -41,13 +41,9 @@ in {
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."resticprofile/profiles.yaml".source =
let
baseProfile = import ./resticprofile-base.nix { inherit lib; };
in
yamlFormat.generate "profiles" (lib.mkMerge [
baseProfile
cfg.profiles
]);
xdg.configFile."resticprofile/profiles.yaml".source = yamlFormat.generate "profiles" {
version = "2";
profiles = profiles;
};
};
}