diff --git a/hosts/challenger/amalieem.nix b/hosts/challenger/amalieem.nix new file mode 100644 index 0000000..7f68df7 --- /dev/null +++ b/hosts/challenger/amalieem.nix @@ -0,0 +1,37 @@ +{ config, pkgs, lib, ... }: +let + cmdChownManga = pkgs.writeScriptBin "chownManga" '' + #!${pkgs.stdenv.shell} + + chown -R amalieem:komga /tank/media/komga/Amalie + chmod -R 750 /tank/media/komga/Amalie + ''; +in { + users.users."amalieem" = { + isNormalUser = true; + home = "/home/amalieem"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID7e+BAoXIFmTeeBYAVImQAcyx6SCoYCErA7h16OGL70 amalieem@wentworth" + ]; + packages = with pkgs; [ + cmdChownManga + + mangal + rsync + ]; + }; + + security.sudo = { + enable = true; + extraRules = [{ + commands = [ + { + command = "${lib.getExe cmdChownManga}"; + options = [ "NOPASSWD" ]; + } + ]; + users = [ "amalieem" ]; + }]; + }; +} + diff --git a/hosts/challenger/configuration.nix b/hosts/challenger/configuration.nix index ee28711..c7d6ef5 100644 --- a/hosts/challenger/configuration.nix +++ b/hosts/challenger/configuration.nix @@ -7,6 +7,7 @@ ../../base.nix ../../common/metrics-exporters.nix + ./amalieem.nix ./backup.nix # ./exports.nix ./filesystems.nix