remove unneded options, add users.nix

This commit is contained in:
Charlie Root 2024-10-27 10:47:44 +01:00
commit 1bb25bda0e
Signed by: faukah
SSH key fingerprint: SHA256:jpYIt4Vkz1NBTQcks/N9OPTfTFxE6KF2W/rV7hrfrIw
4 changed files with 34 additions and 30 deletions

View file

@ -1,5 +1,4 @@
{
config,
lib,
pkgs,
...
@ -79,10 +78,7 @@
};
};
other = {
system = {
hostname = "hermit";
username = "cr";
};
system.username = "cr";
home-manager = {
enable = true;

View file

@ -1 +1,9 @@
_: {imports = [./home-manager.nix ./system.nix ./xdg.nix ./git.nix];}
_: {
imports = [
./home-manager.nix
./system.nix
./xdg.nix
./git.nix
/users.nix
];
}

View file

@ -1,32 +1,10 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.modules.other.system;
{lib, ...}: let
inherit (lib) mkOption types;
in {
options.modules.other.system = {
hostname = mkOption {
description = "hostname for this system";
type = types.str;
};
username = mkOption {
description = "username for this system";
type = types.str;
};
gitPath = mkOption {
description = "path to the flake directory";
type = types.str;
};
};
config = {
users.users.${cfg.username} = {
isNormalUser = true;
extraGroups = ["wheel" "networking"];
};
};
}

22
modules/other/users.nix Normal file
View file

@ -0,0 +1,22 @@
{config, ...}: let
inherit (config.meta.mainUser) username;
in {
users = {
mutableUsers = false;
users = {
${username} = {
isNormalUser = true;
extraGroups = [
"wheel"
"networking"
"video"
"networkmanager"
"audio"
"nix"
];
hashedPasswordFile = "/etc/passwords/cr";
};
root.hashedPasswordFile = "/persist/passwords/root";
};
};
}