smaller resulting packages

This commit is contained in:
Cadey Ratio 2020-02-05 04:07:19 +00:00
parent d5a165fb51
commit c14c5475e2
4 changed files with 59 additions and 9 deletions

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM monacoremo/nix:2020-01-31-62bbc2ab
RUN nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs \
&& nix-channel --update
ENV USER root
RUN nix-env -i gnutar gzip \
&& nix-env -iA cachix -f https://cachix.org/api/v1/install \
&& cachix use xe \
&& nix-env -e cachix \
&& nix-collect-garbage
WORKDIR /xe/pkgs
COPY . .
RUN nix-build default.nix && nix-collect-garbage

View File

@ -5,8 +5,14 @@ let
callPackage = pkgs.lib.callPackageWith (pkgs // self);
x = callPackage ./pkgs/x { };
self = {
MoonPlus = callPackage ./pkgs/moonplus { };
x = callPackage ./pkgs/x { };
appsluggr = x.appsluggr;
johaus = x.johaus;
license = x.license;
mainsanow = x.mainsanow;
prefix = x.prefix;
};
in self

View File

@ -4,21 +4,21 @@ let
repo = fetchFromGitHub {
owner = "pigpigyyy";
repo = "MoonPlus";
rev = "57191ed45bb7bd0ffcd917f00df2e940c900fb3c";
sha256 = "0scbi3d83g7yr51gnxasz2h924wyhbfq3c4a7c7sb0rrzb7m8ln7";
rev = "2e50c15bfe67d4709880a0377d37fca191be2f3e";
sha256 = "0h4kh20qi457mbwi4v7apji4kxqi8razys4aqp4z5v9d7zy0d0zz";
};
defaultAttrs = {
builder = ./builder.sh;
baseInputs = [];
src = repo;
version = "HEAD-57191ed4";
version = "HEAD-2e50c15";
name = "MoonPlus";
system = builtins.currentSystem;
installPhase = ''
ls
install -D bin/release/moonc $out/bin/moonc
install -D bin/release/moonp $out/bin/moonp
'';
};

View File

@ -17,11 +17,42 @@ let
CGO_ENABLED="0";
# TODO: remove references to go in the non-default output
allowGoReference = true;
allowGoReference = false;
subPackages = [
"./..."
"cmd/appsluggr"
"cmd/johaus"
"cmd/license"
"cmd/mainsanow"
"cmd/prefix"
];
outputs = [
"out" # keep the default output but don't use it
"appsluggr"
"johaus"
"license"
"mainsanow"
"prefix"
];
installPhase = ''
dir=$GOPATH/bin
install -D $dir/appsluggr $appsluggr/bin/appsluggr
install -D $dir/johaus $johaus/bin/johaus
install -D $dir/license $license/bin/license
install -D $dir/mainsanow $mainsanow/bin/mainsanow
install -D $dir/prefix $prefix/bin/prefix
# let nix know that everything was fine
touch $out
'';
};
in out
in
{
appsluggr = out.appsluggr;
johaus = out.johaus;
license = out.license;
mainsanow = out.mainsanow;
prefix = out.prefix;
}