nix/nixos-modules -> nix/nixos-module

This commit is contained in:
Astro 2021-03-19 22:55:48 +01:00
parent ce4bda8862
commit 1119f72162
4 changed files with 23 additions and 1 deletions

View File

@ -20,7 +20,7 @@
);
nixosModule = { ... }: {
imports = nixpkgs.lib.filesystem.listFilesRecursive ./nix/nixos-modules;
imports = [ ./nix/nixos-module ];
};
nixosConfigurations.test_vm =

View File

@ -0,0 +1,22 @@
{ 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
];
}