Manually start systemd services

This commit is contained in:
Charlotte 🦝 Delenk 2023-01-01 10:37:59 +01:00
parent 5d6908823b
commit b993476df8
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
8 changed files with 36 additions and 68 deletions

View file

@ -115,4 +115,5 @@ in {
enabled = "ibus"; enabled = "ibus";
ibus.engines = with pkgs.ibus-engines; [anthy]; ibus.engines = with pkgs.ibus-engines; [anthy];
}; };
services.polkit.enable = true;
} }

13
config/programs/foot.nix Normal file
View file

@ -0,0 +1,13 @@
{...}: {
programs.foot = {
enable = true;
server.enable = true;
settings = {
main = {
term = "xterm-256color";
font = "FiraCode Nerd Font:size=12";
dpi-aware = "yes";
};
};
};
}

View file

@ -7,54 +7,9 @@
systemd.user.services.keepassxc = { systemd.user.services.keepassxc = {
Unit = { Unit = {
Description = "keepassxc"; Description = "keepassxc";
After = ["graphical-session-pre.target"];
PartOf = ["graphical-session.target"];
};
Install = {
WantedBy = ["graphical-session.target"];
}; };
Service = { Service = {
ExecStart = "${pkgs.keepassxc}/bin/keepassxc"; ExecStart = "${pkgs.keepassxc}/bin/keepassxc";
}; };
}; };
xdg.configFile."keepassxc/keepassxc.ini".text = ''
[General]
ConfigVersion=1
[Browser]
CustomProxyLocation=
Enabled=true
[FdoSecrets]
Enabled=true
[GUI]
AdvancedSettings=true
ApplicationTheme=dark
TrayIconAppearance=monochrome-light
[KeeShare]
Active="<?xml version=\"1.0\"?>\n<KeeShare xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <Active/>\n</KeeShare>\n"
Foreign="<?xml version=\"1.0\"?>\n<KeeShare xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <Foreign/>\n</KeeShare>\n"
Own="<?xml version=\"1.0\"?>\n<KeeShare xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <PrivateKey/>\n <PublicKey/>\n</KeeShare>\n"
QuietSuccess=true
[PasswordGenerator]
AdditionalChars=
AdvancedMode=true
Braces=true
Dashes=true
EASCII=false
EnsureEvery=false
ExcludedChars=
Length=10
Logograms=true
Math=true
Punctuation=true
Quotes=true
SpecialChars=true
[Security]
IconDownloadFallback=true
'';
} }

View file

@ -2,10 +2,6 @@
systemd.user.services.mako = { systemd.user.services.mako = {
Unit = { Unit = {
Description = "mako"; Description = "mako";
PartOf = ["graphical-session.target"];
};
Install = {
WantedBy = ["graphical-session.target"];
}; };
Service = { Service = {
ExecStart = "${pkgs.mako}/bin/mako --default-timeout 30000"; ExecStart = "${pkgs.mako}/bin/mako --default-timeout 30000";

View file

@ -70,12 +70,6 @@ in {
systemd.user.services.plover = { systemd.user.services.plover = {
Unit = { Unit = {
Description = "plover"; Description = "plover";
After = ["tray.target"];
PartOf = ["graphical-session.target"];
Requires = ["tray.target"];
};
Install = {
WantedBy = ["graphical-session.target"];
}; };
Service = { Service = {
ExecStart = "${plover-env}/bin/plover"; ExecStart = "${plover-env}/bin/plover";

View file

@ -59,6 +59,20 @@
''; '';
installPhase = "true"; installPhase = "true";
}; };
start-extra-services = pkgs.writeTextFile {
name = "start-extra-services";
destination = "/bin/start-extra-services";
exexcutable = true;
text = ''
sleep 5
${pkgs.systemd}/bin/systemctl --user start swayidle
${pkgs.systemd}/bin/systemctl --user start keepassxc
${pkgs.systemd}/bin/systemctl --user start plover
${pkgs.systemd}/bin/systemctl --user start wl-clipboard
${pkgs.systemd}/bin/systemctl --user start mako
'';
};
# bash script to let dbus know about important env variables and # bash script to let dbus know about important env variables and
# propogate them to relevent services run at the end of sway config # propogate them to relevent services run at the end of sway config
# see # see
@ -100,6 +114,7 @@ in {
./wl-clipboard.nix ./wl-clipboard.nix
./mako.nix ./mako.nix
./swayidle.nix ./swayidle.nix
./foot.nix
]; ];
home.file.".config/wofi/config".text = '' home.file.".config/wofi/config".text = ''
allow_markup = true allow_markup = true
@ -138,6 +153,7 @@ in {
inherit (config.wayland.windowManager.sway.config) modifier; inherit (config.wayland.windowManager.sway.config) modifier;
in in
lib.mkOptionDefault { lib.mkOptionDefault {
"${modifier}+Return" = "exec ${pkgs.foot}/bin/foot";
"${modifier}+d" = "exec ${pkgs.wofi}/bin/wofi --show drun"; "${modifier}+d" = "exec ${pkgs.wofi}/bin/wofi --show drun";
"Print" = "mode screenshot"; "Print" = "mode screenshot";
"XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%"; "XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
@ -160,15 +176,15 @@ in {
modes = { modes = {
screenshot = { screenshot = {
Print = "exec ${screenshot_then_switch} copy area"; Print = "exec ${screenshot_then_switch} copy area";
"Shift+Print" = "exec ${screenshot_then_switch} save area $HOME/Pictures/grim-$(date --iso=s).png"; "Shift+Print" = "exec ${screenshot_then_switch} save area $HOME/Pictures/grim-$(date --iso=s | sed 's/:/-/g').png";
a = "exec ${screenshot_then_switch} copy active"; a = "exec ${screenshot_then_switch} copy active";
"Shift+a" = "exec ${screenshot_then_switch} save active $HOME/Pictures/grim-$(date --iso=s).png"; "Shift+a" = "exec ${screenshot_then_switch} save active $HOME/Pictures/grim-$(date --iso=s | sed 's/:/-/g').png";
s = "exec ${screenshot_then_switch} copy screen"; s = "exec ${screenshot_then_switch} copy screen";
"Shift+s" = "exec ${screenshot_then_switch} save screen $HOME/Pictures/grim-$(date --iso=s).png"; "Shift+s" = "exec ${screenshot_then_switch} save screen $HOME/Pictures/grim-$(date --iso=s | sed 's/:/-/g').png";
o = "exec ${screenshot_then_switch} copy output"; o = "exec ${screenshot_then_switch} copy output";
"Shift+o" = "exec ${screenshot_then_switch} save output $HOME/Pictures/grim-$(date --iso=s).png"; "Shift+o" = "exec ${screenshot_then_switch} save output $HOME/Pictures/grim-$(date --iso=s | sed 's/:/-/g').png";
w = "exec ${screenshot_then_switch} copy window"; w = "exec ${screenshot_then_switch} copy window";
"Shift+w" = "exec ${screenshot_then_switch} save window $HOME/Pictures/grim-$(date --iso=s).png"; "Shift+w" = "exec ${screenshot_then_switch} save window $HOME/Pictures/grim-$(date --iso=s | sed 's/:/-/g').png";
Escape = ''mode "default"''; Escape = ''mode "default"'';
Return = ''mode "default"''; Return = ''mode "default"'';
}; };
@ -188,6 +204,7 @@ in {
exec ${dbus-sway-environment}/bin/dbus-sway-environment exec ${dbus-sway-environment}/bin/dbus-sway-environment
exec ${configure-gtk}/bin/configure-gtk exec ${configure-gtk}/bin/configure-gtk
exec ${pkgs.systemd}/bin/systemctl --user import-environment exec ${pkgs.systemd}/bin/systemctl --user import-environment
exec ${start-extra-services}/bin/start-extra-services
''; '';
}; };

View file

@ -20,10 +20,6 @@ in {
systemd.user.services.swayidle = { systemd.user.services.swayidle = {
Unit = { Unit = {
Description = "swayidle"; Description = "swayidle";
PartOf = ["graphical-session.target"];
};
Install = {
WantedBy = ["graphical-session.target"];
}; };
Service = { Service = {
ExecStart = "${pkgs.swayidle}/bin/swayidle -w timeout 300 ${lock-script} timeout 305 ${screen-off-script} resume ${resume-script} before-sleep ${lock-script} timeout 900 ${suspend-script} lock ${lock-script} unlock ${unlock-script}"; ExecStart = "${pkgs.swayidle}/bin/swayidle -w timeout 300 ${lock-script} timeout 305 ${screen-off-script} resume ${resume-script} before-sleep ${lock-script} timeout 900 ${suspend-script} lock ${lock-script} unlock ${unlock-script}";

View file

@ -2,10 +2,6 @@
systemd.user.services.wl-clipboard = { systemd.user.services.wl-clipboard = {
Unit = { Unit = {
Description = "wl-clipboard"; Description = "wl-clipboard";
PartOf = ["graphical-session.target"];
};
Install = {
WantedBy = ["graphical-session.target"];
}; };
Service = { Service = {
ExecStart = "${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.clipman}/bin/clipman store --no-persist"; ExecStart = "${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.clipman}/bin/clipman store --no-persist";