mirror of
https://github.com/Ascyii/typstar.git
synced 2026-01-01 05:24:24 -05:00
dev: add nix flake
This commit is contained in:
64
flake.nix
Normal file
64
flake.nix
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
description = "typstar nix flake for development";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-parts,
|
||||
...
|
||||
}:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
perSystem = {system, ...}: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
typstar = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "typstar";
|
||||
src = self;
|
||||
buildInputs = [
|
||||
pkgs.vimPlugins.luasnip
|
||||
pkgs.vimPlugins.nvim-treesitter-parsers.typst
|
||||
];
|
||||
};
|
||||
in {
|
||||
packages = {
|
||||
default = typstar;
|
||||
nvim = let
|
||||
config = pkgs.neovimUtils.makeNeovimConfig {
|
||||
customRC = ''
|
||||
lua << EOF
|
||||
print("Welcome to Typstar! This is just a demo.")
|
||||
|
||||
require('nvim-treesitter.configs').setup {
|
||||
highlight = { enable = true },
|
||||
}
|
||||
|
||||
require('luasnip').config.set_config({
|
||||
enable_autosnippets = true,
|
||||
})
|
||||
|
||||
require('typstar').setup()
|
||||
EOF
|
||||
'';
|
||||
plugins = [
|
||||
typstar
|
||||
pkgs.vimPlugins.luasnip
|
||||
pkgs.vimPlugins.nvim-treesitter
|
||||
pkgs.vimPlugins.nvim-treesitter-parsers.typst
|
||||
];
|
||||
};
|
||||
in
|
||||
pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped config;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user