Started work on modularized machine config, does not quite work yet. Changed Ophanim's kernel to hardened.

This commit is contained in:
Kevin Baensch 2019-03-17 11:43:14 +01:00
parent 2efae4f888
commit a0f361425a
10 changed files with 162 additions and 63 deletions

View file

@ -1,13 +1,24 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = import ("/etc/nixos/machines/" + (builtins.replaceStrings ["\n"] [""] (builtins.readFile /etc/hostname)) + "/configuration.nix");
in {
# hint: use 'echo -n' so there is no newline char in the hostName file
cfgPath = (builtins.toPath ("/etc/nixos/machines/" + (builtins.readFile /secret/hostName) + "/configuration.nix"));
in rec {
imports = [
cfg.confPath
./config/default.nix
cfgPath
# use
# config.machine.confPath
# instead of
./machines/Lilim/Lilim.nix
# ./config/default.nix # same problem as above
./pkgs/nixpkgs.nix
./pkgs/pkgsets.nix
./services/default.nix
# ./services/default.nix # same problem as above
];
}