[pi4] Split module config

This commit is contained in:
2025-04-15 23:39:10 +02:00
parent 4ed23cdf5f
commit 22ab5aa5cf
7 changed files with 60 additions and 37 deletions

16
hosts/pi4/boot.nix Normal file
View File

@ -0,0 +1,16 @@
{ pkgs, ... }:
{
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = [
"xhci_pci"
"usbhid"
"usb_storage"
];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
}

View File

@ -1,45 +1,15 @@
{
pkgs,
systemConfig,
...
}:
{
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = [
"xhci_pci"
"usbhid"
"usb_storage"
];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
hardware.enableRedistributableFirmware = true;
networking = {
hostName = systemConfig.hostName;
networkmanager.enable = true;
};
services.openssh.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
services.pcscd.enable = true;
imports = [
./boot.nix
./hardware.nix
./networking.nix
./security.nix
];
system.stateVersion = systemConfig.version;

12
hosts/pi4/hardware.nix Normal file
View File

@ -0,0 +1,12 @@
{
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
# TODO mount ext hdd
};
hardware.enableRedistributableFirmware = true;
}

View File

@ -1,5 +1,6 @@
{
lib,
inputs,
outputs,
systemConfig,
...
@ -7,9 +8,10 @@
{
imports = [
inputs.catppuccin.homeModules.catppuccin
(lib.custom.relativeToRoot "shared/home-manager/btop.nix")
(lib.custom.relativeToRoot "shared/home-manager/development/git.nix")
(lib.custom.relativeToRoot "shared/home-manager/development/nixvim.nix")
(lib.custom.relativeToRoot "shared/home-manager/development/nixvim")
(lib.custom.relativeToRoot "shared/home-manager/fastfetch.nix")
(lib.custom.relativeToRoot "shared/home-manager/fish.nix")
(lib.custom.relativeToRoot "shared/home-manager/gpg.nix")

10
hosts/pi4/networking.nix Normal file
View File

@ -0,0 +1,10 @@
{ systemConfig, ... }:
{
networking = {
hostName = systemConfig.hostName;
networkmanager.enable = true;
};
services.openssh.enable = true;
}

7
hosts/pi4/security.nix Normal file
View File

@ -0,0 +1,7 @@
{
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
services.pcscd.enable = true;
}

View File

@ -4,6 +4,12 @@ default:
fmt:
treefmt --on-unmatched info
build HOST:
git add .
just fmt
nh os build . -H {{HOST}}
test *FLAGS:
git add .
just fmt