aboutsummaryrefslogtreecommitdiffstats
path: root/apps/static-users/capabilities.nix
blob: 18618888defa16974614b86d652c569efb2d3b60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{ appConfig, config, lib, ... }:
{
  password-credentials = lib.concatMapAttrs
    (name: attrs: lib.optionalAttrs (attrs.passwordFile != null) {
      ${name} = { inherit (attrs) username passwordFile; };
    })
    # TODO appConfig should come from config to have been fully evaluated
    config.fysiweb-apps.${appConfig.owner}.${appConfig.appName}.${appConfig.appInstanceName}.users;
  ssh-credentials = lib.concatMapAttrs
    (name: attrs: lib.optionalAttrs (attrs.publicKeyFile != null) {
      ${name} = { inherit (attrs) publicKeyFile; };
    })
    appConfig.users;
}