1
0
forked from c3d2/nix-config

Switch pulsebert to dell mini

This commit is contained in:
Sandro - 2022-08-24 00:32:00 +02:00
parent 4733360cdb
commit bdbfef3bc5
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
3 changed files with 32 additions and 77 deletions

View File

@ -509,12 +509,9 @@
pulsebert = nixosSystem' { pulsebert = nixosSystem' {
modules = [ modules = [
./hosts/pulsebert ./hosts/pulsebert
# build: outputs.nixosConfigurations.pulsebert.config.system.build.sdImage
# run: unzstd -cd result/sd-image/nixos-sd-image-*-aarch64-linux.img.zst | pv -br | sudo dd bs=4M of=/dev/sdX
"${inputs.nixos-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel.nix"
]; ];
nixpkgs = inputs.nixos-unstable; nixpkgs = inputs.nixos-unstable;
system = "aarch64-linux"; system = "x86_64-linux";
}; };
radiobert = nixosSystem' { radiobert = nixosSystem' {

View File

@ -8,37 +8,26 @@
c3d2 = { c3d2 = {
isInHq = true; isInHq = true;
mergeHostsFile = true; mergeHostsFile = true;
hq.interface = "eth0"; hq.interface = "enp1s0";
hq.statistics.enable = true; hq.statistics.enable = true;
k-ot.enable = true; k-ot.enable = true;
audioServer.enable = true; audioServer.enable = true;
}; };
boot = { boot = {
growPartition = true; loader.systemd-boot = {
loader = { enable = true;
grub.enable = false; configurationLimit = 2;
}; };
kernelPackages = lib.mkForce pkgs.linuxPackages_latest; loader.efi.canTouchEfiVariables = true;
# No ZFS on latest kernel: kernelPackages = pkgs.linuxPackages_latest;
supportedFilesystems = lib.mkForce [ "vfat" "ext4" ];
kernelParams = [ "console=tty0" ];
tmpOnTmpfs = true; tmpOnTmpfs = true;
}; };
hardware.deviceTree = { hardware.enableRedistributableFirmware = true;
enable = true;
kernelPackage = config.boot.kernelPackages.kernel;
};
nixpkgs.config.packageOverrides = pkgs: {
makeModulesClosure = x:
# prevent kernel install fail due to missing modules
pkgs.makeModulesClosure (x // { allowMissing = true; });
};
nix = { nix = {
buildCores = 4; buildCores = 2;
maxJobs = 1; maxJobs = 1;
}; };
@ -55,19 +44,13 @@
]; ];
}; };
hostName = "pulsebert"; hostName = "pulsebert";
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
useDHCP = false; useDHCP = false;
interfaces = { interfaces = {
eth0.useDHCP = true; enp1s0.useDHCP = true;
wlan0.useDHCP = false; # broken
}; };
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
libraspberrypi
mpd mpd
mpv mpv
ncmpcpp ncmpcpp
@ -85,23 +68,12 @@
}; };
}; };
# quirk for this pi3
systemd.services.bluetooth.serviceConfig = {
Restart = "always";
RestartSec = "1s";
};
users.users = lib.mkMerge [ users.users = lib.mkMerge [
(lib.optionalAttrs config.services.octoprint.enable { (lib.optionalAttrs config.services.octoprint.enable {
# Allow access to printer serial port and GPIO # Allow access to printer serial port and GPIO
"${config.services.octoprint.user}".extraGroups = [ "dialout" ]; "${config.services.octoprint.user}".extraGroups = [ "dialout" ];
}) })
{ {
# Allow gpio group to access GPIO devices
gpio = {
isNormalUser = true;
group = "gpio";
};
} }
]; ];
@ -115,13 +87,6 @@
enable = true; enable = true;
}; };
mjpg-streamer = {
# crashes with: MJPG-streamer [3040]: init_VideoIn failed
enable = false;
inputPlugin = "input_uvc.so -d /dev/v4l/by-id/usb-046d_0817_4B7115A0-video-index0 -r 640x480 -f 30 -pl 50hz -ex auto";
outputPlugin = "output_http.so -p 3020";
};
nginx = { nginx = {
enable = true; enable = true;
virtualHosts = { virtualHosts = {
@ -176,11 +141,7 @@
# #in p: [ octoprint-filament-sensor-universal ]; # #in p: [ octoprint-filament-sensor-universal ];
# in p: []; # in p: [];
}; };
udev.extraRules = ''
KERNEL=="gpiochip*", GROUP="gpio", MODE="0660"
'';
}; };
system.stateVersion = "21.05"; system.stateVersion = "22.11";
} }

View File

@ -4,37 +4,34 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
#imports = imports =
# [ (modulesPath + "/installer/scan/not-detected.nix") [ (modulesPath + "/installer/scan/not-detected.nix")
# ];
boot.initrd.availableKernelModules = [ "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
# mkForce to get rid of "console=ttyAMA0" from sd-image-aarch64.nix
boot.kernelParams = lib.mkForce [
"snd_bcm2835.enable_headphones=1"
]; ];
fileSystems."/" = { boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" "sdhci_acpi" ];
device = "/dev/disk/by-label/NIXOS_SD"; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/dfa5920b-debc-4e60-a33b-ef6a1ef1ed48";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot/firmware" = { fileSystems."/boot" =
device = "/dev/disk/by-label/FIRMWARE"; { device = "/dev/disk/by-uuid/D35A-D516";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [ ];
hardware.enableRedistributableFirmware = true; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
#networking.wireless.enable = true; # (the default) this is the recommended approach. When using systemd-networkd it's
boot.loader.raspberryPi.firmwareConfig = '' # still possible to use this option, but it's recommended to use it in conjunction
gpu_mem=192 # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
dtparam=audio=on networking.useDHCP = lib.mkDefault true;
''; # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }