conky: split sane-battery-estimate out into its own program

This commit is contained in:
2024-05-27 11:33:40 +00:00
parent db3636641d
commit 60b1ab1429
3 changed files with 18 additions and 13 deletions

View File

@@ -801,6 +801,8 @@ in
sane-die-with-parent.sandbox.enable = false; #< it's a launcher; can't sandbox sane-die-with-parent.sandbox.enable = false; #< it's a launcher; can't sandbox
sane-weather = {};
screen.sandbox.enable = false; #< tty; needs to run anything screen.sandbox.enable = false; #< tty; needs to run anything
sequoia.sandbox.method = "bwrap"; # TODO:sandbox: untested sequoia.sandbox.method = "bwrap"; # TODO:sandbox: untested

View File

@@ -1,5 +1,11 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.sane-battery-estimate = {
packageUnwrapped = pkgs.static-nix-shell.mkBash {
pname = "sane-battery-estimate";
srcRoot = ./.;
};
};
sane.programs.conky = { sane.programs.conky = {
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.net = "clearnet"; #< for the scripts it calls (weather) sandbox.net = "clearnet"; #< for the scripts it calls (weather)
@@ -11,18 +17,16 @@
]; ];
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
fs.".config/conky/conky.conf".symlink.target = suggestedPrograms = [
let "sane-battery-estimate"
# TODO: make this just another `suggestedPrograms`! "sane-weather"
battery_estimate = pkgs.static-nix-shell.mkBash { ];
pname = "battery_estimate";
srcRoot = ./.; fs.".config/conky/conky.conf".symlink.target = pkgs.substituteAll {
}; src = ./conky.conf;
in pkgs.substituteAll { bat = "sane-battery-estimate";
src = ./conky.conf; weather = "timeout 20 sane-weather";
bat = "${battery_estimate}/bin/battery_estimate"; };
weather = "timeout 20 ${pkgs.sane-weather}/bin/sane-weather";
};
services.conky = { services.conky = {
description = "conky dynamic desktop background"; description = "conky dynamic desktop background";

View File

@@ -1,4 +1,3 @@
#!/bin/sh
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i bash #!nix-shell -i bash