nixos/modules/users.nix

22 lines
476 B
Nix
Raw Normal View History

{ config, pkgs, lib, ... }:
2024-02-07 21:54:26 +00:00
let
cfg = config.custom.users;
in
{
2024-02-07 21:54:26 +00:00
options.custom.users = {
jake = {
password = lib.mkOption {
description = "Enable an interactive password.";
type = lib.types.bool;
default = false;
};
};
2024-02-07 21:54:26 +00:00
};
2024-02-07 21:54:26 +00:00
config = lib.mkIf cfg.jake.password {
age.secrets."passwords/jake".file = ../secrets/passwords/jake.age;
2024-02-04 10:29:07 +00:00
users.users.jake.hashedPasswordFile = config.age.secrets."passwords/jake".path;
};
}