sops key working
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
{ lib, ... }:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
base = lib.mkDefault {
|
||||
base = {
|
||||
repository = "local:/mnt/backup";
|
||||
passwordFile = "password.txt";
|
||||
source = [ "/home/john/Documents" ];
|
||||
passwordFile = "${config.xdg.configHome}/resticprofile/password.txt";
|
||||
status-file = "{{ .ConfigDir }}/backup-status.json";
|
||||
retention = {
|
||||
after-backup = true;
|
||||
@@ -14,7 +13,7 @@
|
||||
};
|
||||
backup = {
|
||||
verbose = true;
|
||||
exclude-file = "{{ .ConfigDir }}/profiles/excludes";
|
||||
# exclude-file = "{{ .ConfigDir }}/profiles/excludes";
|
||||
schedule-permission = "system";
|
||||
schedule-priority = "background";
|
||||
check-after = true;
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user