xin/users/default.nix

44 lines
811 B
Nix
Raw Permalink Normal View History

2023-09-12 08:44:05 -06:00
{ config
, lib
, pkgs
, isUnstable
, ...
2023-07-11 09:12:50 -06:00
}:
with lib; let
2022-08-25 12:21:35 -06:00
userBase = {
shell = pkgs.zsh;
2023-07-11 09:12:50 -06:00
openssh.authorizedKeys.keys =
config.myconf.hwPubKeys
++ config.myconf.managementPubKeys;
2022-08-25 12:21:35 -06:00
};
2023-09-12 08:44:05 -06:00
in
{
2022-08-25 12:21:35 -06:00
options = {
defaultUsers = {
enable = mkOption {
description = "Enable regular set of users";
default = true;
example = true;
type = lib.types.bool;
};
};
};
config = mkIf config.defaultUsers.enable {
users.users.root = userBase;
2023-07-11 09:12:50 -06:00
users.users.qbit =
userBase
// {
isNormalUser = true;
description = "Aaron Bieber";
home = "/home/qbit";
2023-09-12 08:44:05 -06:00
extraGroups = [ "wheel" ];
2023-07-11 09:12:50 -06:00
};
2022-08-25 12:21:35 -06:00
2022-10-04 09:36:47 -06:00
environment.systemPackages =
2023-07-11 09:12:50 -06:00
if isUnstable
2023-09-12 08:44:05 -06:00
then [ pkgs.yash pkgs.go ]
else [ pkgs.go ];
2022-08-25 12:21:35 -06:00
};
}