about summary refs log tree commit diff stats
path: root/home-manager/config/yambar/default.nix
diff options
context:
space:
mode:
authorene <ene@sils.li>2023-03-04 15:00:11 +0100
committerene <ene@sils.li>2023-03-04 15:00:11 +0100
commit6e77d5a081004fb9fe0d47950bd031119c29e9c2 (patch)
treef78b0e14b4ce94330a734daa0987b2d1b4a9f911 /home-manager/config/yambar/default.nix
parentFix(hm/alacritty): Config (diff)
downloadnixos-config-6e77d5a081004fb9fe0d47950bd031119c29e9c2.tar.gz
nixos-config-6e77d5a081004fb9fe0d47950bd031119c29e9c2.zip
Feat(hm/config/yambar): Update the scripts and better paths
Diffstat (limited to '')
-rw-r--r--home-manager/config/yambar/default.nix39
1 files changed, 36 insertions, 3 deletions
diff --git a/home-manager/config/yambar/default.nix b/home-manager/config/yambar/default.nix
index e288d8ef..75f2afdc 100644
--- a/home-manager/config/yambar/default.nix
+++ b/home-manager/config/yambar/default.nix
@@ -1,10 +1,43 @@
 {
   config,
+  sysLib,
   pkgs,
+  grades,
+  yambar_cpu,
+  yambar_memory,
   ...
-}: {
-  xdg.configFile."yambar/config.yml".source = ./config/config.yml;
-  xdg.configFile."yambar/scripts".source = ./scripts;
+}: let
+  makeScript = {
+    file,
+    dependencies,
+    ...
+  }:
+    sysLib.makeShellScriptWithLibrary {
+      name = "${builtins.baseNameOf file}";
+      script = file;
+      dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;});
+    }
+    + "/bin/${builtins.baseNameOf file}";
+in {
+  xdg.configFile."yambar/config.yml".source = builtins.substitueAll {
+    src = ./config/config.yml;
+
+    volume_script = makeScript {
+      dependencies = builtins.attrValues {inherit (pkgs) pactl gawk;};
+      file = ./scripts/sound-volume.sh;
+    };
+    grade_average_script = makeScript {
+      dependencies = [grades];
+      file = ./scripts/grades-average.sh;
+    };
+    cpu_script = yambar_cpu;
+    memory_script = yambar_memory;
+
+    disk_script = makeScript {
+      dependencies = builtins.attrValues {inherit (pkgs) gawk btrfs-progs coreutils;};
+      file = ./scripts/disk.sh;
+    };
+  };
 }
 # vim: ts=2