nixos-config/config/vf2.nix

120 lines
2.7 KiB
Nix
Raw Normal View History

2023-03-03 09:46:02 +00:00
{
lib,
nix-packages,
config,
pkgs,
2023-06-12 12:40:57 +00:00
nixpkgs,
2023-03-03 09:46:02 +00:00
...
2023-03-03 09:54:31 +00:00
} @ args: {
2023-03-03 09:46:02 +00:00
networking.hostName = "vf2";
networking.hostId = "ad325df9";
imports = [
./services/caddy
./services/acme.nix
2023-03-03 09:54:31 +00:00
./users/remote-build.nix
2023-03-03 09:46:02 +00:00
];
2023-03-04 07:55:40 +00:00
environment.noXlibs = true;
2023-03-04 17:35:33 +00:00
nixpkgs.config.allowUnsupportedSystem = true;
2023-03-04 07:55:40 +00:00
2023-03-03 09:46:02 +00:00
nixpkgs.overlays = [
(import ../overlays/riscv.nix)
];
2023-03-05 20:51:07 +00:00
nix.settings.substituters = ["https://beam.attic.rs/riscv"];
2023-03-03 09:46:02 +00:00
boot = {
supportedFilesystems = lib.mkForce ["vfat" "ext4"];
2023-06-13 05:46:23 +00:00
kernelPackages = pkgs.vf2KernelPackages;
2023-03-03 09:46:02 +00:00
kernelParams = [
"console=tty0"
"console=ttyS0,115200"
"earlycon=sbi"
"boot.shell_on_fail"
];
blacklistedKernelModules = [
# Last thing to log before crash...
"axp15060-regulator"
# Also sus
"at24"
# Also also sus
"jh7110-vin"
# Maybe??
"starfive-jh7110-regulator"
# This one stopped the crashing
"starfivecamss"
];
initrd.includeDefaultModules = false;
initrd.availableKernelModules = [
"dw_mmc-pltfm"
"dw_mmc-starfive"
"dwmac-starfive-plat"
"spi-dw-mmio"
"mmc_block"
"nvme"
"sdhci" #?
"sdhci-pci" #?
"sdhci-of-dwcmshc"
];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
fileSystems = {
"/boot/firmware" = {
device = "/dev/disk/by-label/FIRMWARE";
fsType = "vfat";
options = ["nofail" "noauto"];
};
"/" = {
2023-06-11 14:30:56 +00:00
device = "192.168.2.1:/export/vf2";
fsType = "nfs";
options = ["nofail" "local_lock=all" "nfsvers=4.2"];
2023-03-03 09:46:02 +00:00
};
};
2023-06-11 14:30:56 +00:00
boot.initrd.network.enable = true;
2023-03-03 09:46:02 +00:00
hardware.deviceTree.name = "starfive/jh7110-visionfive-v2.dtb";
2023-06-11 14:30:56 +00:00
system.stateVersion = "23.05";
2023-03-03 09:54:31 +00:00
home-manager.users.darkkirb = import ./home-manager/darkkirb.nix {
desktop = false;
inherit args;
};
2023-03-06 14:44:47 +00:00
nix.settings.cores = 4;
nix.settings.max-jobs = 4;
2023-03-03 09:54:31 +00:00
nix.settings.system-features = [
"nixos-test"
"big-parallel"
"benchmark"
"ca-derivations"
2023-03-06 14:44:47 +00:00
"gccarch-riscv-i"
"gccarch-riscv-m"
"gccarch-riscv-a"
"gccarch-riscv-f"
"gccarch-riscv-d"
"gccarch-riscv-c"
2023-03-03 09:54:31 +00:00
];
nix.daemonCPUSchedPolicy = "idle";
nix.daemonIOSchedClass = "idle";
sops.secrets."root/.ssh/id_ed25519" = {
owner = "root";
path = "/root/.ssh/id_ed25519";
};
system.autoUpgrade.allowReboot = true;
services.tailscale.useRoutingFeatures = "server";
boot.kernel.sysctl."net.ipv4.conf.all.forwarding" = true;
2023-06-11 14:30:56 +00:00
2023-06-12 12:40:57 +00:00
nixpkgs = {
buildPlatform.config = "x86_64-linux";
hostPlatform.config = "riscv64-linux";
pkgs = lib.mkForce (import nixpkgs {
system = "x86_64-linux";
crossSystem = "riscv64-linux";
inherit (config.nixpkgs) config overlays;
});
2023-06-11 14:30:56 +00:00
};
2023-03-03 09:46:02 +00:00
}