nix-config/hosts/riscbert/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.7 KiB
Nix
Raw Normal View History

2022-09-06 01:28:08 +02:00
{ hostRegistry, config, lib, pkgs, ... }:
2022-06-08 22:55:35 +02:00
{
2022-09-06 01:28:08 +02:00
networking.hostName = "riscbert";
2022-06-08 22:55:35 +02:00
boot = {
kernelParams = [
"verbose" "shell_on_fail"
"elevator=deadline"
];
2022-09-06 01:28:08 +02:00
initrd = {
network = {
enable = true;
flushBeforeStage2 = false;
};
supportedFilesystems = lib.mkForce [
"nfs"
];
# includeDefaultModules = false;
2022-09-06 01:28:08 +02:00
availableKernelModules = [
"stmmac-platform"
"nfs"
2022-09-06 01:28:08 +02:00
"usbhid"
];
};
tmpOnTmpfs = true;
2022-06-08 22:55:35 +02:00
};
2022-09-07 16:39:21 +02:00
fileSystems."/mnt" = {
device = "${hostRegistry.hosts.nfsroot.ip4}:/var/lib/nfsroot/riscbert";
fsType = "nfs";
options = [ "nfsvers=3" "proto=tcp" "nolock" "hard" "async" "rw" ];
};
2022-06-08 22:55:35 +02:00
2022-09-26 23:47:36 +02:00
system.build.bootFiles = pkgs.runCommand "boot-files" {} ''
2022-06-08 22:55:35 +02:00
mkdir -p $out/boot
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d $out/boot
'';
2022-09-06 01:28:08 +02:00
services.journald.extraConfig = ''
Storage=volatile
'';
nix = {
buildCores = 2;
maxJobs = 1;
# trustedUsers = [ "client" ];
extraOptions = ''
builders-use-substitutes = true
'';
daemonCPUSchedPolicy = "idle";
daemonIOSchedClass = "idle";
};
nixpkgs.config.packageOverrides = pkgs: {
# TODO: https://github.com/NixOS/nixpkgs/pull/189932
klibc = pkgs.klibc.overrideAttrs (oa: {
makeFlags = map (s:
if s == "KLIBCARCH=riscv"
then "KLIBCARCH=riscv64"
else s
) oa.makeFlags;
});
} //
lib.genAttrs [ "libffi" "libuv" "openssh" "openssl" ] (p: pkgs.${p}.overrideAttrs (oa: { doCheck = false; checkPhase = ""; }));
2022-09-06 01:28:08 +02:00
2022-06-22 00:47:58 +02:00
system.stateVersion = "22.05";
2022-06-08 22:55:35 +02:00
fileSystems."/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
}