network/nix/nixos-module/default.nix

23 lines
379 B
Nix

{ config, lib, ... }:
let
inherit (config.networking) hostName;
inherit (lib) optional;
startsWith = prefix: s:
builtins.substr 0 (builtins.stringLength prefix) s == prefix;
isServer = startsWith "server" hostName;
in
{
imports = [
./defaults.nix
]
++ optional isServer [
./lxc-containers.nix
]
++ optional !isServer [
./container.nix
];
}