mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
Move nix-installer-sha256 to separate file to be cachable
This commit is contained in:
parent
aa367412eb
commit
8359c22d96
3 changed files with 22 additions and 15 deletions
|
|
@ -15,6 +15,8 @@ let
|
||||||
|
|
||||||
nixDirectory = callPackage ./nix-directory.nix { };
|
nixDirectory = callPackage ./nix-directory.nix { };
|
||||||
|
|
||||||
|
nixInstallerSha256 = callPackage ./nix-installer-sha256.nix { };
|
||||||
|
|
||||||
proot = callPackage ./proot.nix { };
|
proot = callPackage ./proot.nix { };
|
||||||
|
|
||||||
qemuAarch64Static = callPackage ./qemu-aarch64-static.nix { };
|
qemuAarch64Static = callPackage ./qemu-aarch64-static.nix { };
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,10 @@
|
||||||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||||
|
|
||||||
{ arch, buildPkgs, qemuAarch64Static }:
|
{ arch, buildPkgs, nixInstallerSha256, qemuAarch64Static }:
|
||||||
|
|
||||||
let
|
let
|
||||||
buildRootDirectory = "root-directory";
|
buildRootDirectory = "root-directory";
|
||||||
filename = "nix-2.2.2-${arch}-linux.tar.bz2.sha256";
|
|
||||||
|
|
||||||
sha256 = buildPkgs.stdenv.mkDerivation {
|
|
||||||
name = "nix-installer-sha256";
|
|
||||||
|
|
||||||
src = builtins.fetchurl "https://nixos.org/releases/nix/nix-2.2.2/${filename}";
|
|
||||||
|
|
||||||
unpackPhase = "true";
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
sed -e 's/\(.*\)/"\1"/' $src > $out
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
prootCommand = buildPkgs.lib.concatStringsSep " " [
|
prootCommand = buildPkgs.lib.concatStringsSep " " [
|
||||||
"${buildPkgs.proot}/bin/proot"
|
"${buildPkgs.proot}/bin/proot"
|
||||||
|
|
@ -34,9 +21,11 @@ in
|
||||||
buildPkgs.stdenv.mkDerivation {
|
buildPkgs.stdenv.mkDerivation {
|
||||||
name = "nixDirectory";
|
name = "nixDirectory";
|
||||||
|
|
||||||
|
# FIXME: find a source where sha256 never changes, nixInstallerSha256
|
||||||
|
# derivation is very impure..
|
||||||
src = builtins.fetchurl {
|
src = builtins.fetchurl {
|
||||||
url = "https://nixos.org/releases/nix/nix-2.2.2/nix-2.2.2-${arch}-linux.tar.bz2";
|
url = "https://nixos.org/releases/nix/nix-2.2.2/nix-2.2.2-${arch}-linux.tar.bz2";
|
||||||
sha256 = import sha256;
|
sha256 = import nixInstallerSha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
PROOT_NO_SECCOMP = 1; # see https://github.com/proot-me/PRoot/issues/106
|
PROOT_NO_SECCOMP = 1; # see https://github.com/proot-me/PRoot/issues/106
|
||||||
|
|
|
||||||
16
src/pkgs/nix-installer-sha256.nix
Normal file
16
src/pkgs/nix-installer-sha256.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||||
|
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||||
|
|
||||||
|
{ arch, buildPkgs }:
|
||||||
|
|
||||||
|
buildPkgs.stdenv.mkDerivation {
|
||||||
|
name = "nix-installer-sha256";
|
||||||
|
|
||||||
|
src = builtins.fetchurl "https://nixos.org/releases/nix/nix-2.2.2/nix-2.2.2-${arch}-linux.tar.bz2.sha256";
|
||||||
|
|
||||||
|
unpackPhase = "true";
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
sed -e 's/\(.*\)/"\1"/' $src > $out
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue