mirror of
https://codeberg.org/jopejoe1/nix-conf.git
synced 2025-06-07 21:39:23 +02:00
flake rewiritte
This commit is contained in:
parent
f206e94425
commit
a0d6ca6267
33 changed files with 1257 additions and 1070 deletions
35
modules/moodle-dl/default.nix
Normal file
35
modules/moodle-dl/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.jopejoe1.moodle-dl;
|
||||
in
|
||||
{
|
||||
options.jopejoe1.moodle-dl = {
|
||||
enable = lib.mkEnableOption "Enable moodle-dl";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.timers."moodle-dl" = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "5m";
|
||||
OnUnitActiveSec = "1h";
|
||||
Unit = "moodle-dl.service";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."moodle-dl" = {
|
||||
script = ''
|
||||
${lib.getExe pkgs.moodle-dl} --path /var/moodle-dl
|
||||
${lib.getExe pkgs.git} -C /var/moodle-dl add .
|
||||
${lib.getExe pkgs.git} -C /var/moodle-dl commit -m "moodle-dl updated on `$(${pkgs.coreutils}/bin/date)`"
|
||||
'';
|
||||
path = [ pkgs.openssh ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue