From 53df9252a9502b54634b2d76779fad4698212dce Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Tue, 13 Feb 2024 12:31:59 -0600 Subject: [PATCH] chore(nix-hm): integrate with nixd lsp --- .envrc | 6 ++++++ .gitignore | 2 ++ .nixd.nix | 10 ++++++++++ flake.lock | 44 +++++++++++++++++++++++++++++++++++++++----- flake.nix | 11 ++++++++++- 5 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 .envrc create mode 100644 .nixd.nix diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..89e26e25 --- /dev/null +++ b/.envrc @@ -0,0 +1,6 @@ +# vim: ft=bash +if ! has nix_direnv_version || ! nix_direnv_version 2.5.1; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.5.1/direnvrc" "sha256-puRzug17Ed4JFS2wbpqa3k764QV6xPP6O3A/ez/JpOM=" +fi +use flake + diff --git a/.gitignore b/.gitignore index 8a20a613..29903dcd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ ./.luarc.json result/ .luarc.json +.direnv +.nixd.json diff --git a/.nixd.nix b/.nixd.nix new file mode 100644 index 00000000..84b52cb5 --- /dev/null +++ b/.nixd.nix @@ -0,0 +1,10 @@ +{ + formatting = { command = "nixfmt"; }; + options = { + enable = true; + target = { + args = [ ]; + installable = ".#homeConfigurations.sam"; + }; + }; +} diff --git a/flake.lock b/flake.lock index 7ae92e36..becad200 100644 --- a/flake.lock +++ b/flake.lock @@ -241,6 +241,24 @@ "inputs": { "systems": "systems_5" }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_6": { + "inputs": { + "systems": "systems_6" + }, "locked": { "lastModified": 1701680307, "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", @@ -255,9 +273,9 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_7": { "inputs": { - "systems": "systems_6" + "systems": "systems_7" }, "locked": { "lastModified": 1705309234, @@ -351,7 +369,7 @@ }, "kanagawa-gtk": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "kanagawa-gtk": "kanagawa-gtk_2", "nixpkgs": [ "nixpkgs" @@ -403,7 +421,7 @@ }, "neovim-flake": { "inputs": { - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_6", "nixpkgs": [ "neovim-nightly-overlay", "nixpkgs" @@ -516,6 +534,7 @@ "bob": "bob", "deepfilternet": "deepfilternet", "emacs-overlay": "emacs-overlay", + "flake-utils": "flake-utils_4", "home-manager": "home-manager", "kanagawa-gtk": "kanagawa-gtk", "neovim-nightly-overlay": "neovim-nightly-overlay", @@ -639,6 +658,21 @@ "type": "github" } }, + "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "waybar": { "inputs": { "flake-compat": "flake-compat_2", @@ -662,7 +696,7 @@ }, "wezterm": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_7", "freetype2": "freetype2", "harfbuzz": "harfbuzz", "libpng": "libpng", diff --git a/flake.nix b/flake.nix index 589e074f..3a61de09 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; kanagawa-gtk = { url = "path:./pkgs/kanagawa-gtk"; inputs.nixpkgs.follows = "nixpkgs"; @@ -74,5 +75,13 @@ ./config ]; }; - }; + } // inputs.flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { inherit system; }; + in { + devShells.default = pkgs.mkShell { + shellHook = '' + nix eval --json --file ./.nixd.nix > .nixd.json + ''; + }; + }); }