mirror of
https://github.com/ilyakooo0/nix-bundle.git
synced 2024-09-11 06:55:53 +03:00
More refactoring.
This commit is contained in:
parent
2cb965c186
commit
2ce85648d9
26
default.nix
26
default.nix
@ -1,25 +1 @@
|
||||
{nixpkgs ? import <nixpkgs> {}}:
|
||||
|
||||
with nixpkgs;
|
||||
|
||||
let
|
||||
|
||||
makeself = callPackage ./makeself.nix {};
|
||||
makedir = callPackage ./makedir.nix {};
|
||||
|
||||
nix-bootstrap = callPackage ./nix-bootstrap.nix {};
|
||||
|
||||
makebootstrap = {name, script}:
|
||||
makeself {
|
||||
inherit name;
|
||||
startup = ".${script}/install";
|
||||
archive = makedir {
|
||||
name = "${name}-dir";
|
||||
toplevel = script;
|
||||
};
|
||||
};
|
||||
|
||||
in makebootstrap {
|
||||
name = "nix-bootstrap.sh";
|
||||
script = nix-bootstrap;
|
||||
}
|
||||
import ./nix-bootstrap.nix
|
||||
|
22
install-nix-from-closure.nix
Normal file
22
install-nix-from-closure.nix
Normal file
@ -0,0 +1,22 @@
|
||||
{ stdenv, fetchFromGitHub, nix, cacert }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "nix-bootstrap";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "matthewbauer";
|
||||
repo = "nix-bootstrap";
|
||||
rev = "cc882b2cb92d8de87dad9cb890ad1745b06a9787";
|
||||
sha256 = "05w6xjg0cgz6a4szc7jd7v53bmy4zjrgph5xkgyj73g62jyq7ajf";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ nix cacert ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/
|
||||
substitute install-nix-from-closure.sh $out/install \
|
||||
--subst-var-by nix .${nix} \
|
||||
--subst-var-by cacert .${cacert}
|
||||
chmod +x $out/install
|
||||
'';
|
||||
}
|
20
makebootstrap.nix
Normal file
20
makebootstrap.nix
Normal file
@ -0,0 +1,20 @@
|
||||
{nixpkgs ? import <nixpkgs> {}}:
|
||||
|
||||
with nixpkgs;
|
||||
|
||||
let
|
||||
|
||||
makeself = callPackage ./makeself.nix {};
|
||||
makedir = callPackage ./makedir.nix {};
|
||||
|
||||
in
|
||||
|
||||
{ name, target, run }:
|
||||
makeself {
|
||||
inherit name;
|
||||
startup = ".${target}${run}";
|
||||
archive = makedir {
|
||||
name = "${name}-dir";
|
||||
toplevel = target;
|
||||
};
|
||||
}
|
@ -1,22 +1,14 @@
|
||||
{ stdenv, fetchFromGitHub, nix, cacert }:
|
||||
{nixpkgs ? import <nixpkgs> {}}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "nix-bootstrap";
|
||||
with nixpkgs;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "matthewbauer";
|
||||
repo = "nix-bootstrap";
|
||||
rev = "cc882b2cb92d8de87dad9cb890ad1745b06a9787";
|
||||
sha256 = "05w6xjg0cgz6a4szc7jd7v53bmy4zjrgph5xkgyj73g62jyq7ajf";
|
||||
};
|
||||
let
|
||||
|
||||
propagatedBuildInputs = [ nix cacert ];
|
||||
makebootstrap = callPackage ./makebootstrap.nix {};
|
||||
install-nix-from-closure = callPackage ./install-nix-from-closure.nix {};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/
|
||||
substitute install-nix-from-closure.sh $out/install \
|
||||
--subst-var-by nix .${nix} \
|
||||
--subst-var-by cacert .${cacert}
|
||||
chmod +x $out/install
|
||||
'';
|
||||
}
|
||||
in makebootstrap {
|
||||
name = "nix-bootstrap.sh";
|
||||
target = install-nix-from-closure;
|
||||
run = "/install";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user