87 lines
2.9 KiB
Nix
87 lines
2.9 KiB
Nix
# 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.
|
||
{ config, lib, pkgs, modulesPath, ... }:
|
||
let
|
||
# needs to get pinned because otherwise kernel will fail to build because of gcc
|
||
kernelpkgs = import (builtins.fetchGit {
|
||
name = "kernelpkgs";
|
||
url = "https://github.com/nixos/nixpkgs/";
|
||
rev = "4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0";
|
||
}) {};
|
||
in
|
||
{
|
||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||
|
||
|
||
boot = {
|
||
loader.systemd-boot.enable = true;
|
||
loader.efi.canTouchEfiVariables = true;
|
||
|
||
kernelPackages = pkgs.linuxPackagesFor (kernelpkgs.callPackage ./pkgs/kernel/vendor.nix {});
|
||
kernel.sysctl = {
|
||
"kernel.printk" = "1 4 1 7";
|
||
};
|
||
supportedFilesystems = lib.mkForce [ "vfat" "fat32" "exfat" "ext4" "btrfs" ];
|
||
initrd.includeDefaultModules = lib.mkForce false;
|
||
initrd.availableKernelModules = lib.mkForce [ "nvme" "mmc_block" "hid" "dm_mod" "dm_crypt" "input_leds" ];
|
||
|
||
# kernelParams copy from Armbian's /boot/armbianEnv.txt & /boot/boot.cmd
|
||
kernelParams = [
|
||
"rootwait"
|
||
|
||
"earlycon" # enable early console, so we can see the boot messages via serial port / HDMI
|
||
"consoleblank=0" # disable console blanking(screen saver)
|
||
"console=ttyS2,1500000" # serial port
|
||
"console=tty1" # HDMI
|
||
|
||
# docker optimizations
|
||
"cgroup_enable=cpuset"
|
||
"cgroup_memory=1"
|
||
"cgroup_enable=memory"
|
||
"swapaccount=1"
|
||
];
|
||
};
|
||
|
||
hardware = {
|
||
deviceTree = {
|
||
# https://github.com/armbian/build/blob/f9d7117/config/boards/orangepi5-plus.wip#L10C51-L10C51
|
||
name = "rockchip/rk3588-orangepi-5-plus.dtb";
|
||
overlays = [
|
||
];
|
||
};
|
||
|
||
enableRedistributableFirmware = lib.mkForce true;
|
||
firmware = [
|
||
(pkgs.callPackage ./pkgs/orangepi-firmware {})
|
||
];
|
||
};
|
||
|
||
|
||
fileSystems."/" =
|
||
{ device = "/dev/disk/by-uuid/c49c99cd-9a91-485d-8572-8f83df262907";
|
||
fsType = "ext4";
|
||
};
|
||
|
||
fileSystems."/boot" =
|
||
{ device = "/dev/disk/by-uuid/12CE-A600";
|
||
fsType = "vfat";
|
||
};
|
||
|
||
swapDevices =
|
||
[ { device = "/dev/disk/by-uuid/1f3fe124-c1f6-4e3f-9e89-4aa6d87d9853"; }
|
||
];
|
||
|
||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||
# still possible to use this option, but it's recommended to use it in conjunction
|
||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||
networking.useDHCP = lib.mkDefault true;
|
||
# networking.interfaces.enP3p49s0.useDHCP = lib.mkDefault true;
|
||
# networking.interfaces.enP4p65s0.useDHCP = lib.mkDefault true;
|
||
# networking.interfaces.enu1u3c2.useDHCP = lib.mkDefault true;
|
||
# networking.interfaces.wlP2p33s0.useDHCP = lib.mkDefault true;
|
||
|
||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||
}
|