88 lines
2.2 KiB
Nix
88 lines
2.2 KiB
Nix
{ config, lib, pkgs, inputs, ... }:
|
|
|
|
{
|
|
# Setup hardware
|
|
imports = [ inputs.nixos-hardware.nixosModules.raspberry-pi-4 ];
|
|
fileSystems = {
|
|
"/" = {
|
|
device = "/dev/disk/by-label/NIXOS_SD";
|
|
fsType = "ext4";
|
|
options = [ "noatime" ];
|
|
};
|
|
};
|
|
# Sops setup for this machine
|
|
sops.secrets = {
|
|
# "borg-ssh-key" = {
|
|
# sopsFile = ../../secrets/tounge/borg.yaml;
|
|
# format = "yaml";
|
|
# };
|
|
# "borg-password" = {
|
|
# sopsFile = ../../secrets/tounge/borg.yaml;
|
|
# format = "yaml";
|
|
# };
|
|
"wifi" = {
|
|
sopsFile = ../../secrets/universe/wifi;
|
|
format = "binary";
|
|
};
|
|
};
|
|
# Setup system configuration
|
|
nathan = {
|
|
services = {
|
|
borg = {
|
|
enable = false;
|
|
extraExcludes = [ "/var/lib/docker" "/var/log" ];
|
|
passwordFile = config.sops.secrets."borg-password".path;
|
|
sshKey = config.sops.secrets."borg-ssh-key".path;
|
|
};
|
|
};
|
|
config = {
|
|
setupGrub = false;
|
|
userUid = "1001";
|
|
nix = {
|
|
autoUpdate = false;
|
|
autoGC = true;
|
|
};
|
|
harden = false;
|
|
};
|
|
};
|
|
# Use just normal ass linux, without zfs
|
|
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_4;
|
|
boot.supportedFilesystems =
|
|
lib.mkForce [ "btrfs" "cifs" "f2fs" "jfs" "ntfs" "vfat" "xfs" ];
|
|
# Configure networking
|
|
networking = {
|
|
domain = "mccarty.io";
|
|
useDHCP = true;
|
|
wireless = {
|
|
environmentFile = config.sops.secrets."wifi".path;
|
|
networks = { "Apollo" = { psk = "@PSK_WIFI@"; }; };
|
|
enable = true;
|
|
interfaces = [ "wlan0" ];
|
|
};
|
|
# Open ports in firewall
|
|
firewall = {
|
|
allowedTCPPorts = [ ];
|
|
allowedUDPPorts = [ ];
|
|
};
|
|
};
|
|
|
|
# Setup home manager
|
|
home-manager.users.nathan = import ./home.nix;
|
|
|
|
# Containers
|
|
virtualisation.oci-containers.containers = {
|
|
# Octoprint
|
|
"octoprint" = {
|
|
image = "octoprint/octoprint";
|
|
environment = { "ENABLE_MJPG_STREAMER" = "true"; };
|
|
ports = [ "80:80" ];
|
|
volumes = [ "/var/octoprint:/octoprint" ];
|
|
extraOptions = [
|
|
"--device=/dev/video0:/dev/video0"
|
|
"--device=/dev/video1:/dev/video1"
|
|
"--device=/dev/ttyUSB0:/dev/ttyUSB0"
|
|
];
|
|
};
|
|
};
|
|
}
|