feat: port Phase 1 foundational modules and setup comin in flake.nix

This commit is contained in:
Tibo De Peuter 2026-07-17 22:05:43 +02:00
parent 647ccfd6e2
commit 17de32268d
Signed by: tdpeuter
SSH key fingerprint: SHA256:u/h/LVoqKF1Iz02uOyxe6hcjmoZASCGV2HM0TG9ZMoU
9 changed files with 196 additions and 0 deletions

View file

@ -0,0 +1,16 @@
{
config = {
homelab = {
services.openssh.enable = true;
users.admin.enable = true;
};
nix.settings.experimental-features = [
"flakes"
"nix-command"
];
# Set your time zone.
time.timeZone = "Europe/Brussels";
};
}

7
modules/default.nix Normal file
View file

@ -0,0 +1,7 @@
{
imports = [
./common
./services
./virtualisation
];
}

View file

@ -0,0 +1,5 @@
{
imports = [
./openssh
];
}

View file

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
let
cfg = config.homelab.services.openssh;
in {
options.homelab.services.openssh.enable = lib.mkEnableOption "OpenSSH daemon";
config = lib.mkIf cfg.enable {
services.openssh = {
# Enable the OpenSSH daemon.
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
# Disable keyboard-interactive authentication.
KbdInteractiveAuthentication = false;
};
};
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./guest
];
}

View 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;
};
}