From da0db450e3e89fb8e3e1404b740c40e8b4380d48 Mon Sep 17 00:00:00 2001 From: IceDBorn Date: Thu, 5 Mar 2026 13:48:49 +0200 Subject: [PATCH] fix(build): export full config flag resulting in error --- build.sh | 14 ++++++++------ flake.nix | 7 ++++++- lib/genflake.nix | 24 ++++++++---------------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/build.sh b/build.sh index bad2e563..48d15f29 100644 --- a/build.sh +++ b/build.sh @@ -7,7 +7,6 @@ CONFIG="$ICEDOS_DIR/configuration-location" FLAKE="flake.nix" cd "$(dirname "$(readlink -f "$0")")" -FLAKE="flake.nix" action="switch" globalBuildArgs=() @@ -119,11 +118,14 @@ ICEDOS_STAGE="genflake" nix eval $trace --file "$ICEDOS_ROOT/lib/genflake.nix" - nixfmt "$ICEDOS_STATE_DIR/$FLAKE" if [ "$export_full_config" == "1" ]; then - ICEDOS_STAGE="genflake" nix eval $trace --file "$ICEDOS_ROOT/lib/genflake.nix" evaluatedConfig | nixfmt | jq -r . > .cache/full-config.json - jsonfmt .cache/full-config.json -w - - toml2json ./config.toml > .cache/config.json - jsonfmt .cache/config.json -w + ( + cd "$ICEDOS_STATE_DIR" + ICEDOS_STAGE="genflake" nix eval $trace --file "$ICEDOS_ROOT/lib/genflake.nix" evaluatedConfig | nixfmt | jq -r . > .cache/full-config.json + jsonfmt .cache/full-config.json -w + + toml2json "$ICEDOS_CONFIG_ROOT/config.toml" > .cache/config.json + jsonfmt .cache/config.json -w + ) exit 0 fi diff --git a/flake.nix b/flake.nix index 50c7dfd7..8dea3624 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,6 @@ isString pathExists readFile - throw ; isFlake = value: (value._type or null) == "flake"; @@ -47,11 +46,14 @@ inherit (pkgs) git + jq + jsonfmt lib nh nix nixfmt rsync + toml2json writeShellScript ; @@ -64,10 +66,13 @@ export PATH="${ makeBinPath [ git + jq + jsonfmt nh nix nixfmt rsync + toml2json ] }:$PATH" export ICEDOS_ROOT="${self}" diff --git a/lib/genflake.nix b/lib/genflake.nix index 08d8b1e9..6811f483 100644 --- a/lib/genflake.nix +++ b/lib/genflake.nix @@ -12,11 +12,9 @@ let concatStringsSep evalModules fileContents - foldl' listToAttrs optional pathExists - recursiveUpdate ; icedosLib = import ../lib { @@ -94,19 +92,13 @@ let toJSON (evalModules { modules = [ - { - config = icedos; - - options = - let - mergedOptions = - foldl' (acc: cur: recursiveUpdate acc cur.options) - (import ../modules/options.nix { inherit icedosLib lib; }).options - modulesFromConfig.options; - in - mergedOptions; - } - ]; + { config = { inherit icedos; }; } + (import ../modules/options.nix { + inherit icedosLib lib; + inputs.icedos-config = ICEDOS_CONFIG_ROOT; + }) + ] + ++ modulesFromConfig.options; }).config; in { @@ -134,7 +126,7 @@ in allowUnfree = true; permittedInsecurePackages = [ - ${concatMapStrings (pkg: ''"${pkg}"'') (icedos.applications.insecurePackages or [])} + ${concatMapStrings (pkg: ''"${pkg}"'') (icedos.applications.insecurePackages or [ ])} ]; }; };