Skip to content

Commit bc3d4d7

Browse files
committedFeb 23, 2025·
added: systemd services -2
1 parent e77cce6 commit bc3d4d7

5 files changed

+64
-15
lines changed
 

‎fhs.nix

+46-15
Original file line numberDiff line numberDiff line change
@@ -77,37 +77,68 @@ pkgs.buildFHSEnv {
7777
(python3.withPackages (ps: with ps; [
7878
i3ipc
7979
]))
80+
81+
# Sway specific tools
82+
gtklock
83+
playerctl
84+
sway-contrib.grimshot
85+
86+
# System utilities
87+
xdg-desktop-portal
88+
xdg-desktop-portal-wlr
89+
90+
# Media controls
91+
nautilus
8092
];
8193

8294
multiPkgs = pkgs: all-inputs;
8395

8496
extraOutputsToInstall = [ "usr" "etc" "lib" "share" ];
8597

86-
# Add environment variables to handle key binding conflicts
98+
# Updated profile with absolute paths and additional error handling
8799
profile = ''
88100
export REGOLITH_PATH=/usr/share/regolith
89101
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share/regolith
90102
export XDG_CONFIG_HOME=$HOME/.config
91103
export GNOME_SHELL_SESSION_MODE=regolith
104+
alias mate-polkit="${pkgs.mate.mate-polkit}/bin/mate-polkit"
92105
93106
# Create systemd user directory if it doesn't exist
94107
mkdir -p $HOME/.config/systemd/user
95108
96-
# Link systemd services
97-
ln -sf /usr/lib/systemd/user/regolith-wayland.target $HOME/.config/systemd/user/
98-
ln -sf /usr/lib/systemd/user/regolith-init-kanshi.service $HOME/.config/systemd/user/
99-
ln -sf /usr/lib/systemd/user/regolith-init-displayd.service $HOME/.config/systemd/user/
100-
ln -sf /usr/lib/systemd/user/regolith-init-powerd.service $HOME/.config/systemd/user/
101-
ln -sf /usr/lib/systemd/user/regolith-init-inputd.service $HOME/.config/systemd/user/
109+
# Copy systemd user service files
110+
if [ -d "/usr/lib/systemd/user" ]; then
111+
cp -rf /usr/lib/systemd/user/* $HOME/.config/systemd/user/
112+
fi
102113
103-
# Enable the services
104-
systemctl --user daemon-reload
105-
systemctl --user enable regolith-wayland.target
106-
systemctl --user enable regolith-init-kanshi.service
107-
systemctl --user enable regolith-init-displayd.service
108-
systemctl --user enable regolith-init-powerd.service
109-
systemctl --user enable regolith-init-inputd.service
114+
# # Reload systemd user services
115+
# ${pkgs.systemd}/bin/systemctl --user daemon-reload
116+
# echo "Reloaded systemd user services"
117+
# ${pkgs.systemd}/bin/systemctl --user enable regolith-wayland.target
118+
# echo "Enabled regolith-wayland.target"
119+
# ${pkgs.systemd}/bin/systemctl --user enable regolith-init-kanshi.service
120+
# echo "Enabled regolith-init-kanshi.service"
121+
# ${pkgs.systemd}/bin/systemctl --user enable regolith-init-displayd.service
122+
# echo "Enabled regolith-init-displayd.service"
123+
# ${pkgs.systemd}/bin/systemctl --user enable regolith-init-powerd.service
124+
# echo "Enabled regolith-init-powerd.service"
125+
# ${pkgs.systemd}/bin/systemctl --user enable regolith-init-inputd.service
126+
# echo "Enabled regolith-init-inputd.service"
127+
128+
# Ensure XDG_RUNTIME_DIR exists
129+
if [ -z "$XDG_RUNTIME_DIR" ]; then
130+
export XDG_RUNTIME_DIR=/run/user/$(id -u)
131+
mkdir -p $XDG_RUNTIME_DIR
132+
chmod 700 $XDG_RUNTIME_DIR
133+
fi
110134
'';
111135

112136
runScript = "${pkgs.fish}/bin/fish";
113-
}
137+
}
138+
139+
# Enabled regolith-init-kanshi.service
140+
# Enabled regolith-init-displayd.service
141+
# Failed to enable unit: Unit regolith-init-powerd.service does not exist
142+
# Enabled regolith-init-powerd.service
143+
# Failed to enable unit: Unit regolith-init-inputd.service does not exist
144+
# Enabled regolith-init-inputd.service

‎packages/regolith-displayd.nix

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ rustPlatform.buildRustPackage rec {
2020
postInstall = ''
2121
install -Dm644 data/regolith-init-kanshi.service $out/lib/systemd/user/regolith-init-kanshi.service
2222
install -Dm644 data/regolith-init-displayd.service $out/lib/systemd/user/regolith-init-displayd.service
23+
patchShebangs $out/lib/systemd/user/regolith-displayd-init
24+
install -Dm644 regolith-displayd-init $out/bin/regolith-displayd-init
2325
'';
2426

2527
meta = {

‎packages/regolith-inputd.nix

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ rustPlatform.buildRustPackage rec {
2727
glib
2828
];
2929

30+
# postInstall = ''
31+
# mkdir -p $out/lib/systemd/user/
32+
# install -Dm644 $src/data/regolith-init-inputd.service $out/lib/systemd/user/
33+
# '';
34+
3035
meta = {
3136
description = "Input management daemon for regolith wayland session";
3237
homepage = "https://github.com/regolith-linux/regolith-inputd";

‎packages/regolith-powerd.nix

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ rustPlatform.buildRustPackage rec {
2727
glib
2828
];
2929

30+
# postInstall = ''
31+
# mkdir -p $out/lib/systemd/user/
32+
# install -Dm644 data/regolith-init-powerd.service $out/lib/systemd/user/
33+
# ls
34+
# ls $src
35+
# '';
36+
3037
meta = {
3138
description = "Daemon to sync gsd power settings with Regolith on Wayland. Provides idle state functionality and sets power button action";
3239
homepage = "https://github.com/regolith-linux/regolith-powerd";

‎packages/regolith-wm-config.nix

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ stdenv.mkDerivation rec {
2626
cp -r $src/scripts/* $out/bin
2727
'';
2828

29+
postInstall = ''
30+
31+
'';
32+
2933
meta = {
3034
description = "Configuration files related to window manager in X11 and Wayland";
3135
homepage = "https://github.com/regolith-linux/regolith-wm-config";

0 commit comments

Comments
 (0)
Please sign in to comment.