4 Commits

8 changed files with 146 additions and 46 deletions
Generated
+33 -33
View File
@@ -35,11 +35,11 @@
]
},
"locked": {
"lastModified": 1781930126,
"narHash": "sha256-AopjjM6497f3Usb6IAZgensjtzGlYGGpJLw7DRtP67I=",
"lastModified": 1782533477,
"narHash": "sha256-2enYwf3n9GUkne9v4J3Ud6LpoG4Uarl3BaSQgRAAH7o=",
"owner": "caelestia-dots",
"repo": "cli",
"rev": "b00dabaa9351d1383dfba162f5b3575b49a126e1",
"rev": "e9e115568f818ee1df2d7a9e21925141b053ec6e",
"type": "github"
},
"original": {
@@ -58,11 +58,11 @@
"quickshell": "quickshell"
},
"locked": {
"lastModified": 1782013769,
"narHash": "sha256-3j6GU+y8RSyRAibriCePKqqU4UPf6qjabUD9cfjehcM=",
"lastModified": 1782636677,
"narHash": "sha256-u01nEjf7afRMCtRjp0LV45DmhC4/n/uPY3S/HAh/V2w=",
"owner": "caelestia-dots",
"repo": "shell",
"rev": "74e4970ab530b3d1a5cddb8424fcf0ee96443bd9",
"rev": "145a6795ee41e023e863681cec6c5db3b334ffc0",
"type": "github"
},
"original": {
@@ -79,11 +79,11 @@
]
},
"locked": {
"lastModified": 1781648708,
"narHash": "sha256-i9ggnF31Uq3tpdp6ZMe7YAOxjTfkB7S4WjSBfXV0uMk=",
"lastModified": 1782492933,
"narHash": "sha256-v/BH1zfHaCFqP+4Ev9PWiGy15YrpmI9wzjxRtiFhgvA=",
"owner": "9001",
"repo": "copyparty",
"rev": "d33d11321f823f58a9109298ef886044f63b02ce",
"rev": "4c8203016f089b38281ed922a78255146f099e7b",
"type": "github"
},
"original": {
@@ -207,11 +207,11 @@
]
},
"locked": {
"lastModified": 1781989573,
"narHash": "sha256-npfH7Zv7t1akX/ArqCNro4zU4ViPlghLaPnbEfHbCxk=",
"lastModified": 1782702263,
"narHash": "sha256-8/MG4Su7PhnynrmsVO61IeAfrK7GuUEu+E+gwbhy1QQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "78e7d8b13ecd7f5256a5c11ce216876164099d9f",
"rev": "789a35fbdeb3c46b260096daa0b321c11be527ea",
"type": "github"
},
"original": {
@@ -268,11 +268,11 @@
]
},
"locked": {
"lastModified": 1782030356,
"narHash": "sha256-h4WpMr455AfRub0FXBaon6Vcpe0waUyJ4GivIW6oyd4=",
"lastModified": 1782636943,
"narHash": "sha256-ripjZa7BBLwL1uS5VJF3s/VpZpWt5ZIQEvkJ/FJNpQw=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "3017088b49efd404f78e3b104f553b97e4af786b",
"rev": "058b1f9381fa79fcda49982370a750ff92dbba43",
"type": "github"
},
"original": {
@@ -283,11 +283,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1781577229,
"narHash": "sha256-lrp67w8AulE9Ks53n27I45ADSzbOCn4H+CNW1Ck8B+8=",
"lastModified": 1782467914,
"narHash": "sha256-pGvFkM8N0xEkIIXDe5YYfbEAvHrk4IxBrjB/x8OomhE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "567a49d1913ce81ac6e9582e3553dd90a955875f",
"rev": "e73de5be04e0eff4190a1432b946d469c794e7b4",
"type": "github"
},
"original": {
@@ -299,11 +299,11 @@
},
"nixpkgsStable": {
"locked": {
"lastModified": 1781509190,
"narHash": "sha256-uJZs9Di8I6ciTp6jiojj0HzlNpBkud8ax5aT/O5aJkw=",
"lastModified": 1782498288,
"narHash": "sha256-8/X3yyTXiE82b38n32ItbOqfWOVBl+gKa8fILyZfR4Q=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d6df3513510aa548c83868fd22bfddd0a8c0a0d4",
"rev": "3cac626ec5e3703e835f227687e88aa9e2f25701",
"type": "github"
},
"original": {
@@ -466,11 +466,11 @@
]
},
"locked": {
"lastModified": 1781943681,
"narHash": "sha256-NFHmA7H47adqiyp+0iEOyZOQhmigDqA/NBAlf4imB6U=",
"lastModified": 1782165805,
"narHash": "sha256-478kKQBvK6SYTOdN2h9jhKJv94nbXRbFMfuL1WshErg=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "420f8d2e9882911f65cfac15cc706f639ba96cca",
"rev": "56b24064fdcaedca53553b1a6d607fd23b613a24",
"type": "github"
},
"original": {
@@ -487,11 +487,11 @@
"systems": "systems_4"
},
"locked": {
"lastModified": 1782031037,
"narHash": "sha256-a7oWSyS7SN81UOqVt481yIEMDsMpaJ7GNdV6Eaz5Yqg=",
"lastModified": 1782633406,
"narHash": "sha256-JOSMk12GgnTLVlUSCuKkqyUF6cw82wl7t7e1WuFfg5s=",
"owner": "Gerg-L",
"repo": "spicetify-nix",
"rev": "9cb27462cfd20edac174353f1e95bc03aa888863",
"rev": "5ff9a6ca9dcbad7cccea2c97d30237468b16feda",
"type": "github"
},
"original": {
@@ -507,11 +507,11 @@
]
},
"locked": {
"lastModified": 1781754174,
"narHash": "sha256-Q5hp6+DYj23gMAvhLXBYNan9EwY9C+oxyU+M1TJDwgo=",
"lastModified": 1782700116,
"narHash": "sha256-E63+nvH3jkAt/hBxhMa5aykstXdqRvBSeqNRDpQNv78=",
"owner": "nix-community",
"repo": "srvos",
"rev": "18ae1c654f60fb8dafb40c48fe25eb09f1aaddb2",
"rev": "d45cf79058f2d42c0b0dd7912bedb5d14faa00ed",
"type": "github"
},
"original": {
@@ -587,11 +587,11 @@
]
},
"locked": {
"lastModified": 1781847955,
"narHash": "sha256-1OSYOGuJp/NoODmSHjsz+6TB/kSilJ+BsFihjY7TTnc=",
"lastModified": 1782624757,
"narHash": "sha256-pqFaCAV+g8H+p0kE4vYn9ZgcEFvt644zGy7SyCdf9c8=",
"owner": "youwen5",
"repo": "zen-browser-flake",
"rev": "4bca251cd556677f7b765ff324d1638ae215be13",
"rev": "907465791e7064d86d37964dd95e23280dfb68da",
"type": "github"
},
"original": {
+3 -2
View File
@@ -96,7 +96,8 @@
flake-utils.lib.eachDefaultSystem (
system: let
inherit (self) outputs;
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {inherit system;};
in {
formatter = pkgs.alejandra;
devShells.default = pkgs.mkShell {
@@ -111,7 +112,7 @@
packages = {
homeConfigurations = let
extraSpecialArgs = {inherit inputs outputs system;};
pkgs = nixpkgs.legacyPackages.x86_64-linux;
pkgs = import nixpkgs {inherit system;};
defaultUserModules = [
inputs.sops-nix.homeManagerModules.sops
inputs.spicetify.homeManagerModules.default
+69
View File
@@ -0,0 +1,69 @@
# Baseline variant of Bun for x86_64-linux CPUs without AVX2 support.
# The regular `bun` from nixpkgs requires AVX2 and crashes with SIGILL on older hardware.
#
# Version is typically kept in sync with nixpkgs's `bun` (passed via `callPackage`).
{
lib,
stdenvNoCC,
fetchurl,
autoPatchelfHook,
unzip,
makeBinaryWrapper,
glibc,
stdenv,
version ? "1.3.13",
}: let
# When updating `version`, compute the new hash with:
# nix store prefetch-file \
# "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-linux-x64-baseline.zip"
hash = "sha256-nYokKSpwaAkCBdqsCloiP19pc29Sh+N7+I07QDHtx1A=";
in
stdenvNoCC.mkDerivation {
pname = "bun-baseline";
inherit version;
src = fetchurl {
url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-linux-x64-baseline.zip";
inherit hash;
};
nativeBuildInputs =
[unzip]
++ lib.optionals stdenvNoCC.hostPlatform.isLinux [
autoPatchelfHook
makeBinaryWrapper
];
buildInputs = lib.optionals stdenvNoCC.hostPlatform.isLinux [
glibc
(lib.getLib stdenv.cc.cc)
];
dontConfigure = true;
dontBuild = true;
unpackPhase = ''
runHook preUnpack
mkdir -p source
cd source
${lib.getExe unzip} -q $src
runHook postUnpack
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
find . -type f -name "bun" -not -path "./__MACOSX/*" -exec cp {} $out/bin/bun \;
chmod +x $out/bin/bun
ln -s $out/bin/bun $out/bin/bunx
runHook postInstall
'';
meta = {
description = "Bun JavaScript runtime (baseline variant, works without AVX2)";
homepage = "https://bun.sh";
license = lib.licenses.mit;
platforms = ["x86_64-linux"];
mainProgram = "bun";
};
}
+1 -1
View File
@@ -44,7 +44,7 @@ in {
};
launcher = {
enabled = true;
showOnHover = true;
showOnHover = false;
useFuzzy = {
apps = true;
schemes = true;
+6 -1
View File
@@ -16,6 +16,11 @@ in {
options.home.dev.ai = {
enable = mkEnableOption "Enables AI features";
lmStudio = mkOption {
default = cfg.enable;
example = true;
description = "Enables LM Studio. Enabled by default when AI is enabled.";
};
mcpServers = mkOption {
inherit (jsonFormat) type;
default = {};
@@ -31,7 +36,7 @@ in {
ollama.enable = mkDefault cfg.enable;
opencode.enable = mkDefault cfg.enable;
};
packages = [pkgs.lmstudio];
packages = lists.optional cfg.lmStudio pkgs.lmstudio;
};
programs.mcp = mkIf (cfg.mcpServers != {}) {
enable = true;
+30 -6
View File
@@ -1,15 +1,39 @@
{
config,
lib,
inputs,
pkgs,
...
}:
with lib; let
inherit (pkgs.stdenv.hostPlatform) system;
cfg = config.home.dev.ai.opencode;
defaultPackageCli = inputs.opencode.packages.${system}.opencode;
defaultPackageDesktop = inputs.opencode.packages.${system}.desktop;
# On x86_64-linux CPUs without AVX2, use the baseline bun variant
# when building opencode - the regular `bun` from nixpkgs requires
# AVX2 and crashes on older hardware, such as my Thinkpad x220s
# Intel Core i5 2640M.
needsBaselineBun =
pkgs.stdenv.hostPlatform.isx86_64 && !pkgs.stdenv.hostPlatform.avx2Support;
defaultPackageCli =
if needsBaselineBun
then
pkgs.opencode.override {
bun = pkgs.callPackage ../../../../packages/bun-baseline.nix {
version = pkgs.bun.version;
};
}
else pkgs.opencode;
defaultPackageDesktop =
if needsBaselineBun
then
pkgs.opencode-desktop.override {
bun = pkgs.callPackage ../../../../packages/bun-baseline.nix {
version = pkgs.bun.version;
};
}
else pkgs.opencode-desktop;
corsList = domains: lists.remove "" (lists.forEach (strings.splitString "," domains) trim);
in {
options.home.dev.ai.opencode = {
@@ -66,9 +90,9 @@ in {
};
};
config.programs.opencode = mkIf cfg.enable {
inherit (cfg) enable tui;
inherit (cfg) enable tui package;
enableMcpIntegration = true;
extraPackages = with pkgs; [uv];
extraPackages = with pkgs; [uv] ++ lists.optional cfg.desktop.enable cfg.desktop.package;
settings =
{
server = mkIf cfg.web.mdns.enable {
+1
View File
@@ -2,6 +2,7 @@
imports = [../home.nix];
home = {
cli.nh.flake = "${config.home.homeDirectory}/.dotfiles";
dev.ai.lmStudio = false;
desktop.hyprland.host = "gampo";
phundrak.sshKey.content = builtins.readFile ../keys/id_gampo.pub;
};