diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-08-31 09:37:24 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-09-10 15:25:37 +0000 |
commit | b508c467d0a54f1aa60c138acdc6677a8ba77abd (patch) | |
tree | a12a3f21cf7dcb88037850e84890b7f6337c6888 /host/initramfs | |
parent | 44d289986b1ef4d7a0c6655b97a487fb61b45534 (diff) | |
download | spectrum-b508c467d0a54f1aa60c138acdc6677a8ba77abd.tar spectrum-b508c467d0a54f1aa60c138acdc6677a8ba77abd.tar.gz spectrum-b508c467d0a54f1aa60c138acdc6677a8ba77abd.tar.bz2 spectrum-b508c467d0a54f1aa60c138acdc6677a8ba77abd.tar.lz spectrum-b508c467d0a54f1aa60c138acdc6677a8ba77abd.tar.xz spectrum-b508c467d0a54f1aa60c138acdc6677a8ba77abd.tar.zst spectrum-b508c467d0a54f1aa60c138acdc6677a8ba77abd.zip |
Introduce a build configuration file
By default, a file called "config.nix" in the root of the Spectrum repository will be read if it exists. That file should contain an attribute set. Currently, only a "pkgs" key is supported, which allows specifying a custom package set that will be used throughout the Spectrum Nix files. This will allow us to provide configuartion options for people who want to build Spectrum in ways that are probably not suitable for upstreaming. For example, using the "pkgs" config option I'm introducing here, it would be possible to use an overlay to patch individual components, like so: { pkgs = import <nixpkgs> { overlays = [ (final: super: { weston = super.weston.overrideAttrs ({ patches ? [], ... }: { patches = patches ++ [ path/to/weston.patch ]; }); }) ]; }; } Signed-off-by: Alyssa Ross <hi@alyssa.is> Message-Id: <20220831093727.282797-1-hi@alyssa.is> Reviewed-by: Ville Ilvonen <ville.ilvonen@unikie.com> Tested-by: José Pekkarinen <jose.pekkarinen@unikie.com>
Diffstat (limited to 'host/initramfs')
-rw-r--r-- | host/initramfs/default.nix | 7 | ||||
-rw-r--r-- | host/initramfs/extfs.nix | 8 | ||||
-rw-r--r-- | host/initramfs/shell.nix | 9 |
3 files changed, 12 insertions, 12 deletions
diff --git a/host/initramfs/default.nix b/host/initramfs/default.nix index 44932ad..e5ddeb9 100644 --- a/host/initramfs/default.nix +++ b/host/initramfs/default.nix @@ -1,11 +1,10 @@ # SPDX-FileCopyrightText: 2021-2022 Alyssa Ross <hi@alyssa.is> # SPDX-License-Identifier: MIT -{ pkgs ? import <nixpkgs> {} -, rootfs ? import ../rootfs { inherit pkgs; } +{ config ? import ../../nix/eval-config.nix {} +, rootfs ? import ../rootfs { inherit config; } }: - -pkgs.callPackage ( +let inherit (config) pkgs; in pkgs.callPackage ( { lib, stdenvNoCC, makeModulesClosure, runCommand, writeReferencesToFile , pkgsStatic, busybox, cpio, microcodeAmd, microcodeIntel }: diff --git a/host/initramfs/extfs.nix b/host/initramfs/extfs.nix index 9fdbd9a..63f436a 100644 --- a/host/initramfs/extfs.nix +++ b/host/initramfs/extfs.nix @@ -1,21 +1,21 @@ # SPDX-FileCopyrightText: 2021-2022 Alyssa Ross <hi@alyssa.is> # SPDX-License-Identifier: MIT -{ pkgs, runCommand, tar2ext4 }: +{ config, runCommand, tar2ext4 }: let netvm = import ../../vm/sys/net { - inherit pkgs; + inherit config; # inherit (foot) terminfo; }; appvm-catgirl = import ../../vm/app/catgirl { - inherit pkgs; + inherit config; # inherit (foot) terminfo; }; appvm-lynx = import ../../vm/app/lynx { - inherit pkgs; + inherit config; # inherit (foot) terminfo; }; in diff --git a/host/initramfs/shell.nix b/host/initramfs/shell.nix index 42da6a4..cbd2c60 100644 --- a/host/initramfs/shell.nix +++ b/host/initramfs/shell.nix @@ -1,16 +1,17 @@ # SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021-2022 Alyssa Ross <hi@alyssa.is> -{ pkgs ? import <nixpkgs> {} }: +{ config ? import ../../nix/eval-config.nix {} }: let + inherit (config) pkgs; inherit (pkgs.lib) cleanSource cleanSourceWith; extfs = pkgs.pkgsStatic.callPackage ./extfs.nix { - inherit pkgs; + inherit config; }; - rootfs = import ../rootfs { inherit pkgs; }; - initramfs = import ./. { inherit pkgs rootfs; }; + rootfs = import ../rootfs { inherit config; }; + initramfs = import ./. { inherit config rootfs; }; in with pkgs; |