Initial commit
This commit is contained in:
35
modules/desktop/qbittorrent.nix
Normal file
35
modules/desktop/qbittorrent.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ username, pkgs, ... }: {
|
||||
systemd.services.qbittorrent-nox = let
|
||||
port = 1999;
|
||||
in {
|
||||
enable = true;
|
||||
description = "QBitTorrent server";
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
serviceConfig = {
|
||||
Type = "exec";
|
||||
User = username;
|
||||
ExecStart = "${pkgs.qbittorrent-nox}/bin/qbittorrent-nox --profile=\"/home/${username}/Torrent\" --configuration=\"/home/${username}/Torrent/config\" --webui-port=${toString port}";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
# WebUI\LocalHostAuth=false
|
||||
|
||||
imp.home.dirs = [ "Torrent" ];
|
||||
|
||||
systemd.services.gdisk = {
|
||||
enable = true;
|
||||
description = "Automounting additional disk";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
ExecStart = pkgs.writeShellScript "mount-gdisk.sh" ''
|
||||
systemd-cryptsetup attach gd /dev/sda /nix/disks/gd/key header=/nix/disks/gd/header
|
||||
mkdir -p /mnt/gd
|
||||
mount /dev/mapper/gd /mnt/gd -o compress=zstd:2
|
||||
'';
|
||||
RemainAfterExit = true;
|
||||
ExecStop = "umount /dev/gd && systemd-cryptsetup detach gd";
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user