summaryrefslogtreecommitdiff
path: root/shell-scripts.nix
blob: 32d77d064efc0698bc2a86c621e5eda494fa99e6 (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
{pkgs, config, ...}:
with builtins; let
  script-names = attrNames (readDir ./shell-scripts);
  package = (
    filename: with pkgs; let
    in
      stdenv.mkDerivation {
        name = filename;

        buildCommand = ''
          install -Dm755 $script $out/bin/${filename}
        '';

        script = substituteAll {
          src = ./shell-scripts/${filename};
          isExecutable = true;
          inherit bash;
          home = config.home.homeDirectory;
        };
      }
  );
  packages = map package script-names;
in
  packages