Compare commits

...

13 Commits

Author SHA1 Message Date
Giulio De Pasquale
fe22704b14 helix: add aichat 2024-04-11 12:32:58 +01:00
Giulio De Pasquale
57f5b0a4e2 ollama: fix proxying 2024-04-02 22:56:17 +01:00
Giulio De Pasquale
ed70646087 sunshine: fixed resolution script invocation, use fixed fork for framepacing 2024-04-02 16:41:15 +01:00
Giulio De Pasquale
16a70daa33 flake update 2024-04-02 13:23:59 +01:00
Giulio De Pasquale
794974dd09 sunshine: set env vars for DXVK 2024-03-27 19:04:32 +00:00
Giulio De Pasquale
567b384537 sunshine: fixed paths for nvidia tools 2024-03-15 10:44:57 +00:00
Giulio De Pasquale
6219046bbe sunshine: more modelines 2024-03-14 16:22:30 +00:00
Giulio De Pasquale
09d2d8ed52 sunshine: added 1440p modelines 2024-03-14 16:18:19 +00:00
Giulio De Pasquale
42c0b804fb sunshine: use nvidia-smi and settings from nvidia-x11 2024-03-14 15:55:37 +00:00
Giulio De Pasquale
73ed58dbdc sunshine: refactor module, reorder things around 2024-03-14 15:49:02 +00:00
Giulio De Pasquale
c1c2a75ac4 sunshine: move pkgs use in resolution script and remove them from path of systemd service 2024-03-14 15:41:14 +00:00
Giulio De Pasquale
3b0e625c1a sunshine: disable triple buffer, ignore edid freqs 2024-03-14 15:12:01 +00:00
Giulio De Pasquale
32dc2af002 ollama: use native ollama 2024-03-14 11:55:56 +00:00
5 changed files with 266 additions and 197 deletions

20
flake.lock generated
View File

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1706981411,
"narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=",
"lastModified": 1710888565,
"narHash": "sha256-s9Hi4RHhc6yut4EcYD50sZWRDKsugBJHSbON8KFwoTw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "652fda4ca6dafeb090943422c34ae9145787af37",
"rev": "f33900124c23c4eca5831b9b5eb32ea5894375ce",
"type": "github"
},
"original": {
@ -24,7 +24,7 @@
"local-unstable": {
"locked": {
"lastModified": 0,
"narHash": "sha256-po3G6QMecwbQjwevncJXrIYFWHqdOnZosO/pH+8RZ+k=",
"narHash": "sha256-zw0FIry0jIH2RD4oPubgHZ2YZ03s7f5YZyvXT/wvTBA=",
"path": "/home/giulio/dev/nixpkgs",
"type": "path"
},
@ -35,11 +35,11 @@
},
"nixos-unstable": {
"locked": {
"lastModified": 1710414438,
"narHash": "sha256-UmaVMvCKex3gm7JasposQxTrxD8TlpRk82gtzr//yaU=",
"lastModified": 1712057272,
"narHash": "sha256-Kj74jzJy3u9VYzCyn6dunAQ9N3+tqi1x8YBOWo/mrZ0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3e33aea56df04bfb498f7ccbc76b1f4f87390de7",
"rev": "3c2fdd0a4e6396fc310a6e86faa24d1043a8486a",
"type": "github"
},
"original": {
@ -51,11 +51,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1710399145,
"narHash": "sha256-yhGlmdqxfstngEs3qikYyqU93iqi39GLOiJ7XDWFdPQ=",
"lastModified": 1712055597,
"narHash": "sha256-fLoHZbpqKAciihzWP7gsfdDeTuNOMV248bVHS74jBIc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d3eeab67779382692725ac423b023edecbd8547e",
"rev": "f526f69b90f41afd865c3c778cd74b1331623c41",
"type": "github"
},
"original": {

View File

@ -1,40 +1,55 @@
{ config, pkgs, ... }:
let
domain = "pino.giugl.io";
backendPort = 8080;
frontendDomain = "pino.giugl.io";
backendDomain = "ollama.giugl.io";
frontendPort = 3030;
# llama-cpp = pkgs.unstablePkgs.llama-cpp.override { cudaSupport = true; };
# ollama = pkgs.unstablePkgs.ollama.override { inherit llama-cpp; };
ollamaPort = 11434;
listenAddress = "127.0.0.1:${toString ollamaPort}";
ollamaPkg = pkgs.unstablePkgs.ollama;
in
{
# environment.systemPackages = [ ollama ];
architect.vhost.${domain} = {
environment = {
systemPackages = [ ollamaPkg ];
variables = {
OLLAMA_ORIGINS = "*";
};
};
services.ollama = {
inherit listenAddress;
enable = true;
acceleration = "cuda";
package = ollamaPkg;
};
architect.vhost.${frontendDomain} = {
dnsInterfaces = [ "tailscale" ];
locations."/" = {
host = "172.17.0.1";
host = "127.0.0.1";
port = frontendPort;
allowLan = true;
allowWAN = true;
# allow = [ config.architect.networks."tailscale".net ];
extraConfig = ''
proxy_read_timeout 600s;
'';
};
};
architect.vhost."ollama.giugl.io" = {
architect.vhost.${backendDomain} = {
dnsInterfaces = [ "tailscale" ];
locations."/" = {
host = "172.17.0.1";
host = "127.0.0.1";
port = 11434;
allowLan = true;
allowWAN = true;
# allow = [ config.architect.networks."tailscale".net ];
extraConfig = ''
proxy_buffering off;
proxy_read_timeout 600s;
proxy_set_header Host localhost:11434;
'';
};
};
@ -46,12 +61,11 @@ in
autoStart = true;
ports = [
"172.17.0.1:${toString frontendPort}:${toString backendPort}"
"127.0.0.1:${toString frontendPort}:8080"
];
environment = {
PORT = "${toString backendPort}";
OLLAMA_API_BASE_URL = "http://172.17.0.1:11434/api";
OLLAMA_API_BASE_URL = "https://${backendDomain}/api";
};
extraOptions = [
@ -61,25 +75,6 @@ in
"/var/lib/ollama-webui:/app/backend/data"
];
};
ollama = {
image = "ollama/ollama:latest";
autoStart = true;
extraOptions = [
"--pull=always"
"--gpus=all"
];
environment = {
OLLAMA_ORIGINS = "*";
};
volumes = [
"/ollama:/root/.ollama"
];
ports = [
"127.0.0.1:11434:11434"
"172.17.0.1:11434:11434"
];
};
};
};
}

View File

@ -0,0 +1,16 @@
diff --git a/cmake/targets/unix.cmake b/cmake/targets/unix.cmake
index 2ce0378..cdbf65c 100644
--- a/cmake/targets/unix.cmake
+++ b/cmake/targets/unix.cmake
@@ -2,7 +2,7 @@
# put anything here that applies to both linux and macos
#WebUI build
-add_custom_target(web-ui ALL
- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
- COMMENT "Installing NPM Dependencies and Building the Web UI"
- COMMAND bash -c \"npm install && SUNSHINE_BUILD_HOMEBREW=${NPM_BUILD_HOMEBREW} SUNSHINE_SOURCE_ASSETS_DIR=${NPM_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${NPM_ASSETS_DIR} npm run build\") # cmake-lint: disable=C0301
+# add_custom_target(web-ui ALL
+# WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+# COMMENT "Installing NPM Dependencies and Building the Web UI"
+# COMMAND bash -c \"npm install && SUNSHINE_BUILD_HOMEBREW=${NPM_BUILD_HOMEBREW} SUNSHINE_SOURCE_ASSETS_DIR=${NPM_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${NPM_ASSETS_DIR} npm run build\") # cmake-lint: disable=C0301

View File

@ -14,27 +14,27 @@ let
resolutionScript = pkgs.writeTextFile {
name = "sunshine-resolution-script";
text = ''
#!/usr/bin/env bash
#!${pkgs.bash}/bin/bash
width=''${1:-1920}
height=''${2:-1080}
width=''${1:-1280}
height=''${2:-720}
refresh_rate=''${3:-120}
# Get the modeline info from the 2nd row in the cvt output
modeline=$(cvt ''${width} ''${height} ''${refresh_rate} | gawk 'FNR == 2')
modeline=$(${pkgs.xorg.libxcvt}/bin/cvt ''${width} ''${height} ''${refresh_rate} | ${pkgs.gawk}/bin/gawk 'FNR == 2')
xrandr_mode_str=''${modeline//Modeline \"*\" /}
mode_alias="''${width}x''${height}"
echo "xrandr setting new mode ''${mode_alias} ''${xrandr_mode_str}"
xrandr --rmmode ''${mode_alias}
xrandr --newmode ''${mode_alias} ''${xrandr_mode_str}
xrandr --addmode DP-0 ''${mode_alias}
${pkgs.xorg.xrandr}/bin/xrandr --rmmode ''${mode_alias}
${pkgs.xorg.xrandr}/bin/xrandr --newmode ''${mode_alias} ''${xrandr_mode_str}
${pkgs.xorg.xrandr}/bin/xrandr --addmode DP-0 ''${mode_alias}
# Apply new xrandr mode
xrandr --output DP-0 --primary --mode ''${mode_alias} --pos 0x0 --rotate normal
${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --primary --mode ''${mode_alias} --pos 0x0 --rotate normal
/run/current-system/sw/bin/nvidia-settings -a 'SyncToVBlank=0'
/run/current-system/sw/bin/nvidia-smi --persistence-mode=ENABLED
${config.boot.kernelPackages.nvidia_x11.settings}/bin/nvidia-settings -a 'SyncToVBlank=0'
${config.boot.kernelPackages.nvidia_x11.bin}/bin/nvidia-smi --persistence-mode=ENABLED
'';
executable = true;
destination = "/bin/resolution.sh";
@ -48,11 +48,65 @@ let
origin_web_ui_allowed=lan
channels=2
min_threads=12
global_prep_cmd=[{"do":"${pkgs.bash}/bin/bash -c \"${resolutionScript}/bin/resolution.sh ''${SUNSHINE_CLIENT_WIDTH} ''${SUNSHINE_CLIENT_HEIGHT} ''${SUNSHINE_CLIENT_FPS}\""}]
'';
sunshinePkg = pkgs.unstablePkgs.sunshine.override { cudaSupport = true; };
sunshinePkg = (pkgs.unstablePkgs.sunshine.override { cudaSupport = true; }).overrideAttrs (old: {
version = "0.22.2-fix";
src = pkgs.fetchFromGitHub {
owner = "gschintgen";
repo = "Sunshine";
rev = "985561c5cfe0934662a90f9b6c406e3f3e981d59";
sha256 = "sha256-APfwDkVG1uYvfqxNjNxGEofDd4H0QAk5fzAKG6IW+CI=";
fetchSubmodules = true;
};
patches = [./sunshine-ui.patch];
buildInputs = old.buildInputs ++ [pkgs.python311];
});
in
{
boot.kernelModules = [ "uinput" ];
environment = {
systemPackages = with pkgs; [
sunshinePkg
xorg.xrandr
xorg.xorgserver
xorg.libxcvt
gamemode
];
variables = {
VDPAU_DRIVER = "nvidia";
LIBVA_DRIVER_NAME = "nvidia";
NVD_BACKEND = "direct";
__GL_SYNC_TO_VBLANK = "0";
__GL_VRR_ALLOWED = "0";
DXVK_ASYNC = "1";
};
};
hardware = {
pulseaudio.enable = true;
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = nvidia-patch.patch-nvenc (nvidia-patch.patch-fbc nvidiaPackage);
};
};
programs.steam.enable = true;
security = {
polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
@ -68,24 +122,17 @@ in
rtkit.enable = true;
};
environment.systemPackages = with pkgs; [
sunshinePkg
xorg.xrandr
xorg.xorgserver
xorg.libxcvt
gamemode
];
environment.variables = {
VDPAU_DRIVER = "nvidia";
LIBVA_DRIVER_NAME = "nvidia";
NVD_BACKEND = "direct";
services = {
avahi = {
enable = true;
publish.userServices = true;
};
sound.enable = true;
udev.extraRules = ''
KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"
'';
services.xserver = {
xserver = {
enable = true;
videoDrivers = [ "nvidia" ];
displayManager = {
@ -106,6 +153,14 @@ in
VertRefresh 5.0 - 1000.0
Option "DPMS"
# 1920x1080 @ 30.00 Hz (GTF) hsync: 32.97 kHz; pclk: 80.18 MHz
Modeline "1920x1080_30.00" 80.18 1920 1984 2176 2432 1080 1081 1084 1099 -HSync +Vsync
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
# 1920x1080 @ 90.00 Hz (GTF) hsync: 102.33 kHz; pclk: 270.15 MHz
Modeline "1920x1080_90.00" 270.15 1920 2072 2280 2640 1080 1081 1084 1137 -HSync +Vsync
# 1920x1080 @ 120.00 Hz (GTF) hsync: 138.84 kHz; pclk: 368.76 MHz
Modeline "1920x1080_120.00" 368.76 1920 2072 2288 2656 1080 1081 1084 1157 -HSync +Vsync
# 2240x1290 @ 30.00 Hz (GTF) hsync: 39.39 kHz; pclk: 113.44 MHz
Modeline "2240x1290_30.00" 113.44 2240 2328 2560 2880 1290 1291 1294 1313 -HSync +Vsync
# 2240x1290 @ 60.00 Hz (GTF) hsync: 80.10 kHz; pclk: 243.50 MHz
@ -118,6 +173,30 @@ in
Modeline "2800x1290_60.00" 303.74 2800 2992 3296 3792 1290 1291 1294 1335 -HSync +Vsync
# 2800x1290 @ 120.00 Hz (GTF) hsync: 165.84 kHz; pclk: 647.44 MHz
Modeline "2800x1290_120.00" 647.44 2800 3040 3352 3904 1290 1291 1294 1382 -HSync +Vsync
# 2560x1440 @ 30.00 Hz (GTF) hsync: 43.95 kHz; pclk: 146.27 MHz
Modeline "2560x1440_30.00" 146.27 2560 2680 2944 3328 1440 1441 1444 1465 -HSync +Vsync
# 2560x1440 @ 60.00 Hz (GTF) hsync: 89.40 kHz; pclk: 311.83 MHz
Modeline "2560x1440_60.00" 311.83 2560 2744 3024 3488 1440 1441 1444 1490 -HSync +Vsync
# 2560x1440 @ 90.00 Hz (GTF) hsync: 136.44 kHz; pclk: 484.63 MHz
Modeline "2560x1440_90.00" 484.63 2560 2768 3056 3552 1440 1441 1444 1516 -HSync +Vsync
# 2560x1440 @ 120.00 Hz (GTF) hsync: 185.16 kHz; pclk: 660.65 MHz
Modeline "2560x1440_120.00" 660.65 2560 2776 3064 3568 1440 1441 1444 1543 -HSync +Vsync
# 3840x1600 @ 30.00 Hz (GTF) hsync: 48.84 kHz; pclk: 246.15 MHz
Modeline "3840x1600_30.00" 246.15 3840 4040 4440 5040 1600 1601 1604 1628 -HSync +Vsync
# 3840x1600 @ 60.00 Hz (GTF) hsync: 99.36 kHz; pclk: 523.03 MHz
Modeline "3840x1600_60.00" 523.03 3840 4128 4552 5264 1600 1601 1604 1656 -HSync +Vsync
# 3840x1600 @ 90.00 Hz (GTF) hsync: 151.56 kHz; pclk: 807.51 MHz
Modeline "3840x1600_90.00" 807.51 3840 4160 4584 5328 1600 1601 1604 1684 -HSync +Vsync
# 3840x1600 @ 120.00 Hz (GTF) hsync: 205.68 kHz; pclk: 1105.74 MHz
Modeline "3840x1600_120.00" 1105.74 3840 4176 4608 5376 1600 1601 1604 1714 -HSync +Vsync
# 3840x2160 @ 30.00 Hz (GTF) hsync: 65.91 kHz; pclk: 339.57 MHz
Modeline "3840x2160_30.00" 339.57 3840 4080 4496 5152 2160 2161 2164 2197 -HSync +Vsync
# 3840x2160 @ 60.00 Hz (GTF) hsync: 134.10 kHz; pclk: 712.34 MHz
Modeline "3840x2160_60.00" 712.34 3840 4152 4576 5312 2160 2161 2164 2235 -HSync +Vsync
# 3840x2160 @ 90.00 Hz (GTF) hsync: 204.66 kHz; pclk: 1100.25 MHz
Modeline "3840x2160_90.00" 1100.25 3840 4176 4608 5376 2160 2161 2164 2274 -HSync +Vsync
# 3840x2160 @ 120.00 Hz (GTF) hsync: 277.68 kHz; pclk: 1501.69 MHz
Modeline "3840x2160_120.00" 1501.69 3840 4192 4624 5408 2160 2161 2164 2314 -HSync +Vsync
'';
deviceSection = ''
@ -131,22 +210,18 @@ in
DefaultDepth 24
Option "ModeValidation" "NoVertRefreshCheck, NoHorizSyncCheck, NoMaxSizeCheck, NoMaxPClkCheck, AllowNonEdidModes, NoEdidMaxPClkCheck"
Option "UseEdidfreqs" "False"
Option "TripleBuffer" "False"
SubSection "Display"
Depth 24
EndSubSection
'';
};
# Sunshine user, service and config
users.users.${user} = {
isNormalUser = true;
home = "/home/${user}";
description = "Sunshine Server";
extraGroups = [ "wheel" "networkmanager" "input" "video" "sound" ];
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1we38/N+t8Ah5yrLof8QUwhrob7/VXFKIddaJeOVBLuDVnW7ljiAtdtEiL69D/DV4Ohmt5wMvkAAjfuHmim6FD9A6lzPbSU4KH9W2dcckszKbbI636kuDwem/xui6BW3wJa6P+0xW5ksygEAkzcK2PXuC2b4B9uwhuUdKahiGMKDxISG/WianqAe72cGMfNkYvion3Y1VsMLUdm48d2ABnxNpr7NI9B5iJ8dziOft9gpgfz13CCQRlReo75gk/4xI+vSNrQp7eR+wzJy2/dZg/T8jtyA9Q6jVxrxBpqQ1LNXkAKaJkGo9OabF6Wgpzp+YTAurL4nwR2NaJxwFuyoKvACQy0ai4jrS3206gC6JXZv8ktZMZrwUN+jPqCwfgh5qObFkAqKCxbp52ioDek2MQLdOvzQBX//DBhGEp5rzHGLZ3vhRIiiQiaof5sF5zWiYDW5mqezSPNxJPX/BrTP/Wbs/jpwTLBh3wytiia0S1WXQmya89bqzTPFiDWvTRA62EVKB/JaQtPQQOFAxWwg799DMycPeZ81xttZOyMtI/MZSddyqx2S8fWGwvToZQvuZ38mSIpFseLM1IkgabRIrAmat5SBNGGy9Dqa0eMEa7bwIY/4CMB1y6HMTnaoMXA6cnQfHMoB/zyTZ6oTXIeqeOyiZsK+RN0Mvahj8mXi7dw== giulio@giulio-X230" ];
};
sound.enable = true;
systemd = {
targets = {
sleep.enable = false;
@ -163,7 +238,7 @@ in
partOf = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
path = with pkgs; [ resolutionScript xorg.xrandr bash xorg.libxcvt xorg.xorgserver gawk gamemode ];
path = with pkgs; [ resolutionScript gamemode ];
serviceConfig = {
ExecStart = "${sunshinePkg}/bin/sunshine ${configFile}";
Restart = "on-failure";
@ -172,33 +247,15 @@ in
};
};
services.avahi.publish.userServices = true;
boot.kernelModules = [ "uinput" ];
services.udev.extraRules = ''
KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"
'';
programs.steam.enable = true;
hardware = {
pulseaudio.enable = true;
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
users = {
users.${user} = {
isNormalUser = true;
home = "/home/${user}";
description = "Sunshine Server";
extraGroups = [ "wheel" "networkmanager" "input" "video" "sound" ];
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1we38/N+t8Ah5yrLof8QUwhrob7/VXFKIddaJeOVBLuDVnW7ljiAtdtEiL69D/DV4Ohmt5wMvkAAjfuHmim6FD9A6lzPbSU4KH9W2dcckszKbbI636kuDwem/xui6BW3wJa6P+0xW5ksygEAkzcK2PXuC2b4B9uwhuUdKahiGMKDxISG/WianqAe72cGMfNkYvion3Y1VsMLUdm48d2ABnxNpr7NI9B5iJ8dziOft9gpgfz13CCQRlReo75gk/4xI+vSNrQp7eR+wzJy2/dZg/T8jtyA9Q6jVxrxBpqQ1LNXkAKaJkGo9OabF6Wgpzp+YTAurL4nwR2NaJxwFuyoKvACQy0ai4jrS3206gC6JXZv8ktZMZrwUN+jPqCwfgh5qObFkAqKCxbp52ioDek2MQLdOvzQBX//DBhGEp5rzHGLZ3vhRIiiQiaof5sF5zWiYDW5mqezSPNxJPX/BrTP/Wbs/jpwTLBh3wytiia0S1WXQmya89bqzTPFiDWvTRA62EVKB/JaQtPQQOFAxWwg799DMycPeZ81xttZOyMtI/MZSddyqx2S8fWGwvToZQvuZ38mSIpFseLM1IkgabRIrAmat5SBNGGy9Dqa0eMEa7bwIY/4CMB1y6HMTnaoMXA6cnQfHMoB/zyTZ6oTXIeqeOyiZsK+RN0Mvahj8mXi7dw== giulio@giulio-X230" ];
};
nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = nvidia-patch.patch-nvenc (nvidia-patch.patch-fbc nvidiaPackage);
# package = config.boot.kernelPackages.nvidiaPackages.production;
groups.media.members = [ user ];
};
};
users.groups.media.members = [ user ];
}

View File

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, lib, stdenv, ... }:
let
actualPkgs = pkgs.unstablePkgs;
@ -17,6 +17,24 @@ let
bash-language-server
pyright
];
aichatConfigDir = "$HOME/.config/aichat";
aichatConfig = ''
model: ollama
clients:
- type: ollama
api_base: https://ollama.giugl.io
api_key: null
models:
- name: pino-fast
max_input_tokens: null
'';
aichatRoles = ''
- name: comment
prompt: >
As a helpful assistant designed to assist in documenting code, your primary task is to review the provided code and add clear, concise comments and documentation that will help other developers understand its purpose, functionality, and implementation details. Your comments should be written using language-specific conventions, such as docstrings for Python or Javadoc for Java, to ensure compatibility and maximize their utility for users of different programming languages.
When adding comments, focus on conveying essential information about the code, including its inputs, outputs, and behavior, but avoid getting bogged down in unnecessary detail. Your goal is to provide enough context and explanation to allow a competent developer to understand how the code works and how to use it effectively, without overwhelming them with irrelevant or overly technical information.
UNDER NO CIRCUMSTANCES should you modify the code itself. Your role is purely to document and explain the code as it currently exists, not to make changes or suggest improvements. By focusing on providing high-quality documentation, you can help ensure that the code is easy to understand, use, and maintain, even as it evolves over time.
'';
in
{
home = {
@ -39,9 +57,11 @@ in
sessionVariables = {
EDITOR = "hx";
VISUAL = "hx";
AICHAT_CONFIG_DIR = aichatConfigDir;
};
file.".config/helix/config.toml".text = ''
file = {
".config/helix/config.toml".text = ''
theme = "monokai_pro_spectrum"
[editor]
@ -63,32 +83,13 @@ in
[editor.statusline]
left = ["mode", "spinner"]
center = ["file-name"]
[keys.select.l]
c = ":pipe ${pkgs.unstablePkgs.aichat}/bin/aichat -c -r comment"
'';
file.".config/helix/languages.toml".text = ''
[[language]]
name = "nix"
formatter = { command = "nixpkgs-fmt" }
[[language]]
name = "python"
formatter = { command = "black", args = [ "-" ] }
language-servers = [ {name = "pyright"}, {name = "ruff-lsp"}, ]
[language-server.pyright]
command = "pyright-langserver"
args = ["--stdio"]
config = {}
[language-server.ruff-lsp]
command = "ruff-lsp"
args = []
config = {}
[[language]]
name = "bash"
indent = { tab-width = 2, unit = " " }
formatter = { command = 'shfmt', args = ["-i", "2"] }
'';
"${aichatConfigDir}/roles.yaml".text = aichatRoles;
"${aichatConfigDir}/config.yaml".text = aichatConfig;
};
};
}