From aac4567c02975aabf26f7ecb5c241a58e3c9c36d Mon Sep 17 00:00:00 2001 From: oqyude Date: Mon, 4 Aug 2025 17:50:57 +0300 Subject: [PATCH] 123 --- modules/default.nix | 44 ++++++++++++++++++++++---------------------- modules/options.nix | 34 ++++++++++++++++++---------------- modules/users.nix | 27 +++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 38 deletions(-) create mode 100644 modules/users.nix diff --git a/modules/default.nix b/modules/default.nix index 8281df8..cb350d0 100755 --- a/modules/default.nix +++ b/modules/default.nix @@ -7,33 +7,33 @@ { imports = with inputs; [ ./essentials + ./users.nix (import ./options.nix { inherit lib inputs; }) # Options - # Flake modules home-manager.nixosModules.home-manager # home-manager module nix-index-database.nixosModules.nix-index # nix-index module ]; # defines global user - config.users = { - users = { - "${config.device.username}" = { - isNormalUser = true; - description = "Jor Oqyude"; - initialPassword = "1234"; - extraGroups = [ - "beets" - "audio" - "disk" - "gamemode" - "libvirtd" - "networkmanager" - "pipewire" - "qemu-libvirtd" - "wheel" - "immich" - ]; - }; - }; - }; + # config.users = { + # users = { + # "${config.xlib.device.username}" = { + # isNormalUser = true; + # description = "Jor Oqyude"; + # initialPassword = "1234"; + # extraGroups = [ + # "beets" + # "audio" + # "disk" + # "gamemode" + # "libvirtd" + # "networkmanager" + # "pipewire" + # "qemu-libvirtd" + # "wheel" + # "immich" + # ]; + # }; + # }; + # }; } diff --git a/modules/options.nix b/modules/options.nix index 102acfd..bc86fbe 100644 --- a/modules/options.nix +++ b/modules/options.nix @@ -5,22 +5,24 @@ }: { options = { - device = { - type = lib.mkOption { - type = lib.types.enum [ - "minimal" - "primary" - "server" - "vds" - "wsl" - ]; - default = "minimal"; - description = "Type of device for this host."; - }; - username = lib.mkOption { - type = lib.types.str; - default = "${inputs.zeroq.devices.admin}"; - description = "Username for host."; + xlib = { + device = { + type = lib.mkOption { + type = lib.types.enum [ + "minimal" + "primary" + "server" + "vds" + "wsl" + ]; + default = "minimal"; + description = "Type of device for this host."; + }; + username = lib.mkOption { + type = lib.types.str; + default = "${inputs.zeroq.devices.admin}"; + description = "Username for host."; + }; }; }; }; diff --git a/modules/users.nix b/modules/users.nix new file mode 100644 index 0000000..81dd364 --- /dev/null +++ b/modules/users.nix @@ -0,0 +1,27 @@ +{ + config, + ... +}: +{ + config.users = { + users = { + "${config.xlib.device.username}" = { + isNormalUser = true; + description = "Jor Oqyude"; + initialPassword = "1234"; + extraGroups = [ + "beets" + "audio" + "disk" + "gamemode" + "libvirtd" + "networkmanager" + "pipewire" + "qemu-libvirtd" + "wheel" + "immich" + ]; + }; + }; + }; +}