users/ryan/modules/simple-bar/default.nix

4d12069176a576f90e32a90c805fa9653934011e · 1008 B · 35 lines raw

1 { config, lib, pkgs, ... }:
2
3 with lib;
4
5 let
6 cfg = config.ryan.simple-bar;
7 # Fetch the git repo at a specific rev
8 "simple-bar-upstream" = builtins.fetchGit {
9 url = "https://github.com/Jean-Tinland/simple-bar";
10 rev = "fb5cada548a05bd01f727772c0a18fd8c7f65b42";
11 shallow = true;
12 };
13 in
14 {
15 options.ryan.simple-bar.enable = mkEnableOption "simple-bar";
16
17 config = mkIf cfg.enable {
18 home.file."Library/Application Support/Übersicht/widgets/simple-bar" = {
19 source = simple-bar-upstream;
20 recursive = false;
21 };
22 home.file.".simplebarrc".source = ./simplebarrc;
23
24 # Install the LaunchD services
25 launchd.agents.simple-bar-server = import ./server.nix { inherit config lib pkgs; };
26
27 launchd.agents.ubersicht = {
28 enable = true;
29 config = {
30 ProgramArguments = [ "/usr/bin/open" "-a" "Übersicht" ];
31 RunAtLoad = true;
32 };
33 };
34 };
35 }