chore: split nixos and opentofu
This commit is contained in:
parent
d125848b82
commit
06500a8f01
68 changed files with 44 additions and 61 deletions
119
nixos/hosts/Niko/default.nix
Normal file
119
nixos/hosts/Niko/default.nix
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
homelab = {
|
||||
apps = {
|
||||
technitiumDNS.enable = true;
|
||||
traefik.enable = true;
|
||||
};
|
||||
users.deploy.enable = true;
|
||||
};
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot/efi";
|
||||
};
|
||||
};
|
||||
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "us";
|
||||
};
|
||||
|
||||
# List packages installed in the system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
cifs-utils
|
||||
];
|
||||
|
||||
hardware = {
|
||||
enableRedistributableFirmware = true;
|
||||
enableAllFirmware = true;
|
||||
graphics.enable = true;
|
||||
};
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
|
||||
networking = {
|
||||
hostName = "Niko";
|
||||
domain = "depeuter.dev";
|
||||
|
||||
enableIPv6 = true;
|
||||
|
||||
# Open ports in the firewall.
|
||||
firewall = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
networkmanager.enable = true;
|
||||
|
||||
extraHosts = ''
|
||||
192.168.0.11 jelly.depeuter.dev
|
||||
'';
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# List services that you want to enable:
|
||||
services = {
|
||||
# Cage, a wayland kiosk service
|
||||
cage = {
|
||||
enable = true;
|
||||
environment = {
|
||||
# Do not fail when there are no input devices.
|
||||
# WLR_LIBINPUT_NO_DEVICES = "1";
|
||||
};
|
||||
extraArguments = [
|
||||
"-d" # Don't draw client side decorations, when possible
|
||||
# "-m" "last" # Use only the last connected output
|
||||
"-s" # Allow VT switching
|
||||
];
|
||||
program = "/home/jellyfin-mpv-shim/start.sh";
|
||||
user = config.users.users.jellyfin-mpv-shim.name;
|
||||
};
|
||||
|
||||
pulseaudio.enable = true;
|
||||
|
||||
tailscale = {
|
||||
enable = true;
|
||||
useRoutingFeatures = "server";
|
||||
authKeyFile = "/etc/nixos/tailscale-authkey";
|
||||
extraUpFlags = [
|
||||
"--advertise-routes=192.168.0.0/24"
|
||||
"--exit-node"
|
||||
];
|
||||
};
|
||||
|
||||
# Fix DNS issues. See:
|
||||
# https://github.com/tailscale/tailscale/issues/4254
|
||||
# resolved.enable = true;
|
||||
};
|
||||
|
||||
# Define a user account. Don't forget to set a password with 'passwd'.
|
||||
users.users.jellyfin-mpv-shim = {
|
||||
description = "Jellyfin MPV Shim User";
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
config.users.groups.audio.name
|
||||
config.users.groups.video.name
|
||||
];
|
||||
packages = with pkgs; [
|
||||
jellyfin-mpv-shim
|
||||
mpv
|
||||
socat
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services."cage-tty1".serviceConfig.Restart = "always";
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
53
nixos/hosts/Niko/hardware-configuration.nix
Normal file
53
nixos/hosts/Niko/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot = {
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
};
|
||||
kernelModules = [ ];
|
||||
extraModulePackages = [ ];
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/20b7eff3-fca5-4b60-a5a9-13219f70ce23";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
"/boot/efi" = {
|
||||
device = "/dev/disk/by-uuid/0B6D-0DCD";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
"/media/photos" = {
|
||||
device = "//192.168.0.11/CANVAS";
|
||||
fsType = "cifs";
|
||||
options = let
|
||||
# This line prevents hanging on network split
|
||||
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,user,users";
|
||||
in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1002,gid=100"];
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/f3679da0-45b3-45c0-a1d0-af8d771a7dbf"; }
|
||||
];
|
||||
|
||||
networking = {
|
||||
hostId = "7a139e16";
|
||||
useDHCP = lib.mkDefault true;
|
||||
};
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue