infra/modules/nixos/common/users.nix
2024-07-24 10:27:26 +00:00

19 lines
466 B
Nix

{ inputs, lib, ... }:
let
usersDir = "${toString inputs.self}/users";
userImports =
let
toUserPath = f: usersDir + "/${f}";
onlyUserFiles = x: lib.hasSuffix ".nix" x && x != "lib.nix";
userDirEntries = builtins.readDir usersDir;
userFiles = builtins.filter onlyUserFiles (lib.attrNames userDirEntries);
in
builtins.map toUserPath userFiles;
in
{
imports = userImports;
# No mutable users
users.mutableUsers = false;
}