System/machines/universe/configuration.nix

88 lines
2.2 KiB
Nix
Raw Normal View History

2023-08-05 13:37:03 -04:00
{ 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 = true;
autoGC = true;
};
harden = false;
};
};
2023-08-05 14:20:39 -04:00
# Use just normal ass linux, without zfs
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_3;
boot.supportedFilesystems =
lib.mkForce [ "btrfs" "cifs" "f2fs" "jfs" "ntfs" "vfat" "xfs" ];
2023-08-05 13:37:03 -04:00
# Configure networking
networking = {
domain = "mccarty.io";
useDHCP = true;
wireless = {
environmentFile = config.sops.secrets."wifi".path;
networks = { "Apollo" = { psk = "@PSK_WIFI@"; }; };
2023-08-05 15:14:34 -04:00
enable = true;
interfaces = [ "wlan0" ];
2023-08-05 13:37:03 -04:00
};
# Open ports in firewall
firewall = {
allowedTCPPorts = [ ];
allowedUDPPorts = [ ];
};
};
# Setup home manager
home-manager.users.nathan = import ./home.nix;
2023-08-05 16:19:58 -04:00
# 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"
];
};
};
2023-08-05 13:37:03 -04:00
}