mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat[work,server,client]: add opkssh
Some checks failed
Flake check / Check flake (push) Has been cancelled
Some checks failed
Flake check / Check flake (push) Has been cancelled
This commit is contained in:
parent
3b368ec8de
commit
c9e7e493d8
14 changed files with 604 additions and 340 deletions
38
modules/nixos/server/opkssh.nix
Normal file
38
modules/nixos/server/opkssh.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ lib, config, globals, ... }:
|
||||
let
|
||||
serviceName = "opkssh";
|
||||
serviceUser = "opksshuser";
|
||||
serviceGroup = serviceUser;
|
||||
|
||||
kanidmDomain = globals.services.kanidm.domain;
|
||||
|
||||
inherit (config.swarselsystems) mainUser;
|
||||
inherit (config.repo.secrets.local) persons;
|
||||
in
|
||||
{
|
||||
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
|
||||
config = lib.mkIf config.swarselmodules.server.${serviceName} {
|
||||
|
||||
services.${serviceName} = {
|
||||
enable = true;
|
||||
user = serviceUser;
|
||||
group = serviceGroup;
|
||||
providers = {
|
||||
kanidm = {
|
||||
lifetime = "oidc";
|
||||
issuer = "https://${kanidmDomain}/oauth2/openid/${serviceName}";
|
||||
clientId = serviceName;
|
||||
};
|
||||
};
|
||||
authorizations = [
|
||||
{
|
||||
user = mainUser;
|
||||
principal = builtins.head persons.${mainUser}.mailAddresses;
|
||||
inherit (config.services.opkssh.providers.kanidm) issuer;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue