nix-config/hosts/dacbert/default.nix

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

211 lines
4.6 KiB
Nix
Raw Normal View History

2022-03-17 00:21:04 +01:00
{ hostRegistry, config, lib, pkgs, modulesPath, ... }:
2021-09-27 22:19:24 +02:00
{
2022-06-12 17:26:32 +02:00
c3d2 = {
2021-09-27 22:19:24 +02:00
isInHq = true;
mergeHostsFile = true;
2021-09-27 22:19:24 +02:00
hq.interface = "eth0";
hq.statistics.enable = true;
audioServer.enable = true;
k-ot.enable = true;
2022-07-04 00:21:56 +02:00
# TODO: move back to radiobert with the HW
pi-sensors = if true then [] else [ {
type = "dht22";
pin = 17;
location = "lang";
} {
type = "dht22";
pin = 23;
location = "kurz";
} ];
2022-06-12 17:26:32 +02:00
};
2021-09-27 22:19:24 +02:00
hardware.enableRedistributableFirmware = true;
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
nixpkgs.config.packageOverrides = pkgs: {
makeModulesClosure = x:
# prevent kernel install fail due to missing modules
pkgs.makeModulesClosure (x // { allowMissing = true; });
};
2022-06-12 17:26:32 +02:00
2021-09-27 22:19:24 +02:00
boot = {
loader = {
raspberryPi = {
enable = true;
2021-09-28 00:28:15 +02:00
version = 4;
2021-09-27 22:19:24 +02:00
firmwareConfig = ''
2022-03-17 00:21:04 +01:00
gpu_mem=256
2021-09-27 22:19:24 +02:00
dtparam=audio=on
'';
};
};
2021-09-29 14:55:56 +02:00
kernelParams = lib.mkForce [
"snd_bcm2835.enable_headphones=1"
# don't let sd-image-aarch64.nix setup serial console as it breaks bluetooth.
"console=tty0"
# allow GPIO access
"iomem=relaxed" "strict-devmem=0"
2022-09-05 21:40:01 +02:00
# booting sometimes fails with an oops in the ethernet driver. reboot after 5s
"panic=5" "oops=panic"
2022-09-30 00:29:19 +02:00
# for the patch below
"compat_uts_machine=armv6l"
2021-09-29 14:55:56 +02:00
];
2021-09-27 22:19:24 +02:00
tmpOnTmpfs = true;
2022-09-22 23:59:04 +02:00
tmpOnTmpfsSize = "80%";
2021-09-27 22:19:24 +02:00
};
# hardware.raspberry-pi."4" = {
# fkms-3d.enable = true;
# };
fileSystems."/" = {
device = "${hostRegistry.hosts.nfsroot.ip4}:/var/lib/nfsroot/dacbert";
fsType = "nfs";
options = [ "nfsvers=3" "proto=tcp" "nolock" "hard" "async" "rw" ];
};
2021-09-27 22:19:24 +02:00
networking = {
hostName = "dacbert"; # Define your hostname.
useDHCP = false;
interfaces.eth0.useDHCP = true;
2021-09-28 00:28:15 +02:00
firewall.enable = false;
2021-09-27 22:19:24 +02:00
};
2022-06-09 17:45:23 +02:00
nix = {
daemonCPUSchedPolicy = "idle";
daemonIOSchedClass = "idle";
2022-12-04 06:36:57 +01:00
settings = {
builders-use-substitutes = true;
cores = 4;
extra-platforms = "armv6l-linux";
max-jobs = 1;
system-features = [];
trusted-users = [ "client" ];
};
2022-06-09 17:45:23 +02:00
};
2022-09-29 21:35:34 +02:00
# kernel 32bit personality patch from Ubuntu
boot.kernelPatches = [
rec {
name = "compat_uts_machine";
patch = pkgs.fetchpatch {
inherit name;
url = "https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/patch/?id=c1da50fa6eddad313360249cadcd4905ac9f82ea";
sha256 = "sha256-mpq4YLhobWGs+TRKjIjoe5uDiYLVlimqWUCBGFH/zzU=";
};
}
];
2022-06-09 17:45:23 +02:00
2022-09-29 01:29:09 +02:00
environment = {
gnome.excludePackages = with pkgs.gnome; [
baobab
cheese
epiphany
gnome-calendar
gnome-contacts
gnome-maps
gnome-music
pkgs.gnome-photos
gnome-weather
simple-scan
totem
yelp
];
systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
vim
wget
libva-utils
mpv
vlc
2022-11-21 20:12:43 +01:00
ffmpeg
2022-09-29 01:29:09 +02:00
yt-dlp
ncpamixer
pulseaudio # required for pactl
chromium
firefox
pavucontrol
glxinfo
# tracer-game
bevy_julia
bevy_mandelbrot
allcolors
];
};
2021-09-27 22:19:24 +02:00
programs.tmux.enable = true;
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
2021-09-28 00:28:15 +02:00
# Select internationalisation properties.
console = {
font = "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz";
keyMap = "de";
};
services = {
2021-09-27 22:19:24 +02:00
# Do not log to flash:
2021-09-28 00:28:15 +02:00
journald.extraConfig = ''
2021-09-27 22:19:24 +02:00
Storage=volatile
2022-06-12 17:26:32 +02:00
'';
2021-09-27 22:19:24 +02:00
openssh = {
2021-09-28 00:28:15 +02:00
enable = true;
};
xserver = {
enable = true;
layout = "de";
xkbOptions = "eurosign:e";
};
};
2022-06-12 17:26:32 +02:00
2021-09-28 00:28:15 +02:00
services.xserver = {
desktopManager = {
gnome.enable = true;
2022-06-12 17:26:32 +02:00
};
2021-09-28 00:28:15 +02:00
displayManager = {
2022-09-08 21:26:23 +02:00
gdm = {
enable = true;
wayland = true;
};
2021-09-28 00:28:15 +02:00
autoLogin = {
enable = true;
user = "k-ot";
2022-06-12 17:26:32 +02:00
};
2022-09-08 21:26:23 +02:00
defaultSession = "gnome";
2022-06-12 17:26:32 +02:00
};
2021-09-28 00:28:15 +02:00
};
2022-06-12 17:26:32 +02:00
2021-09-28 00:28:15 +02:00
systemd = {
2022-06-09 17:45:23 +02:00
services.nix-daemon.serviceConfig = {
LimitNOFILE = lib.mkForce 8192;
CPUWeight = 5;
MemoryHigh = "4G";
MemoryMax = "6G";
MemorySwapMax = "0";
2022-06-12 17:26:32 +02:00
};
2022-09-08 21:26:23 +02:00
# replaced by gnome-sharing
# user.services.wayvnc = {
# description = "Wayland VNC server";
# wantedBy = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
# serviceConfig = {
# ExecStart = ''
# ${pkgs.wayvnc}/bin/wayvnc 0.0.0.0
# '';
# RestartSec = 3;
# Restart = "always";
# };
# };
2021-09-28 00:28:15 +02:00
};
2021-09-27 22:19:24 +02:00
system.stateVersion = "21.05"; # Did you read the comment?
}