-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
73 lines (61 loc) · 1.65 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
description = "Flake for seffs";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs:
inputs.flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import inputs.nixpkgs {
inherit system;
};
simple-seffs = pkgs.writeScriptBin "seffs" (builtins.readFile ./seffs);
wrapped-seffs = pkgs.stdenv.mkDerivation {
name = "seffs";
src = ./seffs;
buildInputs = with pkgs; [ elvish nushell ];
nativeBuildInputs = [ pkgs.makeWrapper ];
dontUnpack = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
runHook preInstall
cp $src $out/bin/seffs
chmod 755 $out/bin/seffs
runHook postInstall
'';
postFixup = with pkgs; ''
wrapProgram $out/bin/seffs --set PATH ${lib.makeBinPath [
coreutils
elvish
nushell
]}:/usr/bin
'';
};
seffs = wrapped-seffs;
in
with pkgs;
{
devShells = {
default = mkShell {
buildInputs = [
bashInteractive
elvish
nushell
];
};
};
packages = {
default = seffs;
};
apps = {
default = {
type = "app";
program = "${seffs}/bin/seffs";
};
};
}
);
}