small update
This commit is contained in:
parent
c4f6785845
commit
b1490ec9a8
100 changed files with 187 additions and 1695 deletions
80
modules/other/users.mod.nix
Normal file
80
modules/other/users.mod.nix
Normal file
|
@ -0,0 +1,80 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) elemAt;
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.types) listOf str package;
|
||||
|
||||
inherit (config.meta.mainUser) username;
|
||||
in {
|
||||
options.meta = {
|
||||
users = mkOption {
|
||||
type = listOf str;
|
||||
default = ["cr"];
|
||||
description = ''
|
||||
A list of users on a system.
|
||||
'';
|
||||
};
|
||||
mainUser = {
|
||||
username = mkOption {
|
||||
type = str;
|
||||
default = elemAt config.meta.users 0;
|
||||
description = ''
|
||||
The main user for each system. This is the first element of the list of users by default.
|
||||
'';
|
||||
};
|
||||
|
||||
gitSigningKey = mkOption {
|
||||
type = str;
|
||||
description = ''
|
||||
The main user's git signing key, used to automatically sing git commits with this key
|
||||
'';
|
||||
default = ''
|
||||
ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAWEDj/Yib6Mqs016jx7rtecWpytwfVl28eoHtPYCM9TVLq81VIHJSN37lbkc/JjiXCdIJy2Ta3A3CVV5k3Z37NbgAu23oKA2OcHQNaRTLtqWlcBf9fk9suOkP1A3NzAqzivFpBnZm3ytaXwU8LBJqxOtNqZcFVruO6fZxJtg2uE34mAw==
|
||||
'';
|
||||
};
|
||||
|
||||
# TODO: clean this up and move it somewhere else.
|
||||
defaultShell = {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
default = "nushell";
|
||||
description = ''
|
||||
The default shell of a user. This is not the main system shell, but the shell used in terminals.
|
||||
'';
|
||||
};
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = pkgs.nushell;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
config = {
|
||||
users = {
|
||||
mutableUsers = true;
|
||||
users = {
|
||||
${username} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networking"
|
||||
"video"
|
||||
"networkmanager"
|
||||
"audio"
|
||||
"nix"
|
||||
"docker"
|
||||
];
|
||||
# shell = self.packages.${pkgs.stdenv.system}.fish;
|
||||
shell = pkgs.nushell;
|
||||
# hashedPasswordFile = "/etc/passwords/cr";
|
||||
};
|
||||
# root.hashedPasswordFile = "/persist/passwords/root";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue