{ 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" ]; }]; }; }