diff --git a/README.md b/README.md index 2b057b5..c448d95 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,6 @@ Because ownerboot is written in [nix](https://nixos.org/manual/nix/unstable/), i Copypasta: ``` -git submodule init -git submodule update --depth 1 nixpkgs -export NIX_PATH=$(pwd) nix-build --option trusted-public-keys "" src -A kgpe.coreboot # kgpe-d16 AMD opteron nix-build --option trusted-public-keys "" src -A am1i.coreboot # am1-i AMD kabini nix-build --option trusted-public-keys "" src -A kevin.coreboot # Samsung chromebook rk3399 arm64 diff --git a/doc/build.md b/doc/build.md index c195314..47b129a 100644 --- a/doc/build.md +++ b/doc/build.md @@ -1,17 +1,12 @@ # Building Ownerboot -Ownerboot should work with any recent version of nixpkgs. A submodule -reference to a known-good nixpkgs revision is included for -demonstration purposes. +Ownerboot should work with any recent version of nixpkgs. By +default a tarball of a known-good nixpkgs commit will be downloaded; +you can override this with the `nixpkgs` or `pkgsFun` top-level +parameters. -``` -git submodule init -git submodule update --depth 1 nixpkgs -export NIX_PATH=$(pwd) -``` - -Then execute one of the following three lines, depending on which -platform you want to build for: +To build ownerboot, execute one of the following three lines, +depending on which platform you want to build for: ``` nix-build --option trusted-public-keys "" src -A kgpe.coreboot # kgpe-d16 AMD opteron diff --git a/nixpkgs b/nixpkgs deleted file mode 160000 index db24d86..0000000 --- a/nixpkgs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit db24d86dd8a4769c50d6b7295e81aa280cd93f35 diff --git a/src/default.nix b/src/default.nix index a1ab025..1c78ed1 100644 --- a/src/default.nix +++ b/src/default.nix @@ -1,5 +1,6 @@ -{ lib ? import -, pkgsFun ? import +{ nixpkgs ? import ./lib/nixpkgs.nix +, lib ? import (nixpkgs + "/lib") +, pkgsFun ? import nixpkgs , hostPlatform ? null # if left `null` this will be set based on the ./platform/ }: let diff --git a/src/lib/nixpkgs.nix b/src/lib/nixpkgs.nix new file mode 100644 index 0000000..6e1c2ad --- /dev/null +++ b/src/lib/nixpkgs.nix @@ -0,0 +1,7 @@ +let + commit = "db24d86dd8a4769c50d6b7295e81aa280cd93f35"; + sha256 = "1l8r5cmb6wdhv2zpn5dx16753z15pqm1wyixga3k897jvw53gx3s"; +in builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/${commit}.tar.gz"; + inherit sha256; +}