mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
nixos/dsearch: add module
This commit is contained in:
parent
6e3c1bf5d2
commit
c3eaa0e1ab
2 changed files with 54 additions and 0 deletions
|
|
@ -201,6 +201,7 @@
|
|||
./programs/direnv.nix
|
||||
./programs/dmrconfig.nix
|
||||
./programs/droidcam.nix
|
||||
./programs/dsearch.nix
|
||||
./programs/dublin-traceroute.nix
|
||||
./programs/ecryptfs.nix
|
||||
./programs/environment.nix
|
||||
|
|
|
|||
53
nixos/modules/programs/dsearch.nix
Normal file
53
nixos/modules/programs/dsearch.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkEnableOption
|
||||
mkOption
|
||||
mkIf
|
||||
mkPackageOption
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.programs.dsearch;
|
||||
in
|
||||
{
|
||||
options.programs.dsearch = {
|
||||
enable = mkEnableOption "dsearch, a fast filesystem search service with fuzzy matching";
|
||||
|
||||
package = mkPackageOption pkgs "dsearch" { };
|
||||
|
||||
systemd = {
|
||||
enable = mkEnableOption "systemd user service for dsearch" // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
target = mkOption {
|
||||
type = types.str;
|
||||
default = "default.target";
|
||||
description = ''
|
||||
The systemd target that will automatically start the dsearch service.
|
||||
|
||||
By default, dsearch starts with the user session (`default.target`).
|
||||
You can change this to `graphical-session.target` if you only want
|
||||
it to run in graphical sessions.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
systemd.packages = [ cfg.package ];
|
||||
|
||||
systemd.user.services.dsearch.wantedBy = mkIf cfg.systemd.enable [ cfg.systemd.target ];
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ luckshiba ];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue