examples: add importable-configuration.nix

This replaces minimal-configuration.nix.
importable-configuration.nix can be directly added to an existing
NixOS configuration. This makes it easy for users to get started quickly.
This commit is contained in:
Erik Arvstedt
2021-09-23 16:51:34 +02:00
parent 020d9486dd
commit d713e7b15c
6 changed files with 81 additions and 35 deletions

View File

@@ -28,14 +28,14 @@ if [[ $EUID != 0 ]]; then
fi
interactive=
minimalConfig=
configuration=
for arg in "$@"; do
case $arg in
-i|--interactive)
interactive=1
;;
--minimal-config)
minimalConfig=1
*)
configuration=$arg
;;
esac
done
@@ -61,9 +61,7 @@ echo "Node info:"
c nodeinfo
'
if [[ $minimalConfig ]]; then
configuration=minimal-configuration.nix
else
if [[ ! $configuration ]]; then
configuration=configuration.nix
demoCmds="${demoCmds}${nodeInfoCmd}"
fi
@@ -84,7 +82,7 @@ read -d '' src <<EOF || true
extra.enableWAN = true;
config = { pkgs, config, lib, ... }: {
imports = [
<${configuration}>
$(realpath "$configuration")
];
nix-bitcoin.generateSecrets = true;
};