Initial commit
This commit is contained in:
commit
32849cc5d2
44 changed files with 3811 additions and 0 deletions
23
modules/virtualisation/containers/default.nix
Normal file
23
modules/virtualisation/containers/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homelab.virtualisation.containers;
|
||||
in {
|
||||
options.homelab.virtualisation.containers.enable = lib.mkEnableOption "OCI containers";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
nfs-utils
|
||||
];
|
||||
|
||||
virtualisation = {
|
||||
docker = {
|
||||
enable = true;
|
||||
enableOnBoot = true;
|
||||
autoPrune.enable = true;
|
||||
};
|
||||
|
||||
oci-containers.backend = "docker";
|
||||
};
|
||||
};
|
||||
}
|
||||
6
modules/virtualisation/default.nix
Normal file
6
modules/virtualisation/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./containers
|
||||
./guest
|
||||
];
|
||||
}
|
||||
34
modules/virtualisation/guest/default.nix
Normal file
34
modules/virtualisation/guest/default.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config, lib, modulesPath, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homelab.virtualisation.guest;
|
||||
in {
|
||||
options.homelab.virtualisation.guest.enable = lib.mkEnableOption "Settings for devices running on virtualisation, e.g. Proxmox";
|
||||
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
boot = {
|
||||
# Whether to enable growing the root partition on boot.
|
||||
growPartition = true;
|
||||
# Use Grub bootloader
|
||||
loader.grub = {
|
||||
enable = true;
|
||||
devices = [
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/" = lib.mkDefault {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
autoResize = true;
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# Enable QEMU Guest for Proxmox
|
||||
services.qemuGuest.enable = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue