refactor!: switch to dendritic pattern
BREAKING CHANGE: complete reorganization of the repository
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
{
|
||||
flake.modules.nixos.system-account-creug = {
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.mySystem.users.creug;
|
||||
in {
|
||||
options.mySystem.users.creug = {
|
||||
enable = mkEnableOption "Enables user creug";
|
||||
sudo = mkEnableOption "Make the user a superuser";
|
||||
trusted = mkOption {
|
||||
description = "Mark the user as trusted by Nix";
|
||||
default = cfg.sudo;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
users.users.creug = mkIf cfg.enable {
|
||||
isNormalUser = true;
|
||||
description = "Greg";
|
||||
extraGroups =
|
||||
["networkmanager" "dialout" "games" "audio" "input"]
|
||||
++ lists.optional cfg.sudo "wheel";
|
||||
shell = pkgs.zsh;
|
||||
openssh.authorizedKeys.keyFiles = lib.filesystem.listFilesRecursive ../home/creug/keys;
|
||||
};
|
||||
nix.settings = mkIf cfg.trusted {
|
||||
trusted-users = ["creug"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
flake.modules.nixos.system-account-phundrak = {
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.mySystem.users.phundrak;
|
||||
in {
|
||||
options.mySystem.users.phundrak = {
|
||||
enable = mkEnableOption "Enables user phundrak";
|
||||
trusted = mkEnableOption "Mark the user as trusted by Nix";
|
||||
extraGroups = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
example = ["feedbackd"];
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
users.users.phundrak = mkIf cfg.enable {
|
||||
isNormalUser = true;
|
||||
description = "Lucien Cartier-Tilet";
|
||||
extraGroups =
|
||||
["networkmanager" "wheel" "dialout" "plugdev" "games" "audio" "input"]
|
||||
++ cfg.extraGroups;
|
||||
shell = pkgs.zsh;
|
||||
openssh.authorizedKeys.keyFiles = lib.filesystem.listFilesRecursive ../home/phundrak/keys;
|
||||
};
|
||||
nix.settings = mkIf cfg.trusted {
|
||||
trusted-users = ["phundrak"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
flake.modules.nixos.system-account-root = {
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.mySystem.users.root;
|
||||
in {
|
||||
options.mySystem.users.root.disablePassword = mkEnableOption "Disables root password";
|
||||
config = {
|
||||
users.users.root = {
|
||||
hashedPassword = mkIf cfg.disablePassword "*";
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user