aboutsummaryrefslogtreecommitdiffstats
path: root/modules/scripts/default.nix
blob: 3fea3df3c1000d04cc5defea604343b8d5a12541 (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
36
37
38
39
{
  config,
  lib,
  ...
}:

# Scripts - Home directory shell scripts (deep-clean, screen-recording, system-monitor)
{
  config = {
    home.sessionPath = [
      "${config.home.homeDirectory}/scripts"
    ];

    home.file =
      let
        shellScript = path: {
          text = ''
            #!${
              if config.tools.zsh.enable then (lib.getExe config.programs.zsh.package) else "#!/usr/bin/env sh"
            }
            ${builtins.readFile path}
          '';
          executable = true;
        };
      in
      {
        "scripts/deep-clean" = shellScript ./deep-clean.sh;
        "scripts/screen-recording" = lib.mkIf (config.tools.ffmpeg.enable && config.tools.slop.enable) (
          shellScript ./screen-recording.sh
        );
        "scripts/system-monitor" = lib.mkIf (
          config.tools.bottom.enable
          && config.tools.nvtop.enable
          && config.tools.tmux.enable
          && config.tools.kitty.enable
        ) (shellScript ./system-monitor.sh);
      };
  };
}