From 6374c6ffe8b7b9e856c949aeb6049c7e4502c489 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 5 Sep 2021 20:19:32 +0200 Subject: [PATCH] nix code --- content/nixos/language-server.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/nixos/language-server.md b/content/nixos/language-server.md index f8cc9af..19ad832 100755 --- a/content/nixos/language-server.md +++ b/content/nixos/language-server.md @@ -39,7 +39,7 @@ to configure files in `~/.spacemacs.d/` and `load` them in the configuration functions inside `~/.spacemacs`. A simple `(load "~/.spacemacs.d/hook-user-config.el")` inside the `dotspacemacs/user-config` function is enough, to make it work. -``` +```nix { pkgs, lib, config, ... }: let @@ -149,7 +149,7 @@ If you don't like that just use the snippet from the next section. You can install the `lsp` (in our case `hie-wrapper`) globally in your `configuration.nix` . I usually do this in my projects (via `lsp.nix`). Here is the part that differs. -``` +```nix home.file.".spacemacs.d/hook-user-config.el".text = let all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}; @@ -177,7 +177,7 @@ This file is to setup the `lsp-server`. If you already installed the `lsp-server` via the `configuration.nix`, this file is not necessary, but also does not hurt. -``` +```nix { pkgs ? import {} }: let all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}; @@ -199,7 +199,7 @@ Provides the environment to run `cabal test` and `cabal build`. All package files (e.g. `./current-project.nix`) are created by `cabal2nix`. -``` +```nix { pkgs ? import { overlays = [ (self: super: { @@ -218,7 +218,7 @@ pkgs.haskellPackages.current-project.env For other scripts and tooling important for development. -``` +```nix { pkgs ? import {} }: let updateCabal = pkgs.writeShellScriptBin "update-cabal" /* sh */ '' @@ -242,7 +242,7 @@ finally we need a `direnv` configuration file. `direnv` and the `direnv-mode` make it possible to load the environment needed and provided by the `*.nix` files. -``` +```shell use nix ./env.nix use nix ./lsp.nix use nix ./shell.nix