This commit is contained in:
2026-02-11 11:04:59 +01:00
commit 50d930e1ff
31 changed files with 2249 additions and 0 deletions

53
nixos/default.nix Normal file
View File

@@ -0,0 +1,53 @@
{ config, pkgs, inputs, self, primaryUser, ... }:
{
imports = [
./hardware.nix
./settings.nix
./packages.nix
];
nixpkgs.config.allowUnfree = true;
networking = {
hostName = "rpi-4";
networkmanager.enable = true;
};
# SSH configuration
services.openssh = {
enable = true;
settings.PermitRootLogin = "no";
settings.PasswordAuthentication = true;
};
# User configuration
users.users.${primaryUser} = {
isNormalUser = true;
home = "/home/${primaryUser}";
description = "Phil";
extraGroups = [ "wheel" "networkmanager" ];
shell = pkgs.fish;
};
# Shell
programs.zsh.enable = true;
programs.fish.enable = true;
# Nix settings
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
builders = "ssh://phil@192.168.2.40 aarch64-linux";
builders-use-substitutes = true;
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
system.stateVersion = "24.11";
}

34
nixos/hardware.nix Normal file
View File

@@ -0,0 +1,34 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
];
# Bootloader
boot = {
kernelPackages = pkgs.linuxPackages_rpi4;
initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
loader.generic-extlinux-compatible.enable = true;
kernelParams = [ "console=ttyS0,115200n8" ];
};
# File systems
fileSystems."/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
# Swap
swapDevices = [{
device = "/swapfile";
size = 4096;
}];
# RPi 4 specific hardware
hardware.enableRedistributableFirmware = true;
# SD Image
image.baseName = "nixos-rpi4";
}

19
nixos/packages.nix Normal file
View File

@@ -0,0 +1,19 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
git
curl
wget
htop
neovim
tmux
ripgrep
fd
bat
eza
fzf
tree
fish
];
}

21
nixos/settings.nix Normal file
View File

@@ -0,0 +1,21 @@
{ config, pkgs, ... }:
{
# Localization
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
# System settings
console.keyMap = "de";
}