From 6ea803da80558e269564c99070e92e285cf977ff Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sat, 11 Feb 2023 17:18:54 +0100 Subject: add personal nixos modules --- modules/nixos/user.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 modules/nixos/user.nix (limited to 'modules/nixos/user.nix') diff --git a/modules/nixos/user.nix b/modules/nixos/user.nix new file mode 100644 index 0000000..0d1585e --- /dev/null +++ b/modules/nixos/user.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: + +let cfg = config.personal.user; +in { + options.personal.user = { + enable = lib.mkEnableOption "main user"; + name = lib.mkOption { + type = lib.types.str; + default = "qaristote"; + }; + }; + + config.users.users."${cfg.name}" = lib.mkIf cfg.enable { + isNormalUser = true; + extraGroups = [ "wheel" ] ++ lib.optional config.sound.enable "sound" + ++ lib.optional config.networking.networkmanager.enable "networkmanager"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK4wGbl3++lqCjLUhoRyABBrVEeNhIXYO4371srkRoyq qaristote@latitude-7490" + ]; + + }; +} -- cgit v1.2.3