This commit is contained in:
mjallen18
2025-12-14 10:19:26 -06:00
parent 90daf80a88
commit f09246dcba
10 changed files with 171 additions and 23 deletions

View File

@@ -1,9 +1,13 @@
{
config,
lib,
namespace,
pkgs,
...
}:
let
git-token = (if config.${namespace}.sops.enable then config.sops.secrets."github-token".path else "error");
update-checker = pkgs.writeScriptBin "update-checker" ''
#!/usr/bin/env nix-shell
#! nix-shell -i python3 --pure
@@ -19,7 +23,7 @@ let
token = None
with open('${config.sops.secrets."github-token".path}', 'r') as token_file:
with open('${git-token}', 'r') as token_file:
token = token_file.readline()
auth = Auth.Token(token)
@@ -267,7 +271,7 @@ let
'';
in
{
config = {
config = lib.mkIf config.${namespace}.sops.enable {
home.packages = [ update-checker ];
};
}