From d79dee8f55daeacb5588860417446aa5500aecc6 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Sun, 11 Feb 2024 19:07:09 +0100 Subject: [PATCH] ddg: add module --- system/hosts/mediaserver.nix | 2 +- system/nixos/ddg.nix | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 system/nixos/ddg.nix diff --git a/system/hosts/mediaserver.nix b/system/hosts/mediaserver.nix index 0686ee1..2257029 100644 --- a/system/hosts/mediaserver.nix +++ b/system/hosts/mediaserver.nix @@ -23,7 +23,7 @@ in ../nixos/attic.nix - #../nixos/bdfr-browser.nix + ../nixos/ddg.nix ../nixos/tailscale.nix diff --git a/system/nixos/ddg.nix b/system/nixos/ddg.nix new file mode 100644 index 0000000..76bf868 --- /dev/null +++ b/system/nixos/ddg.nix @@ -0,0 +1,22 @@ +{ pkgs, lib, ... }: + +{ + systemd.services.ddg = + let + mounts = [ "mnt-media\\x2dscraper.mount" ]; + in + { + description = "discord-downloader-go service"; + requires = mounts; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + Type = "exec"; + WorkingDirectory = "/mnt/media-scraper/Discord"; + User = "media_user"; + Group = "media_group"; + ExecStart = "${lib.getExe pkgs.discord-downloader-go}"; + Restart = "on-failure"; + }; + }; +}