Commit 0e23c1af authored by Saad Nadeem's avatar Saad Nadeem
Browse files

nixos/elephant: init service

parent a23eb256
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@

- [dsearch](https://github.com/AvengeMedia/danksearch), a fast filesystem search service with fuzzy matching. Available as [programs.dsearch](#opt-programs.dsearch.enable).

- [Elephant](https://github.com/abenz1267/elephant), a data provider service and backend for building custom application launchers. Available as [services.elephant](#opt-services.elephant.enable).

- [Dunst](https://github.com/dunst-project/dunst), a lightweight and customizable notification daemon. Available as [services.dunst](#opt-services.dunst.enable).

- [Ente Auth](https://ente.io/auth/), an open source 2FA authenticator, with end-to-end encrypted backups. Available as [programs.ente-auth](#opt-programs.ente-auth.enable).
+1 −0
Original line number Diff line number Diff line
@@ -843,6 +843,7 @@
  ./services/misc/dump1090-fa.nix
  ./services/misc/dwm-status.nix
  ./services/misc/dysnomia.nix
  ./services/misc/elephant.nix
  ./services/misc/errbot.nix
  ./services/misc/ersatztv.nix
  ./services/misc/etebase-server.nix
+37 −0
Original line number Diff line number Diff line
{
  config,
  lib,
  pkgs,
  ...
}:

let
  cfg = config.services.elephant;
in
{
  options.services.elephant = {
    enable = lib.mkEnableOption "Elephant application launcher backend";

    package = lib.mkPackageOption pkgs "elephant" { };
  };

  config = lib.mkIf cfg.enable {
    systemd.user.services.elephant = {
      description = "Elephant application launcher backend";
      wantedBy = [ "graphical-session.target" ];
      partOf = [ "graphical-session.target" ];
      after = [ "graphical-session.target" ];
      serviceConfig = {
        Restart = "always";
        RestartSec = 10;
        ExecStart = "${cfg.package}/bin/elephant";
      };
    };

    environment.systemPackages = [ cfg.package ];
  };

  meta.maintainers = with lib.maintainers; [
    saadndm
  ];
}