Skip to content

Instantly share code, notes, and snippets.

View CRTified's full-sized avatar
🤔

Carl Richard Theodor Schneider CRTified

🤔
View GitHub Profile
@CRTified
CRTified / hostmcu.cfg
Last active March 26, 2024 18:45
Klipper hostmcu config on NixOS
# Relevant part from my klipper config
[mcu host]
serial: /tmp/klipper_host_mcu
[temperature_sensor Host_CPU]
sensor_type: temperature_host
sensor_path: /sys/class/thermal/thermal_zone0/temp
min_temp: 0
max_temp: 90
@CRTified
CRTified / README.md
Last active March 24, 2024 18:03
VFIO Passthrough on NixOS

VFIO Setup on NixOS

Disclaimer: Nobody else tested my setup so far, so this is a "works on my machine" scenario. I am not responsible for anything you break on your machine (although I'd not expect much harm).

Hardware

My system has the following hardware:

  • Board: ASRock X570 Pro4
@CRTified
CRTified / languagetool_base.nix
Created November 26, 2022 22:26
Nix base config for languagetool
{ pkgs, lib, ... }: {
services.languagetool = {
port = lib.mkDefault 7032;
allowOrigin = ""; # To allow access from browser addons
settings = {
# Allowed options:
# https://github.com/languagetool-org/languagetool/blob/master/languagetool-server/src/main/java/org/languagetool/server/HTTPServerConfig.java#L185-L205
# Optional, remove unneeded files
@CRTified
CRTified / 1-output.txt
Created November 7, 2023 22:15
Scoping of `self` demo
$ nix build .#nixosConfigurations.demo.config.system.build.toplevel
trace: I'm Mr. Meeseeks! Existence is pain!
trace: I'm Mr. Meeseeks! Look at me!
@CRTified
CRTified / flake.nix
Created March 23, 2023 22:11
Example flake with auto population from hosts dir
{
inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; };
outputs = { self, nixpkgs, ... }@inputs:
let
inherit (self) outputs;
files = builtins.readDir ./nix_configs/hosts;
hostnames = builtins.filter
(name: builtins.hasAttr name files && (files.${name} == "directory"))
(builtins.attrNames files);
@CRTified
CRTified / AdGuardHome.yaml
Created January 14, 2022 00:37
AdGuard default config
bind_host: 127.0.0.1
bind_port: 80
beta_bind_port: 0
users:
- name: admin
password: $2a$10$HjNx9vh4qXQdl3yxvGtahuYFUOZfc3hB6vCuSJZ7oHgAxnP9GAfrO
auth_attempts: 5
block_auth_min: 15
http_proxy: ""
language: ""
@CRTified
CRTified / configuration.nix
Created January 5, 2022 03:40
RasPi3b+ OctoPrint config with GPIO
{ config, pkgs, lib, ... }:
{
imports = [
./hardware-configuration.nix
./update-uboot.nix
./secrets.nix # Only sets `services.octoprint.extraConfig.api.key`
./octoprint.nix
];
boot.kernelPackages = pkgs.linuxKernel.packages.linux_rpi3;
@CRTified
CRTified / hamaBase.yml
Created January 4, 2022 16:55
esphome config for hama 4AC 4USB Power Strip (00176574)
esphome:
name: hamabase
platform: ESP8266
board: esp8285
wifi:
ssid: WiFi SSID
password: WiFi PW
fast_connect: True
@CRTified
CRTified / adguard.nix
Created December 24, 2021 15:09
AdGuard config
{ config, pkgs, lib, ... }:
let
# https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#configuration-file
baseconf = {
bind_host = "0.0.0.0";
bind_port = 3000;
users = [{
name = "dnsadmin";
password =
"$2a$10$.pGOj.bhC1PmGvIs1z8MVuRibYFMh5JzWeArJWKSfpFPkWhv8zL6G"; # TODO: secret
@CRTified
CRTified / h801.yml
Created June 2, 2021 17:38
H801 esphome.io base config
esphome:
name: h801light
comment: Base Configuration for H801 LED controller
platform: ESP8266
board: esp01_1m
ota:
output:
- platform: esp8266_pwm