Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ CONFIG="$ICEDOS_DIR/configuration-location"
FLAKE="flake.nix"

cd "$(dirname "$(readlink -f "$0")")"
FLAKE="flake.nix"

action="switch"
globalBuildArgs=()
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
isString
pathExists
readFile
throw
;

isFlake = value: (value._type or null) == "flake";
Expand All @@ -47,11 +46,14 @@

inherit (pkgs)
git
jq
jsonfmt
lib
nh
nix
nixfmt
rsync
toml2json
writeShellScript
;

Expand All @@ -64,10 +66,13 @@
export PATH="${
makeBinPath [
git
jq
jsonfmt
nh
nix
nixfmt
rsync
toml2json
]
}:$PATH"
export ICEDOS_ROOT="${self}"
Expand Down
24 changes: 8 additions & 16 deletions lib/genflake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ let
concatStringsSep
evalModules
fileContents
foldl'
listToAttrs
optional
pathExists
recursiveUpdate
;

icedosLib = import ../lib {
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -134,7 +126,7 @@ in
allowUnfree = true;

permittedInsecurePackages = [
${concatMapStrings (pkg: ''"${pkg}"'') (icedos.applications.insecurePackages or [])}
${concatMapStrings (pkg: ''"${pkg}"'') (icedos.applications.insecurePackages or [ ])}
];
};
};
Expand Down