summary refs log tree commit diff
path: root/default.nix
blob: 17a417306b2298d3845f424245b1bb8f36e40974 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
let

  fromEnv = name: default:
    let env = builtins.getEnv name; in
    if env == "" then default else env;
    
  configuration = import (fromEnv "NIXOS_CONFIG" /etc/nixos/configuration.nix);
  
  nixpkgs = fromEnv "NIXPKGS" /etc/nixos/nixpkgs;

  pkgs = import nixpkgs {system = builtins.currentSystem;};

  inherit
    (import ./lib/eval-config.nix {inherit configuration pkgs;})
    config optionDeclarations;

in

{
  # Optionally check wether all config values have corresponding
  # option declarations.
  system = pkgs.checker config.system.build.system
    config.environment.checkConfigurationOptions
    optionDeclarations config;

  # The following are used by nixos-rebuild.
  nixFallback = pkgs.nixUnstable;
  manifests = config.installer.manifests;

  tests = config.tests;
}