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, lib,
pkgs, pkgs,
... ...
@ -79,10 +78,7 @@
}; };
}; };
other = { other = {
system = { system.username = "cr";
hostname = "hermit";
username = "cr";
};
home-manager = { home-manager = {
enable = true; 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 @@
{ {lib, ...}: let
config, inherit (lib) mkOption types;
lib,
...
}:
with lib; let
cfg = config.modules.other.system;
in { in {
options.modules.other.system = { options.modules.other.system = {
hostname = mkOption {
description = "hostname for this system";
type = types.str;
};
username = mkOption { username = mkOption {
description = "username for this system"; description = "username for this system";
type = types.str; 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";
};
};
}