incorporated john-p14s, big squash merge of stuff
This commit is contained in:
@@ -1,12 +1,23 @@
|
||||
# Lifted from:
|
||||
# https://github.com/Doc-Steve/dendritic-design-with-flake-parts/blob/69edacdb5a4a6ca71d649bb8eb62cf8c630c8627/modules/users/bob%20%5BNDn%5D/bob.nix#L8
|
||||
{ self, ... }:
|
||||
{ self, inputs, ... }:
|
||||
{
|
||||
config.flake.factory.user = username: isAdmin: {
|
||||
nixos."${username}" = { lib, pkgs, ... }: {
|
||||
config.flake.factory.user = {
|
||||
username,
|
||||
isAdmin ? false,
|
||||
noPassword ? false,
|
||||
# homeImports ? [ ],
|
||||
# homePackages ? [ ],
|
||||
}: {
|
||||
nixos."${username}" = { config, lib, pkgs, ... }: {
|
||||
imports = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
|
||||
users.users."${username}" = {
|
||||
isNormalUser = true;
|
||||
home = "/home/${username}";
|
||||
shell = lib.mkIf config.programs.zsh.enable pkgs.zsh;
|
||||
extraGroups = [
|
||||
"input"
|
||||
"networkmanager"
|
||||
@@ -21,7 +32,7 @@
|
||||
enable = true;
|
||||
extraRules = [{
|
||||
users = [ "${username}" ];
|
||||
commands = [{
|
||||
commands = lib.mkIf noPassword [{
|
||||
command = "ALL";
|
||||
options = [ "NOPASSWD" ];
|
||||
}];
|
||||
@@ -30,11 +41,10 @@
|
||||
|
||||
# https://github.com/Doc-Steve/dendritic-design-with-flake-parts/wiki/Dendritic_Aspects#multi-context-aspect
|
||||
home-manager.users."${username}" = {
|
||||
imports = [ self.modules.homeManager."${username}" ];
|
||||
home.username = "${username}";
|
||||
home.homeDirectory = "/home/${username}";
|
||||
imports = [
|
||||
self.modules.homeManager."${username}"
|
||||
];
|
||||
# home.packages = homePackages;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user