logoalt Hacker News

Cyph0nyesterday at 1:04 PM2 repliesview on HN

+1, NixOS makes working with systemd a breeze. Defining units in Nix beats wrangling INI files.

  systemd.services.sync-recyclarr = {
    serviceConfig.Type = "oneshot";
    path = [ pkgs.podman ];
    script = ''
      podman exec -it recyclarr recyclarr sync radarr
      podman exec -it recyclarr recyclarr sync sonarr
    '';
  };
  systemd.timers.sync-recyclarr = {
    timerConfig = {
      OnCalendar = "daily";
      Persistent = true;
      Unit = "sync-recyclarr.service";
    };
    partOf = [ "sync-recyclarr.service" ];
    requires = [ "podman-recyclarr.service" ];
    wantedBy = [ "timers.target" ];
  };

Replies

zamalekyesterday at 10:25 PM

I don't currently have a personal use-case for container services, but Quadlets are another example of systemd (and podman) beauty. It looks like someone has gone through the trouble of making the OS+home-manager modules: https://github.com/SEIAROTg/quadlet-nix

show 1 reply
Eduardyesterday at 6:20 PM

is this irony?

show 1 reply