summary refs log tree commit diff
path: root/default.nix
blob: df69ee4c3e2e114a2e67f856198fcf329a98c1a8 (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
32
33
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;

  nix = config.environment.nix;
  
  nixFallback = pkgs.nixUnstable;

  manifests = config.installer.manifests; # exported here because nixos-rebuild uses it

  tests = config.tests;
}