1
0
Fork 0
nixos/configuration.nix

28 lines
684 B
Nix
Raw Normal View History

{ lib, ... }:
2019-02-26 13:44:40 +01:00
2020-03-28 20:03:48 +01:00
with builtins;
with lib;
2019-02-26 13:44:40 +01:00
let
2020-03-28 20:03:48 +01:00
fn = import ./fn.nix { inherit lib; };
# hostName can be set with -I hostName=$HOSTNAME, defaults to the contents of /secret/hostName
2020-03-28 20:03:48 +01:00
hostName = let
hostVal = (tryEval <hostName>).value;
in fn.ifelse (hostVal != false)
hostVal
(fileContents /secret/hostName);
machinePath = (builtins.toPath ( ./machines + ("/" + hostName)));
machineConf = machinePath + "/configuration.nix";
machineOpts = machinePath + "/options.nix";
in {
2019-02-26 13:44:40 +01:00
imports = [
machineConf
machineOpts
./config/default.nix
2019-02-26 13:44:40 +01:00
./pkgs/nixpkgs.nix
./pkgs/systemPackages.nix
./services/containers.nix
./services/default.nix
2019-02-26 13:44:40 +01:00
];
}