add lxc template generator

This commit is contained in:
Vivian 2022-10-15 13:44:27 +02:00
parent 78370fb23b
commit 919ab390de
5 changed files with 68 additions and 40 deletions

View file

@ -1,4 +1,5 @@
{ lib, ... }: {
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.

17
nixos/lxc-template.nix Normal file
View file

@ -0,0 +1,17 @@
{ config, pkgs, lib, ... }: {
# Can't import common completely due to infinite recursion
imports = [ ./common/users ./common/generic-lxc.nix ];
# Enable SSH
services.openssh = {
enable = true;
passwordAuthentication = false;
permitRootLogin = "yes";
};
time.timeZone = lib.mkDefault "Europe/Amsterdam";
networking.interfaces.eth0.useDHCP = true;
system.stateVersion = "22.11";
}

View file

@ -1,7 +1,6 @@
{ nixpkgs, home-manager, hyprland, mailserver, ... }:
let
inherit (nixpkgs) lib;
inherit (builtins) filter mapAttrs attrValues concatLists;
inherit (builtins) filter attrValues concatLists;
# Helper function to resolve what should be imported depending on the type of config (lxc, vm, bare metal)
resolve_imports =