This commit is contained in:
mjallen18
2025-06-10 14:25:07 -05:00
parent 0f2952ccae
commit 35547ca183
5 changed files with 148 additions and 79 deletions

View File

@@ -121,6 +121,8 @@
nas-nixai.url = "github:olafkfreund/nix-ai-help"; nas-nixai.url = "github:olafkfreund/nix-ai-help";
nas-nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
##################################################### #####################################################
# pi5 # # pi5 #
##################################################### #####################################################
@@ -152,9 +154,7 @@
inputs.nixpkgs.follows = "pi5-nixpkgs"; inputs.nixpkgs.follows = "pi5-nixpkgs";
}; };
nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi"; pi5-nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi";
nas-nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
pi5-disko = { pi5-disko = {
# the fork is needed for partition attributes support # the fork is needed for partition attributes support
@@ -196,8 +196,6 @@
pi4-nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi"; pi4-nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi";
pi4-argon40-nix.url = "github:guusvanmeerveld/argon40-nix";
pi4-disko = { pi4-disko = {
# the fork is needed for partition attributes support # the fork is needed for partition attributes support
url = "github:nvmd/disko/gpt-attrs"; url = "github:nvmd/disko/gpt-attrs";
@@ -327,7 +325,7 @@
pi5-impermanence, pi5-impermanence,
pi5-nixos-hardware, pi5-nixos-hardware,
pi5-sops-nix, pi5-sops-nix,
nixos-raspberrypi, pi5-nixos-raspberrypi,
pi5-disko, pi5-disko,
# pi4 # pi4
@@ -338,7 +336,6 @@
pi4-nixos-hardware, pi4-nixos-hardware,
pi4-nixos-raspberrypi, pi4-nixos-raspberrypi,
pi4-disko, pi4-disko,
pi4-argon40-nix,
# Steamdeck # Steamdeck
steamdeck-nixpkgs, steamdeck-nixpkgs,
@@ -509,7 +506,7 @@
}; };
# pi5 # pi5
"pi5" = nixos-raspberrypi.lib.nixosSystem { "pi5" = pi5-nixos-raspberrypi.lib.nixosSystem {
specialArgs = inputs // specialArgs = inputs //
{ {
inherit outputs; inherit outputs;
@@ -527,7 +524,7 @@
{ {
# Hardware specific configuration, see section below for a more complete # Hardware specific configuration, see section below for a more complete
# list of modules # list of modules
imports = with nixos-raspberrypi.nixosModules; [ imports = with pi5-nixos-raspberrypi.nixosModules; [
raspberry-pi-5.base raspberry-pi-5.base
raspberry-pi-5.display-vc4 raspberry-pi-5.display-vc4
raspberry-pi-5.bluetooth raspberry-pi-5.bluetooth
@@ -559,10 +556,10 @@
}; };
# pi4 # pi4
"pi4" = pi4-nixpkgs.lib.nixosSystem { "pi4" = pi4-nixos-raspberrypi.lib.nixosSystem {
# specialArgs = inputs; specialArgs = inputs //
specialArgs = { {
inherit inputs outputs; inherit outputs;
}; };
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ modules = [
@@ -570,10 +567,19 @@
pi4-disko.nixosModules.disko pi4-disko.nixosModules.disko
./share/disko/pi-uefi-disko.nix ./share/disko/pi-uefi-disko.nix
pi4-nixos-hardware.nixosModules.raspberry-pi-4 pi4-nixos-hardware.nixosModules.raspberry-pi-4
{
# Hardware specific configuration, see section below for a more complete
# list of modules
imports = with pi4-nixos-raspberrypi.nixosModules; [
raspberry-pi-4.base
raspberry-pi-4.display-vc4
raspberry-pi-4.bluetooth
raspberry-pi-4.case-argonone
];
}
pi4-impermanence.nixosModules.impermanence pi4-impermanence.nixosModules.impermanence
pi4-sops-nix.nixosModules.sops pi4-sops-nix.nixosModules.sops
./hosts/pi4/configuration.nix ./hosts/pi4/configuration.nix
pi4-argon40-nix.nixosModules.default
pi4-home-manager.nixosModules.home-manager pi4-home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;

View File

@@ -299,8 +299,8 @@ in
}; };
}; };
nix.settings.builders-use-substitutes = true; # nix.settings.builders-use-substitutes = true;
nix.distributedBuilds = true; # nix.distributedBuilds = true;
nix.buildMachines = [ nix.buildMachines = [
{ {
hostName = "pi5.local"; hostName = "pi5.local";

View File

@@ -1,51 +1,51 @@
{ ... }: # { ... }:
{ # {
programs.argon.one = { # programs.argon.one = {
enable = true; # enable = true;
settings = { # settings = {
# Is 'celsius' by default, can also be set to 'fahrenheit' # # Is 'celsius' by default, can also be set to 'fahrenheit'
displayUnits = "celsius"; # displayUnits = "celsius";
# This is the same config as the original Argon40 config. # # This is the same config as the original Argon40 config.
# This is also the default config for this flake. # # This is also the default config for this flake.
fanspeed = [ # fanspeed = [
{ # {
# This the temperature threshold at which this fan speed will activate. # # This the temperature threshold at which this fan speed will activate.
# The temperature is in the above specified unit. # # The temperature is in the above specified unit.
temperature = 55; # temperature = 55;
# This is speed percentage at which the fan will spin. # # This is speed percentage at which the fan will spin.
speed = 30; # speed = 30;
} # }
{ # {
temperature = 60; # temperature = 60;
speed = 55; # speed = 55;
} # }
{ # {
temperature = 65; # temperature = 65;
speed = 100; # speed = 100;
} # }
]; # ];
ir = { # ir = {
enable = true; # enable = true;
gpio.enable = true; # gpio.enable = true;
keymap = { # keymap = {
"POWER" = "00ff39c6"; # "POWER" = "00ff39c6";
"UP" = "00ff53ac"; # "UP" = "00ff53ac";
"DOWN" = "00ff4bb4"; # "DOWN" = "00ff4bb4";
"LEFT" = "00ff9966"; # "LEFT" = "00ff9966";
"RIGHT" = "00ff837c"; # "RIGHT" = "00ff837c";
"VOLUMEUP" = "00ff01fe"; # "VOLUMEUP" = "00ff01fe";
"VOLUMEDOWN" = "00ff817e"; # "VOLUMEDOWN" = "00ff817e";
"OK" = "00ff738c"; # "OK" = "00ff738c";
"HOME" = "00ffd32c"; # "HOME" = "00ffd32c";
"MENU" = "00ffb946"; # "MENU" = "00ffb946";
"BACK" = "00ff09f6"; # "BACK" = "00ff09f6";
}; # };
}; # };
}; # };
}; # };
} # }
# { lib, stdenv, pkgs, config, ...}: # { lib, stdenv, pkgs, config, ...}:
# { # {
# imports = let # imports = let

View File

@@ -1,23 +1,63 @@
# { pkgs, lib, ... }:
# let
# uefi_pi4 = pkgs.callPackage ./pi4-uefi.nix { };
# in
# {
# boot = {
# loader = {
# systemd-boot.enable = lib.mkForce false;
# efi.canTouchEfiVariables = false;
# generic-extlinux-compatible.enable = lib.mkForce true;
# };
# plymouth.enable = false;
# kernelPackages = pkgs.linuxPackages_rpi4;
# kernelModules = [ "i2c-dev" "i2c-bcm2835" ];
# initrd.kernelModules = [ "i2c-dev" "i2c-bcm2835" ];
# };
# # environment.systemPackages = [ uefi_pi4 ];
# # Copy UEFI firmware files to the boot partition
# # system.activationScripts.installUEFIFirmware.text = ''
# # cp -r ${uefi_pi4}/share/uefi_rpi4/* /boot/firmware/
# # '';
# }
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
uefi_pi4 = pkgs.callPackage ./pi4-uefi.nix { }; kernelBundle = pkgs.linuxAndFirmware.latest;
in in
{ {
boot = { boot = {
loader = { loader.raspberryPi.firmwarePackage = kernelBundle.raspberrypifw;
systemd-boot.enable = lib.mkForce false; kernelPackages = kernelBundle.linuxPackages_rpi4;
efi.canTouchEfiVariables = false;
generic-extlinux-compatible.enable = lib.mkForce true;
};
plymouth.enable = false;
kernelPackages = pkgs.linuxPackages_rpi4;
kernelModules = [ "i2c-dev" "i2c-bcm2835" ];
initrd.kernelModules = [ "i2c-dev" "i2c-bcm2835" ];
}; };
# environment.systemPackages = [ uefi_pi4 ];
# Copy UEFI firmware files to the boot partition hardware.raspberry-pi.config = {
# system.activationScripts.installUEFIFirmware.text = '' all = { # [all] conditional filter, https://www.raspberrypi.com/documentation/computers/config_txt.html#conditional-filters
# cp -r ${uefi_pi4}/share/uefi_rpi4/* /boot/firmware/
# ''; options = {
# https://www.raspberrypi.com/documentation/computers/config_txt.html#enable_uart
# in conjunction with `console=serial0,115200` in kernel command line (`cmdline.txt`)
# creates a serial console, accessible using GPIOs 14 and 15 (pins
# 8 and 10 on the 40-pin header)
enable_uart = {
enable = true;
value = true;
};
# https://www.raspberrypi.com/documentation/computers/config_txt.html#uart_2ndstage
# enable debug logging to the UART, also automatically enables
# UART logging in `start.elf`
uart_2ndstage = {
enable = true;
value = true;
};
};
# Base DTB parameters
# https://github.com/raspberrypi/linux/blob/a1d3defcca200077e1e382fe049ca613d16efd2b/arch/arm/boot/dts/overlays/README#L132
base-dt-params = {
};
};
};
} }

View File

@@ -10,11 +10,11 @@ in
{ {
imports = [ imports = [
./adguard.nix ./adguard.nix
./argononed.nix # ./argononed.nix
./boot.nix ./boot.nix
./impermanence.nix ./impermanence.nix
./networking.nix ./networking.nix
./pi4-hw.nix # ./pi4-hw.nix
./sops.nix ./sops.nix
]; ];
@@ -29,6 +29,29 @@ in
}; };
}; };
# Configure nixpkgs
nixpkgs = {
overlays = lib.mkAfter [
(self: super: {
# This is used in (modulesPath + "/hardware/all-firmware.nix") when at least
# enableRedistributableFirmware is enabled
# I know no easier way to override this package
inherit (kernelBundle) raspberrypiWirelessFirmware;
# Some derivations want to use it as an input,
# e.g. raspberrypi-dtbs, omxplayer, sd-image-* modules
inherit (kernelBundle) raspberrypifw;
})
];
};
system.nixos.tags = let
cfg = config.boot.loader.raspberryPi;
in [
"raspberry-pi-${cfg.variant}"
cfg.bootloader
config.boot.kernelPackages.kernel.version
];
programs.zsh.enable = true; programs.zsh.enable = true;
hardware.i2c.enable = true; hardware.i2c.enable = true;