diff options
author | Milan Pässler <milan@petabyte.dev> | 2020-11-03 15:45:51 +0100 |
---|---|---|
committer | Milan Pässler <milan@petabyte.dev> | 2020-11-03 15:45:51 +0100 |
commit | d5fe9ec7598dd8297388a415816a20493af53520 (patch) | |
tree | 72fb079a3f8d433b3ddc825cd171b2af7a819f2e | |
parent | 783026ab2d48a76db01f124c8d0ea3b23cf81720 (diff) |
run nixfmt on everything
-rw-r--r-- | configs/milan/common.nix | 4 | ||||
-rw-r--r-- | configs/milan/milan-x1c.nix | 5 | ||||
-rw-r--r-- | configs/milan/milan-x230-fhd.nix | 5 | ||||
-rw-r--r-- | configs/milan/milan-x230t.nix | 5 | ||||
-rw-r--r-- | default.nix | 13 | ||||
-rw-r--r-- | flake.nix | 74 | ||||
-rw-r--r-- | modules/coreinfo/default.nix | 13 | ||||
-rw-r--r-- | modules/corenix/default.nix | 38 | ||||
-rw-r--r-- | modules/default.nix | 11 | ||||
-rw-r--r-- | modules/grub2/default.nix | 61 | ||||
-rw-r--r-- | modules/nvramcui/default.nix | 3 | ||||
-rw-r--r-- | modules/seabios/default.nix | 13 | ||||
-rw-r--r-- | modules/tianocore/default.nix | 6 | ||||
-rw-r--r-- | modules/tint/default.nix | 7 | ||||
-rw-r--r-- | pkgs/coreboot-payload-coreinfo/default.nix | 7 | ||||
-rw-r--r-- | pkgs/coreboot-payload-grub2/default.nix | 23 | ||||
-rw-r--r-- | pkgs/coreboot-payload-nvramcui/default.nix | 4 | ||||
-rw-r--r-- | pkgs/coreboot-payload-seabios/default.nix | 11 | ||||
-rw-r--r-- | pkgs/coreboot-payload-tianocore/default.nix | 73 | ||||
-rw-r--r-- | pkgs/coreboot-payload-tint/default.nix | 16 | ||||
-rw-r--r-- | pkgs/coreboot/default.nix | 46 | ||||
-rw-r--r-- | pkgs/overlay.nix | 14 |
22 files changed, 188 insertions, 264 deletions
diff --git a/configs/milan/common.nix b/configs/milan/common.nix index b8a7bc002a62..dd3df22758bc 100644 --- a/configs/milan/common.nix +++ b/configs/milan/common.nix @@ -1,9 +1,7 @@ { ... }: { - imports = [ - ../common.nix - ]; + imports = [ ../common.nix ]; grub2.enable = true; grub2.users.root.password = "grub.pbkdf2.sha512.10000.EAE4FDF9D98694628FF5F90A0BB4995BB8B85429D5BDCA849F1F94EA353645C86D553193DF1253908B1A25673898AD9586E117C45BA445B906AA887322DE42A5.4B7D4DF5E8E9F6958ECB3D9EA8FDBE7F3590DB03A287FF29960CDDFE7260D94AE2C50A8D399A54C3764E7F5F20DDD2D2FD9EA2C252DC02CA568C18F87DE45B0E"; diff --git a/configs/milan/milan-x1c.nix b/configs/milan/milan-x1c.nix index 9277c7ee2804..9e49e54b6432 100644 --- a/configs/milan/milan-x1c.nix +++ b/configs/milan/milan-x1c.nix @@ -1,10 +1,7 @@ { lib, ... }: { - imports = [ - ./common.nix - ../boards/x1c.nix - ]; + imports = [ ./common.nix ../boards/x1c.nix ]; corenix.corebootConfig = { CONFIG_LINEAR_FRAMEBUFFER_MAX_WIDTH = "1600"; diff --git a/configs/milan/milan-x230-fhd.nix b/configs/milan/milan-x230-fhd.nix index 4a80cbdf77de..441a2f5612d1 100644 --- a/configs/milan/milan-x230-fhd.nix +++ b/configs/milan/milan-x230-fhd.nix @@ -1,10 +1,7 @@ { ... }: { - imports = [ - ./common.nix - ../boards/x230-fhd - ]; + imports = [ ./common.nix ../boards/x230-fhd ]; corenix.corebootConfig = { CONFIG_LINEAR_FRAMEBUFFER_MAX_WIDTH = "1920"; diff --git a/configs/milan/milan-x230t.nix b/configs/milan/milan-x230t.nix index 019e2209910e..ee3b349916c9 100644 --- a/configs/milan/milan-x230t.nix +++ b/configs/milan/milan-x230t.nix @@ -1,10 +1,7 @@ { ... }: { - imports = [ - ./common.nix - ../boards/x230t.nix - ]; + imports = [ ./common.nix ../boards/x230t.nix ]; corenix.corebootConfig = { CONFIG_LINEAR_FRAMEBUFFER_MAX_WIDTH = "1600"; diff --git a/default.nix b/default.nix index 4f4c255f1bb6..1fbe54326228 100644 --- a/default.nix +++ b/default.nix @@ -1,9 +1,6 @@ -(import ( - fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/94cf59784c73ecec461eaa291918eff0bfb538ac.tar.gz"; - sha256 = "03qz7h3hpb7jhlyidd4jxxncns40kvw8aqsq5l8d0rsdq9nj02qj"; - } -) { - src = ./.; -}).defaultNix +(import (fetchTarball { + url = + "https://github.com/edolstra/flake-compat/archive/94cf59784c73ecec461eaa291918eff0bfb538ac.tar.gz"; + sha256 = "03qz7h3hpb7jhlyidd4jxxncns40kvw8aqsq5l8d0rsdq9nj02qj"; +}) { src = ./.; }).defaultNix diff --git a/flake.nix b/flake.nix index 0c56498ee605..6864f3840909 100644 --- a/flake.nix +++ b/flake.nix @@ -7,51 +7,43 @@ }; description = "A collections of derivations for coreboot and payloads"; - outputs = { self, nixpkgs }: let - nixpkgsOptions = { - system = "x86_64-linux"; - overlays = [ - (import ./pkgs/overlay.nix) - ]; - }; - pkgs = import nixpkgs nixpkgsOptions; - inherit (pkgs) lib; + outputs = { self, nixpkgs }: + let + nixpkgsOptions = { + system = "x86_64-linux"; + overlays = [ (import ./pkgs/overlay.nix) ]; + }; + pkgs = import nixpkgs nixpkgsOptions; + inherit (pkgs) lib; - makeDevice = configFile: (lib.evalModules { - modules = [ - ({ ... }: { - nixpkgs = nixpkgsOptions; - }) - ("${nixpkgs}/nixos/modules/misc/assertions.nix") - ("${nixpkgs}/nixos/modules/misc/nixpkgs.nix") - ./modules - configFile - ]; - }).config.corenix.rom; + makeDevice = configFile: + (lib.evalModules { + modules = [ + ({ ... }: { nixpkgs = nixpkgsOptions; }) + ("${nixpkgs}/nixos/modules/misc/assertions.nix") + ("${nixpkgs}/nixos/modules/misc/nixpkgs.nix") + ./modules + configFile + ]; + }).config.corenix.rom; - exportedPkgs = { - inherit (pkgs) - coreboot - coreboot-payload-grub2 - coreboot-payload-tianocore - coreboot-payload-seabios - coreboot-payload-tint - coreboot-payload-nvramcui - coreboot-payload-coreinfo; + exportedPkgs = { + inherit (pkgs) + coreboot coreboot-payload-grub2 coreboot-payload-tianocore + coreboot-payload-seabios coreboot-payload-tint + coreboot-payload-nvramcui coreboot-payload-coreinfo; - milan-x1c = makeDevice ./configs/milan/milan-x1c.nix; - milan-x230t = makeDevice ./configs/milan/milan-x230t.nix; - milan-x230-fhd = makeDevice ./configs/milan/milan-x230-fhd.nix; - }; + milan-x1c = makeDevice ./configs/milan/milan-x1c.nix; + milan-x230t = makeDevice ./configs/milan/milan-x230t.nix; + milan-x230-fhd = makeDevice ./configs/milan/milan-x230-fhd.nix; + }; - in { - lib = { - inherit makeDevice; - }; + in { + lib = { inherit makeDevice; }; - packages.x86_64-linux = exportedPkgs; + packages.x86_64-linux = exportedPkgs; - # shortcut for use with flake-compat - pkgs = exportedPkgs; - }; + # shortcut for use with flake-compat + pkgs = exportedPkgs; + }; } diff --git a/modules/coreinfo/default.nix b/modules/coreinfo/default.nix index 775bb11cb56e..d1a2a19ecf34 100644 --- a/modules/coreinfo/default.nix +++ b/modules/coreinfo/default.nix @@ -2,15 +2,14 @@ with lib; -let - cfg = config.coreinfo; +let cfg = config.coreinfo; in { options.coreinfo = { enable = mkEnableOption "coreinfo coreboot secondary payload"; coreinfoConfig = mkOption { type = types.attrsOf (types.nullOr types.str); - default = {}; + default = { }; }; }; @@ -18,9 +17,11 @@ in { corenix.extraFiles = { "img/coreinfo" = { type = "payload"; - src = "${pkgs.coreboot-payload-coreinfo.override { - inherit (cfg) coreinfoConfig; - }}/coreinfo.elf"; + src = "${ + pkgs.coreboot-payload-coreinfo.override { + inherit (cfg) coreinfoConfig; + } + }/coreinfo.elf"; }; }; }; diff --git a/modules/corenix/default.nix b/modules/corenix/default.nix index d87a83ecaa45..0ab4e996ff2a 100644 --- a/modules/corenix/default.nix +++ b/modules/corenix/default.nix @@ -6,9 +6,7 @@ let cfg = config.corenix; fileOptions.options = { - src = mkOption { - type = types.nullOr types.path; - }; + src = mkOption { type = types.nullOr types.path; }; type = mkOption { type = types.str; @@ -17,17 +15,14 @@ let }; in { options.corenix = { - installCommands = mkOption { - type = types.lines; - }; + installCommands = mkOption { type = types.lines; }; - extraFiles = mkOption { - type = types.attrsOf (types.submodule fileOptions); - }; + extraFiles = + mkOption { type = types.attrsOf (types.submodule fileOptions); }; corebootConfig = mkOption { type = types.attrsOf (types.nullOr types.str); - default = {}; + default = { }; }; package = mkOption { @@ -45,7 +40,7 @@ in { corenix.installCommands = let filteredFiles = filterAttrs (k: v: v.src != null) cfg.extraFiles; filesList = mapAttrsToList (k: v: v // { name = k; }) filteredFiles; - in concatMapStringsSep "\n" (file: + in concatMapStringsSep "\n" (file: if file.type == "payload" then '' cbfstool $out/coreboot.rom add-payload \ -f "${file.src}" \ @@ -55,18 +50,15 @@ in { -f "${file.src}" \ -n "${file.name}" \ -t "${file.type}" - '' - ) filesList; + '') filesList; - corenix.rom = let - base = cfg.package.override { - inherit (cfg) corebootConfig; - }; - in pkgs.runCommand "coreboot-rom" { - buildInputs = with pkgs; [ cbfstool ]; - } '' - install -D ${base}/coreboot.rom -t $out - ${cfg.installCommands} - ''; + corenix.rom = + let base = cfg.package.override { inherit (cfg) corebootConfig; }; + in pkgs.runCommand "coreboot-rom" { + buildInputs = with pkgs; [ cbfstool ]; + } '' + install -D ${base}/coreboot.rom -t $out + ${cfg.installCommands} + ''; }; } diff --git a/modules/default.nix b/modules/default.nix index c35a9ebc4caa..c461f820cab5 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,13 +1,6 @@ { ... }: { - imports = [ - ./corenix - ./grub2 - ./tianocore - ./seabios - ./tint - ./nvramcui - ./coreinfo - ]; + imports = + [ ./corenix ./grub2 ./tianocore ./seabios ./tint ./nvramcui ./coreinfo ]; } diff --git a/modules/grub2/default.nix b/modules/grub2/default.nix index bc8280dec26e..8066d3ac5a17 100644 --- a/modules/grub2/default.nix +++ b/modules/grub2/default.nix @@ -4,29 +4,28 @@ with lib; let cfg = config.grub2; - payloadName = if cfg.asSecondaryPayload then - "img/grub2" - else - "fallback/payload"; + payloadName = + if cfg.asSecondaryPayload then "img/grub2" else "fallback/payload"; - configText = (readFile ./files/grub.cfg) + - cfg.extraConfig + - (optionalString (cfg.scanDevices) (readFile ./files/grub-scan.cfg)) + - (optionalString (cfg.users != {}) ( - (concatStringsSep "\n" (mapAttrsToList (n: u: '' - ${if u.passwordIsHashed then "password_pbkdf2" else "password"} ${n} ${u.password} - '') cfg.users)) + '' - set superusers="${concatStringsSep " " (attrNames (filterAttrs (n: u: u.superuser) cfg.users))}" - export superusers - '' - )) + - (optionalString cfg.generateSecondaryPayloadEntries ( - concatMapStrings (n: '' - menuentry '${removePrefix "img/" n}' { - chainloader (cbfsdisk)/${n} - } - '') (filter (hasPrefix "img/") (attrNames config.corenix.extraFiles)) - )); + configText = (readFile ./files/grub.cfg) + cfg.extraConfig + + (optionalString (cfg.scanDevices) (readFile ./files/grub-scan.cfg)) + + (optionalString (cfg.users != { }) ((concatStringsSep "\n" (mapAttrsToList + (n: u: '' + ${ + if u.passwordIsHashed then "password_pbkdf2" else "password" + } ${n} ${u.password} + '') cfg.users)) + '' + set superusers="${ + concatStringsSep " " + (attrNames (filterAttrs (n: u: u.superuser) cfg.users)) + }" + export superusers + '')) + (optionalString cfg.generateSecondaryPayloadEntries + (concatMapStrings (n: '' + menuentry '${removePrefix "img/" n}' { + chainloader (cbfsdisk)/${n} + } + '') (filter (hasPrefix "img/") (attrNames config.corenix.extraFiles)))); userOpts = { ... }: { options = { @@ -34,9 +33,7 @@ let type = types.bool; default = true; }; - password = mkOption { - type = types.str; - }; + password = mkOption { type = types.str; }; passwordIsHashed = mkOption { type = types.bool; default = true; @@ -71,13 +68,11 @@ in { default = ""; }; - configFile = mkOption { - type = types.path; - }; + configFile = mkOption { type = types.path; }; users = mkOption { type = types.attrsOf (types.submodule userOpts); - default = {}; + default = { }; }; font = mkOption { @@ -95,11 +90,9 @@ in { type = "payload"; src = "${pkgs.coreboot-payload-grub2}/default_payload.elf"; }; - "font.pf2".src = ( - pkgs.runCommand "font.pf2" { - buildInputs = with pkgs; [ grub2 ]; - } "grub-mkfont --range=0x20-0x7E,0x2501-0x251F,0x2191-0x2193 --size=14 -o $out ${cfg.font}" - ); + "font.pf2".src = + (pkgs.runCommand "font.pf2" { buildInputs = with pkgs; [ grub2 ]; } + "grub-mkfont --range=0x20-0x7E,0x2501-0x251F,0x2191-0x2193 --size=14 -o $out ${cfg.font}"); "etc/grub.cfg".src = cfg.configFile; "background.png".src = ./files/background.png; }; diff --git a/modules/nvramcui/default.nix b/modules/nvramcui/default.nix index 850fac91ad68..b2838a2ff4cd 100644 --- a/modules/nvramcui/default.nix +++ b/modules/nvramcui/default.nix @@ -2,8 +2,7 @@ with lib; -let - cfg = config.nvramcui; +let cfg = config.nvramcui; in { options.nvramcui = { enable = mkEnableOption "nvramcui coreboot secondary payload"; diff --git a/modules/seabios/default.nix b/modules/seabios/default.nix index d48e36387442..711fc2c84f13 100644 --- a/modules/seabios/default.nix +++ b/modules/seabios/default.nix @@ -4,10 +4,8 @@ with lib; let cfg = config.seabios; - payloadName = if cfg.asSecondaryPayload then - "img/seabios" - else - "fallback/payload"; + payloadName = + if cfg.asSecondaryPayload then "img/seabios" else "fallback/payload"; in { options.seabios = { @@ -30,7 +28,7 @@ in { seabiosConfig = mkOption { type = types.attrsOf (types.nullOr types.str); - default = {}; + default = { }; }; }; @@ -43,9 +41,8 @@ in { }); corenix.extraFiles = let - package = pkgs.coreboot-payload-seabios.override { - inherit (cfg) seabiosConfig; - }; + package = + pkgs.coreboot-payload-seabios.override { inherit (cfg) seabiosConfig; }; in { ${payloadName} = { type = "payload"; diff --git a/modules/tianocore/default.nix b/modules/tianocore/default.nix index 0ebe453909bb..59266c1aa058 100644 --- a/modules/tianocore/default.nix +++ b/modules/tianocore/default.nix @@ -4,10 +4,8 @@ with lib; let cfg = config.tianocore; - payloadName = if cfg.asSecondaryPayload then - "img/tianocore" - else - "fallback/payload"; + payloadName = + if cfg.asSecondaryPayload then "img/tianocore" else "fallback/payload"; in { options.tianocore = { diff --git a/modules/tint/default.nix b/modules/tint/default.nix index df0ed6851a2a..35f292be17f0 100644 --- a/modules/tint/default.nix +++ b/modules/tint/default.nix @@ -2,12 +2,9 @@ with lib; -let - cfg = config.tint; +let cfg = config.tint; in { - options.tint = { - enable = mkEnableOption "tint coreboot secondary payload"; - }; + options.tint = { enable = mkEnableOption "tint coreboot secondary payload"; }; config = lib.mkIf cfg.enable { corenix.extraFiles = { diff --git a/pkgs/coreboot-payload-coreinfo/default.nix b/pkgs/coreboot-payload-coreinfo/default.nix index 21e00031166e..0ecb41add1cc 100644 --- a/pkgs/coreboot-payload-coreinfo/default.nix +++ b/pkgs/coreboot-payload-coreinfo/default.nix @@ -1,9 +1,4 @@ -{ coreboot -, lib -, stdenv -, writeText -, coreinfoConfig ? {} -}: +{ coreboot, lib, stdenv, writeText, coreinfoConfig ? { } }: stdenv.mkDerivation rec { pname = "coreboot-payload-coreinfo"; diff --git a/pkgs/coreboot-payload-grub2/default.nix b/pkgs/coreboot-payload-grub2/default.nix index c01d4065ecfe..120afaa12036 100644 --- a/pkgs/coreboot-payload-grub2/default.nix +++ b/pkgs/coreboot-payload-grub2/default.nix @@ -1,11 +1,22 @@ -{ grub2 -, lib -, extraPayloadModules ? [ "png" "gfxmenu" "gfxterm_background" "ls" "cat" "echo" "linux" "xfs" "bsd" ] -}: +{ grub2, lib, extraPayloadModules ? [ + "png" + "gfxmenu" + "gfxterm_background" + "ls" + "cat" + "echo" + "linux" + "xfs" + "bsd" +] }: grub2.overrideAttrs (oA: { pname = "coreboot-payload-${oA.pname}"; - configureFlags = oA.configureFlags ++ [ "--with-platform=coreboot" "--enable-boot-time" ]; - postBuild = "make -j $NIX_BUILD_CORES default_payload.elf EXTRA_PAYLOAD_MODULES=\"${lib.concatStringsSep " " extraPayloadModules}\""; + configureFlags = oA.configureFlags + ++ [ "--with-platform=coreboot" "--enable-boot-time" ]; + postBuild = '' + make -j $NIX_BUILD_CORES default_payload.elf EXTRA_PAYLOAD_MODULES="${ + lib.concatStringsSep " " extraPayloadModules + }"''; installPhase = "install -D default_payload.elf -t $out"; }) diff --git a/pkgs/coreboot-payload-nvramcui/default.nix b/pkgs/coreboot-payload-nvramcui/default.nix index 418f809960d7..2c9ddb36286b 100644 --- a/pkgs/coreboot-payload-nvramcui/default.nix +++ b/pkgs/coreboot-payload-nvramcui/default.nix @@ -1,6 +1,4 @@ -{ coreboot -, stdenv -}: +{ coreboot, stdenv }: stdenv.mkDerivation rec { pname = "coreboot-payload-nvramcui"; diff --git a/pkgs/coreboot-payload-seabios/default.nix b/pkgs/coreboot-payload-seabios/default.nix index f2b1ee3b6021..72a104e1b046 100644 --- a/pkgs/coreboot-payload-seabios/default.nix +++ b/pkgs/coreboot-payload-seabios/default.nix @@ -1,9 +1,8 @@ -{ seabios -, coreboot -, stdenv -, fetchurl -, seabiosConfig ? { CONFIG_COREBOOT = "y"; CONFIG_VGA_COREBOOT = "y"; CONFIG_BUILD_VGABIOS = "y"; } -}: +{ seabios, coreboot, stdenv, fetchurl, seabiosConfig ? { + CONFIG_COREBOOT = "y"; + CONFIG_VGA_COREBOOT = "y"; + CONFIG_BUILD_VGABIOS = "y"; +} }: seabios.overrideAttrs (oA: rec { pname = "coreboot-payload-seabios"; diff --git a/pkgs/coreboot-payload-tianocore/default.nix b/pkgs/coreboot-payload-tianocore/default.nix index 07e90a97d984..5c3e5362462f 100644 --- a/pkgs/coreboot-payload-tianocore/default.nix +++ b/pkgs/coreboot-payload-tianocore/default.nix @@ -1,12 +1,4 @@ -{ fetchFromGitHub -, python2 -, stdenv -, libuuid -, bc -, utillinux -, nasm -, iasl -, seabios +{ fetchFromGitHub, python2, stdenv, libuuid, bc, utillinux, nasm, iasl, seabios }: # we can not override the source in edk2, so we had to copy the entire thing @@ -22,7 +14,7 @@ let version = "unstable"; - pythonEnv = python2.withPackages (ps: [ps.tkinter]); + pythonEnv = python2.withPackages (ps: [ ps.tkinter ]); toolchain = stdenv.mkDerivation { pname = "edk2-coreboot"; @@ -46,42 +38,41 @@ let enableParallelBuilding = true; }; -in - stdenv.mkDerivation { - pname = "coreboot-payload-tianocore"; - inherit version src; +in stdenv.mkDerivation { + pname = "coreboot-payload-tianocore"; + inherit version src; - buildInputs = [ bc pythonEnv utillinux nasm iasl ]; + buildInputs = [ bc pythonEnv utillinux nasm iasl ]; - prePatch = '' - rm -rf BaseTools - ln -sv ${toolchain}/BaseTools BaseTools - ''; + prePatch = '' + rm -rf BaseTools + ln -sv ${toolchain}/BaseTools BaseTools + ''; - configurePhase = '' - runHook preConfigure - export WORKSPACE="$PWD" - . ${toolchain}/edksetup.sh BaseTools - runHook postConfigure - ''; + configurePhase = '' + runHook preConfigure + export WORKSPACE="$PWD" + . ${toolchain}/edksetup.sh BaseTools + runHook postConfigure + ''; - buildPhase = '' - runHook preBuild - build -a X64 -a IA32 -b RELEASE -t GCC5 -p CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc -n $NIX_BUILD_CORES -D CSM_ENABLE - runHook postBuild - ''; + buildPhase = '' + runHook preBuild + build -a X64 -a IA32 -b RELEASE -t GCC5 -p CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc -n $NIX_BUILD_CORES -D CSM_ENABLE + runHook postBuild + ''; - installPhase = '' - runHook preInstall - mv -v Build/*/* $out - runHook postInstall - ''; + installPhase = '' + runHook preInstall + mv -v Build/*/* $out + runHook postInstall + ''; - hardeningDisable = [ "format" "stackprotector" "pic" "fortify" ]; + hardeningDisable = [ "format" "stackprotector" "pic" "fortify" ]; - postPatch = '' - cp ${seabios}/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin - ''; + postPatch = '' + cp ${seabios}/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin + ''; - dontPatchELF = true; - } + dontPatchELF = true; +} diff --git a/pkgs/coreboot-payload-tint/default.nix b/pkgs/coreboot-payload-tint/default.nix index a410a46a254d..b953c773336d 100644 --- a/pkgs/coreboot-payload-tint/default.nix +++ b/pkgs/coreboot-payload-tint/default.nix @@ -1,7 +1,4 @@ -{ coreboot -, stdenv -, fetchurl -}: +{ coreboot, stdenv, fetchurl }: # the original tint does not support building as a coreboot payload # the patches from the coreboot repo require building tint in-tree @@ -14,10 +11,13 @@ stdenv.mkDerivation rec { preConfigure = "cd payloads/external/tint"; preBuild = '' - tar -xf ${fetchurl { - url = "https://mirror.fsf.org/trisquel/pool/main/t/tint/tint_${version}.tar.gz"; - sha256 = "17gbga1lha9yp5hpyr5vn1sc93fx413cksxmpyl8zv3b5rjvzsy1"; - }} + tar -xf ${ + fetchurl { + url = + "https://mirror.fsf.org/trisquel/pool/main/t/tint/tint_${version}.tar.gz"; + sha256 = "17gbga1lha9yp5hpyr5vn1sc93fx413cksxmpyl8zv3b5rjvzsy1"; + } + } mv tint{-${version},} ''; installPhase = "install -D tint/tint.elf -t $out"; 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; }; } diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 37af2f9e81ce..f997739f2b7a 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -1,15 +1,15 @@ final: prev: let inherit (final) callPackage; in { - coreboot = callPackage ./coreboot {}; + coreboot = callPackage ./coreboot { }; # primary payloads - coreboot-payload-grub2 = callPackage ./coreboot-payload-grub2 {}; - coreboot-payload-tianocore = callPackage ./coreboot-payload-tianocore {}; - coreboot-payload-seabios = callPackage ./coreboot-payload-seabios {}; + coreboot-payload-grub2 = callPackage ./coreboot-payload-grub2 { }; + coreboot-payload-tianocore = callPackage ./coreboot-payload-tianocore { }; + coreboot-payload-seabios = callPackage ./coreboot-payload-seabios { }; # secondary payloads - coreboot-payload-nvramcui = callPackage ./coreboot-payload-nvramcui {}; - coreboot-payload-tint = callPackage ./coreboot-payload-tint {}; - coreboot-payload-coreinfo = callPackage ./coreboot-payload-coreinfo {}; + coreboot-payload-nvramcui = callPackage ./coreboot-payload-nvramcui { }; + coreboot-payload-tint = callPackage ./coreboot-payload-tint { }; + coreboot-payload-coreinfo = callPackage ./coreboot-payload-coreinfo { }; } |