From 3fa100e7539e25e60d4094d43cb69ae663742556 Mon Sep 17 00:00:00 2001 From: Ethel Morgan Date: Fri, 29 May 2020 21:50:38 +0100 Subject: move users.nix around --- nixos/modules/module-list.nix | 2 +- nixos/modules/users.nix | 42 ------------------------------------------ nixos/modules/users/eth.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 43 deletions(-) delete mode 100644 nixos/modules/users.nix create mode 100644 nixos/modules/users/eth.nix (limited to 'nixos') diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 3985e25..e8f27d8 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -10,6 +10,6 @@ ./services/snapclient.nix ./services/ssh.nix ./services/upmpdcli.nix - ./users.nix + ./users/eth.nix ./yubikey.nix ] diff --git a/nixos/modules/users.nix b/nixos/modules/users.nix deleted file mode 100644 index ea08cf5..0000000 --- a/nixos/modules/users.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ config, lib, pkgs, ... }: -with lib; - -let - cfg = config.eth.users; - - defaultPackages = with pkgs; [ - direnv - dnsutils - killall - tmux - vim - wget - ]; - -in { - - options.eth.users = { - eth = { - enable = mkEnableOption "Create the user eth"; - - extraPackages = mkOption { - type = types.listOf types.package; - default = []; - }; - }; - }; - - config = { - - users.users.eth = mkIf cfg.eth.enable { - isNormalUser = true; - extraGroups = [ "wheel" ]; - shell = pkgs.fish; - packages = defaultPackages ++ cfg.eth.extraPackages; - openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqcW3HzqQxPUjZteAs5HmDbCEAtHcThnj7qfJacEXBmpO5srinU3mhV/EhrqcAMkEoEIS2az2uQQEsF13nEqDD1uZh/Q7qwEnZepzElgBOIToQ+Np2qziRExV3ROBddJfmD3XBTPc7wA5BohYku+eCsfR37ZrRTgKUIALhZ4MSRxgQqnhtgaxHpL2Nk6ZdxRHO1ISlcmiWhOETP0fj76zN4+CgSv4rkPdYxKYpWVT8XTdKgu6ENbAPbOBzplui9MmrdS17ZaWy0KrKCiyMjhA5qSsOxWLXKL9P8lRuuXkWAl5cpt3vWWKAOzlLV1UCUbtlBblyH2KkeIKfO8AC45wX keychain@eth.moe" - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGf+geluXR5/hxK2OthfS+bG+7QbUVqV25bslT4KgMid+zkOVeWfA49n8/iuXUjYZmB0hP9oiFkM1wjFfC5JtET1OX3V8r0nuexXfhvG4gtWIk6Yw5HfPLv1qYYti4SrPKgQlP+C2i6WjHO6Y4VWSpJkgXgO+XvEa57fGSsjcy3rV6l/B56tpIhNchvwVxm1gHJnb4eZAKtQYcz8Pven2TFNFGLMMzQ7Y7JWAH80TDrdUywxfktaKmswo4rQ6i3zUKXrzaPuaH+egoNLqfZqM3+Q92PWs8bU2Y7uxXUQJXD32KuStRUwEz32A+O55nVVGTrnwKUUqnx9H04KCYBOVP backup@eth.moe" - ]; - }; - }; -} diff --git a/nixos/modules/users/eth.nix b/nixos/modules/users/eth.nix new file mode 100644 index 0000000..c90652f --- /dev/null +++ b/nixos/modules/users/eth.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: +with lib; + +let + cfg = config.eth.users.eth; + + defaultPackages = with pkgs; [ + direnv + dnsutils + killall + tmux + vim + wget + ]; + +in { + + options.eth.users.eth = { + enable = mkEnableOption "Create the user eth"; + + extraPackages = mkOption { + type = types.listOf types.package; + default = []; + }; + }; + + config = { + + users.users.eth = mkIf cfg.enable { + isNormalUser = true; + extraGroups = [ "wheel" ]; + shell = pkgs.fish; + packages = defaultPackages ++ cfg.extraPackages; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqcW3HzqQxPUjZteAs5HmDbCEAtHcThnj7qfJacEXBmpO5srinU3mhV/EhrqcAMkEoEIS2az2uQQEsF13nEqDD1uZh/Q7qwEnZepzElgBOIToQ+Np2qziRExV3ROBddJfmD3XBTPc7wA5BohYku+eCsfR37ZrRTgKUIALhZ4MSRxgQqnhtgaxHpL2Nk6ZdxRHO1ISlcmiWhOETP0fj76zN4+CgSv4rkPdYxKYpWVT8XTdKgu6ENbAPbOBzplui9MmrdS17ZaWy0KrKCiyMjhA5qSsOxWLXKL9P8lRuuXkWAl5cpt3vWWKAOzlLV1UCUbtlBblyH2KkeIKfO8AC45wX keychain@eth.moe" + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGf+geluXR5/hxK2OthfS+bG+7QbUVqV25bslT4KgMid+zkOVeWfA49n8/iuXUjYZmB0hP9oiFkM1wjFfC5JtET1OX3V8r0nuexXfhvG4gtWIk6Yw5HfPLv1qYYti4SrPKgQlP+C2i6WjHO6Y4VWSpJkgXgO+XvEa57fGSsjcy3rV6l/B56tpIhNchvwVxm1gHJnb4eZAKtQYcz8Pven2TFNFGLMMzQ7Y7JWAH80TDrdUywxfktaKmswo4rQ6i3zUKXrzaPuaH+egoNLqfZqM3+Q92PWs8bU2Y7uxXUQJXD32KuStRUwEz32A+O55nVVGTrnwKUUqnx9H04KCYBOVP backup@eth.moe" + ]; + }; + }; +} -- cgit v1.2.3