From f8cea6f6c8a8ce35533d7fa978dbff8cd5427b7c Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Mon, 8 Jan 2024 23:09:42 +0530 Subject: modules/userdata: refactor --- modules/userdata.nix | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) (limited to 'modules/userdata.nix') diff --git a/modules/userdata.nix b/modules/userdata.nix index 136d807..46c7377 100644 --- a/modules/userdata.nix +++ b/modules/userdata.nix @@ -1,26 +1,8 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: let inherit (lib) mkOption types mdDoc; cfg = config.userdata; - - defaultPackages = with pkgs; [ - bc - unzip - htop - curl - file - dig - mtr - nnn - ps_mem - brightnessctl - ]; - defaultPubKeys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDCeMXhkjm9CabbA/1xdtP9bvFEm8pVXPk66NmI9/VvQ sinan@vex" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL8LnyOuPmtKRqAZeHueNN4kfYvpRQVwCivSTq+SZvDU sinan@cez" - ]; - defaultGroups = [ "wheel" ]; in { options.userdata = { @@ -29,11 +11,6 @@ in default = "sinan"; description = mdDoc "Owner's username"; }; - groups = mkOption { - type = types.listOf types.str; - default = []; - description = mdDoc "Groups the owner should be in"; - }; domain = mkOption { type = types.str; default = "sinanmohd.com"; @@ -44,25 +21,11 @@ in default = "sinan@firemail.cc"; description = mdDoc "Owner's email"; }; - packages = mkOption { - type = types.listOf types.package; - default = []; - description = mdDoc "Packages in owner's environment"; - }; - pubKeys = mkOption { - type = types.listOf types.str; - description = mdDoc "Owner's public ssh keys"; - default = []; - }; }; config.users.users.${cfg.user} = { uid = 1000; isNormalUser = true; description = cfg.email; - - extraGroups = defaultGroups ++ cfg.groups; - packages = defaultPackages ++ cfg.packages; - openssh.authorizedKeys.keys = defaultPubKeys ++ cfg.pubKeys; }; } -- cgit v1.2.3