aboutsummaryrefslogtreecommitdiffstats
path: root/modules/scripts/default.nix
blob: 927b36c8596fc8db7c467e797bb44b0bcdd3ed6f (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,
  ...
}:

{
  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/system-monitor" = lib.mkIf (
          config.tools.bottom.enable
          && config.tools.nvtop.enable
          && config.tools.tmux.enable
          && config.tools.kitty.enable
        ) (shellScript ./system-monitor.sh);
      };
  };
}