programs: port to programs.services interface
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
sane.programs.conky = {
|
||||
fs.".config/conky/conky.conf".symlink.target =
|
||||
@@ -12,19 +12,16 @@
|
||||
bat = "${battery_estimate}/bin/battery_estimate";
|
||||
weather = "timeout 20 ${pkgs.sane-weather}/bin/sane-weather";
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: give `sane.programs` native support for defining services
|
||||
systemd.user.services.conky = lib.mkIf config.sane.programs.conky.enabled {
|
||||
services.conky = {
|
||||
description = "conky dynamic desktop background";
|
||||
wantedBy = [ "default.target" ];
|
||||
# XXX: should be part of graphical-session.target, but whatever mix of greetd/sway
|
||||
# i'm using means that target's never reached...
|
||||
# wantedBy = [ "graphical-session.target" ];
|
||||
# partOf = [ "graphical-session.target" ];
|
||||
# TODO: might want `ConditionUser=!@system`
|
||||
|
||||
serviceConfig.ExecStart = "${pkgs.conky}/bin/conky";
|
||||
serviceConfig.ExecStart = "${config.sane.programs.conky.package}/bin/conky";
|
||||
serviceConfig.Type = "simple";
|
||||
serviceConfig.Restart = "on-failure";
|
||||
serviceConfig.RestartSec = "10s";
|
||||
@@ -33,4 +30,5 @@
|
||||
# don't start conky until after sway
|
||||
preStart = ''test -n "$SWAYSOCK"'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# config docs:
|
||||
# - `man 5 mako`
|
||||
{ lib, config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
sane.programs.mako = {
|
||||
# we control mako as a systemd service, so have dbus not automatically activate it.
|
||||
@@ -47,18 +47,15 @@
|
||||
text-color=#ffffff
|
||||
background-color=#ff0000
|
||||
'';
|
||||
};
|
||||
|
||||
# mako supports activation via dbus (i.e. the daemon will be started on-demand when a
|
||||
# dbus client tries to talk to it): that works out-of-the-box just by putting mako
|
||||
# on environment.packages, but then logs are blackholed.
|
||||
# TODO: give `sane.programs` native support for defining services
|
||||
systemd.user.services.mako = lib.mkIf config.sane.programs.mako.enabled {
|
||||
services.mako = {
|
||||
description = "mako desktop notification daemon";
|
||||
wantedBy = [ "default.target" ];
|
||||
# XXX: should be part of graphical-session.target, but whatever mix of greetd/sway
|
||||
# i'm using means that target's never reached...
|
||||
# TODO: might want `ConditionUser=!@system`
|
||||
|
||||
serviceConfig.ExecStart = "${config.sane.programs.mako.package}/bin/mako";
|
||||
serviceConfig.Type = "simple";
|
||||
@@ -66,4 +63,5 @@
|
||||
serviceConfig.Restart = "on-failure";
|
||||
serviceConfig.RestartSec = "10s";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
# TODO: give `sane.programs` native support for defining services
|
||||
systemd.user.services.playerctld = lib.mkIf config.sane.programs.playerctl.enabled {
|
||||
sane.programs.playerctl.services.playerctld = {
|
||||
description = "playerctl daemon to keep track of which MPRIS players were recently active";
|
||||
documentation = [ "https://github.com/altdesktop/playerctl/issues/161" ];
|
||||
wantedBy = [ "default.target" ];
|
||||
|
@@ -146,19 +146,17 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: give `sane.programs` native support for defining services
|
||||
systemd.user.services.swaync = lib.mkIf config.sane.programs.swaynotificationcenter.enabled {
|
||||
services.swaync = {
|
||||
# swaync ships its own service, but i want to add `environment` variables and flags for easier debugging.
|
||||
# seems that's not possible without defining an entire nix-native service (i.e. this).
|
||||
description = "Swaync desktop notification daemon";
|
||||
wantedBy = [ "default.target" ];
|
||||
serviceConfig.ExecStart = "${config.sane.programs.swaynotificationcenter.package}/bin/swaync";
|
||||
serviceConfig.Type = "dbus";
|
||||
serviceConfig.BusName = "org.freedesktop.Notifications";
|
||||
serviceConfig.Type = "simple";
|
||||
# serviceConfig.BusName = "org.freedesktop.Notifications";
|
||||
serviceConfig.Restart = "on-failure";
|
||||
serviceConfig.RestartSec = "10s";
|
||||
environment.G_MESSAGES_DEBUG = "all";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user