-
Notifications
You must be signed in to change notification settings - Fork 7
/
flake.nix
48 lines (41 loc) · 1.25 KB
/
flake.nix
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
40
41
42
43
44
45
46
47
48
{
description = "Shell script collection to download ELF binaries and use them right away!";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }: let
l = nixpkgs.lib // builtins;
scriptNames =
l.filter
(script: l.hasPrefix "nix-autobahn" script)
(l.attrNames (l.readDir ./.));
in
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
packageName = "nix-autobahn";
scripts =
l.map
(scriptName:
pkgs.writeShellApplication {
name = scriptName;
text = l.readFile ("${./.}/${scriptName}");
runtimeInputs = with pkgs; [
findutils
fzf
nix-index
nix-ld
];
})
scriptNames;
in {
packages.${packageName} = pkgs.runCommand "nix-autobahn" {} ''
mkdir -p $out/bin
for script in ${l.toString scripts}; do
cp $script/bin/* $out/bin/
done
'';
defaultPackage = self.packages.${system}.${packageName};
});
}