Mostly LLM-related updates

This commit is contained in:
Konstantin Nazarov 2024-12-27 00:36:40 +00:00
parent 391f8fcf4f
commit 8cfd3bc8a5
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22
6 changed files with 142 additions and 86 deletions

View file

@ -60,7 +60,7 @@ in {
group = config.users.users.knazarov.group;
};
mullvad_account = { };
kagi_api_key = {
claude_api_key = {
owner = config.users.users.knazarov.name;
group = config.users.users.knazarov.group;
};
@ -199,7 +199,7 @@ in {
autoconf
# ----------
(pkgs.callPackage ./nil_cli.nix {})
(pkgs.callPackage ./nil_cli.nix { })
#network-manager-applet
#(clang-tools.override {
#llvmPackages = llvmPackages_17;
@ -211,9 +211,9 @@ in {
# latex basics
(pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-basic
dvisvgm dvipng beamer metafont
wrapfig amsmath ulem hyperref capt-of;
inherit (pkgs.texlive)
scheme-basic dvisvgm dvipng beamer metafont wrapfig amsmath ulem
hyperref capt-of;
})
nodejs
@ -224,6 +224,8 @@ in {
bat
chafa
tmux
];
services.blueman.enable = true;
@ -294,9 +296,7 @@ in {
};
};
programs.steam = {
enable = true;
};
programs.steam = { enable = true; };
# Disable unneeded PipeWire devices and rename the ones I use to more recognizable names
environment.etc."wireplumber/main.lua.d/51-device-rename.lua".text = ''
@ -407,6 +407,15 @@ in {
openFirewall = true;
};
services.ollama = {
enable = true;
rocmOverrideGfx = "10.3.1";
} // (if config.networking.hostName == "mira" then {
acceleration = "rocm";
environmentVariables = { HCC_AMDGPU_TARGET = "gfx1036"; };
} else
{ });
networking.firewall.allowedTCPPorts = [
8096
# Syncthing
@ -443,6 +452,7 @@ in {
fonts.packages = with pkgs; [
dejavu_fonts
(nerdfonts.override { fonts = [ "SourceCodePro" ]; })
#nerd-fonts.sauce-code-pro
source-code-pro
font-awesome # for waybar indicators
];
@ -451,8 +461,10 @@ in {
enable = true;
user = "knazarov";
configDir = "/home/knazarov/.config/syncthing";
key = config.sops.secrets."${config.networking.hostName}_syncthing_key".path;
cert = config.sops.secrets."${config.networking.hostName}_syncthing_cert".path;
key =
config.sops.secrets."${config.networking.hostName}_syncthing_key".path;
cert =
config.sops.secrets."${config.networking.hostName}_syncthing_cert".path;
};
home-manager.users.knazarov = {
@ -464,24 +476,21 @@ in {
GUILE_LOAD_PATH = "${config.users.users.knazarov.home}/guile";
};
home.file.".guile" = {
source = ./guile-config;
};
home.file.".guile" = { source = ./guile-config; };
programs.lf = {
enable = true;
extraConfig = ''
set sixel true
set previewer ${pkgs.chafa}/bin/chafa
set previewer ${./lf_preview.sh}
map D $rm -fr "$fx"
'';
};
programs.bat = {
enable = true;
config = {
theme = "ansi";
};
config = { theme = "ansi"; };
};
programs.bash = {
@ -495,14 +504,16 @@ in {
'';
shellAliases = {
nn = "notes.sh -n";
ne =
''notes.sh -l | fzf --tac --with-nth="2..-1" --preview "notes.sh -p {}" --print-query --bind 'alt-enter:print-query' | xargs -o -d "\n" -n 2 notes.sh -f'';
ne = ''
notes.sh -l | fzf --tac --with-nth="2..-1" --preview "notes.sh -p {}" --print-query --bind 'alt-enter:print-query' | xargs -o -d "\n" -n 2 notes.sh -f'';
vim = "emacs -nw --no-splash";
gg =
"emacs -nw --no-splash --eval '(evil-collection-init)' --eval '(magit-status)'";
};
};
xdg.mimeApps = {
xdg = {
mimeApps = {
enable = true;
defaultApplications = {
@ -513,6 +524,8 @@ in {
"x-scheme-handler/unknown" = "firefox.desktop";
};
};
configFile."mimeapps.list".force = true;
};
gtk = {
enable = true;
@ -563,11 +576,7 @@ in {
key = "0x0560020C9C577C1B";
signByDefault = true;
};
extraConfig = {
push = {
autoSetupRemote = true;
};
};
extraConfig = { push = { autoSetupRemote = true; }; };
};
accounts.email = {
@ -659,13 +668,14 @@ in {
"exec ${pkgs.foot}/bin/foot -T mylauncher -a mylauncher ${pkgs.q-sh}/bin/q";
"Mod4+p" =
"exec '${pkgs.grim}/bin/grim -g \"$$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png'";
"Mod4+o" =
"exec '${pkgs.kooha}/bin/kooha'";
"Mod4+o" = "exec '${pkgs.kooha}/bin/kooha'";
};
output = {
"*" = { bg = "${./wallpaper.jpg} fill"; };
"Lenovo Group Limited LEN T32p-20 VNA4VRNY" = { scale = "1.5"; };
"LG Electronics LG TV SSCR2 0x01010101" = { mode = "1920x1080@60Hz"; };
"LG Electronics LG TV SSCR2 0x01010101" = {
mode = "1920x1080@60Hz";
};
};
input = {
"type:keyboard" = {
@ -735,10 +745,13 @@ in {
height = 24;
modules-left = [ "sway/workspaces" "sway/mode" ];
modules-center = [ "sway/window" ];
modules-right = [ "custom/maildir" "idle_inhibitor" "battery" "clock" "tray" ];
modules-right =
[ "custom/maildir" "idle_inhibitor" "battery" "clock" "tray" ];
clock.format = "{:%Y-%m-%d %H:%M}";
"custom/maildir" = {
exec = "${./waybar_maildir.sh} /home/knazarov/Maildir/personal/Inbox/new knazarov";
exec = "${
./waybar_maildir.sh
} /home/knazarov/Maildir/personal/Inbox/new knazarov";
format = " {} ";
return-type = "json";
};
@ -783,8 +796,8 @@ in {
defaultNetwork.settings = { dns_enabled = true; };
};
};
services.udev.packages = [ pkgs.android-udev-rules
(pkgs.callPackage ./zsa-udev-rules.nix {})];
services.udev.packages =
[ pkgs.android-udev-rules (pkgs.callPackage ./zsa-udev-rules.nix { }) ];
#udevadm info --query=all --name=/dev/sda1 | grep ID_SERIAL
services.udev.extraRules =
''ACTION=="add", SUBSYSTEMS=="usb", SUBSYSTEM=="block", '' + ''

View file

@ -41,7 +41,7 @@
;; -------- Default directories --------
(setq default-directory "~/")
;;(setq default-directory "~/")
;;(setq command-line-default-directory "~/")
;; -------- State files --------
@ -1023,6 +1023,7 @@ Intended for `after-make-frame-functions'."
(use-package magit
:ensure t
:after evil-collection
:bind
("C-x g" . magit-status)
)
@ -1302,17 +1303,17 @@ Intended for `after-make-frame-functions'."
(use-package gptel
:ensure t
:config
(setq gptel-model 'fastgpt)
(setq gptel-kagi-api-key
(setq gptel-model 'claude-3-5-sonnet-latest)
(setq gptel-claude-api-key
(lambda ()
(with-temp-buffer
(insert-file-contents "/var/run/secrets/kagi_api_key")
(buffer-string))
)
)
(setq gptel-backend (gptel-make-kagi "Kagi" :key gptel-kagi-api-key))
(insert-file-contents "/var/run/secrets/claude_api_key")
(string-trim (buffer-string)))))
(setq gptel-org-branching-context t)
(setq gptel-backend
(gptel-make-anthropic "Claude" :stream t :key gptel-claude-api-key))
)
(provide 'init)
;;; init.el ends here

View file

@ -10,11 +10,11 @@
]
},
"locked": {
"lastModified": 1732352436,
"narHash": "sha256-DInAgNnQT0ArMfyZZ4GUIqq8B/wGS/9Y3DEntAbtan4=",
"lastModified": 1735233083,
"narHash": "sha256-3AqQQcBXc2iAvpGqZ4UinsJ7RF8lQ41ml3H4plBqqNI=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "bb0acd64336552d7ed16bc7e2cd0ddfec65fdcbe",
"rev": "644713bfd86acb4198fc416f9452eb6d25775a03",
"type": "github"
},
"original": {
@ -26,7 +26,7 @@
"git-plan": {
"inputs": {
"nixpkgs": [
"nixpkgs"
"nixpkgs-stable"
]
},
"locked": {
@ -50,11 +50,11 @@
]
},
"locked": {
"lastModified": 1732303962,
"narHash": "sha256-5Umjb5AdtxV5jSJd5jxoCckh5mlg+FBQDsyAilu637g=",
"lastModified": 1735053786,
"narHash": "sha256-Gm+0DcbUS338vvkwyYWms5jsWlx8z8MeQBzcnIDuIkw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "8cf9cb2ee78aa129e5b8220135a511a2be254c0c",
"rev": "35b98d20ca8f4ca1f6a2c30b8a2c8bb305a36d84",
"type": "github"
},
"original": {
@ -63,6 +63,27 @@
"type": "github"
}
},
"home-manager-stable": {
"inputs": {
"nixpkgs": [
"nixpkgs-stable"
]
},
"locked": {
"lastModified": 1734366194,
"narHash": "sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "80b0fdf483c5d1cb75aaad909bd390d48673857f",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
},
"knazarovcom": {
"inputs": {
"nixpkgs": [
@ -70,11 +91,11 @@
]
},
"locked": {
"lastModified": 1732360100,
"narHash": "sha256-9j9MBNJ4M1CqdkK9d0wCDivQcSiOirXudYvxUN4Kjq0=",
"lastModified": 1734399782,
"narHash": "sha256-22y5rBb2WCSHz7e+WSwosxuJGRoI9aYncsyg67enKVg=",
"owner": "~knazarov",
"repo": "knazarov.com",
"rev": "6ccae684413275a42ea0ce61dc1429302a9133a0",
"rev": "2ee87d9f5b59cd035540ab1f9bc33a1c8bcc6709",
"type": "sourcehut"
},
"original": {
@ -85,11 +106,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1732363450,
"narHash": "sha256-oLfz9BhKQzQo3uoy0gH/w5Vq8iRcD8Be3eKHEQ/GvEI=",
"lastModified": 1735257413,
"narHash": "sha256-AJ/b5ucTcUIVnwLzl4eu5wsPXzA1eH2O0FO3F2UPPQk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "04f0c72e5956550d622db881dd3151a98d59b23b",
"rev": "162b4bf7b304b9a655ee01da216924946293f760",
"type": "github"
},
"original": {
@ -100,11 +121,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1731755305,
"narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=",
"lastModified": 1735141468,
"narHash": "sha256-VIAjBr1qGcEbmhLwQJD6TABppPMggzOvqFsqkDoMsAY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4",
"rev": "4005c3ff7505313cbc21081776ad0ce5dfd7a3ce",
"type": "github"
},
"original": {
@ -117,15 +138,15 @@
"notes-sh": {
"inputs": {
"nixpkgs": [
"nixpkgs"
"nixpkgs-stable"
]
},
"locked": {
"lastModified": 1731919109,
"narHash": "sha256-v2PcqyIHui4Nb5lZHs46CltQAJ8f+FjQR27L2fbNzS4=",
"lastModified": 1732738142,
"narHash": "sha256-lip8frASXOuYF5Qx/K5wGOOX5Y+DvZMJUcsIl4djInY=",
"owner": "~knazarov",
"repo": "notes2.sh",
"rev": "76038af8020ba4e5c4bf285fb75a127bfe335923",
"rev": "1f8d8b6a55277b3a6a594463f5e61647611fb073",
"type": "sourcehut"
},
"original": {
@ -137,7 +158,7 @@
"q-sh": {
"inputs": {
"nixpkgs": [
"nixpkgs"
"nixpkgs-stable"
]
},
"locked": {
@ -159,6 +180,7 @@
"emacs-overlay": "emacs-overlay",
"git-plan": "git-plan",
"home-manager": "home-manager",
"home-manager-stable": "home-manager-stable",
"knazarovcom": "knazarovcom",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable",
@ -175,11 +197,11 @@
]
},
"locked": {
"lastModified": 1732186149,
"narHash": "sha256-N9JGWe/T8BC0Tss2Cv30plvZUYoiRmykP7ZdY2on2b0=",
"lastModified": 1734546875,
"narHash": "sha256-6OvJbqQ6qPpNw3CA+W8Myo5aaLhIJY/nNFDk3zMXLfM=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "53c853fb1a7e4f25f68805ee25c83d5de18dc699",
"rev": "ed091321f4dd88afc28b5b4456e0a15bd8374b4d",
"type": "github"
},
"original": {
@ -195,11 +217,11 @@
]
},
"locked": {
"lastModified": 1730144506,
"narHash": "sha256-JBeGqX4mghYAOR2GGm2oYwauoRNGQbxuQyYA9p6oZvM=",
"lastModified": 1735229558,
"narHash": "sha256-IbaVefIyVF3TU2/7ZhJV/7KuRHz8lbYfFRa2CWx6ziY=",
"owner": "valeriya-matveeva",
"repo": "vmatveeva.com",
"rev": "21a1cbfce6fe91e5f33649b4e0c9352933cb60db",
"rev": "9a753cfcf559ffa4acb548fbdb9e9b2dbea08795",
"type": "github"
},
"original": {

View file

@ -5,28 +5,38 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11";
#home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager-stable.url = "github:nix-community/home-manager/release-24.11";
home-manager-stable.inputs.nixpkgs.follows = "nixpkgs-stable";
emacs-overlay.url = "github:nix-community/emacs-overlay";
emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
emacs-overlay.inputs.nixpkgs-stable.follows = "nixpkgs-stable";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs-stable";
q-sh.url = "sourcehut:~knazarov/q.sh";
q-sh.inputs.nixpkgs.follows = "nixpkgs";
q-sh.inputs.nixpkgs.follows = "nixpkgs-stable";
notes-sh.url = "sourcehut:~knazarov/notes2.sh";
notes-sh.inputs.nixpkgs.follows = "nixpkgs";
notes-sh.inputs.nixpkgs.follows = "nixpkgs-stable";
knazarovcom.url = "sourcehut:~knazarov/knazarov.com";
knazarovcom.inputs.nixpkgs.follows = "nixpkgs";
vmatveevacom.url = "github:valeriya-matveeva/vmatveeva.com";
vmatveevacom.inputs.nixpkgs.follows = "nixpkgs";
git-plan.url = "sourcehut:~knazarov/git-plan";
git-plan.inputs.nixpkgs.follows = "nixpkgs";
git-plan.inputs.nixpkgs.follows = "nixpkgs-stable";
};
outputs = { self, nixpkgs, nixpkgs-stable, home-manager, emacs-overlay
outputs = { self, nixpkgs, nixpkgs-stable, home-manager, home-manager-stable, emacs-overlay
, sops-nix, q-sh, notes-sh, knazarovcom, vmatveevacom, git-plan, ...
}@attrs:
let
@ -46,7 +56,7 @@
node = dir:
with hostAttrs dir;
buildSystem [
buildSystemStable [
({ config, pkgs, ... }: {
nixpkgs.overlays = [
emacs-overlay.overlay
@ -56,7 +66,7 @@
];
})
sops-nix.nixosModules.sops
home-manager.nixosModule
home-manager-stable.nixosModule
dir
] settings.system;

9
lf_preview.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
FILE_NAME="$1"
PV_WIDTH="$2"
PV_WIDTH="$((PV_WIDTH - 2))"
PV_HEIGHT="$3"
echo "${PV_WIDTH}x${PV_HEIGHT}" > ~/.dim
chafa --size="${PV_WIDTH}x${PV_HEIGHT}" --view-size="${PV_WIDTH}x${PV_HEIGHT}" "$FILE_NAME"

View file

@ -9,6 +9,7 @@ mira_syncthing_key: ENC[AES256_GCM,data:nUEctak0gNO+5Iw7dzBC4hkYQpWYDtqZpdzS8tGa
framework_syncthing_cert: ENC[AES256_GCM,data:ctuJCImoIaRkbJt7CFuew66uOvI9tWBIzw+WsgtKbq757wZke7Eqiy1TOoKmaEhWRzw5pD71y4Uk9rgcsdmRr0+2w9iC6o3joii5KU/dIextbiTYzqBpB88CjESKITzAj57bGWP22RSM156OaGgL7UDpZAyRt8Ys2LlfmnbU6rQ3hpwgHKWkegqluIGjMdl+LW0ShxzEIqSxwkxhyYHW0GVLBAK2jTYtqar8MgPogZ16YRtwmDlK1Me712qvap39RMsB1xMsXvfduKhWjjtY3Ajhq2RF3dLKffCpMFhomMnCuPx62aVJEvnGUb/h99F4d0bLpThvF7hldkuDbiln3n8WehqhoM3A5q/42P0XoSrafvCH43WT6SSpvOASMdTxn7qSlCNB3uXiKNh3X4rgvCEmsdjVEXhBwLi7SZ5k73iVa8oEpaYP+60l9XFd4PEd844Y/wBRXN4Ch+imuCZwNlYMiN7uCyd3/lqr2t7xgIc1E9DqcJloohfJMfTXhl/88GITVqL+3IfwPabTMbYLFwxjr3gBPyPtyEUpgAANSVJNj5h25WnrN2q+muoTiGdk1Z6wk2z/2Obo1LSde1daNVGi+i/CmFyIYFJhmpP53faXi48MqLtF1ix7YP6q/rjyTH26mDPg5ZYKkuWZg2XaNnHegQ/fOfOVG+Q+88yWo/dLwMkMhFqJVrLkli6Ogu9kcgzteD2DgEnE9UVH4Di07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type:str]
claude_api_key: ENC[AES256_GCM,data:YEFd2j5+ijnn3avPMuTYmXsW2ZyXFukWpXQuCBg7MI3i/xf8HiSu0YgtauhFFzwIQddt4skmf/U4qX6zMMqzjv5exHzK6eq0kax9fW3LSc243DsKfU5c2xnIKdtVfwEAhMzNxG5tNveI/6AS,iv:cp6pStR7vkdkJwG+SKFO7doXKWKDXlekTg/7ciMLNiM=,tag:WrUZCvPY1HWvpIkyTZ8Zww==,type:str]
sops:
kms: []
gcp_kms: []
@ -33,8 +34,8 @@ sops:
U3loV2xDMkM5SWNXRDJobDloL0FVUUkK3OP7KvcKkE8mJ880dm6LMFZUxELjl8/P
6+q8qAYiAvl0Cbd4GzkNpUuBbLlFFWfFmC0vbgg8gyZ6xI5AFhHAPw==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-11-23T22:23:34Z"
mac: ENC[AES256_GCM,data:tQjqm7UFbJtGVM8viWdqwwpP15su8LQbk/eIKEES09QovXQYioB3AMeDUxNltP5d/whRBqXGdng4e/PeddBHKl/FunpjnhaN1FUvYfmQPHDjte6pBaJLnJwtnxMh7oyUn0Bab74GDYHOxTUSOR5zIkLOrUQqB0xrcvSSyuF8lwA=,iv:Q7jEKUFIdXY4nq38VzKyrVpHXBt3sCKMotTJLnNLhoQ=,tag:du3BwNT8lim5P9NwO3Dqqg==,type:str]
lastmodified: "2024-12-12T19:04:48Z"
mac: ENC[AES256_GCM,data:+SbPjRlkeZljccT9xaXQqLPZLuz+X+Gh1splgPX81suh/JD24D4a867vNWT0/9VcJrk50a+gb0Azn9AunULOu7ac9gg1T4WvNoReiBI3zK82u+WU+TVjDWKBftkXdbBITaxl3PvaYj5+RNZIEFYCuiME7C+SW6KsZbXWlxxnZls=,iv:Qz2F5lRYZuz7rDwFSc1DNekUlfKfQxF0tM3tnrqN/6Y=,tag:FCTU/l0CrWvS1aqKVEuJQw==,type:str]
pgp:
- created_at: "2023-06-10T01:03:11Z"
enc: |-