aboutsummaryrefslogtreecommitdiff
path: root/pkgs/coreboot/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/coreboot/default.nix')
-rw-r--r--pkgs/coreboot/default.nix46
1 files changed, 14 insertions, 32 deletions
diff --git a/pkgs/coreboot/default.nix b/pkgs/coreboot/default.nix
index 3a24dd92fb54..cc0c2f39b209 100644
--- a/pkgs/coreboot/default.nix
+++ b/pkgs/coreboot/default.nix
@@ -1,17 +1,5 @@
-{ fetchgit
-, fetchurl
-, stdenv
-, m4
-, flex
-, bison
-, zlib
-, gnat
-, curl
-, writeText
-, callPackage
-, lib
-, corebootConfig ? { CONFIG_PAYLOAD_NONE = "y"; }
-}:
+{ fetchgit, fetchurl, stdenv, m4, flex, bison, zlib, gnat, curl, writeText
+, callPackage, lib, corebootConfig ? { CONFIG_PAYLOAD_NONE = "y"; } }:
let
version = "4.12";
@@ -25,18 +13,12 @@ let
toolchain = stdenv.mkDerivation rec {
pname = "coreboot-toolchain";
inherit version src;
- nativeBuildInputs = [
- curl
- stdenv
- m4
- flex
- bison
- zlib
- gnat
- ];
+ nativeBuildInputs = [ curl stdenv m4 flex bison zlib gnat ];
buildPhase = ''
mkdir -p util/crossgcc/tarballs
- ${lib.concatMapStringsSep "\n" (file: "ln -s ${file.archive} util/crossgcc/tarballs/${file.name}") (callPackage ./files.nix {})}
+ ${lib.concatMapStringsSep "\n"
+ (file: "ln -s ${file.archive} util/crossgcc/tarballs/${file.name}")
+ (callPackage ./files.nix { })}
NIX_HARDENING_ENABLE="$\{NIX_HARDENING_ENABLE/ format/\}" make crossgcc-i386 CPUS=$NIX_BUILD_CORES
'';
installPhase = ''
@@ -44,11 +26,13 @@ let
'';
};
- writeConfig = config: let
- filteredConfig = lib.filterAttrs (n: v: v != null) config;
- lines = lib.mapAttrsToList (name: value: "${name}=${value}") filteredConfig;
- configFile = writeText "config" (lib.concatStringsSep "\n" lines);
- in configFile;
+ writeConfig = config:
+ let
+ filteredConfig = lib.filterAttrs (n: v: v != null) config;
+ lines =
+ lib.mapAttrsToList (name: value: "${name}=${value}") filteredConfig;
+ configFile = writeText "config" (lib.concatStringsSep "\n" lines);
+ in configFile;
in stdenv.mkDerivation rec {
@@ -74,7 +58,5 @@ in stdenv.mkDerivation rec {
cp build/coreboot.rom $out
'';
- passthru = {
- inherit toolchain writeConfig corebootConfig;
- };
+ passthru = { inherit toolchain writeConfig corebootConfig; };
}