Skip to content

Commit

Permalink
remove GH-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
NobbZ committed Dec 16, 2023
1 parent d4e41fa commit 823978d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 5 deletions.
1 change: 0 additions & 1 deletion home/configurations/nmelzer_at_mimas.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
sops.defaultSopsFile = "${self}/secrets/mimas/nmelzer/default.yaml";

sops.secrets.rustic.path = "${config.xdg.configHome}/rustic/password";
sops.secrets.gh_hosts.path = "${config.xdg.configHome}/gh/hosts.yml";

dconf.enable = true;

Expand Down
48 changes: 48 additions & 0 deletions home/modules/services/rustic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ _: {
}: let
cfg = config.services.rustic;

osConfig = config;

bin = lib.getExe cfg.package;

globs = let lines = map (g: "${g}\n") cfg.globs; in lib.concatStrings lines;
Expand All @@ -18,6 +20,47 @@ _: {
flags = lib.concatStringsSep " " flagList;

command = "${bin} backup ${flags} %h";

profileModule = {
name,
config,
...
}: {
enable = lib.mkEnableOption name // {default = true;};

repo = lib.mkOption {
type = lib.types.str;
description = "Location of the repository";
};

globs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = "Patterns to apply to backup. Use a hardcoded prefix for the home directory";
};

oneFileSystem = lib.mkOption {
type = lib.types.bool;
default = false;
description = "If true, exclude other file systems, don't cross filesystem boundaries and subvolumes";
};

passwordFile = lib.mkOption {
type = lib.types.path;
default = "${config.xdg.configHome}/rustic/password";
description = "Location of the password file";
};

source = lib.mkOption {
type = lib.types.path;
description = "Location of the base directory for the backup.Of ";
};

settings = lib.mkOption {
type = lib.types.attrsOf lib.types.any;
description = "A nix representation of the profile settings which gets converted to a TOML file";
};
};
in {
_file = ./default.nix;

Expand Down Expand Up @@ -52,6 +95,11 @@ in {
default = "${config.xdg.configHome}/rustic/password";
description = "Location of the password file";
};

profile = lib.mkOption {
type = lib.types.attrsOf profileModule;
description = "Specifies the backup profile to use and its settings";
};
};

config = lib.mkIf cfg.enable {
Expand Down
7 changes: 3 additions & 4 deletions secrets/mimas/nmelzer/default.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
rustic: ENC[AES256_GCM,data:0gI0lIdOrj/1LGg=,iv:NHuqnSibmY/RkJrSUWm0TbgG45iSdjso9ABI8SGqUTg=,tag:/SmXXL/RU/4AjnuFs7E4/w==,type:str]
gh_hosts: ENC[AES256_GCM,data:lLbAynTwguC/xj24/PSyI/iZb25AkU4Kp3aW1CYp2Mou7qg1BfULQPI6fOBhlHgUq6DZUQoRNqs1uktgr3iV5QJAF6tXSo0poVpssTvhvuregR3eXvqx+dn3QUCjMZxwuU+a2twb,iv:iFRFCY7y00O3hTi2Ba7stqfVAGPm9M4QRgpbI7X5u1E=,tag:pJaf0h9e2tVd9yEzrA6jVg==,type:str]
sops:
kms: []
gcp_kms: []
Expand All @@ -24,8 +23,8 @@ sops:
bnNqbDRFWWN4TTB6SE55Qnh3RlhIWWcKhWZGgHU+ucCaaTiY6DJ7ZF08nHGrEoio
AagCusPIXh/5EIC/MqXAicuZvllC4R31pzinnQhLA2XH/e7E7q68aA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2023-11-13T06:10:33Z"
mac: ENC[AES256_GCM,data:bxY2vxPdoeYfBPwI1GfcfuHJHpTm4fBU1VamWAyzathz6CvNYhnxVolom+5aD+GzsHm9N2H2nyfzp/LaAZdt8MERqgTVG96jvI3g/dcqwK8RQcSbB4jk14VQ5Cqqk20FwjZwvVYTM3vkMSUqrrmAZzEHPOW5xmGEfFXL4gzViW0=,iv:Du+NYHoZXBztwkLuKsSuidfTjY1Ku+EkQIwFxzo1zRY=,tag:+4PlzT1ox9r23vd0Odktqg==,type:str]
lastmodified: "2023-12-16T15:28:03Z"
mac: ENC[AES256_GCM,data:XE4hzHc64FtuAx4VZNxpil3Gmlwl387VlYeKpP68GwIw16PVA6oqYwq+unpKN9Jj+6ij7tHUfzYfeGre0X0p5VbpUca7jZ+aqYqDA5/kVYUxDetuTkwLQOqT+HhSQoFw8wJQ5YHOry1iGiYcnt/zdKD3OpVFLF4BslrP5YaBbfs=,iv:zGf2rc7NIVRkFWfb+kSZBv/Y1N+R9vL6NXVP9sLk0D4=,tag:wNkL1yhA6ElrLZYbO6PVtg==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.7.3
version: 3.8.1

0 comments on commit 823978d

Please sign in to comment.