dev/{go,rkt}: add extraShellHook with rkt functionality
This commit is contained in:
parent
2a7c73e748
commit
dcf4cdd88b
2 changed files with 51 additions and 11 deletions
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
pkgs ? import /home/steveej/src/github/NixOS/nixpkgs {},
|
||||
mkGoEnv ? import ./go.nix,
|
||||
rktPath,
|
||||
}:
|
||||
let
|
||||
rktBasebuildInputs = with pkgs; [
|
||||
|
@ -26,6 +27,21 @@ let
|
|||
trousers
|
||||
systemd
|
||||
];
|
||||
extraShellHook = ''
|
||||
TARGET=$GOPATH/src/github.com/coreos/rkt
|
||||
if [[ -e ${rktPath}/rkt/rkt.go ]]; then
|
||||
pushd ${rktPath}
|
||||
else
|
||||
echo rktPath must be run the rkt repository clone, but got '${rktPath}'
|
||||
exit 1
|
||||
fi
|
||||
if ! [[ -e $TARGET/rkt/rkt.go ]]; then
|
||||
mkdir -p $TARGET
|
||||
echo $PWD
|
||||
sudo -E mount -o bind $PWD $TARGET
|
||||
fi
|
||||
pushd $TARGET
|
||||
'';
|
||||
in {
|
||||
go15 = mkGoEnv {
|
||||
inherit pkgs;
|
||||
|
@ -33,6 +49,7 @@ in {
|
|||
name = "rktGo15";
|
||||
version = "1_5";
|
||||
extraBuildInputs = rktBasebuildInputs;
|
||||
inherit extraShellHook;
|
||||
};
|
||||
|
||||
go16 = mkGoEnv {
|
||||
|
@ -41,5 +58,15 @@ in {
|
|||
name = "rktGo16";
|
||||
version = "1_6";
|
||||
extraBuildInputs = rktBasebuildInputs;
|
||||
inherit extraShellHook;
|
||||
};
|
||||
|
||||
go17 = mkGoEnv {
|
||||
inherit pkgs;
|
||||
|
||||
name = "rktGo17";
|
||||
version = "1_7";
|
||||
extraBuildInputs = rktBasebuildInputs;
|
||||
inherit extraShellHook;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue