nix/nixos/hosts/backups-rpi4/default.nix

59 lines
1.9 KiB
Nix
Raw Normal View History

2024-01-12 08:20:40 +01:00
{ inputs, config, lib, pkgs, modulesPath, hostname, ... }: {
2023-12-13 06:17:46 +01:00
imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-4
(modulesPath + "/installer/scan/not-detected.nix")
2024-01-12 07:03:47 +01:00
../../common/services/tailscale-autoconnect.nix
2023-12-13 14:58:10 +01:00
./backup-script.nix
./cron.nix
./wireguard.nix
2023-12-13 06:17:46 +01:00
];
# Enable distributed Builds
nix.distributedBuilds = true;
hardware = {
raspberry-pi."4".apply-overlays-dtmerge.enable = true;
deviceTree = {
enable = true;
filter = "*rpi-4-*.dtb";
};
};
2023-12-15 08:48:55 +01:00
console.enable = true;
2023-12-13 06:17:46 +01:00
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
];
2023-12-15 13:38:01 +01:00
# Set your time zone.
time.timeZone = "Asia/Tokyo";
2023-12-13 06:17:46 +01:00
#####################################################################################
# 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
#####################################################################################
services.tailscale.extraUpFlags = [ "--advertise-exit-node" ];
boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; };
}