made the flake work with dendritic

This commit is contained in:
2026-07-03 19:27:54 +01:00
parent 388beee1b4
commit 1dd3e16674
2 changed files with 87 additions and 84 deletions

37
flake.lock generated
View File

@@ -16,9 +16,44 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1780336545,
"narHash": "sha256-vhVhuXzFrIOfcssC/9hDHx7MHzDKjF3keHuREOQqQiQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4df1b885d76a54e1aa1a318f8d16fd6005b6401f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"wrappers": "wrappers"
}
},
"wrappers": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1782135443,
"narHash": "sha256-vAmbArdCyjqpVW+37aCy/PMBOLIqukUXLQuEKLwUhA4=",
"owner": "BirdeeHub",
"repo": "nix-wrapper-modules",
"rev": "6e7f66fa2cdf4d63162580b438f7fcf87c28a46f",
"type": "github"
},
"original": {
"owner": "BirdeeHub",
"repo": "nix-wrapper-modules",
"type": "github"
} }
} }
}, },

134
flake.nix
View File

@@ -3,92 +3,60 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
wrappers.url = "github:BirdeeHub/nix-wrapper-modules";
}; };
outputs = outputs = {
{ self, nixpkgs }: self,
let nixpkgs,
system = "x86_64-linux"; # change if needed ...
pkgs = import nixpkgs { inherit system; }; } @ inputs: let
pkgList = with pkgs; [ # Define the systems you want to support
# LSPs supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
lua-language-server
vscode-langservers-extracted
emmet-language-server
svelte-language-server
rust-analyzer
ast-grep
prettier
black
alejandra
rustfmt
python313Packages.python-lsp-server
typescript-language-server
tailwindcss-language-server
stylua
nixd
# other tools # A helper function to generate outputs for each system
lua5_1 # It imports nixpkgs for the system and passes the resulting 'pkgs' to the function 'f'
tree-sitter forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f (import nixpkgs {inherit system;}));
ripgrep in {
gcc # Use the helper to generate the packages attribute for every system
fzf packages = forAllSystems (
gnumake pkgs: let
imagemagick pkgList = with pkgs; [
luarocks # LSPs
]; lua-language-server
vscode-langservers-extracted
emmet-language-server
svelte-language-server
rust-analyzer
ast-grep
prettier
black
alejandra
rustfmt
python313Packages.python-lsp-server
typescript-language-server
tailwindcss-language-server
stylua
nixd
nvimRemoteConfig = pkgs.runCommand "nvim-remote-config" { } '' # other tools
mkdir -p $out/nvim-remote lua5_1
cp ${./init.lua} $out/nvim-remote/init.lua tree-sitter
cp -r ${./lua} $out/nvim-remote/lua ripgrep
''; gcc
fzf
mkWrappedNvim = gnumake
{ imagemagick
name, luarocks
extraWrapArgs ? "",
}:
pkgs.symlinkJoin {
inherit name;
paths = [ pkgs.neovim ];
buildInputs = [ pkgs.makeWrapper ];
meta.mainProgram = "nvim";
postBuild = ''
wrapProgram $out/bin/nvim \
--prefix PATH : ${pkgs.lib.makeBinPath pkgList} \
--set TREE_SITTER_LIB_PATH "${pkgs.tree-sitter}/lib" \
${extraWrapArgs}
'';
};
nvim-wrapped = mkWrappedNvim { name = "nvim"; };
nvim-remote = mkWrappedNvim {
name = "nvim-remote";
extraWrapArgs = ''
--set NVIM_APPNAME "nvim-remote" \
--set XDG_CONFIG_HOME "${nvimRemoteConfig}"
'';
};
in
{
packages.${system} = {
default = nvim-wrapped;
remote = nvim-remote;
};
devShells.${system}.default = pkgs.mkShell {
packages = [
nvim-wrapped
]; ];
in {
shellHook = '' # Define the default package for this system
export TREE_SITTER_LIB_PATH="${pkgs.tree-sitter}/lib" default = inputs.wrappers.wrappers.neovim.wrap {
export DEVSHELL_NAME="󱄅 flake/#89dceb| neovim/green" inherit pkgs;
''; runtimePkgs = pkgList;
}; settings.config_directory = ./.;
}; };
}
);
};
} }