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

This commit is contained in:
Colin 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-weather = {};
screen.sandbox.enable = false; #< tty; needs to run anything
sequoia.sandbox.method = "bwrap"; # TODO:sandbox: untested

View File

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

View File

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