106 lines
2.6 KiB
Nix
106 lines
2.6 KiB
Nix
{ config, pkgs, lib, inputs, ... }:
|
|
|
|
let ci-secrets = import ../../ci-secrets.nix;
|
|
in
|
|
{
|
|
# https://en.wikipedia.org/wiki/Aka_Manto
|
|
networking.hostName = "akamanto";
|
|
deployment.targetHost = "akamanto.waw.hackerspace.pl";
|
|
|
|
imports = with inputs.self.nixosModules; [
|
|
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
|
|
common
|
|
];
|
|
sdImage.compressImage = false;
|
|
hardware.enableRedistributableFirmware = true;
|
|
boot = {
|
|
# revisit https://github.com/NixOS/nixpkgs/issues/154163 if actually needed
|
|
# kernelPackages = pkgs.linuxPackages_rpi3;
|
|
# camera, kernel side
|
|
kernelModules = [ "bcm2835-v4l2" ];
|
|
# avoid building zfs
|
|
supportedFilesystems = lib.mkForce [ "vfat" "ext4" ];
|
|
};
|
|
|
|
environment.etc."wifi-secrets".text = ci-secrets.wifi;
|
|
|
|
networking = {
|
|
useDHCP = false;
|
|
wireless = {
|
|
enable = true;
|
|
environmentFile = "/etc/wifi-secrets";
|
|
networks."hackerspace.pl-guests".psk = "@HSWAW_WIFI@";
|
|
networks."hackerspace.pl-guests-5G".psk = "@HSWAW_WIFI@";
|
|
};
|
|
};
|
|
|
|
services.avahi = {
|
|
enable = true;
|
|
publish = {
|
|
enable = true;
|
|
addresses = true;
|
|
workstation = true;
|
|
};
|
|
};
|
|
|
|
time.timeZone = "Europe/Warsaw";
|
|
users.users.ar.openssh.authorizedKeys.keys =
|
|
config.users.users.root.openssh.authorizedKeys.keys;
|
|
users.mutableUsers = false;
|
|
|
|
# strictly printer stuff below
|
|
services.klipper = {
|
|
enable = true;
|
|
firmwares = {
|
|
mcu = {
|
|
enableKlipperFlash = true;
|
|
enable = false;
|
|
configFile = ./klipper-smoothie.cfg;
|
|
serial = "/dev/ttyACM0";
|
|
};
|
|
};
|
|
settings = {
|
|
mcu.serial = "/dev/ttyACM0";
|
|
printer = {
|
|
kinematics = "corexy";
|
|
max_velocity = 300;
|
|
max_accel = 2000;
|
|
max_z_velocity = 5;
|
|
max_z_accel = 100;
|
|
};
|
|
};
|
|
};
|
|
|
|
services.moonraker = {
|
|
user = "root";
|
|
enable = true;
|
|
address = "0.0.0.0";
|
|
settings = {
|
|
octoprint_compat = { };
|
|
history = { };
|
|
authorization = {
|
|
force_logins = true;
|
|
cors_domains = [ "*.local" "*.waw.hackerspace.pl" ];
|
|
trusted_clients = [ "10.8.0.0/23" ];
|
|
};
|
|
};
|
|
};
|
|
|
|
services.fluidd = {
|
|
enable = true;
|
|
nginx.locations."/webcam".proxyPass = "http://127.0.0.1:8080/stream";
|
|
};
|
|
|
|
services.nginx.clientMaxBodySize = "1000m";
|
|
|
|
systemd.services.ustreamer = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
description = "uStreamer for video0";
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
ExecStart =
|
|
"${pkgs.ustreamer}/bin/ustreamer --encoder=HW --persistent --drop-same-frames=30";
|
|
};
|
|
};
|
|
}
|