Prep for new rpi images

This commit is contained in:
iFargle 2023-12-13 14:17:46 +09:00
parent 2befa17937
commit ce1c589651
7 changed files with 187 additions and 7 deletions

View file

@ -44,7 +44,9 @@
framework-server = libx.mkHost { hostname = "framework-server"; }; framework-server = libx.mkHost { hostname = "framework-server"; };
# nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; desktop = "gnome"; gpu = "nvidia"; }; # nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; desktop = "gnome"; gpu = "nvidia"; };
# nixos-framework = libx.mkHost { hostname = "nixos-framework"; desktop = "hyprland"; gpu = "amd"; theme = "green"; }; # nixos-framework = libx.mkHost { hostname = "nixos-framework"; desktop = "hyprland"; gpu = "amd"; theme = "green"; };
nixos-rpi4-01 = libx.mkHost { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; }; backups-rpi4 = libx.deploy { hostname = "backups-rpi4"; platform = "aarch64-linux"; };
piaware-rpi4 = libx.deploy { hostname = "piaware-rpi4"; platform = "aarch64-linux"; };
nixos-rpi4-01 = libx.deploy { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; };
nixos-rpi4-02 = libx.mkHost { hostname = "nixos-rpi4-02"; platform = "aarch64-linux"; }; nixos-rpi4-02 = libx.mkHost { hostname = "nixos-rpi4-02"; platform = "aarch64-linux"; };
nixos-rpi4-03 = libx.mkHost { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; }; nixos-rpi4-03 = libx.mkHost { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; };
}; };
@ -54,6 +56,8 @@
"albert@framework-server" = libx.mkHome { hostname = "framework-server"; }; "albert@framework-server" = libx.mkHome { hostname = "framework-server"; };
# "albert@nixos-desktop" = libx.mkHome { hostname = "nixos-desktop"; desktop = "gnome"; }; # "albert@nixos-desktop" = libx.mkHome { hostname = "nixos-desktop"; desktop = "gnome"; };
# "albert@nixos-framework" = libx.mkHome { hostname = "nixos-framework"; desktop = "hyprland"; theme = "green"; }; # "albert@nixos-framework" = libx.mkHome { hostname = "nixos-framework"; desktop = "hyprland"; theme = "green"; };
"albert@backups-rpi4" = libx.mkHome { hostname = "backups-rpi4"; platform = "aarch64-linux"; type = "small"; };
"albert@piaware-rpi4" = libx.mkHome { hostname = "piaware-rpi4"; platform = "aarch64-linux"; type = "small"; };
"albert@nixos-rpi4-01" = libx.mkHome { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; type = "small"; }; "albert@nixos-rpi4-01" = libx.mkHome { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; type = "small"; };
"albert@nixos-rpi4-02" = libx.mkHome { hostname = "nixos-rpi4-02"; platform = "aarch64-linux"; type = "small"; }; "albert@nixos-rpi4-02" = libx.mkHome { hostname = "nixos-rpi4-02"; platform = "aarch64-linux"; type = "small"; };
"albert@nixos-rpi4-03" = libx.mkHome { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; type = "small"; }; "albert@nixos-rpi4-03" = libx.mkHome { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; type = "small"; };
@ -64,6 +68,8 @@
framework-server = libx.deploy { hostname = "framework-server"; }; framework-server = libx.deploy { hostname = "framework-server"; };
# nixos-desktop = libx.deploy { hostname = "nixos-desktop"; }; # nixos-desktop = libx.deploy { hostname = "nixos-desktop"; };
# nixos-framework = libx.deploy { hostname = "nixos-framework"; }; # nixos-framework = libx.deploy { hostname = "nixos-framework"; };
backups-rpi4 = libx.deploy { hostname = "backups-rpi4"; platform = "aarch64-linux"; };
piaware-rpi4 = libx.deploy { hostname = "piaware-rpi4"; platform = "aarch64-linux"; };
nixos-rpi4-01 = libx.deploy { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; }; nixos-rpi4-01 = libx.deploy { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; };
nixos-rpi4-02 = libx.deploy { hostname = "nixos-rpi4-02"; platform = "aarch64-linux"; }; nixos-rpi4-02 = libx.deploy { hostname = "nixos-rpi4-02"; platform = "aarch64-linux"; };
nixos-rpi4-03 = libx.deploy { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; }; nixos-rpi4-03 = libx.deploy { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; };

View file

@ -0,0 +1,66 @@
# 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.
{ inputs, config, lib, pkgs, modulesPath, ... }: {
imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-4
(modulesPath + "/installer/scan/not-detected.nix")
];
# Enable distributed Builds
nix.distributedBuilds = true;
hardware = {
raspberry-pi."4".apply-overlays-dtmerge.enable = true;
deviceTree = {
enable = true;
filter = "*rpi-4-*.dtb";
};
};
console.enable = false;
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
];
#####################################################################################
# BEGIN hardware config
#####################################################################################
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
boot.loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
};
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
networking.hostName = "backups-rpi4";
#####################################################################################
# END hardware config
#####################################################################################
# Generic Tailscale configs are in /nixos/common/services/tailscale.nix
# Set up the secrets file:
sops.secrets."tailscale_keys/backups-rpi4" = {
owner = "root";
sopsFile = ../../../secrets/tailscale.yaml;
restartUnits = [
"tailscaled.service"
"tailscaled-autoconnect.service"
];
};
services.tailscale.authKeyFile = "/run/secrets/tailscale_keys/backups-rpi4";
services.tailscale.extraUpFlags = [ "--advertise-exit-node" ];
boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; };
}

View file

@ -1,6 +1,5 @@
{ inputs, config, lib, pkgs, modulesPath, desktop, username, platform, ... }: { { inputs, config, lib, pkgs, modulesPath, desktop, username, platform, ... }: {
imports = [ imports = [
# inputs.nixos-hardware.nixosModules.framework-13-inch-13th-gen-intel
inputs.nixos-hardware.nixosModules.framework-13th-gen-intel inputs.nixos-hardware.nixosModules.framework-13th-gen-intel
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
./disks.nix ./disks.nix

View file

@ -1,13 +1,27 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { { inputs, config, lib, pkgs, modulesPath, ... }: {
imports = [ imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-4
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
# Enable distributed Builds # Enable distributed Builds
nix.distributedBuilds = true; nix.distributedBuilds = true;
hardware = {
raspberry-pi."4".apply-overlays-dtmerge.enable = true;
deviceTree = {
enable = true;
filter = "*rpi-4-*.dtb";
};
};
console.enable = false;
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
];
##################################################################################### #####################################################################################
# BEGIN hardware config # BEGIN hardware config
##################################################################################### #####################################################################################

View file

@ -1,12 +1,27 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { { inputs, config, lib, pkgs, modulesPath, ... }: {
imports = [ imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-4
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
# Enable distributed Builds # Enable distributed Builds
nix.distributedBuilds = true; nix.distributedBuilds = true;
hardware = {
raspberry-pi."4".apply-overlays-dtmerge.enable = true;
deviceTree = {
enable = true;
filter = "*rpi-4-*.dtb";
};
};
console.enable = false;
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
];
##################################################################################### #####################################################################################
# BEGIN hardware config # BEGIN hardware config
##################################################################################### #####################################################################################

View file

@ -1,13 +1,27 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { { inputs, config, lib, pkgs, modulesPath, ... }: {
imports = [ imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-4
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
# Enable distributed Builds # Enable distributed Builds
nix.distributedBuilds = true; nix.distributedBuilds = true;
hardware = {
raspberry-pi."4".apply-overlays-dtmerge.enable = true;
deviceTree = {
enable = true;
filter = "*rpi-4-*.dtb";
};
};
console.enable = false;
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
];
##################################################################################### #####################################################################################
# BEGIN hardware config # BEGIN hardware config
##################################################################################### #####################################################################################

View file

@ -0,0 +1,66 @@
# 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.
{ inputs, config, lib, pkgs, modulesPath, ... }: {
imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-4
(modulesPath + "/installer/scan/not-detected.nix")
];
# Enable distributed Builds
nix.distributedBuilds = true;
hardware = {
raspberry-pi."4".apply-overlays-dtmerge.enable = true;
deviceTree = {
enable = true;
filter = "*rpi-4-*.dtb";
};
};
console.enable = false;
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
];
#####################################################################################
# BEGIN hardware config
#####################################################################################
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
boot.loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
};
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
networking.hostName = "piaware-rpi4";
#####################################################################################
# END hardware config
#####################################################################################
# Generic Tailscale configs are in /nixos/common/services/tailscale.nix
# Set up the secrets file:
sops.secrets."tailscale_keys/piaware-rpi4" = {
owner = "root";
sopsFile = ../../../secrets/tailscale.yaml;
restartUnits = [
"tailscaled.service"
"tailscaled-autoconnect.service"
];
};
services.tailscale.authKeyFile = "/run/secrets/tailscale_keys/piaware-rpi4";
services.tailscale.extraUpFlags = [ "--advertise-exit-node" ];
boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; };
}