From 323973ecbb71b6186290a798af1c8a2c91299e18 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Fri, 23 Feb 2024 03:23:54 +0100 Subject: apps/static-users: init --- apps/static-users/appspec.nix | 12 ++++++++++++ apps/static-users/capabilities.nix | 8 ++++++++ apps/static-users/module.nix | 1 + 3 files changed, 21 insertions(+) create mode 100644 apps/static-users/appspec.nix create mode 100644 apps/static-users/capabilities.nix create mode 100644 apps/static-users/module.nix (limited to 'apps/static-users') diff --git a/apps/static-users/appspec.nix b/apps/static-users/appspec.nix new file mode 100644 index 0000000..6ab5c7d --- /dev/null +++ b/apps/static-users/appspec.nix @@ -0,0 +1,12 @@ +{ lib, ... }: { + description = "static-users"; + endOfLife = null; + options.users = lib.mkOption { + type = lib.types.attrsOf (lib.types.submodule { + options.publicKeyFile = lib.mkOption { + type = lib.types.path; + }; + }); + default = { }; + }; +} diff --git a/apps/static-users/capabilities.nix b/apps/static-users/capabilities.nix new file mode 100644 index 0000000..de8d1f0 --- /dev/null +++ b/apps/static-users/capabilities.nix @@ -0,0 +1,8 @@ +{ appConfig, lib, ... }: +lib.concatMapAttrs + (name: attrs: lib.optionalAttrs (attrs ? publicKeyFile) { + ${name} = { + inherit (attrs) publicKeyFile; + }; + }) + appConfig.users diff --git a/apps/static-users/module.nix b/apps/static-users/module.nix new file mode 100644 index 0000000..c915eb0 --- /dev/null +++ b/apps/static-users/module.nix @@ -0,0 +1 @@ +{ ... }: { } -- cgit v1.2.3