Files
nix-config/systems/x86_64-linux/nuc-nixos/default.nix
mjallen18 aa7fc9c228 rpi lin
2026-02-03 10:21:00 -06:00

127 lines
3.3 KiB
Nix

{
pkgs,
namespace,
...
}:
{
# imports = [ ./hardware-configuration.nix ];
${namespace} = {
# ###################################################
# # Boot # #
# ###################################################
bootloader.lanzaboote.enable = true;
# ###################################################
# # Hardware # #
# ###################################################
hardware.disko = {
enable = true;
enableLuks = true;
filesystem = "btrfs";
# rootDisk = "/dev/loop0";
};
headless.enable = true;
# ###################################################
# # Impermanence # #
# ###################################################
impermanence = {
enable = true;
extraDirectories = [
"/var/lib/homeassistant"
"/var/lib/mosquitto"
"/var/lib/music-assistant"
"/var/lib/postgresql"
"/var/lib/zigbee2mqtt"
];
};
# ###################################################
# # Network # #
# ###################################################
network = {
hostName = "nuc-nixos";
ipv4 = {
method = "manual";
address = "10.0.1.4/24";
gateway = "10.0.1.1";
dns = "10.0.1.1";
interface = "wlp1s0";
};
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [
8192
8880
8881
];
allowedUDPPorts = [
8192
8880
8881
];
};
};
# ###################################################
# # Security # #
# ###################################################
security.tpm.enable = true;
# ###################################################
# # Services # #
# ###################################################
services = {
home-assistant = {
enable = true;
automation = {
lightswitch = {
living-room-lights = {
id = 1741726347213;
alias = "Living Room Light Switch";
mqttDeviceId = "c90174f076a500c6fd531ecd7e5e259b";
lightEntityId = "light.living_room_lights";
};
bedroom-lights = {
id = 1741726231261;
alias = "Bedroom Light Switch";
mqttDeviceId = "7578af456fc02ac36bf3c4e414ac0bd9";
lightEntityId = "light.bedroom_lights";
};
};
};
};
otbr = {
enable = true;
restPort = 8881;
port = 8880;
};
};
# ###################################################
# # User # #
# ###################################################
user = {
name = "admin";
linger = true;
};
};
# ###################################################
# # Boot # #
# ###################################################
boot.kernelPackages = pkgs.${namespace}.linuxPackages_cachyos-server-lto;
fileSystems."/etc".neededForBoot = true;
}