restructured modules, toggling them, overlays

This commit is contained in:
2024-04-19 14:55:22 -06:00
parent 14676a34dc
commit 71c838a95a
24 changed files with 1173 additions and 76 deletions

55
modules/bundles/users.nix Normal file
View File

@@ -0,0 +1,55 @@
{ lib, config, inputs, outputs, myLib, pkgs, ... }:
let cfg = config.myNixOS;
in {
options.myNixOS.home-users = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule {
options = {
userConfig = lib.mkOption {
default = ./../../home-manager/work.nix;
example = "DP-1";
};
userSettings = lib.mkOption {
default = { };
example = "{}";
};
};
});
default = { };
};
config = {
programs.zsh.enable = true;
programs.hyprland.enable = cfg.sharedSettings.hyprland.enable;
services.xserver = lib.mkIf cfg.sharedSettings.hyprland.enable {
displayManager = { defaultSession = "hyprland"; };
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
inherit myLib;
outputs = inputs.self.outputs;
};
users = builtins.mapAttrs (name: user:
{ ... }: {
imports =
[ (import user.userConfig) outputs.homeManagerModules.default ];
}) (config.myNixOS.home-users);
};
users.users = builtins.mapAttrs (name: user:
{
isNormalUser = true;
initialPassword = "12345";
description = "";
shell = pkgs.zsh;
extraGroups = [ "libvirtd" "networkmanager" "wheel" ];
} // user.userSettings) (config.myNixOS.home-users);
};
}