walker: add elephant integration

Add an option to order Walker's user service after elephant.service and add a systemd Requires= dependency when enabled.

The option defaults to services.elephant.enable, so Home Manager-managed Elephant setups work automatically while users can still enable the dependency for an externally managed elephant.service.
This commit is contained in:
Austin Horstman
2026-05-17 22:25:27 -05:00
parent 84ddd33ed0
commit d918d22422
4 changed files with 54 additions and 2 deletions
@@ -0,0 +1,15 @@
{ config, ... }:
{
time = "2026-05-18T03:07:36+00:00";
condition = config.services.walker.enable;
message = ''
The 'services.walker' module now supports Elephant integration through
{option}`services.walker.enableElephantIntegration`.
When both `services.walker` and `services.elephant` are enabled, Walker's
systemd user service now starts after `elephant.service` and requires it.
Set {option}`services.walker.enableElephantIntegration` to `false` to
disable this service dependency.
'';
}
+21 -2
View File
@@ -22,7 +22,20 @@ in
options.services.walker = {
enable = mkEnableOption "walker";
package = mkPackageOption pkgs "walker" { nullable = true; };
enableElephantIntegration = mkOption {
type = types.bool;
default = config.services.elephant.enable;
defaultText = lib.literalExpression "config.services.elephant.enable";
example = true;
description = ''
Whether to make Walker's systemd service depend on
{option}`services.elephant`.
'';
};
settings = mkOption {
inherit (tomlFormat) type;
default = { };
@@ -95,12 +108,18 @@ in
}
];
home.packages = mkIf (cfg.package != null) [ cfg.package ];
home.packages = lib.optional (cfg.package != null) cfg.package;
xdg.configFile."walker/config.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "walker-config" cfg.settings;
};
systemd.user.services.walker = mkIf (cfg.systemd.enable && cfg.package != null) {
Unit.Description = "Walker - Application Runner";
Unit = {
Description = "Walker - Application Runner";
}
// lib.optionalAttrs cfg.enableElephantIntegration {
After = [ "elephant.service" ];
Requires = [ "elephant.service" ];
};
Install.WantedBy = [ "graphical-session.target" ];
Service = {
ExecStart = "${lib.getExe cfg.package} --gapplication-service";
@@ -3,9 +3,12 @@ let
layout_xml = builtins.readFile ./item_dmenu.xml;
in
{
services.elephant.enable = true;
services.walker = {
enable = true;
systemd.enable = true;
enableElephantIntegration = true;
settings = {
app_launch_prefix = "";
terminal_title_flag = "";
@@ -49,5 +52,9 @@ in
assertFileContent home-files/.config/walker/themes/mytheme/style.css \
${./mytheme.css}
walkerService=home-files/.config/systemd/user/walker.service
assertFileContent $walkerService ${./walker.service}
'';
}
@@ -0,0 +1,11 @@
[Install]
WantedBy=graphical-session.target
[Service]
ExecStart=@walker@/bin/walker --gapplication-service
Restart=on-failure
[Unit]
After=elephant.service
Description=Walker - Application Runner
Requires=elephant.service