1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

pizauth: reload on change and option type

- added onChange pizauth reload for config file

- clientSecret is not required for outlook365 so should be nullable.
This commit is contained in:
Anton Tetov 2025-08-27 12:39:10 +02:00 committed by Austin Horstman
parent 77a71380c3
commit 99a69bdf8a
2 changed files with 18 additions and 1 deletions

View file

@ -60,7 +60,8 @@ in
};
clientSecret = mkOption {
type = types.str;
type = types.nullOr types.str;
default = null;
description = ''
The OAuth2 client secret.
'';
@ -128,6 +129,8 @@ in
${indent}auth_uri = "${acc.authUri}";
${indent}token_uri = "${acc.tokenUri}";
${indent}client_id = "${acc.clientId}";
''
+ lib.optionalString (acc.clientSecret != "" && acc.clientSecret != null) ''
${indent}client_secret = "${acc.clientSecret}";
''
+ lib.optionalString (acc.scopes != [ ] && acc.scopes != null) ''
@ -164,6 +167,7 @@ in
Unit = {
Description = "Pizauth OAuth2 token manager";
After = [ "network.target" ];
X-Restart-Triggers = [ "${config.xdg.configFile."pizauth.conf".source}" ];
};
Service = {

View file

@ -28,6 +28,13 @@
"offline_access"
];
};
test3 = {
authUri = "authUri3";
tokenUri = "tokenUri3";
clientId = "clientId3";
scopes = [
];
};
};
};
@ -64,6 +71,12 @@
"offline_access"
];
}
account "test3" {
auth_uri = "authUri3";
token_uri = "tokenUri3";
client_id = "clientId3";
}
''}
'';
};