move user home-manager declarations to nixosModules

This commit is contained in:
Aly Raffauf 2024-06-28 19:36:23 -04:00
parent 94d894f76e
commit e59d580d37
10 changed files with 49 additions and 21 deletions

View file

@ -5,8 +5,4 @@
pkgs, pkgs,
... ...
}: { }: {
home-manager = {
users.aly = import ../../homes/aly;
users.dustin = import ../../homes/dustin;
};
} }

View file

@ -16,6 +16,5 @@
}; };
} }
]; ];
users.aly = import ../../homes/aly;
}; };
} }

View file

@ -16,7 +16,5 @@
}; };
} }
]; ];
users.aly = import ../../homes/aly;
users.morgan = import ../../homes/morgan;
}; };
} }

View file

@ -63,7 +63,7 @@
} }
]; ];
users.aly = { users.aly = lib.mkForce {
imports = [../../homes/aly]; imports = [../../homes/aly];
systemd.user = { systemd.user = {
services = { services = {
@ -141,6 +141,5 @@
}; };
}; };
}; };
users.dustin = import ../../homes/dustin;
}; };
} }

View file

@ -16,6 +16,5 @@
''; '';
} }
]; ];
users.aly = import ../../homes/aly;
}; };
} }

View file

@ -24,6 +24,5 @@
}; };
} }
]; ];
users.aly = import ../../homes/aly;
}; };
} }

View file

@ -254,29 +254,53 @@
type = lib.types.bool; type = lib.types.bool;
}; };
size = lib.mkOption { size = lib.mkOption {
description = "Percent size of the zram swap relative to RAM."; description = "zram swap size relative to RAM.";
default = 50; default = 50;
type = lib.types.int; type = lib.types.int;
}; };
}; };
}; };
users = { users = {
aly = { aly = {
enable = lib.mkEnableOption "Aly's user."; enable = lib.mkEnableOption "Aly's user.";
manageHome = lib.mkOption {
description = "Whether to enable aly's home directory.";
type = lib.types.bool;
default = config.ar.users.aly.enable;
};
password = lib.mkOption { password = lib.mkOption {
description = "Hashed password for aly."; description = "Hashed password for aly.";
type = lib.types.str; type = lib.types.str;
}; };
}; };
dustin = { dustin = {
enable = lib.mkEnableOption "Dustin's user."; enable = lib.mkEnableOption "Dustin's user.";
manageHome = lib.mkOption {
description = "Whether to manage dustin's home directory.";
type = lib.types.bool;
default = config.ar.users.dustin.enable;
};
password = lib.mkOption { password = lib.mkOption {
description = "Hashed password for dustin."; description = "Hashed password for dustin.";
type = lib.types.str; type = lib.types.str;
}; };
}; };
morgan = { morgan = {
enable = lib.mkEnableOption "Morgan's user."; enable = lib.mkEnableOption "Morgan's user.";
manageHome = lib.mkOption {
description = "Whether to manage morgan's home directory.";
type = lib.types.bool;
default = config.ar.users.morgan.enable;
};
password = lib.mkOption { password = lib.mkOption {
description = "Hashed password for morgan."; description = "Hashed password for morgan.";
type = lib.types.str; type = lib.types.str;

View file

@ -1,11 +1,15 @@
{ {
inputs,
pkgs,
lib,
config, config,
lib,
pkgs,
... ...
}: { }: {
config = lib.mkIf config.ar.users.aly.enable { config = lib.mkIf config.ar.users.aly.enable {
home-manager.users.aly =
if config.ar.users.aly.manageHome
then import ../../../homes/aly
else {};
users.users.aly = { users.users.aly = {
description = "Aly Raffauf"; description = "Aly Raffauf";
extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "video"]; extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "video"];

View file

@ -1,15 +1,20 @@
{ {
inputs,
pkgs,
lib,
config, config,
lib,
pkgs,
... ...
}: { }: {
config = lib.mkIf config.ar.users.dustin.enable { config = lib.mkIf config.ar.users.dustin.enable {
home-manager.users.dustin =
if config.ar.users.dustin.manageHome
then import ../../../homes/dustin
else {};
users.users.dustin = { users.users.dustin = {
description = "Dustin Raffauf"; description = "Dustin Raffauf";
extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "video"]; extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "video"];
hashedPassword = config.ar.users.dustin.password; hashedPassword = config.ar.users.dustin.password;
isNormalUser = true; isNormalUser = true;
uid = 1001; uid = 1001;
}; };

View file

@ -1,15 +1,20 @@
{ {
inputs,
pkgs,
lib,
config, config,
lib,
pkgs,
... ...
}: { }: {
config = lib.mkIf config.ar.users.morgan.enable { config = lib.mkIf config.ar.users.morgan.enable {
home-manager.users.morgan =
if config.ar.users.morgan.manageHome
then import ../../../homes/morgan
else {};
users.users.morgan = { users.users.morgan = {
description = "Morgan Tamayo"; description = "Morgan Tamayo";
extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "video"]; extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "video"];
hashedPassword = config.ar.users.morgan.password; hashedPassword = config.ar.users.morgan.password;
isNormalUser = true; isNormalUser = true;
uid = 1002; uid = 1002;
}; };