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:
parent
77a71380c3
commit
99a69bdf8a
2 changed files with 18 additions and 1 deletions
|
|
@ -60,7 +60,8 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
clientSecret = mkOption {
|
clientSecret = mkOption {
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
The OAuth2 client secret.
|
The OAuth2 client secret.
|
||||||
'';
|
'';
|
||||||
|
|
@ -128,6 +129,8 @@ in
|
||||||
${indent}auth_uri = "${acc.authUri}";
|
${indent}auth_uri = "${acc.authUri}";
|
||||||
${indent}token_uri = "${acc.tokenUri}";
|
${indent}token_uri = "${acc.tokenUri}";
|
||||||
${indent}client_id = "${acc.clientId}";
|
${indent}client_id = "${acc.clientId}";
|
||||||
|
''
|
||||||
|
+ lib.optionalString (acc.clientSecret != "" && acc.clientSecret != null) ''
|
||||||
${indent}client_secret = "${acc.clientSecret}";
|
${indent}client_secret = "${acc.clientSecret}";
|
||||||
''
|
''
|
||||||
+ lib.optionalString (acc.scopes != [ ] && acc.scopes != null) ''
|
+ lib.optionalString (acc.scopes != [ ] && acc.scopes != null) ''
|
||||||
|
|
@ -164,6 +167,7 @@ in
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Pizauth OAuth2 token manager";
|
Description = "Pizauth OAuth2 token manager";
|
||||||
After = [ "network.target" ];
|
After = [ "network.target" ];
|
||||||
|
X-Restart-Triggers = [ "${config.xdg.configFile."pizauth.conf".source}" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,13 @@
|
||||||
"offline_access"
|
"offline_access"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
test3 = {
|
||||||
|
authUri = "authUri3";
|
||||||
|
tokenUri = "tokenUri3";
|
||||||
|
clientId = "clientId3";
|
||||||
|
scopes = [
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -64,6 +71,12 @@
|
||||||
"offline_access"
|
"offline_access"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
account "test3" {
|
||||||
|
auth_uri = "authUri3";
|
||||||
|
token_uri = "tokenUri3";
|
||||||
|
client_id = "clientId3";
|
||||||
|
}
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue