feat(wezterm): add module for wezterm

Enable it for `homix`
This commit is contained in:
reo101 2023-02-21 23:31:38 +02:00
parent 0fac8b394e
commit bd2df72ebc
Signed by: reo101
GPG key ID: 675AA7EF13964ACB
7 changed files with 217 additions and 30 deletions

View file

@ -41,11 +41,11 @@
"diffz": { "diffz": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1676154556, "lastModified": 1676881125,
"narHash": "sha256-foiZMt5GBbbLEZPPK/qgkjQ6FCj2rLPniaF8rC5Z56w=", "narHash": "sha256-iCXoJp+89GhdFO9roE208mhqURTuMX8zKiEEpvMH2do=",
"owner": "ziglibs", "owner": "ziglibs",
"repo": "diffz", "repo": "diffz",
"rev": "f25b31c4f8d06bc134018133a2d57b6dcbb6941e", "rev": "efc91679b000a2d7f86fb40930f0a95a0d349bff",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -201,11 +201,11 @@
}, },
"hardware": { "hardware": {
"locked": { "locked": {
"lastModified": 1675933606, "lastModified": 1676924492,
"narHash": "sha256-y427VhPQHOKkYvkc9MMsL/2R7M11rQxzsRdRLM3htx8=", "narHash": "sha256-78278eyP55JRFe7UCpmFwdkrTY6H2arzTpVeteWo8kM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "44ae00e02e8036a66c08f4decdece7e3bbbefee2", "rev": "d24ea777c57b69c6b143cf11d83184ef71b0dbbf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -222,11 +222,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1674440933, "lastModified": 1676257154,
"narHash": "sha256-CASRcD/rK3fn5vUCti3jzry7zi0GsqRsBohNq9wPgLs=", "narHash": "sha256-eW3jymNLpdxS5fkp9NWKyNtgL0Gqtgg1vCTofKXDF1g=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "65c47ced082e3353113614f77b1bc18822dc731f", "rev": "2cb27c79117a2a75ff3416c3199a2dc57af6a527",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -262,11 +262,11 @@
}, },
"locked": { "locked": {
"dir": "contrib", "dir": "contrib",
"lastModified": 1676447500, "lastModified": 1676961797,
"narHash": "sha256-ZwNSq45LcUMfGToWXqwHYsgPeAcqUtmFoQb+vHzr0kQ=", "narHash": "sha256-2iFgeZt4U6BGFFVI6T8NOUZoL5WBObuq5HORD75Sbc0=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "8307ed3a194d0c0420feb0b3e5c2f6919095415f", "rev": "f0ee548137263a67e3d163b674f48e6e004210fb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -283,11 +283,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1676448935, "lastModified": 1676967323,
"narHash": "sha256-S3vVH9R6B5d6ypy/nH+QLmSmbixRsiiQCOgQo+sWAWo=", "narHash": "sha256-O1MYNghLLIsQAEw5zCTzigIpjliM8mQzetge4nIeY3U=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "cc3a0896253491f47a11db5d959206c541b1b443", "rev": "16013225fd352a7046a4e24e94b3e68331ea815c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -435,11 +435,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1676300157, "lastModified": 1676885936,
"narHash": "sha256-1HjRzfp6LOLfcj/HJHdVKWAkX9QRAouoh6AjzJiIerU=", "narHash": "sha256-ZRKb6zBfTvdCOXI7nGC1L9UWSU5ay2ltxg+f5UIzBOU=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "545c7a31e5dedea4a6d372712a18e00ce097d462", "rev": "b69883faca9542d135fa6bab7928ff1b233c167f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -588,11 +588,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1676462917, "lastModified": 1676999840,
"narHash": "sha256-J7PejnvGs3bcKIkYziFnvi3GaqI1/9jsI0RxLlEupUo=", "narHash": "sha256-hOctK9Skbpdy1plgZlWzj6EoVQJFwpG1JRrr0F+9l34=",
"owner": "mitchellh", "owner": "mitchellh",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "e4679c0cc53b68fa68c2b56f7103efef9a885208", "rev": "1b0d9c8d127616d40abb11f663924293b8e6dbfd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -637,11 +637,11 @@
"zig-overlay": "zig-overlay_2" "zig-overlay": "zig-overlay_2"
}, },
"locked": { "locked": {
"lastModified": 1676362045, "lastModified": 1676929205,
"narHash": "sha256-rzmbNSLgBju5c7zag2BNQ3eWKsMB15AX45D7hcPj5mo=", "narHash": "sha256-gVmxoXi2WJsrIoONXp0CHPbib6mh1yfP8FoBgVOF0zQ=",
"owner": "zigtools", "owner": "zigtools",
"repo": "zls", "repo": "zls",
"rev": "2071db440d6ec3ec4e76e82473db23ea49449c73", "rev": "b635317e2a426074fd28fbf954293efb4e124192",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,7 +1,10 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# Super+Return to start an instance of foot (https://codeberg.org/dnkl/foot) # # Super+Return to start an instance of foot (https://codeberg.org/dnkl/foot)
riverctl map normal Super Return spawn foot # riverctl map normal Super Return spawn foot
# Super+Return to start an instance of wezterm
riverctl map normal Super Return spawn wezterm
# Super+Q to close the focused view # Super+Q to close the focused view
riverctl map normal Super Q close riverctl map normal Super Q close

View file

@ -98,6 +98,9 @@
}; };
}; };
### Fonts
fonts.fontconfig.enable = true;
### NVIDIA ### NVIDIA
services.xserver = { services.xserver = {
videoDrivers = [ "nvidia" ]; videoDrivers = [ "nvidia" ];

View file

@ -89,11 +89,16 @@
userEmail = "pavel.atanasov2001@gmail.com"; userEmail = "pavel.atanasov2001@gmail.com";
}; };
reo101.shell = { reo101 = {
shell = {
enable = true; enable = true;
direnv = true; direnv = true;
zoxide = true; zoxide = true;
}; };
wezterm = {
enable = true;
};
};
systemd.user.services."swww" = { systemd.user.services."swww" = {
Unit = { Unit = {

View file

@ -5,4 +5,5 @@
# List your module files here # List your module files here
# my-module = import ./my-module.nix; # my-module = import ./my-module.nix;
reo101-shell = import ./reo101-shell.nix; reo101-shell = import ./reo101-shell.nix;
reo101-wezterm = import ./reo101-wezterm;
} }

View file

@ -0,0 +1,47 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.reo101.wezterm;
in
{
imports =
[
];
options =
{
reo101.wezterm = {
enable = mkEnableOption "reo101 wezterm setup";
extraConfig = mkOption {
type = types.str;
description = "Extra zsh config";
default = ''
'';
};
};
};
config =
mkIf cfg.enable {
home.packages = with pkgs;
builtins.concatLists [
[
wezterm
(nerdfonts.override { fonts = [ "FiraCode" ]; })
]
];
programs.wezterm = {
enable = true;
extraConfig = builtins.concatStringsSep "\n" [
(builtins.readFile ./wezterm.lua)
cfg.extraConfig
];
};
};
meta = {
maintainers = with lib.maintainers; [ reo101 ];
};
}

View file

@ -0,0 +1,128 @@
local M = {}
local wezterm = require("wezterm")
----------
-- Font --
----------
M.font = wezterm.font("FiraCode Nerd Font Mono")
------------------
-- Font options --
------------------
M.harfbuzz_features = {
"liga",
"cv02",
"cv19",
"cv25",
"cv26",
"cv28",
"cv30",
"cv32",
"ss02",
"ss03",
"ss05",
"ss07",
"ss09",
"zero",
}
--------------------
-- Font rendering --
--------------------
M.freetype_render_target = "Light"
------------------
-- Cursor style --
------------------
-- M.default_cursor_style = "BlinkingBar"
--------------------
-- Window options --
--------------------
-- M.window_background_opacity = 0.2
M.text_background_opacity = 1.0
-- M.window_background_image = "/home/reo101/.local/share/bg/ide_bg.jpeg"
M.window_decorations = "NONE"
M.window_close_confirmation = "NeverPrompt"
M.use_resize_increments = false
M.enable_scroll_bar = false
M.adjust_window_size_when_changing_font_size = false
M.window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
}
-------------
-- Tab bar --
-------------
M.enable_tab_bar = false
--------------
-- Keybinds --
--------------
local function keybind(mods, key, action)
if type(action) == "table" then
action = wezterm.action(action)
end
return {
mods = mods,
key = key,
action = action,
}
end
M.disable_default_key_bindings = true
M.keys = {
---------------
-- Clipboard --
---------------
keybind("ALT", "c", { CopyTo = "Clipboard" }),
keybind("ALT", "v", { PasteFrom = "Clipboard" }),
---------------
-- Font size --
---------------
keybind("ALT|SHIFT", "UpArrow", "IncreaseFontSize"),
keybind("ALT|SHIFT", "DownArrow", "DecreaseFontSize"),
------------
-- Scroll --
------------
keybind("ALT", "u", { ScrollByPage = -1 }),
keybind("ALT", "d", { ScrollByPage = 1 }),
------------
-- Reload --
------------
keybind("CTRL|SHIFT", "r", "ReloadConfiguration"),
}
-----------
-- Links --
-----------
M.hyperlink_rules = {
-- Linkify things that look like URLs
-- This is actually the default if you don't specify any hyperlink_rules
{
regex = "\\b\\w+://(?:[\\w.-]+)\\.[a-z]{2,15}\\S*\\b",
format = "$0",
},
-- linkify email addresses
{
regex = "\\b\\w+@[\\w-]+(\\.[\\w-]+)+\\b",
format = "mailto:$0",
},
-- file:// URI
{
regex = "\\bfile://\\S*\\b",
format = "$0",
},
}
return M