-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
40 lines (33 loc) · 1.05 KB
/
default.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
{ pkgs ? import <nixpkgs> {} }: with pkgs;
let
inherit (lib) cleanSource makeBinPath;
inherit (stdenv) mkDerivation isLinux;
runtimePaths = makeBinPath [
openssh git coreutils findutils gnused gnugrep less
(if isLinux then inotify-tools else fswatch)
];
in mkDerivation rec {
version = "0.4.0";
name = "pairon-${version}";
src = cleanSource ./.;
nativeBuildInputs = [ makeWrapper ];
phases = "unpackPhase installPhase fixupPhase";
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r -t $out bin lib libexec template editor-plugins
runHook postInstall
'';
fixupPhase = ''
runHook preFixup
#sed -i"" '2iexport PATH="${runtimePaths}:$PATH"' $out/bin/pairon
#sed -i"" 's|#!/bin/sh|#!${dash}/bin/dash|' $out/bin/* $out/libexec/*
substituteInPlace $out/bin/* $out/libexec/* \
--replace "/bin/sh" "${dash}/bin/dash"
wrapProgram $out/bin/pairon \
--set PATH "${runtimePaths}" \
--set PAIRON_SHELL "${dash}/bin/dash" \
--set PAIRON_VERSION "${version}"
runHook postFixup
'';
}