nixos/configuration.nix

21 lines
612 B
Nix

{ lib, ... }:
with lib;
let
# hostName can be set with -I hostName=$HOSTNAME, defaults to the contents of /secret/hostName
hostName = (findFirst (elem: elem.prefix == "hostName") { path = (fileContents /secret/hostName); } builtins.nixPath).path;
machinePath = (builtins.toPath ( ./machines + ("/" + hostName)));
machineConf = machinePath + "/configuration.nix";
machineOpts = machinePath + "/options.nix";
in {
imports = [
machineConf
machineOpts
./config/default.nix
./pkgs/nixpkgs.nix
./pkgs/systemPackages.nix
./services/containers.nix
./services/default.nix
];
}