Compare commits

..

No commits in common. "b56d3893907f98a6b43ff85b8275903f0f0f9eed" and "f0d49bc838e0c97a1becc2830e8cd92a5902612c" have entirely different histories.

6 changed files with 57 additions and 33 deletions

View file

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

View file

@ -14,6 +14,7 @@
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 { };
@ -25,6 +26,16 @@
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,23 +24,16 @@ 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");
// 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_pushboolean(l, 1);
c.lua_call(l, 2, 0);
c.lua_pop(l, 3);
}
return 0;

View file

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

View file

@ -1,18 +0,0 @@
{ 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;
};
}

38
nix/userstyles.nix Normal file
View file

@ -0,0 +1,38 @@
# 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));
'')
];
};
}