mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-15 05:39:11 +02:00
wip: migrate client modules
This commit is contained in:
parent
f6d2ff1544
commit
7ce27d5d2f
245 changed files with 20254 additions and 188 deletions
40
modules-clone/nixos/server/opkssh.nix
Normal file
40
modules-clone/nixos/server/opkssh.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ lib, config, globals, confLib, ... }:
|
||||
let
|
||||
inherit (confLib.gen { name = "opkssh"; user = "opksshuser"; group = "opksshuser"; }) serviceName serviceUser serviceGroup;
|
||||
|
||||
kanidmDomain = globals.services.kanidm.domain;
|
||||
|
||||
inherit (config.swarselsystems) mainUser;
|
||||
mailAddress = config.repo.secrets.common.mail.address4;
|
||||
in
|
||||
{
|
||||
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
|
||||
config = lib.mkIf config.swarselmodules.server.${serviceName} {
|
||||
|
||||
users.persistentIds = {
|
||||
opksshuser = confLib.mkIds 980;
|
||||
};
|
||||
|
||||
services.${serviceName} = {
|
||||
enable = true;
|
||||
user = serviceUser;
|
||||
group = serviceGroup;
|
||||
providers = {
|
||||
kanidm = {
|
||||
lifetime = "oidc";
|
||||
issuer = "https://${kanidmDomain}/oauth2/openid/${serviceName}";
|
||||
clientId = serviceName;
|
||||
};
|
||||
};
|
||||
authorizations = [
|
||||
{
|
||||
user = mainUser;
|
||||
principal = mailAddress;
|
||||
inherit (config.services.opkssh.providers.kanidm) issuer;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue