687 current 2024-05-26 18:53:13 24.11.20240524.bfb7a88 6.9.1-zen1 *
This commit is contained in:
parent
9cc2434150
commit
3ae49b3d62
8 changed files with 178 additions and 170 deletions
69
flake.lock
generated
69
flake.lock
generated
|
|
@ -546,27 +546,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"home-manager_stable": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs_stable"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1716729592,
|
|
||||||
"narHash": "sha256-Y3bOjoh2cFBqZN0Jw1zUdyr7tjygyxl2bD/QY73GZP0=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"rev": "2c78a57c544dd19b07442350727ced097e1aa6e6",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"ref": "release-23.11",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"hyprcursor": {
|
"hyprcursor": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"hyprlang": [
|
"hyprlang": [
|
||||||
|
|
@ -805,11 +784,11 @@
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
"pre-commit-hooks": "pre-commit-hooks"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716747123,
|
"lastModified": 1716760058,
|
||||||
"narHash": "sha256-XZFVa21Vpn39Y7fCmGAb8CxKJlX0YKKUyUfArvhXNjo=",
|
"narHash": "sha256-5fMMNezTARjbc8HgEkvcOazlrsBBzlKSMVp56xTCY2g=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "neovim-nightly-overlay",
|
"repo": "neovim-nightly-overlay",
|
||||||
"rev": "491c6d2a3f239754a2e6aa110d47899a38d94c45",
|
"rev": "0c1fc48841eda5e35402327b1a71f4bb034a012c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -996,16 +975,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_7": {
|
"nixpkgs_7": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716704148,
|
"lastModified": 1716509168,
|
||||||
"narHash": "sha256-XsWxhtvSUsft43XbSkpSroSyUyXj4focTG2CFCx1wqE=",
|
"narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "8debaa1f45995e3a621c1f55c09bf68e214f5878",
|
"rev": "bfb7a882678e518398ce9a31a881538679f6f092",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable-small",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
@ -1042,22 +1021,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_stable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1716361217,
|
|
||||||
"narHash": "sha256-mzZDr00WUiUXVm1ujBVv6A0qRd8okaITyUp4ezYRgc4=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "46397778ef1f73414b03ed553a3368f0e7e33c2f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-23.11",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pnpm2nix": {
|
"pnpm2nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
|
|
@ -1094,13 +1057,13 @@
|
||||||
"lastModified": 1716213921,
|
"lastModified": 1716213921,
|
||||||
"narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=",
|
"narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0",
|
"rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -1164,11 +1127,11 @@
|
||||||
"systems": "systems_11"
|
"systems": "systems_11"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716726255,
|
"lastModified": 1716763745,
|
||||||
"narHash": "sha256-OlByCyBMJ3tZobHyzTVm41DhGzrQ/3FQv1krm+czCIw=",
|
"narHash": "sha256-01OYLdDWJfIwNO1hJ7urv5mmTOg8Wc2hTz5lAmFmxpQ=",
|
||||||
"owner": "raphamorim",
|
"owner": "raphamorim",
|
||||||
"repo": "rio",
|
"repo": "rio",
|
||||||
"rev": "a0eb2b64ece67edc38f7209b7e0fe2138c1b07b3",
|
"rev": "3079cfe94b19583d3c7bb05ff07720116bf84873",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -1185,7 +1148,6 @@
|
||||||
"blog": "blog",
|
"blog": "blog",
|
||||||
"catppuccin": "catppuccin",
|
"catppuccin": "catppuccin",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"home-manager_stable": "home-manager_stable",
|
|
||||||
"hypridle": "hypridle",
|
"hypridle": "hypridle",
|
||||||
"hyprland": "hyprland",
|
"hyprland": "hyprland",
|
||||||
"kb-gui": "kb-gui",
|
"kb-gui": "kb-gui",
|
||||||
|
|
@ -1193,7 +1155,6 @@
|
||||||
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||||
"nixos-generators": "nixos-generators",
|
"nixos-generators": "nixos-generators",
|
||||||
"nixpkgs": "nixpkgs_7",
|
"nixpkgs": "nixpkgs_7",
|
||||||
"nixpkgs_stable": "nixpkgs_stable",
|
|
||||||
"resume": "resume",
|
"resume": "resume",
|
||||||
"rio-term": "rio-term",
|
"rio-term": "rio-term",
|
||||||
"snowfall-lib": "snowfall-lib",
|
"snowfall-lib": "snowfall-lib",
|
||||||
|
|
@ -1252,11 +1213,11 @@
|
||||||
"nixpkgs": "nixpkgs_9"
|
"nixpkgs": "nixpkgs_9"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715998563,
|
"lastModified": 1716603336,
|
||||||
"narHash": "sha256-krjs9VkDoRrYNQVyCTXUGUfAJziCk0Fkki1ZnnmNgjk=",
|
"narHash": "sha256-81u/zd7V+XRTq88zwRLxw5GnwZyEiAvGA2BvAXUe864=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "4731829dec4859921bfc0e1548478207d6c9c8fa",
|
"rev": "4d0f1e4d5d65c23cdbb77e4b0d91940be7309bd4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -11,19 +11,13 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
nixpkgs_stable.url = "github:nixos/nixpkgs/nixos-23.11";
|
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager_stable = {
|
|
||||||
url = "github:nix-community/home-manager/release-23.11";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs_stable";
|
|
||||||
};
|
|
||||||
|
|
||||||
resume.url = "git+https://git.zackster.zip/zack/resume";
|
resume.url = "git+https://git.zackster.zip/zack/resume";
|
||||||
anyrun.url = "github:Kirottu/anyrun";
|
anyrun.url = "github:Kirottu/anyrun";
|
||||||
anyrun.inputs.nixpkgs.follows = "nixpkgs";
|
anyrun.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
|
||||||
|
|
@ -10,20 +10,27 @@ with lib.custom; let
|
||||||
in {
|
in {
|
||||||
options.apps.term.kitty = with types; {
|
options.apps.term.kitty = with types; {
|
||||||
enable = mkBoolOpt false "Enable Kitty Term";
|
enable = mkBoolOpt false "Enable Kitty Term";
|
||||||
|
|
||||||
|
fonts = {
|
||||||
|
normal = mkStringOpt "Zed Mono Bold" "Normal Font";
|
||||||
|
bold = mkStringOpt "Zed Mono Heavy" "Bold Font";
|
||||||
|
italic = mkStringOpt "Zed Mono Bold Italic" "Italic Font";
|
||||||
|
bold_italic = mkStringOpt "Zed Mono Bold Heavy Italic" "Bold Italic Font";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
font = {
|
font = {
|
||||||
name = "Iosevka Term SemiBold";
|
name = cfg.fonts.normal;
|
||||||
size = 14;
|
size = 14;
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
bold_font Iosevk Term Heavy
|
bold_font ${cfg.fonts.bold}
|
||||||
italic_font Iosevka Term SemiBold Italic
|
italic_font ${cfg.fonts.italic}
|
||||||
bold_italic_font Iosevka Term Heavy Italic
|
bold_italic_font ${cfg.fonts.bold_italic}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
catppuccin.enable = true;
|
catppuccin.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -67,28 +67,10 @@ in {
|
||||||
opts = function()
|
opts = function()
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
|
local lspkind = require("lspkind")
|
||||||
|
|
||||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
|
|
||||||
local icons = {
|
|
||||||
branch = "",
|
|
||||||
bullet = "•",
|
|
||||||
o_bullet = "○",
|
|
||||||
check = "✔",
|
|
||||||
d_chev = "∨",
|
|
||||||
ellipses = "…",
|
|
||||||
file = "╼",
|
|
||||||
hamburger = "≡",
|
|
||||||
lock = "",
|
|
||||||
r_chev = ">",
|
|
||||||
ballot_x = " ",
|
|
||||||
up_tri = " ",
|
|
||||||
info_i = " ",
|
|
||||||
-- ballot_x = '✘',
|
|
||||||
-- up_tri = '▲',
|
|
||||||
-- info_i = '¡',
|
|
||||||
}
|
|
||||||
|
|
||||||
local function get_lsp_completion_context(completion, source)
|
local function get_lsp_completion_context(completion, source)
|
||||||
local ok, source_name = pcall(function()
|
local ok, source_name = pcall(function()
|
||||||
return source.source.client.config.name
|
return source.source.client.config.name
|
||||||
|
|
@ -139,14 +121,12 @@ in {
|
||||||
luasnip.lsp_expand(args.body)
|
luasnip.lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
window = {
|
window = {
|
||||||
completion = {
|
completion = {
|
||||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
||||||
side_padding = 4,
|
col_offset = -3,
|
||||||
},
|
side_padding = 0,
|
||||||
documentation = {
|
|
||||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
|
||||||
side_padding = 4,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
|
|
@ -189,86 +169,24 @@ in {
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
},
|
},
|
||||||
|
view = {
|
||||||
|
entries = { name = "custom", selection_order = "near_cursor" },
|
||||||
|
},
|
||||||
|
experimental = {
|
||||||
|
ghost_text = true,
|
||||||
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
-- format = lspkind_status_ok and lspkind.cmp_format({
|
fields = { "kind", "abbr", "menu" },
|
||||||
-- mode = "symbol",
|
|
||||||
-- maxwidth = 25,
|
|
||||||
-- ellipsis_char = "...",
|
|
||||||
-- before = function(entry, vim_item)
|
|
||||||
-- if vim_item.kind == "Color" and entry.completion_item.documentation then
|
|
||||||
-- local _, _, r, g, b =
|
|
||||||
-- string.find(entry.completion_item.documentation, "^rgb%((%d+), (%d+), (%d+)")
|
|
||||||
-- if r then
|
|
||||||
-- local color = string.format("%02x", r)
|
|
||||||
-- .. string.format("%02x", g)
|
|
||||||
-- .. string.format("%02x", b)
|
|
||||||
-- local group = "Tw_" .. color
|
|
||||||
-- if vim.fn.hlID(group) < 1 then
|
|
||||||
-- vim.api.nvim_set_hl(0, group, { fg = "#" .. color })
|
|
||||||
-- end
|
|
||||||
-- vim_item.kind_hl_group = group
|
|
||||||
-- return vim_item
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- return vim_item
|
|
||||||
-- end,
|
|
||||||
-- }),
|
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
if not require("cmp.utils.api").is_cmdline_mode() then
|
local kind = lspkind.cmp_format({
|
||||||
local abbr_width_max = 25
|
mode = "symbol_text",
|
||||||
local menu_width_max = 20
|
maxwidth = 50,
|
||||||
|
})(entry, vim_item)
|
||||||
|
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||||
|
kind.kind = " " .. strings[1] .. " "
|
||||||
|
kind.menu = " (" .. strings[2] .. ")"
|
||||||
|
|
||||||
local choice = require("lspkind").cmp_format({
|
return kind
|
||||||
ellipsis_char = icons.ellipsis,
|
|
||||||
maxwidth = abbr_width_max,
|
|
||||||
mode = "symbol",
|
|
||||||
})(entry, vim_item)
|
|
||||||
|
|
||||||
choice.abbr = vim.trim(choice.abbr)
|
|
||||||
|
|
||||||
local abbr_width = string.len(choice.abbr)
|
|
||||||
if abbr_width < abbr_width_max then
|
|
||||||
local padding = string.rep(" ", abbr_width_max - abbr_width)
|
|
||||||
vim_item.abbr = choice.abbr .. padding
|
|
||||||
end
|
|
||||||
|
|
||||||
local cmp_ctx = get_lsp_completion_context(entry.completion_item, entry.source)
|
|
||||||
if cmp_ctx ~= nil and cmp_ctx ~= "" then
|
|
||||||
choice.menu = cmp_ctx
|
|
||||||
else
|
|
||||||
choice.menu = ""
|
|
||||||
end
|
|
||||||
|
|
||||||
local menu_width = string.len(choice.menu)
|
|
||||||
if menu_width > menu_width_max then
|
|
||||||
choice.menu = vim.fn.strcharpart(choice.menu, 0, menu_width_max - 1)
|
|
||||||
choice.menu = choice.menu .. icons.ellipses
|
|
||||||
else
|
|
||||||
local padding = string.rep(" ", menu_width_max - menu_width)
|
|
||||||
choice.menu = padding .. choice.menu
|
|
||||||
end
|
|
||||||
|
|
||||||
return choice
|
|
||||||
else
|
|
||||||
local abbr_width_min = 20
|
|
||||||
local abbr_width_max = 50
|
|
||||||
|
|
||||||
local choice = require("lspkind").cmp_format({
|
|
||||||
ellipsis_char = icons.ellipses,
|
|
||||||
maxwidth = abbr_width_max,
|
|
||||||
mode = "symbol",
|
|
||||||
})(entry, vim_item)
|
|
||||||
|
|
||||||
choice.abbr = vim.trim(choice.abbr)
|
|
||||||
|
|
||||||
local abbr_width = string.len(choice.abbr)
|
|
||||||
if abbr_width < abbr_width_min then
|
|
||||||
local padding = string.rep(" ", abbr_width_min - abbr_width)
|
|
||||||
vim_item.abbr = choice.abbr .. padding
|
|
||||||
end
|
|
||||||
|
|
||||||
return choice
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,35 @@ return {
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
transparent_background = true,
|
transparent_background = true,
|
||||||
custom_highlights = function(colors)
|
custom_highlights = function(C)
|
||||||
return {
|
return {
|
||||||
Pmenu = { bg = colors.base },
|
Pmenu = { bg = C.base },
|
||||||
|
CmpItemKindSnippet = { fg = C.base, bg = C.mauve },
|
||||||
|
CmpItemKindKeyword = { fg = C.base, bg = C.red },
|
||||||
|
CmpItemKindText = { fg = C.base, bg = C.teal },
|
||||||
|
CmpItemKindMethod = { fg = C.base, bg = C.blue },
|
||||||
|
CmpItemKindConstructor = { fg = C.base, bg = C.blue },
|
||||||
|
CmpItemKindFunction = { fg = C.base, bg = C.blue },
|
||||||
|
CmpItemKindFolder = { fg = C.base, bg = C.blue },
|
||||||
|
CmpItemKindModule = { fg = C.base, bg = C.blue },
|
||||||
|
CmpItemKindConstant = { fg = C.base, bg = C.peach },
|
||||||
|
CmpItemKindField = { fg = C.base, bg = C.green },
|
||||||
|
CmpItemKindProperty = { fg = C.base, bg = C.green },
|
||||||
|
CmpItemKindEnum = { fg = C.base, bg = C.green },
|
||||||
|
CmpItemKindUnit = { fg = C.base, bg = C.green },
|
||||||
|
CmpItemKindClass = { fg = C.base, bg = C.yellow },
|
||||||
|
CmpItemKindVariable = { fg = C.base, bg = C.flamingo },
|
||||||
|
CmpItemKindFile = { fg = C.base, bg = C.blue },
|
||||||
|
CmpItemKindInterface = { fg = C.base, bg = C.yellow },
|
||||||
|
CmpItemKindColor = { fg = C.base, bg = C.red },
|
||||||
|
CmpItemKindReference = { fg = C.base, bg = C.red },
|
||||||
|
CmpItemKindEnumMember = { fg = C.base, bg = C.red },
|
||||||
|
CmpItemKindStruct = { fg = C.base, bg = C.blue },
|
||||||
|
CmpItemKindValue = { fg = C.base, bg = C.peach },
|
||||||
|
CmpItemKindEvent = { fg = C.base, bg = C.blue },
|
||||||
|
CmpItemKindOperator = { fg = C.base, bg = C.blue },
|
||||||
|
CmpItemKindTypeParameter = { fg = C.base, bg = C.blue },
|
||||||
|
CmpItemKindCopilot = { fg = C.base, bg = C.teal },
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
flavor = "mocha",
|
flavor = "mocha",
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,8 @@ M.mode = {
|
||||||
S = colors.sky,
|
S = colors.sky,
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
fg = map[mode] or colors.lavender,
|
fg = colors.base,
|
||||||
bg = colors.base,
|
bg = map[mode] or colors.blue,
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
@ -46,6 +46,7 @@ M.branch = {
|
||||||
icon = icons.GitBranch,
|
icon = icons.GitBranch,
|
||||||
color = function()
|
color = function()
|
||||||
local colors = require("catppuccin.palettes").get_palette()
|
local colors = require("catppuccin.palettes").get_palette()
|
||||||
|
|
||||||
return { bg = colors.base }
|
return { bg = colors.base }
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ in {
|
||||||
noto-fonts-emoji
|
noto-fonts-emoji
|
||||||
jetbrains-mono
|
jetbrains-mono
|
||||||
(nerdfonts.override {fonts = ["Iosevka" "JetBrainsMono"];})
|
(nerdfonts.override {fonts = ["Iosevka" "JetBrainsMono"];})
|
||||||
|
custom.zed-fonts
|
||||||
];
|
];
|
||||||
|
|
||||||
enableDefaultPackages = false;
|
enableDefaultPackages = false;
|
||||||
|
|
|
||||||
100
packages/zed-fonts/default.nix
Normal file
100
packages/zed-fonts/default.nix
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
{
|
||||||
|
buildNpmPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
remarshal,
|
||||||
|
ttfautohint-nox,
|
||||||
|
stdenv,
|
||||||
|
lib,
|
||||||
|
darwin,
|
||||||
|
privateBuildPlan ? null,
|
||||||
|
extraParameters ? null,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
buildNpmPackage rec {
|
||||||
|
version = "1.2.0";
|
||||||
|
pname = "zed-mono";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "zed-industries";
|
||||||
|
repo = "zed-fonts";
|
||||||
|
rev = "${version}";
|
||||||
|
hash = "sha256-qa683ED5q1LR2pAY0vRuprsHXLz/3IQPp3pFfzRPdQo=";
|
||||||
|
};
|
||||||
|
|
||||||
|
npmDepsHash = "sha256-M2GmTWEvNv485EdexDZoShuGeRmVvoGFV9EvQR3jE1c=";
|
||||||
|
|
||||||
|
nativeBuildInputs =
|
||||||
|
[
|
||||||
|
remarshal
|
||||||
|
ttfautohint-nox
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenv.isDarwin [
|
||||||
|
# libtool
|
||||||
|
darwin.cctools
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPlan =
|
||||||
|
if builtins.isAttrs privateBuildPlan
|
||||||
|
then builtins.toJSON {buildPlans.${pname} = privateBuildPlan;}
|
||||||
|
else privateBuildPlan;
|
||||||
|
|
||||||
|
inherit extraParameters;
|
||||||
|
passAsFile =
|
||||||
|
["extraParameters"]
|
||||||
|
++ lib.optionals
|
||||||
|
(!(builtins.isString privateBuildPlan
|
||||||
|
&& lib.hasPrefix builtins.storeDir privateBuildPlan)) ["buildPlan"];
|
||||||
|
|
||||||
|
configurePhase = ''
|
||||||
|
runHook preConfigure
|
||||||
|
${lib.optionalString (builtins.isAttrs privateBuildPlan) ''
|
||||||
|
remarshal -i "$buildPlanPath" -o private-build-plans.toml -if json -of toml
|
||||||
|
''}
|
||||||
|
${lib.optionalString (builtins.isString privateBuildPlan
|
||||||
|
&& (!lib.hasPrefix builtins.storeDir privateBuildPlan)) ''
|
||||||
|
cp "$buildPlanPath" private-build-plans.toml
|
||||||
|
''}
|
||||||
|
${lib.optionalString (builtins.isString privateBuildPlan
|
||||||
|
&& (lib.hasPrefix builtins.storeDir privateBuildPlan)) ''
|
||||||
|
cp "$buildPlan" private-build-plans.toml
|
||||||
|
''}
|
||||||
|
${lib.optionalString (extraParameters != null) ''
|
||||||
|
echo -e "\n" >> params/parameters.toml
|
||||||
|
cat "$extraParametersPath" >> params/parameters.toml
|
||||||
|
''}
|
||||||
|
runHook postConfigure
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
export HOME=$TMPDIR
|
||||||
|
runHook preBuild
|
||||||
|
npm run build --no-update-notifier -- --jCmd=$NIX_BUILD_CORES --verbose=9 ttf::$pname
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
fontdir="$out/share/fonts/truetype"
|
||||||
|
install -d "$fontdir"
|
||||||
|
install "dist/$pname/ttf"/* "$fontdir"
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://zed.dev";
|
||||||
|
downloadPage = "https://github.com/zed-industries/zed-fonts/releases";
|
||||||
|
description = "Fonts for Zed Editor, based on Iosevka";
|
||||||
|
longDescription = ''
|
||||||
|
Zed Mono & Zed Sans are custom builds of Iosevka liscensed under the SIL Open Font License, Version 1.1.
|
||||||
|
|
||||||
|
They are built for use in Zed. Zed Sans uses a quasi-proportional spacing to allow the font to still feel monospace while not having such wide gaps in a UI setting.
|
||||||
|
'';
|
||||||
|
license = licenses.ofl;
|
||||||
|
platforms = platforms.all;
|
||||||
|
maintainers = with maintainers; [
|
||||||
|
zackartz
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue