This commit is contained in:
jdonszelmann 2024-08-02 13:19:05 +02:00
parent db45954236
commit a94e2ae578
No known key found for this signature in database
GPG key ID: E0C1EA36407B2FF2
7 changed files with 140 additions and 4 deletions

17
flake.lock generated
View file

@ -217,6 +217,22 @@
"type": "github"
}
},
"kitty-search": {
"flake": false,
"locked": {
"lastModified": 1675366825,
"narHash": "sha256-egisza7V5dWplRYHIYt4bEQdqXa4E7UhibyWJAup8as=",
"owner": "trygveaa",
"repo": "kitty-kitten-search",
"rev": "0760138fad617c5e4159403cbfce8421ccdfe571",
"type": "github"
},
"original": {
"owner": "trygveaa",
"repo": "kitty-kitten-search",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
@ -299,6 +315,7 @@
"inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"kitty-search": "kitty-search",
"nixpkgs": "nixpkgs",
"nixvim": "nixvim",
"t": "t"

View file

@ -13,9 +13,14 @@
};
t.url = "github:jdonszelmann/t-rs";
kitty-search = {
url = "github:trygveaa/kitty-kitten-search";
flake = false;
};
};
outputs = { self, home-manager, nixpkgs, flake-utils, nixvim, t }:
outputs = { self, home-manager, nixpkgs, flake-utils, nixvim, t, ... }@inputs:
let
homeManagerModules = [ nixvim.homeManagerModules.nixvim ];
@ -58,10 +63,10 @@
homeConfigurations = {
kili = mkHomeConfiguration (import ./hosts/kili/home.nix) {
extraSpecialArgs = { };
extraSpecialArgs = { inherit inputs; };
};
ori = mkHomeConfiguration (import ./hosts/ori/home.nix) {
extraSpecialArgs = { };
extraSpecialArgs = { inherit inputs; };
};
};

View file

@ -1,4 +1,4 @@
{ ... }: {
{ pkgs, ... }: {
home.stateVersion = "24.05";
home.username = "jonathan";
home.homeDirectory = "/home/jonathan";
@ -6,5 +6,18 @@
imports = [
../../programs/nvim
../../programs/zsh
../../programs/kanata
../../programs/kitty
];
# use the system-installed version of kitty on arch
# something graphics related crashes otherwise
programs.kitty.package = pkgs.stdenv.mkDerivation {
name = "kitty";
src = ./.;
installPhase = ''
mkdir -p $out/bin
echo "#!/usr/bin/env bash\nexec /usr/bin/kitty" > $out/bin/kitty;
'';
};
}

30
programs/kanata/cfg.kbd Normal file
View file

@ -0,0 +1,30 @@
(defcfg
process-unmapped-keys yes
)
(defsrc
esc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
caps a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lmet lalt spc ralt rctl
)
(deflayer qwerty
@esc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
@cap a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lmet lalt spc ralt rctl
)
(defalias
esc (tap-hold 200 800 esc caps)
cap (tap-dance 300 (esc C-k esc))
qwr (layer-switch qwerty)
)

View file

@ -0,0 +1,30 @@
{pkgs, config, ...}: {
# sudo groupadd uinput
# sudo usermod -aG input $USER
# sudo usermod -aG uinput $USER
# echo "KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"" >> /etc/udev/rules.d/99-input.rules
# reboot or sudo udevadm control --reload-rules && sudo udevadm trigger
# sudo modprobe uinput
systemd.user.services.kanata ={
Unit = {
Description = "kanata";
};
Service = {
Restart = "always";
RestartSec = "3";
ExecStart = "${pkgs.kanata}/bin/kanata --cfg ${config.home.file.kanata.target}";
Nice = "-20";
};
Install = {
WantedBy = ["default.target"];
};
};
home.file.kanata = {
target = ".config/kanata/kanata.kbd";
text = builtins.readFile ./cfg.kbd;
};
}

View file

@ -0,0 +1,40 @@
{pkgs, inputs, ...}: {
programs.kitty = {
enable = true;
font.name = "Jetbrains Mono";
font.size = 13.0;
font.package = pkgs.jetbrains-mono;
settings = {
scrollback_lines = 20000;
repaint_delay = 10;
input_delay = 3;
enable_audio_bell = false;
update_check_interval = 0;
initial_window_width = "95c";
initial_window_height = "30c";
remember_window_size = "no";
draw_minimal_borders = false;
hide_window_decorations = true;
shell = "${pkgs.tmux}/bin/tmux";
clipboard_control = "write-clipboard write-primary read-clipboard read-primary";
foreground = "#fcfcfc";
background = "#232627";
linux_display_server = "auto";
};
keybindings = {
"ctrl+f" = "launch --location=hsplit --allow-remote-control kitty +kitten ${inputs.kitty-search}/search.py @active-kitty-window-id";
"ctrl+r" = "load_config_file";
"ctrl+EQUAL" = "change_font_size all +2.0";
"ctrl+minus" = "change_font_size all -2.0";
"ctrl+0" = "change_font_size all 0";
};
};
}

1
result Symbolic link
View file

@ -0,0 +1 @@
/nix/store/r6mc0binq1svz4p2d0h6cb4a0nrx5ygw-home-manager