From a19ecfbd3e32d60791c5ca9faad02c481a71c448 Mon Sep 17 00:00:00 2001 From: osbm Date: Tue, 9 Sep 2025 11:00:23 +0300 Subject: [PATCH] set users --- modules/users.nix | 61 +++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/modules/users.nix b/modules/users.nix index 3056e19..4339e46 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -1,29 +1,38 @@ -{ ... }: +{ lib, config, ... }: { - users.users = { - osbm = { - isNormalUser = true; - description = "osbm"; - initialHashedPassword = "$6$IamAbigfailure$irfkAsWev8CMAr78wUwUggclplXL98sbI21fpGY9nMDz47bU88RZWFLO7FcN5SdRA18ZSidkMqS76uLCMH68f."; - extraGroups = [ - "networkmanager" - "wheel" - "docker" - ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPfnV+qqUCJf92npNW4Jy0hIiepCJFBDJHXBHnUlNX0k" - ]; - packages = [ - ]; + options = { + myModules.setUsers = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Enable user management."; + }; + }; + + config = lib.mkIf config.myModules.setUsers { + users.users = { + osbm = { + isNormalUser = true; + description = "osbm"; + initialHashedPassword = "$6$IamAbigfailure$irfkAsWev8CMAr78wUwUggclplXL98sbI21fpGY9nMDz47bU88RZWFLO7FcN5SdRA18ZSidkMqS76uLCMH68f."; + extraGroups = [ + "networkmanager" + "wheel" + "docker" + ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPfnV+qqUCJf92npNW4Jy0hIiepCJFBDJHXBHnUlNX0k" + ]; + packages = [ + ]; + }; + bayram = { + isNormalUser = true; + description = "bayram"; + initialHashedPassword = "$6$IamAbigfailure$3BP231DVwbqUtZ.mq33nM/JitBrT2u26Y25VpsfBwhZbezMHz4XbySrOMnaMcCYdsb3wZFL3Ppcp0L.R8nonT."; + extraGroups = [ "networkmanager" ]; + packages = [ + ]; + }; + root.initialHashedPassword = "$6$IamAbigfailure$irfkAsWev8CMAr78wUwUggclplXL98sbI21fpGY9nMDz47bU88RZWFLO7FcN5SdRA18ZSidkMqS76uLCMH68f."; }; - bayram = { - isNormalUser = true; - description = "bayram"; - initialHashedPassword = "$6$IamAbigfailure$3BP231DVwbqUtZ.mq33nM/JitBrT2u26Y25VpsfBwhZbezMHz4XbySrOMnaMcCYdsb3wZFL3Ppcp0L.R8nonT."; - extraGroups = [ "networkmanager" ]; - packages = [ - ]; - }; - root.initialHashedPassword = "$6$IamAbigfailure$irfkAsWev8CMAr78wUwUggclplXL98sbI21fpGY9nMDz47bU88RZWFLO7FcN5SdRA18ZSidkMqS76uLCMH68f."; }; -}