nix-config/hosts/server7/containers/default.nix

32 lines
695 B
Nix
Raw Normal View History

2019-12-09 22:52:53 +01:00
{ lib, ... }:
2019-11-28 11:38:03 +01:00
let
yggaddr = import ../yggaddr.nix;
containerFunc = name:
# Generate a container expression from the directory at `name`.
{
2019-11-28 11:38:03 +01:00
inherit name;
value = import (./. + "/${name}") name;
2019-11-28 11:38:03 +01:00
};
containerDir = builtins.readDir ../containers;
containerSubdirs =
lib.filterAttrs (_: kind: kind == "directory") containerDir;
containerNames = builtins.attrNames containerSubdirs;
containers = builtins.listToAttrs (map containerFunc containerNames);
in {
boot.enableContainers = true;
inherit containers;
2019-12-01 00:39:16 +01:00
imports = [ ../../../lib/lxc ];
lxc.containers = {
trivial = {
nixos-config = "/tmp/trivial.nix";
lxc = { };
2019-12-01 00:39:16 +01:00
};
};
2019-11-28 11:38:03 +01:00
}