1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

treewide: add missing package options (#7575)

Add options to support more flexible module configurations.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-07-29 12:20:22 -05:00 committed by GitHub
parent 25deca8939
commit 03fdb31290
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 147 additions and 70 deletions

View file

@ -20,6 +20,8 @@ in
programs.browserpass = {
enable = lib.mkEnableOption "the browserpass extension host application";
package = lib.mkPackageOption pkgs "browserpass" { };
browsers = lib.mkOption {
type = lib.types.listOf (lib.types.enum browsers);
default = browsers;
@ -47,7 +49,7 @@ in
# Policies are read from `/etc/brave/policies` only
# https://github.com/brave/brave-browser/issues/19052
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
}
]
else if x == "chrome" then
@ -61,9 +63,9 @@ in
[
{
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${dir}/../policies/managed/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
}
]
else if x == "chromium" then
@ -77,11 +79,11 @@ in
[
{
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
}
{
"${dir}/../policies/managed/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
}
]
else if x == "firefox" then
@ -95,7 +97,7 @@ in
[
{
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/firefox/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/firefox/com.github.browserpass.native.json";
}
]
else if x == "librewolf" then
@ -109,7 +111,7 @@ in
[
{
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/firefox/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/firefox/com.github.browserpass.native.json";
}
]
@ -124,9 +126,9 @@ in
[
{
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${dir}/../policies/managed/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
}
]
else

View file

@ -26,12 +26,6 @@
let
cfg = config.programs.info;
# Installs this package -- the interactive just means that it
# includes the curses `info` program. We also use `install-info`
# from this package in the activation script.
infoPkg = pkgs.texinfoInteractive;
in
{
imports = [
@ -41,11 +35,18 @@ in
'')
];
options.programs.info.enable = lib.mkEnableOption "GNU Info";
options.programs.info = {
enable = lib.mkEnableOption "GNU Info";
# Installs this package -- the interactive just means that it
# includes the curses `info` program. We also use `install-info`
# from this package in the activation script.
package = lib.mkPackageOption pkgs "texinfo" { default = "texinfoInteractive"; };
};
config = lib.mkIf cfg.enable {
home.packages = [
infoPkg
cfg.package
# Make sure the target directory is a real directory.
(pkgs.runCommandLocal "dummy-info-dir1" { } "mkdir -p $out/share/info")
@ -63,7 +64,7 @@ in
PATH="${
lib.makeBinPath [
pkgs.gzip
infoPkg
cfg.package
]
}''${PATH:+:}$PATH" \
find -L "${infoPath}" \( -name '*.info' -o -name '*.info.gz' \) \

View file

@ -186,6 +186,8 @@ in
programs.irssi = {
enable = lib.mkEnableOption "the Irssi chat client";
package = lib.mkPackageOption pkgs "irssi" { nullable = true; };
extraConfig = mkOption {
default = "";
description = "These lines are appended to the Irssi configuration.";
@ -226,7 +228,7 @@ in
};
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.irssi ];
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.file.".irssi/config".text = ''
settings = {

View file

@ -60,6 +60,8 @@ in
programs.powerline-go = {
enable = lib.mkEnableOption "Powerline-go, a beautiful and useful low-latency prompt for your shell";
package = lib.mkPackageOption pkgs "powerline-go" { };
modules = mkOption {
default = null;
type = types.nullOr (types.listOf types.str);
@ -157,7 +159,7 @@ in
local old_exit_status=$?
${
if evalMode then "eval " else "PS1="
}"$(${pkgs.powerline-go}/bin/powerline-go -error $old_exit_status -shell bash${commandLineArguments})"
}"$(${lib.getExe cfg.package} -error $old_exit_status -shell bash${commandLineArguments})"
${cfg.extraUpdatePS1}
return $old_exit_status
}
@ -171,7 +173,7 @@ in
function powerline_precmd() {
${
if evalMode then "eval " else "PS1="
}"$(${pkgs.powerline-go}/bin/powerline-go -error $? -shell zsh${commandLineArguments})"
}"$(${lib.getExe cfg.package} -error $? -shell zsh${commandLineArguments})"
${cfg.extraUpdatePS1}
}
@ -192,7 +194,7 @@ in
# https://github.com/justjanne/powerline-go#fish
programs.fish.interactiveShellInit = mkIf (cfg.enable && config.programs.fish.enable) ''
function fish_prompt
eval ${pkgs.powerline-go}/bin/powerline-go -error $status -jobs (count (jobs -p))${commandLineArguments}
eval ${lib.getExe cfg.package} -error $status -jobs (count (jobs -p))${commandLineArguments}
${cfg.extraUpdatePS1}
end
'';

View file

@ -28,6 +28,8 @@ in
options.programs.zsh.zplug = {
enable = lib.mkEnableOption "zplug - a zsh plugin manager";
package = lib.mkPackageOption pkgs "zplug" { };
plugins = mkOption {
default = [ ];
type = types.listOf pluginModule;
@ -44,12 +46,12 @@ in
};
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.zplug ];
home.packages = [ cfg.package ];
programs.zsh.initContent = lib.mkOrder 550 ''
export ZPLUG_HOME=${cfg.zplugHome}
source ${pkgs.zplug}/share/zplug/init.zsh
source ${cfg.package}/share/zplug/init.zsh
${optionalString (cfg.plugins != [ ]) ''
${lib.concatStrings (

View file

@ -6,6 +6,7 @@
}:
let
inherit (lib)
getExe'
mkEnableOption
mkOption
optional
@ -26,6 +27,8 @@ in
options.services.barrier = {
package = lib.mkPackageOption pkgs "barrier" { };
client = {
enable = mkEnableOption "Barrier Client daemon";
@ -81,7 +84,7 @@ in
Service.ExecStart =
with cfg.client;
toString (
[ "${pkgs.barrier}/bin/barrierc" ]
[ "${getExe' cfg.package "barrierc"}" ]
++ optional (name != null) "--name ${name}"
++ optional (!enableCrypto) "--disable-crypto"
++ optional enableDragDrop "--enable-drag-drop"

View file

@ -4,6 +4,9 @@
pkgs,
...
}:
let
cfg = config.services.blueman-applet;
in
{
options = {
services.blueman-applet = {
@ -19,6 +22,8 @@
```
'';
};
package = lib.mkPackageOption pkgs "blueman" { };
};
};
@ -43,7 +48,7 @@
};
Service = {
ExecStart = "${pkgs.blueman}/bin/blueman-applet";
ExecStart = "${lib.getExe' cfg.package "blueman-applet"}";
};
};
};

View file

@ -13,6 +13,8 @@ in
options = {
services.caffeine = {
enable = lib.mkEnableOption "Caffeine service";
package = lib.mkPackageOption pkgs "caffeine-ng" { };
};
};
@ -36,7 +38,7 @@ in
ProtectSystem = "full";
Type = "exec";
Slice = "session.slice";
ExecStart = "${pkgs.caffeine-ng}/bin/caffeine";
ExecStart = "${lib.getExe' cfg.package "caffeine"}";
};
};
};

View file

@ -16,6 +16,8 @@ in
Devilspie2, a window matching utility, allowing the user to
perform scripted actions on windows as they are created'';
package = lib.mkPackageOption pkgs "devilspie2" { };
config = lib.mkOption {
type = lib.types.lines;
default = "";
@ -37,7 +39,7 @@ in
];
systemd.user.services.devilspie2 = {
Service.ExecStart = "${pkgs.devilspie2}/bin/devilspie2";
Service.ExecStart = "${lib.getExe cfg.package}";
Unit = {
Description = "devilspie2";
After = [ "graphical-session.target" ];

View file

@ -8,7 +8,7 @@ let
cfg = config.services.dropbox;
baseDir = ".dropbox-hm";
dropboxCmd = "${pkgs.dropbox-cli}/bin/dropbox";
dropboxCmd = "${lib.getExe' cfg.package "dropbox"}";
homeBaseDir = "${config.home.homeDirectory}/${baseDir}";
in
@ -19,6 +19,8 @@ in
services.dropbox = {
enable = lib.mkEnableOption "Dropbox daemon";
package = lib.mkPackageOption pkgs "dropbox-cli" { };
path = lib.mkOption {
type = lib.types.path;
default = "${config.home.homeDirectory}/Dropbox";
@ -34,7 +36,7 @@ in
(lib.hm.assertions.assertPlatform "services.dropbox" pkgs lib.platforms.linux)
];
home.packages = [ pkgs.dropbox-cli ];
home.packages = [ cfg.package ];
systemd.user.services.dropbox = {
Unit = {

View file

@ -17,6 +17,8 @@ in
services.fluidsynth = {
enable = lib.mkEnableOption "fluidsynth midi synthesizer";
package = lib.mkPackageOption pkgs "fluidsynth" { };
soundFont = mkOption {
type = types.path;
default = "${pkgs.soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2";
@ -71,7 +73,7 @@ in
};
Service = {
ExecStart = "${pkgs.fluidsynth}/bin/fluidsynth -a pulseaudio -si ${lib.concatStringsSep " " cfg.extraOptions} ${cfg.soundFont}";
ExecStart = "${lib.getExe cfg.package} -a pulseaudio -si ${lib.concatStringsSep " " cfg.extraOptions} ${cfg.soundFont}";
};
};
};

View file

@ -19,6 +19,8 @@ in
services.getmail = {
enable = lib.mkEnableOption "the getmail systemd service to automatically retrieve mail";
package = lib.mkPackageOption pkgs "getmail" { default = "getmail6"; };
frequency = lib.mkOption {
type = lib.types.str;
default = "*:0/5";
@ -45,7 +47,7 @@ in
Description = "getmail email fetcher";
};
Service = {
ExecStart = "${pkgs.getmail6}/bin/getmail ${configFiles}";
ExecStart = "${lib.getExe cfg.package} ${configFiles}";
};
};

View file

@ -16,6 +16,8 @@ in
services.gnome-keyring = {
enable = lib.mkEnableOption "GNOME Keyring";
package = lib.mkPackageOption pkgs "gnome-keyring" { };
components = lib.mkOption {
type = lib.types.listOf (
lib.types.enum [
@ -63,7 +65,7 @@ in
++ lib.optional (cfg.components != [ ]) ("--components=" + lib.concatStringsSep "," cfg.components)
);
in
"${pkgs.gnome-keyring}/bin/gnome-keyring-daemon ${args}";
"${lib.getExe' cfg.package "gnome-keyring-daemon"} ${args}";
Restart = "on-abort";
};

View file

@ -19,6 +19,8 @@ in
services.grobi = {
enable = lib.mkEnableOption "the grobi display setup daemon";
package = lib.mkPackageOption pkgs "grobi" { };
executeAfter = mkOption {
type = with types; listOf str;
default = [ ];
@ -87,7 +89,7 @@ in
Service = {
Type = "simple";
ExecStart = "${pkgs.grobi}/bin/grobi watch -v";
ExecStart = "${lib.getExe cfg.package} watch -v";
Restart = "always";
RestartSec = "2s";
Environment = [ "PATH=${pkgs.xorg.xrandr}/bin:${pkgs.bash}/bin" ];

View file

@ -30,6 +30,8 @@ in
options.services.hound = {
enable = lib.mkEnableOption "hound";
package = lib.mkPackageOption pkgs "hound" { };
maxConcurrentIndexers = mkOption {
type = types.ints.positive;
default = 2;
@ -70,7 +72,7 @@ in
(lib.hm.assertions.assertPlatform "services.hound" pkgs lib.platforms.linux)
];
home.packages = [ pkgs.hound ];
home.packages = [ cfg.package ];
systemd.user.services.hound = {
Unit = {
@ -90,7 +92,7 @@ in
]
}"
];
ExecStart = "${pkgs.hound}/bin/houndd ${lib.concatStringsSep " " houndOptions}";
ExecStart = "${lib.getExe' cfg.package "houndd"} ${lib.concatStringsSep " " houndOptions}";
};
};
};

View file

@ -14,6 +14,8 @@ in
services.kbfs = {
enable = lib.mkEnableOption "Keybase File System";
package = lib.mkPackageOption pkgs "kbfs" { };
mountPoint = lib.mkOption {
type = lib.types.str;
default = "keybase";
@ -59,7 +61,7 @@ in
"KEYBASE_SYSTEMD=1"
];
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${mountPoint}";
ExecStart = "${pkgs.kbfs}/bin/kbfsfuse ${toString cfg.extraFlags} ${mountPoint}";
ExecStart = "${lib.getExe' cfg.package "kbfsfuse"} ${toString cfg.extraFlags} ${mountPoint}";
ExecStopPost = "/run/wrappers/bin/fusermount -u ${mountPoint}";
Restart = "on-failure";
};
@ -67,7 +69,7 @@ in
Install.WantedBy = [ "default.target" ];
};
home.packages = [ pkgs.kbfs ];
home.packages = [ cfg.package ];
services.keybase.enable = true;
};
}

View file

@ -10,20 +10,24 @@ let
in
{
options.services.keybase.enable = lib.mkEnableOption "Keybase";
options.services.keybase = {
enable = lib.mkEnableOption "Keybase";
package = lib.mkPackageOption pkgs "keybase" { };
};
config = lib.mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.keybase" pkgs lib.platforms.linux)
];
home.packages = [ pkgs.keybase ];
home.packages = [ cfg.package ];
systemd.user.services.keybase = {
Unit.Description = "Keybase service";
Service = {
ExecStart = "${pkgs.keybase}/bin/keybase service --auto-forked";
ExecStart = "${lib.getExe cfg.package} service --auto-forked";
Restart = "on-failure";
PrivateTmp = true;
};

View file

@ -12,6 +12,8 @@ in
{
options.services.keynav = {
enable = lib.mkEnableOption "keynav";
package = lib.mkPackageOption pkgs "keynav" { };
};
config = lib.mkIf cfg.enable {
@ -27,7 +29,7 @@ in
};
Service = {
ExecStart = "${pkgs.keynav}/bin/keynav";
ExecStart = lib.getExe cfg.package;
RestartSec = 3;
Restart = "always";
};

View file

@ -12,7 +12,11 @@ in
{
meta.maintainers = [ lib.maintainers.thibautmarty ];
options.services.mpris-proxy.enable = lib.mkEnableOption "a proxy forwarding Bluetooth MIDI controls via MPRIS2 to control media players";
options.services.mpris-proxy = {
enable = lib.mkEnableOption "a proxy forwarding Bluetooth MIDI controls via MPRIS2 to control media players";
package = lib.mkPackageOption pkgs "bluez" { };
};
config = lib.mkIf cfg.enable {
assertions = [
@ -30,7 +34,7 @@ in
Service = {
Type = "simple";
ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
ExecStart = lib.getExe' cfg.package "mpris-proxy";
};
};
};

View file

@ -139,6 +139,8 @@ in
meta.maintainers = with lib.maintainers; [ euxane ];
options.services.muchsync = {
package = lib.mkPackageOption pkgs "muchsync" { };
remotes = mkOption {
type = with types; attrsOf (submodule syncOptions);
default = { };
@ -190,7 +192,7 @@ in
''"NMBGIT=${config.home.sessionVariables.NMBGIT}"''
];
ExecStart = lib.concatStringsSep " " (
[ "${pkgs.muchsync}/bin/muchsync" ]
[ (lib.getExe cfg.package) ]
++ [ "-s ${escapeShellArg remoteCfg.sshCommand}" ]
++ optional (!remoteCfg.upload) "--noup"

View file

@ -18,6 +18,8 @@ in
options = {
services.network-manager-applet = {
enable = lib.mkEnableOption "the Network Manager applet (nm-applet)";
package = lib.mkPackageOption pkgs "networkmanagerapplet" { };
};
};
@ -27,7 +29,7 @@ in
];
# The package provides some icons that are good to have available.
xdg.systemDirs.data = [ "${pkgs.networkmanagerapplet}/share" ];
xdg.systemDirs.data = [ "${cfg.package}/share" ];
systemd.user.services.network-manager-applet = {
Unit = {
@ -46,7 +48,7 @@ in
Service = {
ExecStart = toString (
[ "${pkgs.networkmanagerapplet}/bin/nm-applet" ]
[ (lib.getExe' cfg.package "nm-applet") ]
++ lib.optional config.xsession.preferStatusNotifierItems "--indicator"
);
};

View file

@ -15,6 +15,8 @@ in
services.pasystray = {
enable = lib.mkEnableOption "PulseAudio system tray";
package = lib.mkPackageOption pkgs "pasystray" { };
extraOptions = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
@ -54,7 +56,7 @@ in
];
in
[ "PATH=${toolPaths}" ];
ExecStart = lib.escapeShellArgs ([ "${pkgs.pasystray}/bin/pasystray" ] ++ cfg.extraOptions);
ExecStart = lib.escapeShellArgs ([ (lib.getExe cfg.package) ] ++ cfg.extraOptions);
};
};
};

View file

@ -13,6 +13,8 @@ in
meta.maintainers = [ lib.maintainers.ehmry ];
options.services.plan9port = {
package = lib.mkPackageOption pkgs "plan9port" { };
fontsrv.enable = lib.mkEnableOption "the Plan 9 file system access to host fonts";
plumber.enable = lib.mkEnableOption "the Plan 9 file system for interprocess messaging";
};
@ -25,13 +27,13 @@ in
systemd.user.services.fontsrv = lib.mkIf cfg.fontsrv.enable {
Unit.Description = "the Plan 9 file system access to host fonts";
Install.WantedBy = [ "default.target" ];
Service.ExecStart = "${pkgs.plan9port}/bin/9 fontsrv";
Service.ExecStart = "${lib.getExe' cfg.package "9"} fontsrv";
};
systemd.user.services.plumber = lib.mkIf cfg.plumber.enable {
Unit.Description = "file system for interprocess messaging";
Install.WantedBy = [ "default.target" ];
Service.ExecStart = "${pkgs.plan9port}/bin/9 plumber -f";
Service.ExecStart = "${lib.getExe' cfg.package "9"} plumber -f";
};
};

View file

@ -31,6 +31,8 @@ in
options.services.poweralertd = {
enable = lib.mkEnableOption "the Upower-powered power alertd";
package = lib.mkPackageOption pkgs "poweralertd" { };
extraArgs = lib.mkOption {
type = with types; listOf str;
default = [ ];
@ -61,7 +63,7 @@ in
Service = {
Type = "simple";
ExecStart = "${pkgs.poweralertd}/bin/poweralertd ${escapeSystemdExecArgs cfg.extraArgs}";
ExecStart = "${lib.getExe cfg.package} ${escapeSystemdExecArgs cfg.extraArgs}";
Restart = "always";
};
};

View file

@ -24,6 +24,8 @@ in
options.services.psd = {
enable = lib.mkEnableOption "Profile-sync-daemon service";
package = lib.mkPackageOption pkgs "profile-sync-daemon" { };
resyncTimer = lib.mkOption {
type = lib.types.str;
default = "1h";
@ -75,12 +77,12 @@ in
(lib.hm.assertions.assertPlatform "services.psd" pkgs lib.platforms.linux)
];
home.packages = [ pkgs.profile-sync-daemon ];
home.packages = [ cfg.package ];
systemd.user = {
services =
let
exe = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon";
exe = lib.getExe' cfg.package "profile-sync-daemon";
envPath = lib.makeBinPath (
with pkgs;
[
@ -93,7 +95,7 @@ in
findutils
nettools
util-linux
profile-sync-daemon
cfg.package
]
);
in

View file

@ -37,6 +37,8 @@ in
'';
};
package = lib.mkPackageOption pkgs "feh" { };
imageDirectory = mkOption {
type = types.str;
example = "%h/backgrounds";
@ -98,7 +100,7 @@ in
Service = {
Type = "oneshot";
ExecStart = "${pkgs.feh}/bin/feh ${flags} ${cfg.imageDirectory}";
ExecStart = "${lib.getExe cfg.package} ${flags} ${cfg.imageDirectory}";
IOSchedulingClass = "idle";
};

View file

@ -12,9 +12,9 @@ let
in
{
options.services.rsibreak = {
enable = lib.mkEnableOption "rsibreak";
package = lib.mkPackageOption pkgs "rsibreak" { };
};
config = lib.mkIf cfg.enable {
@ -22,7 +22,7 @@ in
(lib.hm.assertions.assertPlatform "services.rsibreak" pkgs lib.platforms.linux)
];
home.packages = [ pkgs.rsibreak ];
home.packages = [ cfg.package ];
systemd.user.services.rsibreak = {
Unit = {
Description = "RSI break timer";
@ -36,7 +36,7 @@ in
Service = {
Environment = [ "PATH=${config.home.profileDirectory}/bin" ];
ExecStart = "${pkgs.rsibreak}/bin/rsibreak";
ExecStart = lib.getExe cfg.package;
};
};
};

View file

@ -12,6 +12,8 @@
services.sctd = {
enable = lib.mkEnableOption "sctd";
package = lib.mkPackageOption pkgs "sct" { };
baseTemperature = lib.mkOption {
type = lib.types.ints.between 2500 9000;
default = 4500;
@ -38,8 +40,8 @@
Install.WantedBy = [ "graphical-session.target" ];
Service = {
ExecStart = "${pkgs.sct}/bin/sctd ${toString config.services.sctd.baseTemperature}";
ExecStopPost = "${pkgs.sct}/bin/sct";
ExecStart = "${config.services.sctd.package}/bin/sctd ${toString config.services.sctd.baseTemperature}";
ExecStopPost = "${config.services.sctd.package}/bin/sct";
Restart = "on-abnormal";
SuccessExitStatus = 1;
@ -61,7 +63,7 @@
pkgs.coreutils
pkgs.gnused
pkgs.which
pkgs.sct
config.services.sctd.package
logger
]
}"

View file

@ -16,6 +16,8 @@ in
options = {
services.ssh-agent = {
enable = lib.mkEnableOption "OpenSSH private key agent";
package = lib.mkPackageOption pkgs "openssh" { };
};
};
@ -39,7 +41,7 @@ in
};
Service = {
ExecStart = "${pkgs.openssh}/bin/ssh-agent -D -a %t/ssh-agent";
ExecStart = "${lib.getExe' cfg.package "ssh-agent"} -D -a %t/ssh-agent";
};
};
};

View file

@ -4,13 +4,17 @@
pkgs,
...
}:
let
cfg = config.services.systembus-notify;
in
{
meta.maintainers = [ lib.maintainers.asymmetric ];
options = {
services.systembus-notify = {
enable = lib.mkEnableOption "systembus-notify - system bus notification daemon";
package = lib.mkPackageOption pkgs "systembus-notify" { };
};
};
@ -22,7 +26,7 @@
systemd.user.services.systembus-notify = {
Unit.Description = "systembus-notify daemon";
Install.WantedBy = [ "graphical-session.target" ];
Service.ExecStart = "${pkgs.systembus-notify}/bin/systembus-notify";
Service.ExecStart = lib.getExe cfg.package;
};
};
}

View file

@ -4,13 +4,17 @@
pkgs,
...
}:
let
cfg = config.services.tahoe-lafs;
in
{
meta.maintainers = [ lib.maintainers.rycee ];
options = {
services.tahoe-lafs = {
enable = lib.mkEnableOption "Tahoe-LAFS";
package = lib.mkPackageOption pkgs "tahoelafs" { };
};
};
@ -25,7 +29,7 @@
};
Service = {
ExecStart = "${pkgs.tahoelafs}/bin/tahoe run -C %h/.tahoe";
ExecStart = "${lib.getExe' cfg.package "tahoe"} run -C %h/.tahoe";
};
};
};

View file

@ -44,6 +44,8 @@ in
'';
};
package = lib.mkPackageOption pkgs "udiskie" { };
settings = mkOption {
type = yaml.type;
default = { };
@ -133,7 +135,7 @@ in
};
Service.ExecStart = toString (
[ "${pkgs.udiskie}/bin/udiskie" ]
[ (lib.getExe cfg.package) ]
++ lib.optional config.xsession.preferStatusNotifierItems "--appindicator"
);

View file

@ -20,6 +20,8 @@ in
services.xcape = {
enable = lib.mkEnableOption "xcape";
package = lib.mkPackageOption pkgs "xcape" { };
timeout = lib.mkOption {
type = types.nullOr types.int;
default = null;
@ -80,7 +82,7 @@ in
Service = {
Type = "forking";
ExecStart =
"${pkgs.xcape}/bin/xcape"
"${lib.getExe cfg.package}"
+ lib.optionalString (cfg.timeout != null) " -t ${toString cfg.timeout}"
+
lib.optionalString (cfg.mapExpression != { })

View file

@ -119,6 +119,8 @@ in
services.xsuspender = {
enable = lib.mkEnableOption "XSuspender";
package = lib.mkPackageOption pkgs "xsuspender" { };
defaults = mkOption {
description = "XSuspender defaults.";
type = xsuspenderOptions;
@ -182,7 +184,7 @@ in
// lib.mapAttrs (_: mkSection) cfg.rules;
# To make the xsuspender tool available.
home.packages = [ pkgs.xsuspender ];
home.packages = [ cfg.package ];
xdg.configFile."xsuspender.conf".source = iniFormat.generate "xsuspender.conf" cfg.iniContent;
@ -195,7 +197,7 @@ in
};
Service = {
ExecStart = "${pkgs.xsuspender}/bin/xsuspender";
ExecStart = lib.getExe cfg.package;
Environment = lib.mkIf cfg.debug [ "G_MESSAGES_DEBUG=all" ];
};