Various squashed tweaks

This commit is contained in:
Tristan D. 2023-10-21 03:33:27 +02:00
parent ffc6ae9637
commit dfadf6d878
Signed by: tristan
SSH key fingerprint: SHA256:U7y6eMb7CQDaTHv9XoX6/BaQnPqyxxKc+Xnfcefi6rY
13 changed files with 159 additions and 50 deletions

View file

@ -179,5 +179,78 @@
(centaur-tabs-local-mode)))) (centaur-tabs-local-mode))))
) )
;; cape ;;;;;
(use-package! cape)
;; (after! company
;; (setq-default company-frontends '(company-preview-frontend)))
(use-package! codeium
:after cape
:init
;; use globally
(add-to-list 'completion-at-point-functions #'codeium-completion-at-point)
;; or on a hook
;; (add-hook 'python-mode-hook
;; (lambda ()
;; (setq-local completion-at-point-functions '(codeium-completion-at-point))))
;; if you want multiple completion backends, use cape (https://github.com/minad/cape):
;; (add-hook 'python-mode-hook
;; (lambda ()
;; (setq-local completion-at-point-functions
;; (list (cape-super-capf #'codeium-completion-at-point #'lsp-completion-at-point)))))
;; an async company-backend is coming soon!
;; codeium-completion-at-point is autoloaded, but you can
;; optionally set a timer, which might speed up things as the
;; codeium local language server takes ~0.2s to start up
;; (add-hook 'emacs-startup-hook
;; (lambda () (run-with-timer 0.1 nil #'codeium-init)))
;; :defer t ;; lazy loading, if you want
:config
(setq use-dialog-box nil) ;; do not use popup boxes
;; if you don't want to use customize to save the api-key
;; (setq codeium/metadata/api_key "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
;; (setq codeium/metadata/api_key (with-temp-buffer (insert-file-contents "~/.codeium")
;; (buffer-string)))
(defalias 'my/codeium-complete
(cape-interacive-capf #'codeium-completion-at-point))
(map! :localleader
:map evil-normal-state-map
"c e" #'my/codeium-complete)
;; get codeium status in the modeline
(setq codeium-mode-line-enable
(lambda (api) (not (memq api '(CancelRequest Heartbeat AcceptCompletion)))))
(add-to-list 'mode-line-format '(:eval (car-safe codeium-mode-line)) t)
;; alternatively for a more extensive mode-line
;; (add-to-list 'mode-line-format '(-50 "" codeium-mode-line) t)
;; use M-x codeium-diagnose to see apis/fields that would be sent to the local language server
(setq codeium-api-enabled
(lambda (api)
(memq api '(GetCompletions Heartbeat CancelRequest GetAuthToken RegisterUser auth-redirect AcceptCompletion))))
;; you can also set a config for a single buffer like this:
;; (add-hook 'python-mode-hook
;; (lambda ()
;; (setq-local codeium/editor_options/tab_size 4)))
;; You can overwrite all the codeium configs!
;; for example, we recommend limiting the string sent to codeium for better performance
(defun my-codeium/document/text ()
(buffer-substring-no-properties (max (- (point) 3000) (point-min)) (min (+ (point) 1000) (point-max))))
;; if you change the text, you should also change the cursor_offset
;; warning: this is measured by UTF-8 encoded bytes
(defun my-codeium/document/cursor_offset ()
(codeium-utf8-byte-length
(buffer-substring-no-properties (max (- (point) 3000) (point-min)) (point))))
(setq codeium/document/text 'my-codeium/document/text)
(setq codeium/document/cursor_offset 'my-codeium/document/cursor_offset))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -49,7 +49,7 @@
;;unicode ; extended unicode support for various languages ;;unicode ; extended unicode support for various languages
(vc-gutter (vc-gutter
+diff-hl +diff-hl
+pretty) ; vcs diff in the fringe +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB vi-tilde-fringe ; fringe tildes to mark beyond EOB
(window-select ; visually switch windows (window-select ; visually switch windows
+numbers) +numbers)
@ -97,7 +97,7 @@
;;collab ; buffers with friends ;;collab ; buffers with friends
;;debugger ; FIXME stepping through code, to help you add bugs ;;debugger ; FIXME stepping through code, to help you add bugs
direnv direnv
;;docker (docker +lsp)
;;editorconfig ; let someone else argue about tabs vs spaces ;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs ;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls) (eval +overlay) ; run code, run (also, repls)
@ -213,5 +213,5 @@
(default +bindings +smartparens)) (default +bindings +smartparens))
(after! doom-cli-env (after! doom-cli-env
;; Allow SSH-related environment variables to be set in persistent configuration. ;; Allow SSH-related environment variables to be set in persistent configuration.
(add-to-list 'doom-env-allow "^SSH_")) (add-to-list 'doom-env-allow "^SSH_"))

View file

@ -38,8 +38,16 @@
;(package! builtin-package :recipe (:branch "develop")) ;(package! builtin-package :recipe (:branch "develop"))
;; Use `:pin' to specify a particular commit to install. ;; Use `:pin' to specify a particular commit to install.
;; tabs
(package! centaur-tabs) (package! centaur-tabs)
;; nix
(package! nixpkgs-fmt) (package! nixpkgs-fmt)
;; codeium
(package! codeium :recipe (:host github :repo "Exafunction/codeium.el"))
(package! cape)
;; Doom's packages are pinned to a specific commit and updated from release to ;; Doom's packages are pinned to a specific commit and updated from release to
;; release. The `unpin!' macro allows you to unpin single packages... ;; release. The `unpin!' macro allows you to unpin single packages...

42
flake.lock generated
View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1697721991, "lastModified": 1698155728,
"narHash": "sha256-Sjm7WaD+zLi9R7x8QKa9HGkizFQXvWGo18WlQtNPPtw=", "narHash": "sha256-PUJ40o/0LyMEgSBEfLVyPA0K3gQnPYQDq9dW9nCOU9M=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "c24c3a902935321e1dfa1ca587e66f47edf79faf", "rev": "8c5d52db5690c72406b0cb13a5ac8554a287c93a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -31,11 +31,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1697799469, "lastModified": 1698341451,
"narHash": "sha256-9KT+HBqy/wZZ04FDo3Kovjr/utjnleKz4FTo/sbdr8Y=", "narHash": "sha256-l86yjvyaRIje0t++PuNTlBPLcyxf2/lZWrp4NbctgLY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "4a09e468458ee95f18c162e69f3d667686fee02a", "rev": "723d8ec014852d74bc04769c5b47446d5eee5a1d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -159,11 +159,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1697340827, "lastModified": 1697946153,
"narHash": "sha256-XlrR68N7jyaZ0bs8TPrhqcWG0IPG3pbjrKzJMpYOsos=", "narHash": "sha256-7k7qIwWLaYPgQ4fxmEdew3yCffhK6rM4I4Jo3X/79DA=",
"owner": "Mic92", "owner": "Mic92",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "29977d0796c058bbcfb2df5b18eb5badf1711007", "rev": "5a2006282caaf32663cdcd582c5b18809c7d7d8d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -216,11 +216,11 @@
}, },
"nixos-unstable": { "nixos-unstable": {
"locked": { "locked": {
"lastModified": 1697456312, "lastModified": 1698134075,
"narHash": "sha256-roiSnrqb5r+ehnKCauPLugoU8S36KgmWraHgRqVYndo=", "narHash": "sha256-foCD+nuKzfh49bIoiCBur4+Fx1nozo+4C/6k8BYk4sg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ca012a02bf8327be9e488546faecae5e05d7d749", "rev": "8efd5d1e283604f75a808a20e6cde0ef313d07d4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -232,11 +232,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1697655685, "lastModified": 1698288402,
"narHash": "sha256-79Kuv+QdgsVc+rkibuAgWHnh8IXrLBTOKg5nM0Qvux0=", "narHash": "sha256-jIIjApPdm+4yt8PglX8pUOexAdEiAax/DXW3S/Mb21E=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "80c1aab725151632ddc2a20caeb914e76dd0673c", "rev": "60b9db998f71ea49e1a9c41824d09aa274be1344",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -264,11 +264,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1697730408, "lastModified": 1698266953,
"narHash": "sha256-Ww//zzukdTrwTrCUkaJA/NsaLEfUfQpWZXBdXBYfhak=", "narHash": "sha256-jf72t7pC8+8h8fUslUYbWTX5rKsRwOzRMX8jJsGqDXA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ff0a5a776b56e0ca32d47a4a47695452ec7f7d80", "rev": "75a52265bda7fd25e06e3a67dee3f0354e73243c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -296,11 +296,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1697793907, "lastModified": 1698360430,
"narHash": "sha256-V2nTR/bN1GwozE2+Wz/YuuRq2uZhGo8HUSKCteJGQFs=", "narHash": "sha256-Kkr6rPExovu7dFZi50oTyu9QATfBNszY0slpL3pBM0k=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "d531cd7ef0001eaba84743d6666726df3c3b5620", "rev": "3b1db33750b06f122e369cac982eed7ba7f25791",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -91,6 +91,10 @@
inherit overlays; inherit overlays;
config = { config = {
allowUnfree = true; allowUnfree = true;
permittedInsecurePackages = [
"electron-22.3.27"
"electron-24.8.6"
];
}; };
}; };
pkgs = import nixpkgs pkgs-args; pkgs = import nixpkgs pkgs-args;

View file

@ -1,5 +1,7 @@
{ config, lib, pkgs, ... }: { config
, lib
{ , pkgs
, ...
}: {
home.homeDirectory = "/home/${config.home.username}"; home.homeDirectory = "/home/${config.home.username}";
} }

View file

@ -3,7 +3,6 @@
, inputs , inputs
, ... , ...
}: }:
let let
wallpaper = inputs.nix-wallpaper.packages.${pkgs.system}.default.override { wallpaper = inputs.nix-wallpaper.packages.${pkgs.system}.default.override {
logoSize = 24; logoSize = 24;
@ -11,7 +10,6 @@ let
}; };
wallpaperPath = "${wallpaper}/share/wallpapers/nixos-wallpaper.png"; wallpaperPath = "${wallpaper}/share/wallpapers/nixos-wallpaper.png";
in in
{ {
home = { home = {
file.".background".source = wallpaperPath; file.".background".source = wallpaperPath;
@ -21,6 +19,7 @@ in
brave brave
cavalier cavalier
freetube freetube
filelight
inkscape inkscape
jellyfin-media-player jellyfin-media-player
kate kate
@ -28,9 +27,11 @@ in
nextcloud-client nextcloud-client
onlyoffice-bin onlyoffice-bin
rustdesk rustdesk
tutanota-desktop spotify
signal-desktop signal-desktop
tutanota-desktop
thunderbird thunderbird
webcord-vencord
]; ];
}; };
} }

View file

@ -3,8 +3,7 @@
, config , config
, inputs , inputs
, ... , ...
}: }: {
{
# imports = [ # imports = [
# ../shell # ../shell
#]; #];

View file

@ -10,7 +10,6 @@ let
ref = "master"; ref = "master";
rev = "986398504d09e585c7d1a8d73a6394024fe6f164"; rev = "986398504d09e585c7d1a8d73a6394024fe6f164";
}; };
in in
{ {
programs = { programs = {
@ -94,7 +93,6 @@ in
}; };
}; };
services = { services = {
gpg-agent = { gpg-agent = {
enable = true; enable = true;
@ -111,7 +109,6 @@ in
}; };
}; };
home = { home = {
activation.setupEmacs = lib.hm.dag.entryAfter [ "writeBoundary" ] '' activation.setupEmacs = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir ~/.config/emacs -p mkdir ~/.config/emacs -p
@ -122,6 +119,7 @@ in
file.".config/doom" = { file.".config/doom" = {
recursive = true; recursive = true;
source = ../../ext/doom; source = ../../ext/doom;
onChange = "${config.home.homeDirectory}/.config/emacs/bin/doom sync";
}; };
packages = with pkgs.unstable-pkgs; [ packages = with pkgs.unstable-pkgs; [

View file

@ -5,10 +5,8 @@
}: { }: {
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.nameservers = [ networking.nameservers = [
"45.90.28.0#921984.dns.nextdns.io" "23.88.68.113#dns.vlt81.de"
"45.90.30.0#921984.dns.nextdns.io" "2a01:4f8:272:5917::baad:c0de#dns.vlt81.de"
"2a07:a8c0::#921984.dns.nextdns.io"
"2a07:a8c1::#921984.dns.nextdns.io"
]; ];
services = { services = {
@ -16,7 +14,14 @@
enable = true; enable = true;
dnssec = "true"; dnssec = "true";
domains = [ "~." ]; domains = [ "~." ];
fallbackDns = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ]; fallbackDns = [
"45.90.28.0#921984.dns.nextdns.io"
"45.90.30.0#921984.dns.nextdns.io"
"2a07:a8c0::#921984.dns.nextdns.io"
"2a07:a8c1::#921984.dns.nextdns.io"
"1.1.1.1#one.one.one.one"
"1.0.0.1#one.one.one.one"
];
extraConfig = '' extraConfig = ''
DNSOverTLS=yes DNSOverTLS=yes
''; '';

View file

@ -25,6 +25,7 @@
}; };
}; };
luksSwap = { luksSwap = {
# size = "64G"
end = "-192G"; end = "-192G";
content = { content = {
type = "luks"; type = "luks";
@ -82,15 +83,36 @@
"/_active" = { }; "/_active" = { };
"/_active/root" = { "/_active/root" = {
mountpoint = "/"; mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [
"autodefrag"
"compress=zstd"
"discard=async"
"noatime"
"space_cache=v2"
"ssd"
];
}; };
"/_active/home" = { "/_active/home" = {
mountpoint = "/home"; mountpoint = "/home";
mountOptions = [ "compress=zstd" "relatime" ]; mountOptions = [
"autodefrag"
"compress=zstd"
"discard=async"
"relatime"
"space_cache=v2"
"ssd"
];
}; };
"/_active/nix" = { "/_active/nix" = {
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [
"autodefrag"
"compress=zstd"
"discard=async"
"noatime"
"space_cache=v2"
"ssd"
];
}; };
}; };
}; };

View file

@ -3,12 +3,11 @@
, inputs , inputs
, system , system
, ... , ...
}: }: {
{
imports = [ imports = [
../home-mods/common ../home-mods/common
../home-mods/dev
../home-mods/desktop ../home-mods/desktop
../home-mods/dev
../home-mods/firefox ../home-mods/firefox
../home-mods/plasma ../home-mods/plasma
../home-mods/shell ../home-mods/shell

View file

@ -3,9 +3,7 @@
, inputs , inputs
, system , system
, ... , ...
}: }: {
{
imports = [ imports = [
../home-mods/common ../home-mods/common
../home-mods/desktop ../home-mods/desktop