Compare commits

...

6 commits

Author SHA1 Message Date
magic_rb 1ea62e80e2
Fix up klipper
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-01-22 00:44:41 +01:00
magic_rb d925c68f58
Add service to deploy home-assistant pyscript scripts
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-01-22 00:44:17 +01:00
magic_rb b7d82b950c
Disable vault agent kodi mount
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-01-22 00:43:34 +01:00
magic_rb 1142e4a94b
Update secret
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-01-22 00:43:24 +01:00
magic_rb 27f4b1bc33
Don't compile git-annex on 32-bit arm
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-01-20 23:02:03 +01:00
magic_rb b71e57e8af
Disable specialisations for omen, makes eval too long
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-01-20 22:59:44 +01:00
7 changed files with 93 additions and 75 deletions

View file

@ -2143,8 +2143,8 @@
"secret": {
"flake": false,
"locked": {
"lastModified": 1704823351,
"narHash": "sha256-KAiEA1ftvLVzGEzgi6GwrTJ7vA54i76/a1EHPr/CoYU=",
"lastModified": 1705880353,
"narHash": "sha256-xhiTJu5C0rIZuS243jhSXj9l/Pu6qCjlBvUI/KQlBL8=",
"path": "/home/main/dotfiles/secret",
"type": "path"
},

View file

@ -2143,7 +2143,7 @@
"secret": {
"flake": false,
"locked": {
"lastModified": 1704919213,
"lastModified": 1705786717,
"narHash": "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=",
"path": "/var/empty",
"type": "path"

View file

@ -1,13 +1,13 @@
{ config, pkgs, lib, ... }:
let
inherit (lib)
optional
;
in
{
home.packages = with pkgs; [
git-annex
file
];
] ++ (optional (pkgs.stdenv.system != "armv6l-linux" && pkgs.stdenv.system != "armv7l-linux") git-annex);
imports = [
../bash

View file

@ -109,6 +109,20 @@ in
system.stateVersion = "21.05";
systemd.services.home-assistant-pyscript = {
wantedBy = ["multi-user.target"];
restartIfChanged = true;
path = [ pkgs.rsync ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = "yes";
};
script = ''
mkdir -p /mnt/kyle/infrastructure/home-assistant/home-assistant/pyscript
rsync --chown 403:403 --chmod Du=rwx,Dgo=rx,Fu=rw,Fgo=r -arvc --delete ${secret.pyscript}/. /mnt/kyle/infrastructure/home-assistant/home-assistant/pyscript/
'';
};
boot.kernel.sysctl."fs.inotify.max_user_instances" = 256;
services.udev.extraRules =
let

View file

@ -9,13 +9,13 @@ in
sshfs
];
services.hashicorp.vault-agent = {
settings.template = singleton {
source = pkgs.writeText "kodi-samba.cred.vtmpl"
''{{ with secret "kv/data/homelab-1/blowhole/kodi_samba.cred" }}{{ .Data.data.cred }}{{ end }}'';
destination = "/run/secrets/kodi_samba.cred";
};
};
# services.hashicorp.vault-agent = {
# settings.template = singleton {
# source = pkgs.writeText "kodi-samba.cred.vtmpl"
# ''{{ with secret "kv/data/homelab-1/blowhole/kodi_samba.cred" }}{{ .Data.data.cred }}{{ end }}'';
# destination = "/run/secrets/kodi_samba.cred";
# };
# };
fileSystems =
{

View file

@ -1,4 +1,4 @@
{ inputs, lib, pkgs, secret, config, config', ...}:
{ inputs', lib, pkgs, secret, config, config', ...}:
let
inherit (lib)
concatStringsSep
@ -71,8 +71,8 @@ in
hostPath = "/var/lib/klipper/gcodes";
isReadOnly = false;
};
"/dev/serial/by-id/" = {
hostPath = "/dev/serial/by-id/";
"/dev/ttyEnder3" = {
hostPath = "/dev/serial/by-id/usb-Klipper_lpc1768_13E0FF0C469027AEBAA84A52871E00F5-if00";
isReadOnly = false;
};
};
@ -90,14 +90,19 @@ in
hashicorp-envoy
];
networking.firewall.interfaces.eth0.allowedTCPPorts = [19000];
services.hashicorp-envoy.mainsail = {
envoyPackage = inputs'.nixpkgs-stable.legacyPackages.${pkgs.stdenv.system}.envoy;
service = {
name = "mainsail";
id = "mainsail";
address = "10.64.99.6";
port = 80;
connect.sidecar_service = {};
connect.sidecar_service = {
port = 19000;
};
};
environment = {
@ -109,7 +114,6 @@ in
address = "10.64.99.6:19000";
adminBind = "127.0.0.1:19100";
hotRestart = false;
extraConsulArgs = [ "-ignore-envoy-compatibility" ];
};
users.users.klipper = {
@ -222,7 +226,7 @@ in
};
mcu = {
serial = "/dev/serial/by-id/usb-Klipper_lpc1768_13E0FF0C469027AEBAA84A52871E00F5-if00";
serial = "/dev/ttyEnder3";
};
printer = {
@ -415,10 +419,10 @@ in
''
G92 E0 # Reset Extruder
G1 Z2.0 F3000 # Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0 # Move to start position
G1 X0.1 Y200.0 Z0.3 F1500.0 E15 # Draw the first line
G1 X0.4 Y200.0 Z0.3 F5000.0 # Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30 # Draw the second line
G1 X1 Y20 Z0.3 F5000.0 # Move to start position
G1 X1 Y200.0 Z0.3 F1500.0 E15 # Draw the first line
G1 X1.3 Y200.0 Z0.3 F5000.0 # Move to side a little
G1 X1.3 Y20 Z0.3 F1500.0 E30 # Draw the second line
G92 E0 # Reset Extruder
G1 Z2.0 F3000 # Move Z Axis up little to prevent scratching of Heat Bed
G1 X5 Y20 Z0.3 F5000.0 # Move over to prevent blob squish

View file

@ -60,67 +60,67 @@ in {
hardware.tuxedo-keyboard.enable = true;
specialisation.nvidia-sync.configuration = {
environment.variables.NIXOS_SPECIALIZATION = "nvidia-sync";
boot.loader.grub.enable = mkOverride 0 false;
# specialisation.nvidia-sync.configuration = {
# environment.variables.NIXOS_SPECIALIZATION = "nvidia-sync";
# boot.loader.grub.enable = mkOverride 0 false;
hardware.nvidia = {
powerManagement.enable = mkForce false;
powerManagement.finegrained = mkForce false;
prime.offload.enableOffloadCmd = mkForce false;
prime.offload.enable = mkForce false;
prime.sync.enable = true;
};
};
# hardware.nvidia = {
# powerManagement.enable = mkForce false;
# powerManagement.finegrained = mkForce false;
# prime.offload.enableOffloadCmd = mkForce false;
# prime.offload.enable = mkForce false;
# prime.sync.enable = true;
# };
# };
specialisation.nouveau.configuration = {
environment.variables.NIXOS_SPECIALIZATION = "nouveau";
boot.loader.grub.enable = mkOverride 0 false;
# specialisation.nouveau.configuration = {
# environment.variables.NIXOS_SPECIALIZATION = "nouveau";
# boot.loader.grub.enable = mkOverride 0 false;
hardware.nvidia = mapAttrs (_: v: mkForce v) {
powerManagement.enable = false;
powerManagement.finegrained = false;
prime.offload.enableOffloadCmd = false;
prime.offload.enable = false;
nvidiaPersistenced = false;
# hardware.nvidia = mapAttrs (_: v: mkForce v) {
# powerManagement.enable = false;
# powerManagement.finegrained = false;
# prime.offload.enableOffloadCmd = false;
# prime.offload.enable = false;
# nvidiaPersistenced = false;
prime.reverseSync.enable = false;
};
services.xserver.videoDrivers = mkForce ["modesetting" "nouveau"];
};
# prime.reverseSync.enable = false;
# };
# services.xserver.videoDrivers = mkForce ["modesetting" "nouveau"];
# };
specialisation.no-nvidia.configuration = {
environment.variables.NIXOS_SPECIALIZATION = "no-nvidia";
boot.loader.grub.enable = mkOverride 0 false;
# specialisation.no-nvidia.configuration = {
# environment.variables.NIXOS_SPECIALIZATION = "no-nvidia";
# boot.loader.grub.enable = mkOverride 0 false;
hardware.nvidia = mapAttrs (_: v: mkForce v) {
powerManagement.enable = false;
powerManagement.finegrained = false;
prime.offload.enableOffloadCmd = false;
prime.offload.enable = false;
nvidiaPersistenced = false;
# hardware.nvidia = mapAttrs (_: v: mkForce v) {
# powerManagement.enable = false;
# powerManagement.finegrained = false;
# prime.offload.enableOffloadCmd = false;
# prime.offload.enable = false;
# nvidiaPersistenced = false;
prime.reverseSync.enable = false;
};
services.xserver.videoDrivers = mkForce ["modesetting"];
# prime.reverseSync.enable = false;
# };
# services.xserver.videoDrivers = mkForce ["modesetting"];
boot.extraModprobeConfig = ''
blacklist nouveau
options nouveau modeset=0
'';
# boot.extraModprobeConfig = ''
# blacklist nouveau
# options nouveau modeset=0
# '';
services.udev.extraRules = ''
# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA VGA/3D controller devices
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
'';
boot.blacklistedKernelModules = ["nouveau" "nvidia" "nvidia_drm" "nvidia_modeset"];
};
# services.udev.extraRules = ''
# # Remove NVIDIA USB xHCI Host Controller devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA USB Type-C UCSI devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA Audio devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA VGA/3D controller devices
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
# '';
# boot.blacklistedKernelModules = ["nouveau" "nvidia" "nvidia_drm" "nvidia_modeset"];
# };
hardware.nvidia = {
nvidiaPersistenced = true;