Skip to content

Instantly share code, notes, and snippets.

View vtuan10's full-sized avatar

Van Tuan Vo vtuan10

  • Munich, Germany
View GitHub Profile
@vtuan10
vtuan10 / klipper-firmware.nix
Created November 8, 2022 17:50
Klipper firmware Option
services.klipper = {
enable = true;
...
firmwares = {
mcu = {
enable = true;
# Run klipper-genconf to generate this
configFile = ./avr.cfg;
# Serial port connected to the microcontroller
serial = "/dev/serial/by-id/usb-Arduino__www.arduino.cc__0042_55639303235351D01152-if00";
@vtuan10
vtuan10 / build.sh
Created March 24, 2022 22:14
Building klipper firmware manually
git clone git@github.com:Klipper3d/klipper.git
cd klipper
nix-shell -p python2 python3 pkgsCross.avr.stdenv.cc gcc-arm-embedded bintools-unwrapped libffi libusb1 avrdude stm32flash pkg-config wxGTK
@vtuan10
vtuan10 / moonraker.nix
Last active March 20, 2022 01:46
moonraker on NixOS
{ config, pkgs, ... }:
{
services.moonraker = {
user = "root";
enable = true;
address = "0.0.0.0";
settings = {
octoprint_compat = { };
history = { };
authorization = {
@vtuan10
vtuan10 / user_networking.nix
Last active March 20, 2022 01:45
User and networking on NixOS
{ config, pkgs, ...}:
{
user = {
mutableUsers = false;
users.root = {
# Add password file by running mkpasswd -m SHA-512 > root.passwd
passwordFile = /secrets/root.passwd;
# Replace with your public key
openssh.authorizedKeys.keys = "ssh-ed25519 AAAAC3NzaCetcetera/etceteraJZMfk3QPfQ foo@bar";
};
@vtuan10
vtuan10 / pkgs.nix
Last active March 24, 2022 21:43
Installing packages on NixOS
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
git
wget
htop
vim
tmux
libraspberrypi
];
@vtuan10
vtuan10 / fluidd.nix
Created March 19, 2022 13:53
Fluidd on NixOS
services.fluidd.enable = true;
services.fluidd.nginx.locations."/webcam".proxyPass = "http://127.0.0.1:8080/stream";
services.nginx.clientMaxBodySize = "1000m";
@vtuan10
vtuan10 / rpi.nix
Last active January 2, 2022 14:48
Raspberry Pi Base Nix Config
{ config, pkgs, lib, ... }:
{
boot.loader.grub.enable = false;
# Latest kernel bricks raspberry pi 3: https://github.com/NixOS/nixpkgs/issues/142848
boot.kernelPackages = pkgs.linuxPackages_5_10;
boot.kernelParams = ["cma=256M"];
boot.loader.raspberryPi.enable = true;
boot.loader.raspberryPi.version = 3;