Personal Nix flake
nixos home-manager nix
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: Revamp raspberrypi config

+72 -61
+50
nix/nixos/configs/raspberrypi/default.nix
··· 12 12 13 13 my = { 14 14 ci.build = true; 15 + networking.tailscale.trusted = true; 15 16 security.u2f.relaxed = true; 16 17 }; 17 18 ··· 19 20 nixpkgs.hostPlatform = "aarch64-linux"; 20 21 21 22 age.rekey.hostPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILr9pl4qaL/+DV//lhE5y6V7xJ2eh1BSlwNYD9L9a2sQ"; 23 + 24 + virtualisation.incus.enable = false; 25 + networking = { 26 + firewall.interfaces.incusbr0 = { 27 + allowedTCPPorts = [53 67]; 28 + allowedUDPPorts = [53 67]; 29 + }; 30 + firewall.trustedInterfaces = ["incusbr0"]; 31 + nftables.enable = true; 32 + }; 33 + users.users.lpchaim.extraGroups = ["incus-admin"]; 34 + 35 + services.home-assistant = { 36 + enable = false; 37 + openFirewall = true; 38 + configWritable = true; 39 + lovelaceConfigWritable = true; 40 + config.homeassistant = { 41 + unit_system = "metric"; 42 + temperature_unit = "C"; 43 + time_zone = "America/Sao_Paulo"; 44 + }; 45 + customComponents = with pkgs.home-assistant-custom-components; [ 46 + localtuya 47 + midea_ac 48 + midea_ac_lan 49 + sleep_as_android 50 + tuya_local 51 + ]; 52 + customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [ 53 + mushroom 54 + ]; 55 + extraPackages = python3Packages: 56 + with python3Packages; [ 57 + psycopg2 58 + ]; 59 + extraComponents = [ 60 + "default_config" 61 + "adguard" 62 + "asuswrt" 63 + "esphome" 64 + "google_translate" 65 + "homeassistant_hardware" 66 + "shopping_list" 67 + "tuya" 68 + "workday" 69 + ]; 70 + }; 71 + 22 72 system.stateVersion = "24.05"; 23 73 home-manager.users.${name.user}.home.stateVersion = "24.05"; 24 74 }
-2
nix/nixos/configs/raspberrypi/hardware-configuration.nix
··· 2 2 # and may be overwritten by future invocations. Please make changes 3 3 # to /etc/nixos/configuration.nix instead. 4 4 { 5 - config, 6 5 lib, 7 - pkgs, 8 6 modulesPath, 9 7 ... 10 8 }: {
+22 -59
nix/nixos/configs/raspberrypi/storage.nix
··· 1 - {pkgs, ...}: let 2 - uefiFirmware = pkgs.fetchzip { 3 - url = "https://github.com/pftf/RPi4/releases/download/v1.38/RPi4_UEFI_Firmware_v1.38.zip"; 4 - hash = "sha256-0axfcb5fhbhkqvfysy7xqk2xi8k3lsx4146nms5315r4ynhh897q="; 1 + { 2 + fileSystems."/boot" = { 3 + device = "/dev/disk/by-uuid/12CE-A600"; 4 + fsType = "vfat"; 5 + options = ["fmask=0022" "dmask=0022"]; 6 + }; 7 + 8 + fileSystems."/" = { 9 + device = "/dev/disk/by-uuid/322a6d8e-f946-4d60-98a3-dd1af1373c79"; 10 + fsType = "btrfs"; 11 + options = ["subvol=@" "compress=zstd" "noatime"]; 12 + }; 13 + 14 + fileSystems."/home" = { 15 + device = "/dev/disk/by-uuid/322a6d8e-f946-4d60-98a3-dd1af1373c79"; 16 + fsType = "btrfs"; 17 + options = ["subvol=@home" "compress=zstd" "noatime"]; 5 18 }; 6 - in { 7 - disko.devices = { 8 - disk = { 9 - vdb = { 10 - device = "/dev/disk/by-uuid/322a6d8e-f946-4d60-98a3-dd1af1373c79"; 11 - type = "disk"; 12 - content = { 13 - type = "gpt"; 14 - partitions = { 15 - ESP = { 16 - type = "EF00"; 17 - size = "1GB"; 18 - content = { 19 - type = "filesystem"; 20 - format = "vfat"; 21 - mountpoint = "/boot"; 22 - postMountHook = '' 23 - cp -r ${uefiFirmware} /boot 24 - ''; 25 - }; 26 - }; 27 - root = { 28 - size = "100%"; 29 - content = { 30 - type = "btrfs"; 31 - extraArgs = ["-f"]; # Override existing partition 32 - # Subvolumes must set a mountpoint in order to be mounted, 33 - # unless their parent is mounted 34 - subvolumes = { 35 - # Subvolume name is different from mountpoint 36 - "@" = { 37 - mountOptions = ["compress=zstd" "noatime"]; 38 - mountpoint = "/"; 39 - }; 40 - # Subvolume name is the same as the mountpoint 41 - "@home" = { 42 - mountOptions = ["compress=zstd" "noatime"]; 43 - mountpoint = "/home"; 44 - }; 45 - # Parent is not mounted so the mountpoint must be set 46 - "@nix" = { 47 - mountOptions = ["compress=zstd" "noatime"]; 48 - mountpoint = "/nix"; 49 - }; 50 - "@swap" = { 51 - mountpoint = "/.swapvol"; 52 - swap.swapfile.size = "4GB"; 53 - }; 54 - }; 55 - }; 56 - }; 57 - }; 58 - }; 59 - }; 60 - }; 19 + 20 + fileSystems."/nix" = { 21 + device = "/dev/disk/by-uuid/322a6d8e-f946-4d60-98a3-dd1af1373c79"; 22 + fsType = "btrfs"; 23 + options = ["subvol=@nix" "compress=zstd" "noatime"]; 61 24 }; 62 25 }