Add rnix-lsp

This commit is contained in:
Natsu Kagami 2021-10-29 00:25:58 -04:00
parent 466f5f1e90
commit 4f635b3cd3
5 changed files with 88 additions and 5 deletions

View file

@ -58,6 +58,26 @@
"type": "github" "type": "github"
} }
}, },
"naersk": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1629707199,
"narHash": "sha256-sGxlmfp5eXL5sAMNqHSb04Zq6gPl+JeltIZ226OYN0w=",
"owner": "nmattia",
"repo": "naersk",
"rev": "df71f5e4babda41cd919a8684b72218e2e809fa9",
"type": "github"
},
"original": {
"owner": "nmattia",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1635471979, "lastModified": 1635471979,
@ -119,6 +139,22 @@
} }
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": {
"lastModified": 1630481079,
"narHash": "sha256-leWXLchbAbqOlLT6tju631G40SzQWPqaAXQG3zH1Imw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "110a2c9ebbf5d4a94486854f18a37a938cfacbbb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-21.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1625223284, "lastModified": 1625223284,
"narHash": "sha256-jjLcDSU1rRiJb+n3uez23XAa7kbnPcGZTa6jIKh1GMQ=", "narHash": "sha256-jjLcDSU1rRiJb+n3uez23XAa7kbnPcGZTa6jIKh1GMQ=",
@ -149,6 +185,26 @@
"type": "github" "type": "github"
} }
}, },
"rnix-lsp": {
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_4",
"utils": "utils"
},
"locked": {
"lastModified": 1634449716,
"narHash": "sha256-JuRCU4KCIA3/pp8BjHqqF9dj1d2xtpkxKKAtSuOzTIY=",
"owner": "nix-community",
"repo": "rnix-lsp",
"rev": "a2d06d2d2910cbe35b4f323a54ef484f51d71e20",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "rnix-lsp",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"darwin": "darwin", "darwin": "darwin",
@ -157,12 +213,13 @@
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"nur": "nur", "nur": "nur",
"rnix-lsp": "rnix-lsp",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
} }
}, },
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1633273832, "lastModified": 1633273832,
@ -177,6 +234,21 @@
"repo": "sops-nix", "repo": "sops-nix",
"type": "github" "type": "github"
} }
},
"utils": {
"locked": {
"lastModified": 1629481132,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "997f7efcb746a9c140ce1f13c72263189225f482",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -10,9 +10,13 @@
home-manager-21_05.url = "github:nix-community/home-manager/release-21.05"; home-manager-21_05.url = "github:nix-community/home-manager/release-21.05";
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
# ---
# Imported apps
rnix-lsp.url = "github:nix-community/rnix-lsp";
}; };
outputs = { self, darwin, nixpkgs, nixpkgs-unstable, home-manager-unstable, home-manager-21_05, sops-nix, nur }: { outputs = { self, darwin, nixpkgs, nixpkgs-unstable, home-manager-unstable, home-manager-21_05, sops-nix, nur, ... }@inputs : {
# MacBook configuration: nix-darwin + home-manager # MacBook configuration: nix-darwin + home-manager
darwinConfigurations."nki-macbook" = darwin.lib.darwinSystem { darwinConfigurations."nki-macbook" = darwin.lib.darwinSystem {
system = "aarch64-darwin"; system = "aarch64-darwin";
@ -49,9 +53,12 @@
# override some packages that needs unstable that cannot be changed in the setup. # override some packages that needs unstable that cannot be changed in the setup.
nix-direnv = prev.unstable.nix-direnv; nix-direnv = prev.unstable.nix-direnv;
}; };
overlay-imported = final: prev: {
rnix-lsp = inputs.rnix-lsp.defaultPackage."x86_64-linux";
};
in in
{ {
nixpkgs.overlays = [ overlay-unstable overlay-needs-unstable nur.overlay ]; # we assign the overlay created before to the overlays of nixpkgs. nixpkgs.overlays = [ overlay-unstable overlay-needs-unstable overlay-imported nur.overlay ]; # we assign the overlay created before to the overlays of nixpkgs.
}) })
]; ];
}; };

View file

@ -28,6 +28,7 @@
yarn yarn
## Nix ## Nix
cachix cachix
rnix-lsp
# Fonts # Fonts
fantasque-sans-mono fantasque-sans-mono

View file

@ -159,4 +159,7 @@ command = "FSharpLanguageServer"
# command = "dotnet" # command = "dotnet"
# args = ["/home/natsukagami/Projects/FsAutoComplete/bin/release_netcore/fsautocomplete.dll", "--background-service-enabled"] # args = ["/home/natsukagami/Projects/FsAutoComplete/bin/release_netcore/fsautocomplete.dll", "--background-service-enabled"]
[language.nix]
filetypes = ["nix"]
roots = ["flake.nix", "shell.nix", ".git"]
command = "rnix-lsp"

View file

@ -95,7 +95,7 @@ hook global InsertCompletionHide .* %{
try %{ try %{
eval %sh{test -z "$WE_STARTED_KAK" && kak-lsp --kakoune -s $kak_session} eval %sh{test -z "$WE_STARTED_KAK" && kak-lsp --kakoune -s $kak_session}
} }
hook global WinSetOption filetype=(racket|rust|python|go|javascript|typescript|c|cpp|tex|latex|fsharp|ocaml|haskell) %{ hook global WinSetOption filetype=(racket|rust|python|go|javascript|typescript|c|cpp|tex|latex|fsharp|ocaml|haskell|nix) %{
lsp-enable-window lsp-enable-window
map global normal <c-l> ": enter-user-mode lsp<ret>" map global normal <c-l> ": enter-user-mode lsp<ret>"
lsp-auto-hover-enable lsp-auto-hover-enable