chore: upgrade

This commit is contained in:
winston 2023-05-18 12:30:46 +02:00
parent 430319efea
commit 77e31df662
Signed by: winston
GPG key ID: 3786770EDBC2B481
5 changed files with 90 additions and 123 deletions

View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1683754942,
"narHash": "sha256-L+Bj8EL4XLmODRIuOkk9sI6FDECVzK+C8jeZFv7q6eY=",
"lastModified": 1684343812,
"narHash": "sha256-ZTEjiC8PDKeP8JRchuwcFXUNlMcyQ4U+DpyVZ3pB6Q4=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "252541bd05a7f55f3704a3d014ad1badc1e3360d",
"rev": "dfbdabbb3e797334172094d4f6c0ffca8c791281",
"type": "github"
},
"original": {
@ -113,11 +113,11 @@
]
},
"locked": {
"lastModified": 1683929392,
"narHash": "sha256-qJddrb/bgS58AXAv25iv5xJ+69G5g7FAYCWec1lLnW0=",
"lastModified": 1684321175,
"narHash": "sha256-V4EbM+jK7pvjKBaj0dgAiW9ultzDE27Nz5fRyu/ceMk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "eec22729990ddf53d1e45e74624ddf667cdbe11b",
"rev": "59659243cd4ababda605e79b4a9c2e6d83e24c86",
"type": "github"
},
"original": {
@ -198,11 +198,11 @@
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1683504292,
"narHash": "sha256-jlZbBIKGa6IMGkcJkQ08pbKnouTAPfeq1fD5I7l/rBw=",
"lastModified": 1684025543,
"narHash": "sha256-hGe7S+i5je+8E/b2mOXVI9nmr038Dw+bV8e1P8xHSe0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ba0086c178d4ed60a7899f739caea553eca2e046",
"rev": "c6d2f3dc0d3efd4285eebe4f8a36a47ba438138e",
"type": "github"
},
"original": {
@ -214,11 +214,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1683777345,
"narHash": "sha256-V2p/A4RpEGqEZussOnHYMU6XglxBJGCODdzoyvcwig8=",
"lastModified": 1684363872,
"narHash": "sha256-jkvhzrICFSmj+NBHksKTWzs8Q3+D7RsVK0wLKacbu8s=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "635a306fc8ede2e34cb3dd0d6d0a5d49362150ed",
"rev": "1d77f3b72756ca36f16440c59e6b89a957908647",
"type": "github"
},
"original": {
@ -246,11 +246,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1683475240,
"narHash": "sha256-sy6MYoCaIZsOenYplbzVXI4Ce9Bp/vIOpuFa97+a6wc=",
"lastModified": 1683777345,
"narHash": "sha256-V2p/A4RpEGqEZussOnHYMU6XglxBJGCODdzoyvcwig8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e040aab15638aaf8d0786894851a2b1ca09a7baf",
"rev": "635a306fc8ede2e34cb3dd0d6d0a5d49362150ed",
"type": "github"
},
"original": {
@ -262,11 +262,11 @@
},
"nur": {
"locked": {
"lastModified": 1683946044,
"narHash": "sha256-23K45lAT63YN1quyxaIGS+sLqjuvgpXUOUuLW3CBCCk=",
"lastModified": 1684393705,
"narHash": "sha256-w5xLzA7UKW9zaJSQ8s3eSV72AQwBrODJcHcdwM2curI=",
"owner": "nix-community",
"repo": "nur",
"rev": "ff2a014db7026ae20be955a7ac2a3acae59b8964",
"rev": "369d7cbaccdc84b26bd40b33050c5d56ab1cfcff",
"type": "github"
},
"original": {
@ -284,11 +284,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1682596858,
"narHash": "sha256-Hf9XVpqaGqe/4oDGr30W8HlsWvJXtMsEPHDqHZA6dDg=",
"lastModified": 1684195081,
"narHash": "sha256-IKnQUSBhQTChFERxW2AzuauVpY1HRgeVzAjNMAA4B6I=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "fb58866e20af98779017134319b5663b8215d912",
"rev": "96eabec58248ed8f4b0ad59e7ce9398018684fdc",
"type": "github"
},
"original": {
@ -317,11 +317,11 @@
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1683545104,
"narHash": "sha256-48wC0zzHAej/wLFWIgV+uj63AvQ2UUk85g7wmXJzTqk=",
"lastModified": 1684032930,
"narHash": "sha256-ueeSYDii2e5bkKrsSdP12JhkW9sqgYrUghLC8aDfYGQ=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "36b062a2c85a0efb37de1300c79c54602a094fab",
"rev": "a376127bb5277cd2c337a9458744f370aaf2e08d",
"type": "github"
},
"original": {
@ -338,11 +338,11 @@
]
},
"locked": {
"lastModified": 1683317270,
"narHash": "sha256-dtAbtiRnY1GL9UuPE9iKwF2ZwxPqaOva196Pl8YARg0=",
"lastModified": 1684366788,
"narHash": "sha256-qAP0v8DaDTGRdLjWPd1IReE6lwmZ2aqYOjnQdP1n6hg=",
"owner": "willpower3309",
"repo": "swayfx",
"rev": "6e53c04abf34599a6c36d1fb57df26d641bee8a1",
"rev": "acafb20b114ea93f971e118da0233c07157286c0",
"type": "github"
},
"original": {

View file

@ -1,16 +1,19 @@
{
config,
flakePath,
pkgs,
...
}: {
programs.wezterm = {
enable = true;
# TODO: fix my wezterm NUR package :(
# package = pkgs.nur.repos.nekowinston.wezterm-nightly;
extraConfig = ''
package.path = "${flakePath}/home/apps/wezterm/?.lua;" .. package.path;
return require("config")
'';
};
# disable the default config created by Home-Manager
xdg.configFile."wezterm/wezterm.lua".enable = false;
# and use my own config instead
xdg.configFile."wezterm" = {
source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/wezterm";
recursive = true;
};
programs.zsh.initExtra = ''

View file

@ -1,72 +1,36 @@
local wezterm = require("wezterm")
local utils = require("utils")
local M = {}
local defaults = {
size = 16,
ui_font = "IBM Plex Sans",
}
-- fonts I like, with the settings I prefer
-- kept separately from the rest of the config so that I can easily change them
local fonts = {
berkeley = { font = "Berkeley Mono" },
comic = {
font = "Comic Code Ligatures",
ui_font = "xkcd Script",
},
victor = {
font = {
local function get_victor(weigth)
return wezterm.font({
family = "Victor Mono",
weight = "DemiBold",
harfbuzz_features = { "ss02=1" },
},
size = defaults.size - 1,
},
}
for k, v in pairs(fonts) do
fonts[k] = utils.tableMerge(v, defaults)
style = "Italic",
weight = weigth,
})
end
M.get_font = function(name)
return {
font = wezterm.font_with_fallback({
fonts[name].font,
M.apply = function(c)
c.font = wezterm.font_with_fallback({
"Berkeley Mono",
"Symbols Nerd Font",
}),
size = fonts[name].size,
ui_font = wezterm.font(fonts[name].ui_font),
})
c.font_rules = {
{
font = get_victor("Black"),
intensity = "Bold",
italic = true,
},
{
font = get_victor("Bold"),
intensity = "Half",
italic = true,
},
{
font = get_victor("DemiBold"),
intensity = "Normal",
italic = true,
},
}
end
wezterm.on("switch-font", function(window, _)
local next_font = next(fonts, wezterm.GLOBAL.font)
if next_font == nil then
next_font = next(fonts)
end
wezterm.GLOBAL.font = next_font
local f = M.get_font(next_font)
local window_frame = window:effective_config().window_frame
window_frame = utils.tableMerge({ font = f.ui_font }, window_frame)
window:set_config_overrides({
font = f.font,
font_size = f.size,
window_frame = window_frame,
})
end)
wezterm.GLOBAL = { font = "berkeley" }
M.apply = function(c)
local f = M.get_font(wezterm.GLOBAL.font)
c.font = f.font
c.font_size = f.size
if c.window_frame == nil then
c.window_frame = {}
end
c.window_frame.font = f.ui_font
end
return M

View file

@ -1,5 +1,10 @@
local wezterm = require("wezterm")
local M = {}
---merge two tables, t2 overwriting t1
---@param t1 table
---@param t2 table
---@return table
M.tableMerge = function(t1, t2)
for k, v in pairs(t2) do
if type(v) == "table" then
@ -15,14 +20,29 @@ M.tableMerge = function(t1, t2)
return t1
end
---check if a table contains a value
---@param t table
---@param val any
---@return boolean
M.tableContains = function(t, val)
for _, v in ipairs(t) do
if v == val then
return true
end
end
return false
end
---check if we're on Linux
---@return boolean
M.is_linux = function()
return wezterm.target_triple:find("linux") ~= nil
end
---check if we're on macOS
---@return boolean
M.is_darwin = function()
return wezterm.target_triple:find("darwin") ~= nil
end
return M

View file

@ -1,4 +1,5 @@
local wezterm = require("wezterm")
local utils = require("utils")
local c = {}
if wezterm.config_builder then
@ -8,29 +9,14 @@ end
require("fonts").apply(c)
require("keys").apply(c)
c.window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
}
-- set up terminfo on nix
c.set_environment_variables = {
TERMINFO_DIRS = wezterm.home_dir .. "/.nix-profile/share/terminfo",
}
-- window
c.window_decorations = "RESIZE"
c.window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
}
c.window_padding = { left = 0, right = 0, top = 0, bottom = 0 }
-- dim unfocused panes
c.inactive_pane_hsb = {
saturation = 1.0,
brightness = 0.6,
brightness = 0.8,
}
-- etc.
c.adjust_window_size_when_changing_font_size = false
@ -40,25 +26,19 @@ c.default_cursor_style = "BlinkingBar"
c.launch_menu = {
{ label = "Music player", args = { "ncmpcpp" } },
}
c.command_palette_font_size = 16.0
c.command_palette_font_size = 13.0
c.window_frame = { font_size = 13.0 }
c.window_background_opacity = 0.9
c.window_frame = {
font_size = 18.0,
}
wezterm.plugin
.require("https://github.com/catppuccin/wezterm")
.apply_to_config(c, {
flavor = "mocha",
sync = wezterm.target_triple:find("darwin") ~= nil,
sync = utils.is_darwin(),
sync_flavors = { light = "latte", dark = "mocha" },
})
wezterm.plugin
.require("https://github.com/nekowinston/wezterm-bar")
.apply_to_config(c, {
indicator = {
leader = { off = "", on = "" },
},
})
.apply_to_config(c)
return c