about summary refs log tree commit diff stats
path: root/home-manager/config/yambar/default.nix
blob: db77600e128c5be45b282bb0a5af8ebe3772234b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
  config,
  sysLib,
  system,
  pkgs,
  grades,
  yambar_cpu,
  yambar_memory,
  ...
}: 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 = pkgs.substituteAll {
    src = ./config/config.yml;

    volume_script = makeScript {
      dependencies = builtins.attrValues {inherit (pkgs) pulseaudio gawk;};
      file = ./scripts/sound-volume;
    };
    grade_average_script = makeScript {
      dependencies = [
        grades.outputs.packages.${system}.default
      ];
      file = ./scripts/grades-average;
    };
    cpu_script = yambar_cpu.app.${system}.default.program;
    memory_script = yambar_memory.app.${system}.default.program;

    disk_script = makeScript {
      dependencies = builtins.attrValues {inherit (pkgs) gawk btrfs-progs coreutils;};
      file = ./scripts/disk;
    };
  };
}
# vim: ts=2