skipper: eww, the nix way

This commit is contained in:
Adithya 2024-09-28 22:39:47 +05:30
parent aa4ba08f7e
commit 9ca5d889b0
Signed by: adtya
GPG key ID: B8857BFBA2C47B9C
2 changed files with 63 additions and 5 deletions

View file

@ -1,11 +1,12 @@
(defwindow activate-notice
(defwindow default
:monitor 0
:geometry (geometry :x "20px"
:y "20px"
:width "200px"
:height "50px"
:anchor "bottom right")
:stacking "fg"
:stacking "bottom"
:exclusive false
:focusable false
"Test driving eww!")
"@test_string@")

View file

@ -1,6 +1,63 @@
_: {
{ lib, config, pkgs, ... }:
let
configFile = pkgs.substituteAll {
src = ./config/eww.yuck;
test_string = "Testing Out Eww!";
};
cssFile = ./config/eww.scss;
configDir = _: pkgs.stdenvNoCC.mkDerivation {
name = "eww-config";
srcs = [ configFile cssFile ];
dontUnpack = true;
installPhase = ''
mkdir -p $out
for src in $srcs; do
cp "$src" $out/$(stripHash "$src")
done
'';
};
in
{
programs.eww = {
enable = true;
configDir = ./config;
configDir = pkgs.callPackage configDir { };
};
systemd.user.services = {
eww = {
Unit = {
Description = "ElKowars wacky widgets - daemon";
Documentation = "https://elkowar.github.io/eww/";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session-pre.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${lib.getExe config.programs.eww.package} daemon --no-daemonize --logs";
Restart = "on-failure";
KillMode = "mixed";
};
};
eww-widgets = {
Unit = {
Description = "ElKowars wacky widgets";
Documentation = "https://elkowar.github.io/eww/";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session-pre.target" ];
Requires = [ "eww.service" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${lib.getExe config.programs.eww.package} open activate-notice";
};
};
};
}