diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ed41822 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1679198465, + "narHash": "sha256-VfXpHpniNWgg7pBzxb20pRX7kqn80LApPDQYTReiFCw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5a05160f7671434e1c833b1b01284b876e04eca4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1678379998, + "narHash": "sha256-TZdfNqftHhDuIFwBcN9MUThx5sQXCTeZk9je5byPKRw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c13d60b89adea3dc20704c045ec4d50dd964d447", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "parts": "parts" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ce3b6d7 --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + description = "LSP bridge for Hoon"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + + parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + }; + + outputs = inputs @ { + self + , nixpkgs + , parts + }: parts.lib.mkFlake { inherit inputs; } { + systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"]; + + flake = { + overlays.default = nixpkgs.lib.composeManyExtensions [ + (final: prev: { + hoon-language-server = final.callPackage ./. { }; + }) + ]; + }; + + perSystem = { pkgs, system, ... }: { + imports = [ + { config._module.args.pkgs = import nixpkgs { inherit system; overlays = [self.overlays.default]; }; } + ]; + + packages.default = pkgs.hoon-language-server; + apps.default = { + type = "app"; + program = "${pkgs.hoon-language-server}/bin/hoon-language-server"; + }; + }; + }; +} diff --git a/src/server.ts b/src/server.ts index 1ca705b..354b5c5 100644 --- a/src/server.ts +++ b/src/server.ts @@ -5,7 +5,7 @@ import pino from "pino"; import { uniqueId } from "lodash"; import * as qs from "querystring"; import * as yargs from "yargs"; -import { tmpdir } from os; +import { tmpdir } from "os"; import { Channel } from "urbit-airlock/lib/channel"; import { connect } from "urbit-airlock/lib/setup";