fennel-ls/flake.nix
grenewode 112132cc5a feat: add nix(os) packaging &development support
* Adds `/flake.nix`, which allows the package to be installed & developed
  easily by most NixOS users.
* Adds `/default.nix`, which is an older way that some Nix(OS) users
  may expect software to be packaged.
* Adds `/nix/**/*.nix`, which defines various additional helpers used by
  `/flake.nix` and `/default.nix`.
* Updates `.gitignore` to include `/result`, which is the default output
  location when the package is built using

  `nix flake build .` or `nix-build .`
2024-02-19 23:14:52 -06:00

39 lines
1.0 KiB
Nix

{
description = "A language server for fennel";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (flake-utils.lib) mkApp;
inherit (pkgs) callPackage;
in
{
packages = {
fennel_ls = callPackage ./nix/package.nix {
version = self.shortRev or self.shortDirtyRev or self.lastModifiedDate;
};
default = self.packages.${system}.fennel_ls;
};
devShells = {
fennel_ls = callPackage ./nix/shell.nix {
fennel_ls = self.packages.${system}.fennel_ls;
};
default = self.devShells.${system}.fennel_ls;
};
apps = rec {
fennel_ls = mkApp {
drv = self.packages.${system}.fennel_ls;
exePath = "/bin/fennel-ls";
};
default = self.apps.${system}.fennel_ls;
};
}
);
}