Compare commits
27 Commits
ac5425e5b1
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b08d81ab0 | |||
| a3df8a8162 | |||
|
|
48dc241b0b | ||
|
|
7b70909a16 | ||
|
|
ff07a0a8c6 | ||
| 05aac965f1 | |||
| a4f23b64d3 | |||
|
|
268a06af61 | ||
|
|
fbbef69fa1 | ||
|
|
998200233c | ||
|
|
34aab3550d | ||
| c9478fa513 | |||
| 4acde426e9 | |||
| 40a288f413 | |||
| 2e09c668e5 | |||
|
|
43020e5b51 | ||
|
|
0b3b7c1822 | ||
|
|
497a318d0b | ||
|
|
302a4fe136 | ||
|
|
99b008305c | ||
|
|
c696e8702f | ||
|
|
ded04993c8 | ||
|
|
23058e5831 | ||
| 68f4726bcf | |||
|
|
c54bf86f7f | ||
|
|
e15989f29f | ||
| a1fe50ee54 |
95
flake.lock
generated
95
flake.lock
generated
@@ -12,11 +12,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1771437256,
|
||||
"narHash": "sha256-bLqwib+rtyBRRVBWhMuBXPCL/OThfokA+j6+uH7jDGU=",
|
||||
"lastModified": 1776249299,
|
||||
"narHash": "sha256-Dt9t1TGRmJFc0xVYhttNBD6QsAgHOHCArqGa0AyjrJY=",
|
||||
"owner": "numtide",
|
||||
"repo": "blueprint",
|
||||
"rev": "06ee7190dc2620ea98af9eb225aa9627b68b0e33",
|
||||
"rev": "56131e8628f173d24a27f6d27c0215eff57e40dd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -31,7 +31,6 @@
|
||||
"llm-agents",
|
||||
"flake-parts"
|
||||
],
|
||||
"import-tree": "import-tree",
|
||||
"nixpkgs": [
|
||||
"llm-agents",
|
||||
"nixpkgs"
|
||||
@@ -46,15 +45,16 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1770895533,
|
||||
"narHash": "sha256-v3QaK9ugy9bN9RXDnjw0i2OifKmz2NnKM82agtqm/UY=",
|
||||
"lastModified": 1777369708,
|
||||
"narHash": "sha256-1xW7cRZNsFNPQD+cE0fwnLVStnDth0HSoASEIFeT7uI=",
|
||||
"owner": "nix-community",
|
||||
"repo": "bun2nix",
|
||||
"rev": "c843f477b15f51151f8c6bcc886954699440a6e1",
|
||||
"rev": "e659e1cc4b8e1b21d0aa85f1c481f9db61ecfa98",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "staging-2.1.0",
|
||||
"repo": "bun2nix",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -67,11 +67,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1775087534,
|
||||
"narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
|
||||
"lastModified": 1777988971,
|
||||
"narHash": "sha256-qIoWPDs+0/8JecyYgE3gpKQxW/4bLW/gp45vow9ioCQ=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
|
||||
"rev": "0678d8986be1661af6bb555f3489f2fdfc31f6ff",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -80,6 +80,29 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"glide": {
|
||||
"inputs": {
|
||||
"home-manager": [
|
||||
"home-manager"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1777767341,
|
||||
"narHash": "sha256-lV2i2hBWxUKU2dgHza9SGfizOsV+uUcTQD/De+6/X3M=",
|
||||
"owner": "glide-browser",
|
||||
"repo": "glide.nix",
|
||||
"rev": "790c9d37e3dcf9bb04ae4486a0320b999a8eec32",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "glide-browser",
|
||||
"repo": "glide.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -87,11 +110,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1775143651,
|
||||
"narHash": "sha256-S0RqAyDPMTcv9vASMaE8eY1QexFysAOdnxUxFHIPOyE=",
|
||||
"lastModified": 1778248595,
|
||||
"narHash": "sha256-dhFgEjoeJMYN/7OY6xfxS799YB4IjbbYXTjyGIJyLpc=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "d166a078541982a76f14d3e06e9665fa5c9ed85e",
|
||||
"rev": "fdb2ccba9d5e1238d32e0c4a3ec1a277efa80c1d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -141,21 +164,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"import-tree": {
|
||||
"locked": {
|
||||
"lastModified": 1763762820,
|
||||
"narHash": "sha256-ZvYKbFib3AEwiNMLsejb/CWs/OL/srFQ8AogkebEPF0=",
|
||||
"owner": "vic",
|
||||
"repo": "import-tree",
|
||||
"rev": "3c23749d8013ec6daa1d7255057590e9ca726646",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "vic",
|
||||
"repo": "import-tree",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"llm-agents": {
|
||||
"inputs": {
|
||||
"blueprint": "blueprint",
|
||||
@@ -166,11 +174,11 @@
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1775136683,
|
||||
"narHash": "sha256-UWC+DqtcUiFxGS4Kc4AX5VNfKSKbUuZaFAVnPxcbZdM=",
|
||||
"lastModified": 1778247177,
|
||||
"narHash": "sha256-ZSe9r9xbx72NnBCCiC1UZxmIFzFA9IPno10Esp1kjiE=",
|
||||
"owner": "Qumulo",
|
||||
"repo": "llm-agents",
|
||||
"rev": "fd7a138b9649ec7868da78eb7a0db1fd7bd8bb37",
|
||||
"rev": "02444d83933d3ca28c9fd5d0be28812bdcf1232e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -197,11 +205,11 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1775064974,
|
||||
"narHash": "sha256-fp7+8MzxHrIixIIVvyORI2XpqpQnxf8NodmEHy8rczg=",
|
||||
"lastModified": 1778124196,
|
||||
"narHash": "sha256-pYEytCNic/czazbV9r3tbQ6BZzqRBg/41x2dIC5ymOo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6ebfbc38bdc6b22822a6f991f2d922306f33cfbc",
|
||||
"rev": "68a8af93ff4297686cb68880845e61e5e2e41d92",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -213,11 +221,11 @@
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1775036866,
|
||||
"narHash": "sha256-ZojAnPuCdy657PbTq5V0Y+AHKhZAIwSIT2cb8UgAz/U=",
|
||||
"lastModified": 1777954456,
|
||||
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6201e203d09599479a3b3450ed24fa81537ebc4e",
|
||||
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -237,11 +245,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1774915545,
|
||||
"narHash": "sha256-COT4l/+ZddGBvrDVfPf7MEOJxV8EDKame6/aRnNIKcY=",
|
||||
"lastModified": 1775856943,
|
||||
"narHash": "sha256-b7Mp7P+q2Md5AGt4rjHfMcBykzMumFTen10ST++AuTU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "plasma-manager",
|
||||
"rev": "f3177b3c69fb3f03201098d7fe8ab6422cce7fc1",
|
||||
"rev": "a524a6160e6df89f7673ba293cf7d78b559eb1a5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -252,6 +260,7 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"glide": "glide",
|
||||
"home-manager": "home-manager",
|
||||
"impermanence": "impermanence",
|
||||
"llm-agents": "llm-agents",
|
||||
@@ -282,11 +291,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1773297127,
|
||||
"narHash": "sha256-6E/yhXP7Oy/NbXtf1ktzmU8SdVqJQ09HC/48ebEGBpk=",
|
||||
"lastModified": 1775636079,
|
||||
"narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "71b125cd05fbfd78cab3e070b73544abe24c5016",
|
||||
"rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
23
flake.nix
23
flake.nix
@@ -11,6 +11,12 @@
|
||||
# to avoid problems caused by different versions of nixpkgs.
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
glide = {
|
||||
url = "github:glide-browser/glide.nix";
|
||||
# optionally: follow your flake's inputs
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.home-manager.follows = "home-manager";
|
||||
};
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
plasma-manager = {
|
||||
url = "github:nix-community/plasma-manager";
|
||||
@@ -29,6 +35,7 @@
|
||||
impermanence,
|
||||
plasma-manager,
|
||||
llm-agents,
|
||||
glide,
|
||||
# nix-flatpak,
|
||||
}@inputs:
|
||||
let
|
||||
@@ -72,6 +79,22 @@
|
||||
}
|
||||
];
|
||||
};
|
||||
latitude = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./machines/latitude/configuration.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.extraSpecialArgs = { inherit inputs outputs; };
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
home-manager.users.laythe = import ./machines/latitude/home.nix;
|
||||
home-manager.sharedModules = [ plasma-manager.homeModules.plasma-manager ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
nix-fast-build
|
||||
colmena
|
||||
;
|
||||
openldap = prev.openldap.overrideAttrs {
|
||||
doCheck = !prev.stdenv.hostPlatform.isi686;
|
||||
};
|
||||
})
|
||||
];
|
||||
nix.package = pkgs.lixPackageSets.stable.lix;
|
||||
@@ -32,13 +35,13 @@
|
||||
blasSupport = true;
|
||||
}).overrideAttrs
|
||||
(oldAttrs: rec {
|
||||
version = "8660";
|
||||
version = "8940";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "ggml-org";
|
||||
repo = "llama.cpp";
|
||||
tag = "b${version}";
|
||||
# rev = "6ebf2e0d00d31acfc1a1fa9662e9a7d38bd07bf7"; # https://github.com/ggml-org/llama.cpp/pull/19970
|
||||
hash = "sha256-4QwFMHpaYeD+aul/p5XFBRYivJ6WgI1kxecbrqFml6o=";
|
||||
hash = "sha256-JlJeNO7eID6JvxZMkck136mC/Rvd5v8320tAuQabzhU=";
|
||||
leaveDotGit = true;
|
||||
postFetch = ''
|
||||
git -C "$out" rev-parse --short HEAD > $out/COMMIT
|
||||
@@ -46,7 +49,7 @@
|
||||
'';
|
||||
};
|
||||
# Must update npm deps hash to match the new version's webui dependencies
|
||||
npmDepsHash = "sha256-DxgUDVr+kwtW55C4b89Pl+j3u2ILmACcQOvOBjKWAKQ=";
|
||||
npmDepsHash = "sha256-RAFtsbBGBjteCt5yXhrmHL39rIDJMCFBETgzId2eRRk=";
|
||||
# Enable native CPU optimizations for massively better CPU performance
|
||||
# This enables AVX, AVX2, AVX-512, FMA, etc. for your specific CPU
|
||||
# NOTE: This is intentionally opposite of nixpkgs (which uses -DGGML_NATIVE=off
|
||||
@@ -101,7 +104,6 @@
|
||||
} -C $out/bin
|
||||
chmod +x $out/bin/llama-swap
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
# 🇺🇸
|
||||
@@ -232,8 +234,23 @@
|
||||
jq
|
||||
nasctui
|
||||
trilium-desktop
|
||||
haruna
|
||||
(pkgs.runCommand "nvenc-compress" { nativeBuildInputs = [ pkgs.bash ]; }
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
cp ${./nvenc_compress.sh} $out/bin/nvenc-compress
|
||||
chmod +x $out/bin/nvenc-compress
|
||||
'')
|
||||
];
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
twitter-color-emoji
|
||||
];
|
||||
|
||||
fonts.fontconfig.defaultFonts = {
|
||||
emoji = [ "Twitter Color Emoji" ];
|
||||
};
|
||||
|
||||
services.usbmuxd = {
|
||||
enable = true;
|
||||
package = pkgs.usbmuxd2;
|
||||
|
||||
87
global/nvenc_compress.sh
Executable file
87
global/nvenc_compress.sh
Executable file
@@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Usage: nvenc_compress.sh <video_path> [target_size_mb]
|
||||
|
||||
VIDEO="$1"
|
||||
TARGET_MB="${2:-9}"
|
||||
TARGET_BYTES=$((TARGET_MB * 1024 * 1024))
|
||||
|
||||
if [[ ! -f "$VIDEO" ]]; then
|
||||
echo "Error: file not found: $VIDEO"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BASENAME="${VIDEO##*/}"
|
||||
BASENAME="${BASENAME%.*}"
|
||||
OUTDIR="$(dirname "$VIDEO")"
|
||||
OUTFILE="$OUTDIR/${BASENAME}_compressed.mp4"
|
||||
|
||||
# nvenc cq range: 0 (best/largest) to 51 (worst/smallest)
|
||||
# We binary search this range to hit the target file size
|
||||
LO=0
|
||||
HI=51
|
||||
BEST_DIFF=999999999
|
||||
BEST_CQ=23
|
||||
MAX_ITERATIONS=20
|
||||
|
||||
echo "Target size: ${TARGET_MB}MB (${TARGET_BYTES} bytes)"
|
||||
echo "Encoding with nvenc (h264_nvenc)..."
|
||||
echo ""
|
||||
|
||||
for ((i=0; i<MAX_ITERATIONS; i++)); do
|
||||
CQ=$(( (LO + HI) / 2 ))
|
||||
TMPFILE="${OUTFILE}_iter_${i}_cq${CQ}.mp4"
|
||||
|
||||
echo "--- Iteration $((i+1))/$MAX_ITERATIONS ---"
|
||||
echo "Trying cq=$CQ (lo=$LO, hi=$HI)"
|
||||
|
||||
ffmpeg -y -i "$VIDEO" -c:v h264_nvenc -cq "$CQ" -c:a copy -preset p7 -f mp4 "$TMPFILE" 2>/dev/null
|
||||
|
||||
if [[ ! -f "$TMPFILE" ]]; then
|
||||
echo "Error: ffmpeg failed at cq=$CQ"
|
||||
rm -f "$TMPFILE"
|
||||
break
|
||||
fi
|
||||
|
||||
FILE_SIZE=$(stat -c%s "$TMPFILE" 2>/dev/null || stat -f%z "$TMPFILE" 2>/dev/null)
|
||||
DIFF=$(( FILE_SIZE - TARGET_BYTES ))
|
||||
ABS_DIFF=${DIFF#-}
|
||||
|
||||
echo " Size: $(( FILE_SIZE / 1024 / 1024 ))MB (diff: $(( DIFF / 1024 / 1024 ))MB)"
|
||||
|
||||
if (( ABS_DIFF < BEST_DIFF )); then
|
||||
BEST_DIFF=$ABS_DIFF
|
||||
BEST_CQ=$CQ
|
||||
cp "$TMPFILE" "$OUTFILE"
|
||||
fi
|
||||
|
||||
rm -f "$TMPFILE"
|
||||
|
||||
# If within 1% of target, we're close enough
|
||||
if (( ABS_DIFF < TARGET_BYTES / 100 )); then
|
||||
echo ""
|
||||
echo "Within tolerance! Stopping."
|
||||
break
|
||||
fi
|
||||
|
||||
# Binary search direction:
|
||||
# Higher cq = smaller file, lower cq = larger file
|
||||
if (( FILE_SIZE > TARGET_BYTES )); then
|
||||
# File too big, need higher cq (smaller)
|
||||
LO=$(( CQ + 1 ))
|
||||
else
|
||||
# File too small, need lower cq (larger)
|
||||
HI=$(( CQ - 1 ))
|
||||
fi
|
||||
|
||||
if (( LO > HI )); then
|
||||
echo ""
|
||||
echo "Range exhausted. Stopping."
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Done! Best cq=$BEST_CQ, final size: $(( BEST_DIFF / 1024 / 1024 ))MB from target"
|
||||
echo "Output: $OUTFILE"
|
||||
@@ -1,4 +1,4 @@
|
||||
{...}:
|
||||
{ ... }:
|
||||
{
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
@@ -12,4 +12,4 @@
|
||||
activate-linux = "echo Done!"; # I am a shitposter at heart
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
# Configure network connections interactively with nmcli or nmtui.
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
virtualization.podman.enableNvidia = true;
|
||||
|
||||
# Only computer I own that can actually run ollama, and I don't want to make an ai folder.
|
||||
# services.ollama = {
|
||||
# enable = true;
|
||||
@@ -48,6 +50,8 @@
|
||||
pkgs.opencode
|
||||
pkgs.llama-cpp
|
||||
pkgs.llama-swap
|
||||
# pkgs.agent-browser
|
||||
pkgs.nvidia-container-toolkit
|
||||
|
||||
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.pi
|
||||
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.rtk
|
||||
@@ -90,11 +94,17 @@
|
||||
# As long as this is here the models are declarative. llama-server will grab them if not downloaded already.
|
||||
environment.etc."llama-swap/config.yaml".text = ''
|
||||
models:
|
||||
"Qwen3.6-35B-A3B-GGUF":
|
||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.6-35B-A3B-GGUF:UD-Q4_K_S --ctx-size 128000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -np 1 --fit-target 256 --ubatch-size 1024 -fa on --slots --slot-save-path /home/laythe/llamapcache --jinja -kvu --no-mmproj --swa-checkpoints 32 --chat-template-kwargs '{\"preserve_thinking\": true}'"
|
||||
ttl: 2400
|
||||
"Qwen3.6-35B-A3B-FLASH":
|
||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.6-35B-A3B-GGUF:UD-Q3_K_M --ctx-size 128000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -np 1 --fit-target 256 --ubatch-size 1024 -fa on --slots --slot-save-path /home/laythe/llamapcache --jinja -kvu --no-mmproj --swa-checkpoints 32 --chat-template-kwargs '{\"preserve_thinking\": true}'"
|
||||
ttl: 2400
|
||||
"Qwen3.5-35B-A3B-GGUF":
|
||||
cmd: llama-server --port ''${PORT} -hf mudler/Qwen3.5-35B-A3B-APEX-GGUF:Mini --ctx-size 128000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -np 1 --fit-target 256 --ubatch-size 1024 -fa on --slots --slot-save-path /home/laythe/llamapcache --jinja -kvu --no-mmproj --swa-checkpoints 32 --no-kv-offload
|
||||
ttl: 2400
|
||||
"Gemma4-26B-A4B":
|
||||
cmd: llama-server --port ''${PORT} -hf unsloth/gemma-4-26B-A4B-it-GGUF:UD-IQ4_XS --ctx-size 128000 --temp 1.0 --top-p 0.95 --top-k 64 --min-p 0.00 -np 1 --fit-target 256 --ubatch-size 1024 -fa on --slots --slot-save-path /home/laythe/llamapcache --jinja -kvu --no-mmproj --swa-checkpoints 32 --no-kv-offload
|
||||
cmd: llama-server --port ''${PORT} -hf mudler/gemma-4-26B-A4B-it-heretic-APEX-GGUF:Mini --ctx-size 128000 --temp 1.0 --top-p 0.95 --top-k 64 --min-p 0.00 -np 1 --fit-target 256 --ubatch-size 1024 -fa on --slots --slot-save-path /home/laythe/llamapcache --jinja -kvu --no-mmproj --swa-checkpoints 32 --no-kv-offload
|
||||
ttl: 2400
|
||||
"Qwen3-1.7B-GGUF":
|
||||
cmd: llama-server --port ''${PORT} -hf unsloth/Qwen3-1.7B-GGUF:Q4_K_S --ctx-size 32768 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu
|
||||
@@ -105,20 +115,17 @@
|
||||
"Qwen3-4B-Claude-Opus-Distill":
|
||||
cmd: llama-server --port ''${PORT} -hf TeichAI/Qwen3-4B-Thinking-2507-Claude-4.5-Opus-High-Reasoning-Distill-GGUF:Q4_K_M --ctx-size 32768 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256
|
||||
ttl: 300
|
||||
"Qwen3.5-9B-Thinking":
|
||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-9B-GGUF:Q4_K_M --ctx-size 128000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256 --chat-template-kwargs '{\"enable_thinking\": true}' --no-mmproj --no-kv-offload"
|
||||
"Qwen3.5-9B":
|
||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-9B-GGUF:Q4_K_M --ctx-size 64000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256"
|
||||
ttl: 300
|
||||
"Qwen3.5-9B-Claude-Opus-Distill":
|
||||
cmd: "llama-server --port ''${PORT} -hf Jackrong/Qwen3.5-9B-Claude-4.6-Opus-Reasoning-Distilled-GGUF:Q4_K_S --ctx-size 32000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 512 --chat-template-kwargs '{\"enable_thinking\": true}' --no-mmproj"
|
||||
ttl: 300
|
||||
"Qwen3.5-4B-Thinking":
|
||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-4B-GGUF:Q4_K_M --ctx-size 64000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256 --chat-template-kwargs '{\"enable_thinking\": true}'"
|
||||
"Qwen3.5-4B":
|
||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-4B-GGUF:Q4_K_M --ctx-size 64000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256"
|
||||
ttl: 300
|
||||
"Qwen3.5-9B-Non-Thinking":
|
||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-9B-GGUF:Q4_K_M --ctx-size 32000 --temp 0.7 --top-p 0.8 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256 --no-mmproj"
|
||||
ttl: 300
|
||||
"Qwen3.5-4B-Non-Thinking":
|
||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-4B-GGUF:Q4_K_M --ctx-size 64000 --temp 0.7 --top-p 0.8 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256"
|
||||
"Gemma4-E4B":
|
||||
cmd: "llama-server --port ''${PORT} -hf Abhiray/gemma-4-E4B-it-heretic-GGUF:Q4_K_M --ctx-size 64000 --temp 0.7 --top-p 0.8 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256"
|
||||
ttl: 300
|
||||
"Qwen3.5-0.8B-Non-Thinking":
|
||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-0.8B-GGUF:Q4_K_M --ctx-size 64000 --temp 0.7 --top-p 0.8 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256"
|
||||
|
||||
@@ -93,10 +93,10 @@
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
nix.settings = {
|
||||
substituters = [ "https://cache.nixos-cuda.org" ];
|
||||
trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
|
||||
};
|
||||
# nix.settings = {
|
||||
# substituters = [ "https://cache.nixos-cuda.org" ];
|
||||
# trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
|
||||
# };
|
||||
|
||||
system.stateVersion = "24.11"; # No touchy
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
{config, pkgs, lib, inputs, outputs, ...}:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
outputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# These both are probably always going to be the same, but I'll keep them local just in case:tm:
|
||||
home.username = "laythe";
|
||||
@@ -11,4 +18,6 @@
|
||||
home.stateVersion = "24.11";
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
|
||||
fonts.fontconfig.subpixelRendering = "none";
|
||||
}
|
||||
|
||||
138
machines/latitude/configuration.nix
Executable file
138
machines/latitude/configuration.nix
Executable file
@@ -0,0 +1,138 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page, on
|
||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../global/default.nix
|
||||
../../modules/communication/default.nix
|
||||
../../modules/creative/default.nix
|
||||
../../modules/development/default.nix
|
||||
../../modules/fabrication/default.nix
|
||||
../../modules/gaming/default.nix
|
||||
../../modules/sway/default.nix
|
||||
../../modules/virtualization/default.nix
|
||||
# ../../modules/vr/default.nix
|
||||
# ../../global/eraseyourdarlings.nix
|
||||
];
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
# boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.hostName = "latitude"; # Define your hostname.
|
||||
|
||||
# Configure network connections interactively with nmcli or nmtui.
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Only computer I own that can actually run ollama, and I don't want to make an ai folder.
|
||||
# services.ollama = {
|
||||
# enable = true;
|
||||
# acceleration = "cuda";
|
||||
# host = "[::]";
|
||||
# };
|
||||
|
||||
# Set your time zone.
|
||||
# time.timeZone = "Europe/Amsterdam";
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
# Select internationalisation properties.
|
||||
# i18n.defaultLocale = "en_US.UTF-8";
|
||||
# console = {
|
||||
# font = "Lat2-Terminus16";
|
||||
# keyMap = "us";
|
||||
# useXkbConfig = true; # use xkb.options in tty.
|
||||
# };
|
||||
|
||||
# services.xserver.enable = true; # On anything else modern this should be false.
|
||||
|
||||
# Configure keymap in X11
|
||||
# services.xserver.xkb.layout = "us";
|
||||
# services.xserver.xkb.options = "eurosign:e,caps:escape";
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
# services.printing.enable = true;
|
||||
|
||||
# Enable sound.
|
||||
# services.pulseaudio.enable = true;
|
||||
# OR
|
||||
# services.pipewire = {
|
||||
# enable = true;
|
||||
# pulse.enable = true;
|
||||
# };
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
# services.libinput.enable = true;
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
# users.users.alice = {
|
||||
# isNormalUser = true;
|
||||
# extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||||
# packages = with pkgs; [
|
||||
# tree
|
||||
# ];
|
||||
# };
|
||||
|
||||
# programs.firefox.enable = true;
|
||||
|
||||
# List packages installed in system profile.
|
||||
# You can use https://search.nixos.org/ to find more packages (and options).
|
||||
environment.systemPackages = [
|
||||
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.pi
|
||||
];
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
# programs.gnupg.agent = {
|
||||
# enable = true;
|
||||
# enableSSHSupport = true;
|
||||
# };
|
||||
|
||||
# List services that you want to enable:
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
# services.openssh.enable = true;
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
# Copy the NixOS configuration file and link it from the resulting system
|
||||
# (/run/current-system/configuration.nix). This is useful in case you
|
||||
# accidentally delete configuration.nix.
|
||||
# system.copySystemConfiguration = true;
|
||||
|
||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||
#
|
||||
# Most users should NEVER change this value after the initial install, for any reason,
|
||||
# even if you've upgraded your system to a new NixOS release.
|
||||
#
|
||||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||
# to actually do that.
|
||||
#
|
||||
# This value being lower than the current NixOS release does NOT mean your system is
|
||||
# out of date, out of support, or vulnerable.
|
||||
#
|
||||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||
# and migrated your data accordingly.
|
||||
#
|
||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
system.stateVersion = "25.11"; # Did you read the comment?
|
||||
|
||||
}
|
||||
86
machines/latitude/hardware-configuration.nix
Executable file
86
machines/latitude/hardware-configuration.nix
Executable file
@@ -0,0 +1,86 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
# services.tlp.enable = true;
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
"nvme"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"sdhci_pci"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/NIXROOT";
|
||||
fsType = "ext4";
|
||||
};
|
||||
boot.resumeDevice = "/dev/disk/by-label/NIXSWAP";
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/NIXBOOT";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0022"
|
||||
"dmask=0022"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/dev/disk/by-label/NIXSWAP";
|
||||
}
|
||||
];
|
||||
|
||||
services.power-profiles-daemon.enable = true;
|
||||
# Suspend first then hibernate when closing the lid
|
||||
services.logind.settings.Login.LidSwitch = "ignore";
|
||||
# Hibernate on power button pressed
|
||||
services.logind.settings.Login.PowerKey = "hibernate";
|
||||
services.logind.settings.Login.PowerKeyLongPress = "poweroff";
|
||||
|
||||
# Suspend first
|
||||
boot.kernelParams = [
|
||||
"mem_sleep_default=deep"
|
||||
];
|
||||
|
||||
# Define time delay for hibernation
|
||||
systemd.sleep.settings.Sleep = {
|
||||
HibernateDelaySec = 300;
|
||||
};
|
||||
|
||||
# facial recognition
|
||||
security.pam.howdy.enable = true;
|
||||
services.howdy.enable = true;
|
||||
services.linux-enable-ir-emitter.enable = true; # lmao
|
||||
# by default face is good enough
|
||||
security.pam.howdy.control = "sufficient";
|
||||
services.howdy.settings = {
|
||||
core = {
|
||||
workaround = "off";
|
||||
};
|
||||
video = {
|
||||
timeout = "20";
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
23
machines/latitude/home.nix
Executable file
23
machines/latitude/home.nix
Executable file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
outputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# These both are probably always going to be the same, but I'll keep them local just in case:tm:
|
||||
home.username = "laythe";
|
||||
home.homeDirectory = lib.mkForce "/home/laythe";
|
||||
|
||||
imports = [
|
||||
../../home/default.nix
|
||||
../../modules/sway/home.nix
|
||||
# ../../modules/kde/home.nix
|
||||
];
|
||||
|
||||
home.stateVersion = "25.11";
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
@@ -17,7 +17,6 @@
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
policies.ExtensionSettings = {
|
||||
"*".installation_mode = "blocked"; # blocks all addons except the ones specified below
|
||||
# uBlock Origin:
|
||||
"uBlock0@raymondhill.net" = {
|
||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
||||
|
||||
77
modules/sway/default.nix
Normal file
77
modules/sway/default.nix
Normal file
@@ -0,0 +1,77 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
configure-gtk = pkgs.writeTextFile {
|
||||
name = "configure-gtk";
|
||||
destination = "/bin/configure-gtk";
|
||||
executable = true;
|
||||
text =
|
||||
let
|
||||
schema = pkgs.gsettings-desktop-schemas;
|
||||
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
|
||||
in
|
||||
''
|
||||
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
|
||||
gnome_schema=org.gnome.desktop.interface
|
||||
gsettings set $gnome_schema gtk-theme 'Dracula'
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
wl-clipboard # Copy/Paste functionality.
|
||||
mako # Notification utility.
|
||||
];
|
||||
|
||||
# Enables Gnome Keyring to store secrets for applications.
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
pkgs.xdg-desktop-portal-wlr
|
||||
];
|
||||
};
|
||||
|
||||
security.polkit.enable = true;
|
||||
|
||||
# Enable Sway.
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = false;
|
||||
extraPackages = [
|
||||
pkgs.foot
|
||||
pkgs.swayidle
|
||||
pkgs.swaylock
|
||||
pkgs.wmenu
|
||||
pkgs.wl-clipboard
|
||||
pkgs.mako
|
||||
pkgs.kdePackages.kate
|
||||
pkgs.kdePackages.filelight
|
||||
inputs.glide.packages.${pkgs.stdenv.hostPlatform.system}.default
|
||||
pkgs.swaybg
|
||||
pkgs.pulseaudioFull
|
||||
pkgs.waybar
|
||||
pkgs.dracula-theme # gtk theme
|
||||
pkgs.brightnessctl
|
||||
configure-gtk
|
||||
pkgs.mpvpaper
|
||||
];
|
||||
};
|
||||
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
default_session = {
|
||||
command = "${pkgs.tuigreet}/bin/tuigreet --remember --time --cmd sway";
|
||||
user = "greeter";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
354
modules/sway/home.nix
Normal file
354
modules/sway/home.nix
Normal file
@@ -0,0 +1,354 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true; # Fixes common issues with GTK 3 apps
|
||||
config = rec {
|
||||
modifier = "Mod4";
|
||||
# Use kitty as default terminal
|
||||
terminal = "foot";
|
||||
keybindings = {
|
||||
# Brightness Controls
|
||||
"XF86MonBrightnessDown" = "exec brightnessctl s 5%-";
|
||||
"XF86MonBrightnessUp" = "exec brightnessctl s 5%+";
|
||||
|
||||
# Volume Controls
|
||||
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%";
|
||||
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%";
|
||||
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
|
||||
"Mod4+q" = "kill";
|
||||
"Mod4+Return" = "exec foot";
|
||||
"Mod4+Shift+q" = "kill";
|
||||
"Mod4+d" = "exec wmenu-run";
|
||||
|
||||
"Mod4+Left" = "focus left";
|
||||
"Mod4+Down" = "focus down";
|
||||
"Mod4+Up" = "focus up";
|
||||
"Mod4+Right" = "focus right";
|
||||
|
||||
"Mod4+Shift+Left" = "move left";
|
||||
"Mod4+Shift+Down" = "move down";
|
||||
"Mod4+Shift+Up" = "move up";
|
||||
"Mod4+Shift+Right" = "move right";
|
||||
|
||||
"Mod4+b" = "splith";
|
||||
"Mod4+v" = "splitv";
|
||||
"Mod4+f" = "fullscreen toggle";
|
||||
"Mod4+a" = "focus parent";
|
||||
|
||||
"Mod4+s" = "layout stacking";
|
||||
"Mod4+w" = "layout tabbed";
|
||||
"Mod4+e" = "layout toggle split";
|
||||
|
||||
"Mod4+Shift+space" = "floating toggle";
|
||||
"Mod4+space" = "focus mode_toggle";
|
||||
|
||||
"Mod4+1" = "workspace number 1";
|
||||
"Mod4+2" = "workspace number 2";
|
||||
"Mod4+3" = "workspace number 3";
|
||||
"Mod4+4" = "workspace number 4";
|
||||
"Mod4+5" = "workspace number 5";
|
||||
"Mod4+6" = "workspace number 6";
|
||||
"Mod4+7" = "workspace number 7";
|
||||
"Mod4+8" = "workspace number 8";
|
||||
"Mod4+9" = "workspace number 9";
|
||||
"Mod4+0" = "workspace number 10";
|
||||
|
||||
"Mod4+Shift+1" = "move container to workspace number 1";
|
||||
"Mod4+Shift+2" = "move container to workspace number 2";
|
||||
"Mod4+Shift+3" = "move container to workspace number 3";
|
||||
"Mod4+Shift+4" = "move container to workspace number 4";
|
||||
"Mod4+Shift+5" = "move container to workspace number 5";
|
||||
"Mod4+Shift+6" = "move container to workspace number 6";
|
||||
"Mod4+Shift+7" = "move container to workspace number 7";
|
||||
"Mod4+Shift+8" = "move container to workspace number 8";
|
||||
"Mod4+Shift+9" = "move container to workspace number 9";
|
||||
"Mod4+Shift+0" = "move container to workspace number 10";
|
||||
|
||||
"Mod4+Shift+minus" = "move scratchpad";
|
||||
"Mod4+minus" = "scratchpad show";
|
||||
|
||||
"Mod4+p" = "[app_id=\"trilium\"] scratchpad show, resize set 90 ppt 90 ppt, move position center";
|
||||
"Mod4+g" = "exec glide-browser";
|
||||
|
||||
"Mod4+Shift+i" = "exec makoctl invoke && makoctl dismiss";
|
||||
"Mod4+i" = "exec makoctl dismiss";
|
||||
|
||||
"Mod4+Shift+c" = "reload";
|
||||
"Mod4+Shift+e" =
|
||||
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
||||
|
||||
"Mod4+r" = "mode resize";
|
||||
|
||||
"Mod4+c" = "[app_id=\"discord\"] scratchpad show, resize set 90 ppt 90 ppt, move position center";
|
||||
|
||||
"Mod4+j" = "[class=\"Jami\"] scratchpad show, resize set 90 ppt 90 ppt, move position center";
|
||||
|
||||
"Print" = "exec flameshot gui";
|
||||
};
|
||||
bars = [
|
||||
{
|
||||
command = "${pkgs.waybar}/bin/waybar";
|
||||
}
|
||||
];
|
||||
output = {
|
||||
eDP-1 = {
|
||||
scale = "1.25";
|
||||
};
|
||||
};
|
||||
input = {
|
||||
"type:touchpad" = {
|
||||
# Enables or disables tap for specified input device.
|
||||
tap = "enabled";
|
||||
# Enables or disables natural (inverted) scrolling for the specified input device.
|
||||
natural_scroll = "enabled";
|
||||
# Enables or disables disable-while-typing for the specified input device.
|
||||
dwt = "disabled";
|
||||
};
|
||||
};
|
||||
bindswitches = {
|
||||
"lid:on" = {
|
||||
reload = true;
|
||||
locked = true;
|
||||
action = "exec systemctl suspend-then-hibernate";
|
||||
};
|
||||
};
|
||||
startup = [
|
||||
# { command = "swaybg -i ~/.background-image -m fill"; }
|
||||
{ command = "discord --enable-features=UseOzonePlatform --ozone-platform=wayland"; }
|
||||
{ command = "trilium"; }
|
||||
{ command = "jami"; }
|
||||
];
|
||||
window.commands = [
|
||||
{
|
||||
criteria = {
|
||||
app_id = "discord";
|
||||
};
|
||||
command = "move scratchpad";
|
||||
}
|
||||
{
|
||||
criteria = {
|
||||
app_id = "trilium";
|
||||
};
|
||||
command = "move scratchpad";
|
||||
}
|
||||
{
|
||||
criteria = {
|
||||
class = "Jami";
|
||||
};
|
||||
command = "move scratchpad";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.random-background = {
|
||||
Unit = {
|
||||
Description = "Universal Wallpaper Rotator (Images, GIFs, Videos)";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "simple";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
|
||||
ExecStart = "${pkgs.writeShellScript "wallpaper-rotator" ''
|
||||
WALLPAPER_DIR="$HOME/wallpapers"
|
||||
INTERVAL=60 # Time in seconds between wallpaper changes (600 = 10 mins)
|
||||
|
||||
# 1. Safely find Wayland and Sway sockets
|
||||
if [ -z "$WAYLAND_DISPLAY" ]; then
|
||||
shopt -s nullglob
|
||||
W_SOCKETS=("$XDG_RUNTIME_DIR"/wayland-[0-9]*)
|
||||
if [ ''${#W_SOCKETS[@]} -gt 0 ]; then
|
||||
export WAYLAND_DISPLAY=$(basename "''${W_SOCKETS[0]}")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$SWAYSOCK" ]; then
|
||||
shopt -s nullglob
|
||||
S_SOCKETS=("$XDG_RUNTIME_DIR"/sway-ipc.*.sock)
|
||||
if [ ''${#S_SOCKETS[@]} -gt 0 ]; then
|
||||
export SWAYSOCK="''${S_SOCKETS[0]}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# State tracking for mpvpaper
|
||||
MPV_PID=""
|
||||
|
||||
# Clean up mpvpaper gracefully if systemd stops the service
|
||||
cleanup() {
|
||||
if [ -n "$MPV_PID" ]; then
|
||||
kill $MPV_PID 2>/dev/null || true
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
trap cleanup SIGINT SIGTERM
|
||||
|
||||
# 2. Infinite rotation loop
|
||||
while true; do
|
||||
if [ ! -d "$WALLPAPER_DIR" ]; then
|
||||
echo "Wallpaper directory not found. Waiting..."
|
||||
${pkgs.coreutils}/bin/sleep 60
|
||||
continue
|
||||
fi
|
||||
|
||||
# Find images, gifs, and videos
|
||||
MEDIA=$(${pkgs.findutils}/bin/find "$WALLPAPER_DIR" -type f \( \
|
||||
-iname \*.jpg -o -iname \*.jpeg -o -iname \*.png -o \
|
||||
-iname \*.mp4 -o -iname \*.webm -o -iname \*.mkv -o -iname \*.gif \
|
||||
\) 2>/dev/null | ${pkgs.coreutils}/bin/shuf -n 1 || true)
|
||||
|
||||
if [ -n "$MEDIA" ]; then
|
||||
echo "Selected: $MEDIA"
|
||||
EXT="''${MEDIA##*.}"
|
||||
EXT=$(echo "$EXT" | tr '[:upper:]' '[:lower:]') # Convert to lowercase
|
||||
|
||||
# If it's a static image, use Sway directly (saves battery/RAM)
|
||||
if [[ "$EXT" == "jpg" || "$EXT" == "jpeg" || "$EXT" == "png" ]]; then
|
||||
if [ -n "$MPV_PID" ]; then
|
||||
kill $MPV_PID 2>/dev/null || true
|
||||
MPV_PID=""
|
||||
fi
|
||||
${pkgs.sway}/bin/swaymsg output "*" bg "$MEDIA" fill
|
||||
|
||||
# If it's a video/gif, use mpvpaper
|
||||
else
|
||||
if [ -n "$MPV_PID" ]; then
|
||||
kill $MPV_PID 2>/dev/null || true
|
||||
fi
|
||||
# Start mpvpaper in the background and record its process ID
|
||||
${pkgs.mpvpaper}/bin/mpvpaper -o "loop no-audio" "*" "$MEDIA" &
|
||||
MPV_PID=$!
|
||||
fi
|
||||
else
|
||||
echo "No media found in $WALLPAPER_DIR."
|
||||
fi
|
||||
|
||||
# Wait for the next rotation
|
||||
${pkgs.coreutils}/bin/sleep $INTERVAL
|
||||
done
|
||||
''}";
|
||||
};
|
||||
};
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
style = ./waybar.css;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "bottom"; # Puts the bar at the bottom
|
||||
height = 30;
|
||||
|
||||
# Define what goes where on the bar
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/mode"
|
||||
];
|
||||
modules-center = [ "sway/window" ];
|
||||
modules-right = [
|
||||
"backlight"
|
||||
"pulseaudio"
|
||||
"battery"
|
||||
"clock"
|
||||
"tray"
|
||||
];
|
||||
backlight = {
|
||||
format = "{icon} {percent}%";
|
||||
format-icons = [
|
||||
"🌑"
|
||||
"🌘"
|
||||
"🌗"
|
||||
"🌖"
|
||||
"🌕"
|
||||
];
|
||||
};
|
||||
pulseaudio = {
|
||||
format = "{icon} {volume}%";
|
||||
format-muted = "🔇 Muted";
|
||||
format-icons = {
|
||||
default = [
|
||||
"🔈"
|
||||
"🔉"
|
||||
"🔊"
|
||||
];
|
||||
};
|
||||
scroll-step = 1;
|
||||
on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
};
|
||||
|
||||
clock = {
|
||||
"format" = "{:%I:%M %p}";
|
||||
"format-alt" = "{:%d-%m-%Y}";
|
||||
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
|
||||
};
|
||||
battery = {
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{icon} {capacity}% ({time})";
|
||||
format-charging = "⚡ {capacity}% ({time})";
|
||||
format-plugged = "🔌 {capacity}% ({time})";
|
||||
format-icons = [
|
||||
"🪫"
|
||||
"🔋"
|
||||
"🔋"
|
||||
"🔋"
|
||||
"🔋"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.swayidle.events = {
|
||||
"before-sleep" = "${pkgs.swaylock}/bin/swaylock -fF";
|
||||
};
|
||||
services.swayidle.enable = true;
|
||||
|
||||
# Configure Qt to use kvantum theming
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme.name = "org.kde.breezedark.desktop";
|
||||
style = {
|
||||
name = "org.kde.breezedark.desktop";
|
||||
};
|
||||
};
|
||||
|
||||
services.flameshot = {
|
||||
# Also installs/enables flameshot
|
||||
enable = true;
|
||||
settings = {
|
||||
General = {
|
||||
useGrimAdapter = true;
|
||||
# Stops warnings for using Grim
|
||||
disabledGrimWarning = true;
|
||||
uiColor = "#00ff73";
|
||||
contrastUiColor = "#002f01";
|
||||
drawColor = "#ff0000";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Install packages for better Qt support and kvantum themes
|
||||
home.packages = with pkgs; [
|
||||
kdePackages.breeze
|
||||
];
|
||||
|
||||
# Environment variables for kvantum theming
|
||||
home.sessionVariables = {
|
||||
QT_QPA_PLATFORMTHEME = "org.kde.breezedark.desktop";
|
||||
QT_STYLE_OVERRIDE = "org.kde.breezedark.desktop";
|
||||
GTK_THEME = "Materia-dark-compact";
|
||||
};
|
||||
|
||||
}
|
||||
329
modules/sway/waybar.css
Normal file
329
modules/sway/waybar.css
Normal file
@@ -0,0 +1,329 @@
|
||||
* {
|
||||
/* `otf-font-awesome` is required to be installed for icons */
|
||||
font-family: Roboto, Helvetica, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: rgba(43, 48, 59, 0.5);
|
||||
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
|
||||
color: #ffffff;
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
/*
|
||||
window#waybar.empty {
|
||||
background-color: transparent;
|
||||
}
|
||||
window#waybar.solo {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
*/
|
||||
|
||||
window#waybar.termite {
|
||||
background-color: #3F3F3F;
|
||||
}
|
||||
|
||||
window#waybar.chromium {
|
||||
background-color: #000000;
|
||||
border: none;
|
||||
}
|
||||
|
||||
button {
|
||||
/* Use box-shadow instead of border so the text isn't offset */
|
||||
box-shadow: inset 0 -3px transparent;
|
||||
/* Avoid rounded borders under each button name */
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
button:hover {
|
||||
background: inherit;
|
||||
box-shadow: inset 0 -3px #ffffff;
|
||||
}
|
||||
|
||||
/* you can set a style on hover for any module like this */
|
||||
#pulseaudio:hover {
|
||||
background-color: #a37800;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background-color: transparent;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#workspaces button.focused,
|
||||
#workspaces button.active {
|
||||
background-color: #64727D;
|
||||
box-shadow: inset 0 -3px #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background-color: #64727D;
|
||||
box-shadow: inset 0 -3px #ffffff;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#disk,
|
||||
#temperature,
|
||||
#backlight,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#wireplumber,
|
||||
#custom-media,
|
||||
#tray,
|
||||
#mode,
|
||||
#idle_inhibitor,
|
||||
#scratchpad,
|
||||
#power-profiles-daemon,
|
||||
#mpd {
|
||||
padding: 0 10px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#window,
|
||||
#workspaces {
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
/* If workspaces is the leftmost module, omit left margin */
|
||||
.modules-left>widget:first-child>#workspaces {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* If workspaces is the rightmost module, omit right margin */
|
||||
.modules-right>widget:last-child>#workspaces {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#clock {
|
||||
background-color: #64727D;
|
||||
}
|
||||
|
||||
#battery {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#battery.charging,
|
||||
#battery.plugged {
|
||||
color: #ffffff;
|
||||
background-color: #26A65B;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
/* Using steps() instead of linear as a timing function to limit cpu usage */
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: #f53c3c;
|
||||
color: #ffffff;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: steps(12);
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#power-profiles-daemon {
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
#power-profiles-daemon.performance {
|
||||
background-color: #f53c3c;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#power-profiles-daemon.balanced {
|
||||
background-color: #2980b9;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#power-profiles-daemon.power-saver {
|
||||
background-color: #2ecc71;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
label:focus {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
background-color: #2ecc71;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#memory {
|
||||
background-color: #9b59b6;
|
||||
}
|
||||
|
||||
#disk {
|
||||
background-color: #964B00;
|
||||
}
|
||||
|
||||
#backlight {
|
||||
background-color: #90b1b1;
|
||||
}
|
||||
|
||||
#network {
|
||||
background-color: #2980b9;
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
background-color: #f53c3c;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
background-color: #f1c40f;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
background-color: #90b1b1;
|
||||
color: #2a5c45;
|
||||
}
|
||||
|
||||
#wireplumber {
|
||||
background-color: #fff0f5;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#wireplumber.muted {
|
||||
background-color: #f53c3c;
|
||||
}
|
||||
|
||||
#custom-media {
|
||||
background-color: #66cc99;
|
||||
color: #2a5c45;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
#custom-media.custom-spotify {
|
||||
background-color: #66cc99;
|
||||
}
|
||||
|
||||
#custom-media.custom-vlc {
|
||||
background-color: #ffa000;
|
||||
}
|
||||
|
||||
#temperature {
|
||||
background-color: #f0932b;
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#tray {
|
||||
background-color: #2980b9;
|
||||
}
|
||||
|
||||
#tray>.passive {
|
||||
-gtk-icon-effect: dim;
|
||||
}
|
||||
|
||||
#tray>.needs-attention {
|
||||
-gtk-icon-effect: highlight;
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
background-color: #2d3436;
|
||||
}
|
||||
|
||||
#idle_inhibitor.activated {
|
||||
background-color: #ecf0f1;
|
||||
color: #2d3436;
|
||||
}
|
||||
|
||||
#mpd {
|
||||
background-color: #66cc99;
|
||||
color: #2a5c45;
|
||||
}
|
||||
|
||||
#mpd.disconnected {
|
||||
background-color: #f53c3c;
|
||||
}
|
||||
|
||||
#mpd.stopped {
|
||||
background-color: #90b1b1;
|
||||
}
|
||||
|
||||
#mpd.paused {
|
||||
background-color: #51a37a;
|
||||
}
|
||||
|
||||
#language {
|
||||
background: #00b093;
|
||||
color: #740864;
|
||||
padding: 0 5px;
|
||||
margin: 0 5px;
|
||||
min-width: 16px;
|
||||
}
|
||||
|
||||
#keyboard-state {
|
||||
background: #97e1ad;
|
||||
color: #000000;
|
||||
padding: 0 0px;
|
||||
margin: 0 5px;
|
||||
min-width: 16px;
|
||||
}
|
||||
|
||||
#keyboard-state>label {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
#keyboard-state>label.locked {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#scratchpad {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#scratchpad.empty {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#privacy {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#privacy-item {
|
||||
padding: 0 5px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#privacy-item.screenshare {
|
||||
background-color: #cf5700;
|
||||
}
|
||||
|
||||
#privacy-item.audio-in {
|
||||
background-color: #1ca000;
|
||||
}
|
||||
|
||||
#privacy-item.audio-out {
|
||||
background-color: #0069d4;
|
||||
}
|
||||
@@ -14,6 +14,6 @@
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
enableNvidia = true;
|
||||
# enableNvidia = true;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user