diff options
author | Silas Schöffel <sils@sils.li> | 2024-04-04 17:06:23 +0200 |
---|---|---|
committer | Silas Schöffel <sils@sils.li> | 2024-04-04 17:06:23 +0200 |
commit | 924ec30e7075ea7a9dbac569a537d876f9146850 (patch) | |
tree | 11ff56048f05536a1905490137333b3596d0ee18 /hm/yambar/default.nix | |
parent | users/default.nix: delete (diff) | |
download | nix-config-924ec30e7075ea7a9dbac569a537d876f9146850.tar.gz nix-config-924ec30e7075ea7a9dbac569a537d876f9146850.zip |
refactor: move users/sils dir to hm
Diffstat (limited to 'hm/yambar/default.nix')
-rw-r--r-- | hm/yambar/default.nix | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/hm/yambar/default.nix b/hm/yambar/default.nix new file mode 100644 index 0000000..814174c --- /dev/null +++ b/hm/yambar/default.nix @@ -0,0 +1,49 @@ +{ + nixosConfig, + 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/laptop.yml; + + backlight = "intel_backlight"; + volume_script = makeScript { + dependencies = builtins.attrValues {inherit (pkgs) pulseaudio gawk coreutils;}; + file = ./scripts/sound-volume; + }; + grade_average_script = makeScript { + dependencies = + [ + grades.outputs.packages.${system}.default + ] + ++ (builtins.attrValues {inherit (pkgs) coreutils gawk;}); + 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 + |