Compare commits

...

3 Commits

Author SHA1 Message Date
LordMZTE b56d389390
nix changes 2024-04-25 00:31:45 +02:00
LordMZTE 3e159a31d1
update nix deps 2024-04-24 19:51:15 +02:00
LordMZTE 774f48f30a
mzte-nv: use new inlay hint API 2024-04-22 17:02:12 +02:00
6 changed files with 33 additions and 57 deletions

View File

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1713537308,
"narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=",
"lastModified": 1713714899,
"narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5c24cf2f0a12ad855f444c30b2421d044120c66f",
"rev": "6143fc5eeb9c4f00163267708e26191d1e918932",
"type": "github"
},
"original": {

View File

@ -14,7 +14,6 @@
let
pkgs = import nixpkgs { inherit system; };
common = pkgs.callPackage ./lib/common-nix { };
flakePkg = ref: (builtins.getFlake ref).packages.${system}.default;
root-mod = {
options.packages = nixpkgs.lib.mkOption { };
@ -26,16 +25,6 @@
inherit (pkgs) lib stdenv stdenvNoCC;
};
# Local user nix env
config.packages.mzte-nix = pkgs.symlinkJoin {
name = "mzte-nix";
paths = [
pkgs.nix-output-monitor
pkgs.nix-du
(flakePkg "github:nix-community/zon2nix")
];
};
# devshell for the dotfiles
config.dev-shells.default = nixpkgs.legacyPackages.${system}.mkShell {
buildInputs = with pkgs;

View File

@ -24,16 +24,23 @@ fn lOnAttach(l: *c.lua_State) !c_int {
};
if (has_inlay_hints) {
// func: vim.lsp.inlay_hint.enable
c.lua_getglobal(l, "vim");
defer c.lua_pop(l, 1);
c.lua_getfield(l, -1, "lsp");
defer c.lua_pop(l, 1);
c.lua_getfield(l, -1, "inlay_hint");
defer c.lua_pop(l, 1);
c.lua_getfield(l, -1, "enable");
c.lua_pushnumber(l, bufnr);
// arg 1: true
c.lua_pushboolean(l, 1);
// arg 2: table w/ bufnr
c.lua_createtable(l, 0, 1);
c.lua_pushnumber(l, bufnr);
c.lua_setfield(l, -2, "bufnr");
c.lua_call(l, 2, 0);
c.lua_pop(l, 3);
}
return 0;

View File

@ -3,6 +3,6 @@
imports = [
./cgnix
./mcdev.nix
./userstyles.nix
./mzte-nix.nix
];
}

18
nix/mzte-nix.nix Normal file
View File

@ -0,0 +1,18 @@
{ lib, pkgs, config, ... }:
let
flakePkg = ref: (builtins.getFlake ref).packages.${pkgs.system}.default;
in
{
options.mzte-nix-packages = lib.mkOption { };
config.mzte-nix-packages = [
pkgs.nix-output-monitor
pkgs.nix-du
(flakePkg "github:nix-community/zon2nix")
];
config.packages.mzte-nix = pkgs.symlinkJoin {
name = "mzte-nix";
paths = config.mzte-nix-packages;
};
}

View File

@ -1,38 +0,0 @@
# Module that provides an output for a stylus import file with catppuccin themes.
{ pkgs, stdenvNoCC, ... }:
let
flavor = "mocha";
accent-color = "red";
in
{
packages.userstyles = stdenvNoCC.mkDerivation {
name = "userstyles.json";
src = pkgs.fetchurl {
url = "https://github.com/catppuccin/userstyles/releases/download/all-userstyles-export/import.json";
hash = "sha256-eYU9Y95au9mI3muS4+1QJt31W7s2zVmurdKbQ1dU+pk=";
};
dontUnpack = true;
# TODO: use better language
realBuilder = "${pkgs.deno}/bin/deno";
args = [
"run"
"-A"
(pkgs.writeText "build.js" ''
const json = await import(Deno.env.get("src"), { with: { type: "json" } });
const processed = json.default.map(theme => {
if (theme.usercssData?.vars?.accentColor?.default)
theme.usercssData.vars.accentColor.default = "${accent-color}";
if (theme.usercssData?.vars?.darkFlavor?.default)
theme.usercssData.vars.darkFlavor.default = "${flavor}";
return theme;
});
Deno.writeTextFileSync(Deno.env.get("out"), JSON.stringify(processed));
'')
];
};
}