test
This commit is contained in:
@@ -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 ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = {
|
||||
config = lib.mkIf cfg.enable {
|
||||
sops = {
|
||||
age.keyFile = "/home/${config.${namespace}.user.name}/.config/sops/age/keys.txt";
|
||||
defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
|
||||
|
||||
Reference in New Issue
Block a user