aboutsummaryrefslogtreecommitdiff
path: root/users/ryan/modules/simple-bar/default.nix
blob: 116216f20488f4d9dcbc2ad983c71d4ebef4124a (plain)
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
{ config, lib, pkgs, ... }:

with lib;

let
    cfg = config.ryan.simple-bar;
    # Fetch the git repo at a specific rev
    "simple-bar-upstream" = builtins.fetchGit {
        url = "https://github.com/Jean-Tinland/simple-bar";
        rev = "fb5cada548a05bd01f727772c0a18fd8c7f65b42";
        shallow = true;
    };
in
{
    options.ryan.simple-bar.enable = mkEnableOption "simple-bar";

    config = mkIf cfg.enable {
        home.file."Library/Application Support/Übersicht/widgets/simple-bar" = {
            source = simple-bar-upstream;
            recursive = false;
        };
        home.file.".simplebarrc".source = ./simplebarrc;

        # Install the LaunchD services
        launchd.agents.simple-bar-server = import ./server.nix { inherit config lib pkgs; };

        launchd.agents.ubersicht = {
            enable = true;
            config = {
                ProgramArguments = [ "/usr/bin/open" "-a" "Übersicht" ];
                RunAtLoad = true;
            };
        };
    };
}