feat(nixos): add owner config to manifest and users module

This commit is contained in:
Mohammad Rafiq 2025-07-06 23:33:36 +08:00
parent b6ba95a93c
commit 90a42fc7d5
No known key found for this signature in database
2 changed files with 73 additions and 37 deletions

View file

@ -0,0 +1,28 @@
{ config, ... }:
let
inherit (config.flake.manifest) owner;
in
{
flake.modules.nixos.default =
{ pkgs, ... }:
{
#TODO: move sudo/security options elsewhere
security.sudo.wheelNeedsPassword = false;
nix.settings.trusted-users = [ "@wheel" ];
#TODO: move to shell config
programs.${owner.shell}.enable = true;
#TODO: move ssh key settings elsewhere
users = {
mutableUsers = false;
groups.users.gid = 100;
users.root.openssh.authorizedKeys.keys = [ owner.pubkey ];
users.${owner.username} = {
isNormalUser = true;
# hashedPasswordFile
extraGroups = [ "wheel" ];
shell = pkgs.${owner.shell};
openssh.authorizedKeys.keys = [ owner.pubkey ];
};
};
};
}