Personal Nix flake
nixos home-manager nix
1
fork

Configure Feed

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

chore: Merge branch 'raspberrypi' into develop

+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 profiles = { 17 18 headless = true; ··· 23 24 nixpkgs.hostPlatform = "aarch64-linux"; 24 25 25 26 age.rekey.hostPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILr9pl4qaL/+DV//lhE5y6V7xJ2eh1BSlwNYD9L9a2sQ"; 27 + 28 + virtualisation.incus.enable = false; 29 + networking = { 30 + firewall.interfaces.incusbr0 = { 31 + allowedTCPPorts = [53 67]; 32 + allowedUDPPorts = [53 67]; 33 + }; 34 + firewall.trustedInterfaces = ["incusbr0"]; 35 + nftables.enable = true; 36 + }; 37 + users.users.lpchaim.extraGroups = ["incus-admin"]; 38 + 39 + services.home-assistant = { 40 + enable = false; 41 + openFirewall = true; 42 + configWritable = true; 43 + lovelaceConfigWritable = true; 44 + config.homeassistant = { 45 + unit_system = "metric"; 46 + temperature_unit = "C"; 47 + time_zone = "America/Sao_Paulo"; 48 + }; 49 + customComponents = with pkgs.home-assistant-custom-components; [ 50 + localtuya 51 + midea_ac 52 + midea_ac_lan 53 + sleep_as_android 54 + tuya_local 55 + ]; 56 + customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [ 57 + mushroom 58 + ]; 59 + extraPackages = python3Packages: 60 + with python3Packages; [ 61 + psycopg2 62 + ]; 63 + extraComponents = [ 64 + "default_config" 65 + "adguard" 66 + "asuswrt" 67 + "esphome" 68 + "google_translate" 69 + "homeassistant_hardware" 70 + "shopping_list" 71 + "tuya" 72 + "workday" 73 + ]; 74 + }; 75 + 26 76 system.stateVersion = "24.05"; 27 77 home-manager.users.${name.user}.home.stateVersion = "24.05"; 28 78 }
-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 }