about summary refs log tree commit diff stats
path: root/modules/home.legacy/conf/yambar/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/home.legacy/conf/yambar/default.nix')
-rw-r--r--modules/home.legacy/conf/yambar/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/modules/home.legacy/conf/yambar/default.nix b/modules/home.legacy/conf/yambar/default.nix
new file mode 100644
index 00000000..007e7f25
--- /dev/null
+++ b/modules/home.legacy/conf/yambar/default.nix
@@ -0,0 +1,50 @@
+{
+  nixosConfig,
+  sysLib,
+  pkgs,
+  lib,
+  ...
+}: let
+  makeScript = {
+    name,
+    dependencies,
+    ...
+  }:
+    sysLib.writeShellScript {
+      inherit name;
+      src = ./scripts/${name}.sh;
+      dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;});
+    }
+    + "/bin/${name}";
+in {
+  xdg.configFile."yambar/config.yml".source = pkgs.substituteAll {
+    src =
+      if nixosConfig.soispha.laptop.enable
+      then ./config/laptop.yml
+      else ./config/config.yml;
+
+    backlight =
+      if nixosConfig.soispha.laptop.enable
+      then nixosConfig.soispha.laptop.backlight
+      else "";
+
+    mpd_song_name_script = makeScript {
+      dependencies = builtins.attrValues {inherit (pkgs) mpc-cli;};
+      name = "mpd_song_name";
+    };
+
+    volume_script = makeScript {
+      dependencies = builtins.attrValues {inherit (pkgs) pulseaudio gawk coreutils;};
+      name = "sound-volume";
+    };
+
+    cpu_script = lib.getExe pkgs.yambar-cpu;
+
+    memory_script = lib.getExe pkgs.yambar-memory;
+
+    disk_script = makeScript {
+      dependencies = builtins.attrValues {inherit (pkgs) gawk btrfs-progs coreutils;};
+      name = "disk";
+    };
+  };
+}