added capybara

+52 -1
flake.lock
···
"type": "github"
}
},
+
"flake-compat_4": {
+
"locked": {
+
"lastModified": 1696426674,
+
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
+
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
+
"revCount": 57,
+
"type": "tarball",
+
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
+
},
+
"original": {
+
"type": "tarball",
+
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
+
}
+
},
"flake-utils": {
"locked": {
"lastModified": 1676283394,
···
"type": "github"
}
},
+
"nix-rpi5": {
+
"inputs": {
+
"flake-compat": "flake-compat_4",
+
"nixpkgs": "nixpkgs_3"
+
},
+
"locked": {
+
"lastModified": 1704485878,
+
"narHash": "sha256-i7UH31IZyil99EUB5qnQJAiszFkea1B1yZf5pQEDIYg=",
+
"owner": "vriska",
+
"repo": "nix-rpi5",
+
"rev": "ac9942532e1dc2f825ad2aa3a6d31bfbd3b42eed",
+
"type": "gitlab"
+
},
+
"original": {
+
"owner": "vriska",
+
"ref": "main",
+
"repo": "nix-rpi5",
+
"type": "gitlab"
+
}
+
},
"nixlib": {
"locked": {
"lastModified": 1643502816,
···
}
},
"nixpkgs_3": {
+
"locked": {
+
"lastModified": 1703013332,
+
"narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=",
+
"owner": "nixos",
+
"repo": "nixpkgs",
+
"rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nixos",
+
"ref": "nixos-unstable",
+
"repo": "nixpkgs",
+
"type": "github"
+
}
+
},
+
"nixpkgs_4": {
"locked": {
"lastModified": 1710162809,
"narHash": "sha256-i2R2bcnQp+85de67yjgZVvJhd6rRnJbSYNpGmB6Leb8=",
···
"matrix-appservices": "matrix-appservices",
"neovim": "neovim",
"nix-on-droid": "nix-on-droid",
+
"nix-rpi5": "nix-rpi5",
"nixos-hardware": "nixos-hardware",
-
"nixpkgs": "nixpkgs_3",
+
"nixpkgs": "nixpkgs_4",
"nixpkgs-compat": "nixpkgs-compat",
"nixpkgs-unstable": "nixpkgs-unstable",
"ryan-cv": "ryan-cv",
+1
flake.nix
···
i3-workspace-history.url = "github:RyanGibb/i3-workspace-history";
hyperbib-eeg.url = "github:RyanGibb/hyperbib?ref=nixify";
neovim.url = "github:neovim/neovim/f40df63bdca33d343cada6ceaafbc8b765ed7cc6?dir=contrib";
+
nix-rpi5.url = "gitlab:vriska/nix-rpi5?ref=main";
# deduplicate flake inputs
eilean.inputs.nixpkgs.follows = "nixpkgs";
+36
hardware-configuration.nix
···
+
# Do not modify this file! It was generated by ‘nixos-generate-config’
+
# and may be overwritten by future invocations. Please make changes
+
# to /etc/nixos/configuration.nix instead.
+
{ config, lib, pkgs, modulesPath, ... }:
+
+
{
+
imports =
+
[ (modulesPath + "/installer/scan/not-detected.nix")
+
];
+
+
boot.initrd.availableKernelModules = [ "usbhid" "usb_storage" ];
+
boot.initrd.kernelModules = [ ];
+
boot.kernelModules = [ ];
+
boot.extraModulePackages = [ ];
+
+
fileSystems."/" =
+
{ device = "/dev/disk/by-uuid/4cef5b18-2c69-4f92-835d-52ac0b96256c";
+
fsType = "ext4";
+
};
+
+
fileSystems."/boot" =
+
{ device = "/dev/disk/by-uuid/63BC-60B5";
+
fsType = "vfat";
+
};
+
+
swapDevices = [ ];
+
+
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
+
# (the default) this is the recommended approach. When using systemd-networkd it's
+
# still possible to use this option, but it's recommended to use it in conjunction
+
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
+
networking.useDHCP = lib.mkDefault true;
+
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
+
+
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
+
}
+92
hosts/capybara/default.nix
···
+
{ config, pkgs, lib, nix-rpi5, ... }:
+
+
{
+
imports = [
+
./hardware-configuration.nix
+
];
+
+
personal = {
+
enable = true;
+
tailscale = true;
+
machineColour = "red";
+
};
+
+
networking.networkmanager.enable = true;
+
+
boot.kernelPackages = nix-rpi5.legacyPackages.aarch64-linux.linuxPackages_rpi5;
+
+
networking.firewall.enable = false;
+
networking.firewall.allowedTCPPorts = [ 44 ];
+
+
services.caddy = {
+
enable = true;
+
virtualHosts."http://capybara" = {
+
extraConfig = "reverse_proxy http://127.0.0.1:15606";
+
};
+
virtualHosts."http://capybara.fn06.org" = {
+
extraConfig = "reverse_proxy http://127.0.0.1:15606";
+
};
+
virtualHosts."http://128.232.86.23" = {
+
extraConfig = "reverse_proxy http://127.0.0.1:15606";
+
};
+
};
+
+
services.zigbee2mqtt = {
+
enable = true;
+
settings = {
+
permit_join = true;
+
mqtt = {
+
server = "mqtt://capybara:1883";
+
user = "zigbee2mqtt";
+
password = "test";
+
};
+
serial = {
+
port = "/dev/ttyUSB0";
+
};
+
frontend = {
+
port = 15606;
+
};
+
homeassistant = true;
+
advanced = {
+
channel = 15;
+
};
+
};
+
};
+
+
services.mosquitto = {
+
enable = true;
+
listeners = [
+
{
+
users = {
+
zigbee2mqtt = {
+
acl = [ "readwrite #" ];
+
hashedPassword = "$6$nuDIW/ZPVsrDHyBe$JffJJvvMG+nH8GH9V5h4FqJkU0nfiFkDzAsdYNTHeJMgBXEX9epPkQTUdLG9L47K54vMxm/+toeMAiKD63Dfkw==";
+
};
+
homeassistant = {
+
acl = [ "readwrite #" ];
+
hashedPassword = "$7$101$wGQZPdVdeW7iQFmH$bK/VOR6LXCLJKbb6M4PNeVptocjBAWXCLMtEU5fQNBr0Y5UAWlhVg8UAu4IkIXgnViI51NnhXKykdlWF63VkVQ==";
+
};
+
};
+
}
+
];
+
};
+
+
services.home-assistant = {
+
enable = true;
+
extraComponents = [
+
# Components required to complete the onboarding
+
"esphome"
+
"met"
+
"radio_browser"
+
"mqtt"
+
"zha"
+
];
+
config = {
+
# Includes dependencies for a basic setup
+
# https://www.home-assistant.io/integrations/default_config/
+
default_config = {};
+
http.use_x_forwarded_for = true;
+
http.trusted_proxies = "100.64.0.2";
+
};
+
};
+
}
+32
hosts/capybara/hardware-configuration.nix
···
+
{ config, lib, pkgs, modulesPath, ... }:
+
+
{
+
imports =
+
[ (modulesPath + "/installer/scan/not-detected.nix")
+
];
+
+
boot.loader.grub.device = "nodev";
+
boot.loader.grub.efiSupport = true;
+
boot.loader.grub.efiInstallAsRemovable = true;
+
boot.loader.efi.canTouchEfiVariables = false;
+
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
+
boot.initrd.kernelModules = [ ];
+
boot.kernelModules = [ ];
+
boot.extraModulePackages = [ ];
+
+
fileSystems."/" =
+
{ device = "/dev/disk/by-uuid/4cef5b18-2c69-4f92-835d-52ac0b96256c";
+
fsType = "ext4";
+
};
+
+
fileSystems."/boot" =
+
{ device = "/dev/disk/by-uuid/63BC-60B5";
+
fsType = "vfat";
+
};
+
+
swapDevices = [ ];
+
+
networking.useDHCP = lib.mkDefault true;
+
+
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
+
}