From 47e7ac5479307a287c5dd097b49174526178d32d Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Thu, 23 Sep 2021 20:13:38 +0300 Subject: [PATCH] better systemd user services --- profiles/applications/emacs/default.nix | 6 ++++-- profiles/workspace/kde/default.nix | 1 + profiles/workspace/mako.nix | 10 +++++++++- profiles/workspace/zsh.nix | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/profiles/applications/emacs/default.nix b/profiles/applications/emacs/default.nix index 6ba5bd1..2d8cecf 100644 --- a/profiles/applications/emacs/default.nix +++ b/profiles/applications/emacs/default.nix @@ -91,8 +91,10 @@ in { Service = { Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/balsoft/bin"; - After = "sway-session.target"; - WantedBy = "sway-session.target"; + }; + Install = { + After = [ "sway-session.target" ]; + WantedBy = lib.mkForce [ "sway-session.target" ]; }; }; diff --git a/profiles/workspace/kde/default.nix b/profiles/workspace/kde/default.nix index bf2794d..efe6857 100644 --- a/profiles/workspace/kde/default.nix +++ b/profiles/workspace/kde/default.nix @@ -1,6 +1,7 @@ { pkgs, lib, config, ... }: with pkgs.my-lib; { xdg.portal.enable = true; + services.dbus.packages = [ pkgs.firefox pkgs.systemd pkgs.papirus-icon-theme ]; services.udev.packages = [ pkgs.libmtp pkgs.media-player-info ]; diff --git a/profiles/workspace/mako.nix b/profiles/workspace/mako.nix index 95f1616..af63b9e 100644 --- a/profiles/workspace/mako.nix +++ b/profiles/workspace/mako.nix @@ -1,6 +1,14 @@ { pkgs, config, ... }: { home-manager.users.balsoft = { - wayland.windowManager.sway.config.startup = [{ command = "mako"; }]; + systemd.user.services.mako = { + Service = { + ExecStart = "${pkgs.mako}/bin/mako"; + }; + Install = { + After = [ "sway-session.target" ]; + WantedBy = [ "sway-session.target" ]; + }; + }; programs.mako = with pkgs.my-lib.thmHash; { enable = true; layer = "overlay"; diff --git a/profiles/workspace/zsh.nix b/profiles/workspace/zsh.nix index 055d38c..5fc4c9e 100755 --- a/profiles/workspace/zsh.nix +++ b/profiles/workspace/zsh.nix @@ -82,7 +82,7 @@ else cmdstat="✘" fi - if [ ! -z "$cmd" ]; then + if [ ! -z "$cmd" ] && [[ $cmd_time -gt 3 ]]; then ${pkgs.libnotify}/bin/notify-send -i utilities-terminal -u low "$cmdstat $cmd" "in `date -u -d @$cmd_time +'%T'`" fi unset cmd