* Fix nixos-option.
svn path=/nixos/trunk/; revision=33031
This commit is contained in:
parent
f2870ea7b5
commit
b4d16ef07e
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
: ${mountPoint=/mnt}
|
: ${mountPoint=/mnt}
|
||||||
: ${NIXOS_CONFIG=/etc/nixos/configuration.nix}
|
: ${NIXOS_CONFIG=/etc/nixos/configuration.nix}
|
||||||
|
export NIXOS_CONFIG
|
||||||
|
|
||||||
usage () {
|
usage () {
|
||||||
echo 1>&2 "
|
echo 1>&2 "
|
||||||
@ -143,7 +144,7 @@ evalAttr(){
|
|||||||
local prefix=$1
|
local prefix=$1
|
||||||
local suffix=$2
|
local suffix=$2
|
||||||
local strict=$3
|
local strict=$3
|
||||||
echo "(import $NIXOS {}).$prefix${option:+.$option}${suffix:+.$suffix}" |
|
echo "(import <nixos> {}).$prefix${option:+.$option}${suffix:+.$suffix}" |
|
||||||
evalNix ${strict:+--strict}
|
evalNix ${strict:+--strict}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +158,7 @@ evalCfg(){
|
|||||||
|
|
||||||
findSources(){
|
findSources(){
|
||||||
local suffix=$1
|
local suffix=$1
|
||||||
echo "builtins.map (f: f.source) (import $NIXOS {}).eval.options${option:+.$option}.$suffix" |
|
echo "builtins.map (f: f.source) (import <nixos> {}).eval.options${option:+.$option}.$suffix" |
|
||||||
evalNix --strict
|
evalNix --strict
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +186,7 @@ nixMap() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if $install; then
|
if $install; then
|
||||||
export NIXOS_CONFIG="$mountPoint$NIXOS_CONFIG"
|
NIXOS_CONFIG="$mountPoint$NIXOS_CONFIG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $generate; then
|
if $generate; then
|
||||||
@ -307,8 +308,8 @@ if $xml; then
|
|||||||
evalNix --xml --no-location <<EOF
|
evalNix --xml --no-location <<EOF
|
||||||
let
|
let
|
||||||
reach = attrs: attrs${option:+.$option};
|
reach = attrs: attrs${option:+.$option};
|
||||||
nixos = <nixos>;
|
nixos = import <nixos> {};
|
||||||
nixpkgs = <nixpkgs>;
|
nixpkgs = import <nixpkgs> {};
|
||||||
sources = builtins.map (f: f.source);
|
sources = builtins.map (f: f.source);
|
||||||
opt = reach nixos.eval.options;
|
opt = reach nixos.eval.options;
|
||||||
cfg = reach nixos.config;
|
cfg = reach nixos.config;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user