restructured modules, toggling them, overlays
This commit is contained in:
55
modules/bundles/users.nix
Normal file
55
modules/bundles/users.nix
Normal 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);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user