diff --git a/configuration.nix b/configuration.nix index 112ee04..8c8c7be 100644 --- a/configuration.nix +++ b/configuration.nix @@ -115,7 +115,7 @@ keep-derivations = true ''; - autoOptimiseStore = true; + settings.auto-optimise-store = true; gc = { automatic = true; dates = "weekly"; diff --git a/flake.lock b/flake.lock index 9467c3b..934f96b 100644 --- a/flake.lock +++ b/flake.lock @@ -4,35 +4,68 @@ "inputs": { "nixpkgs": [ "nixpkgs" - ] + ], + "utils": "utils" }, "locked": { - "lastModified": 1667907331, - "narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=", + "lastModified": 1670253003, + "narHash": "sha256-/tJIy4+FbsQyslq1ipyicZ2psOEd8dvl4OJ9lfisjd0=", "owner": "nix-community", "repo": "home-manager", - "rev": "6639e3a837fc5deb6f99554072789724997bc8e5", + "rev": "0e8125916b420e41bf0d23a0aa33fadd0328beb3", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-22.05", + "ref": "release-22.11", "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1669152211, - "narHash": "sha256-mBLiTNTzrtlYPHF0bL8NeGA4n8K5b35fYVdqaTIIkgc=", + "lastModified": 1670276674, + "narHash": "sha256-FqZ7b2RpoHQ/jlG6JPcCNmG/DoUPCIvyaropUDFhF3Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "56ca700ceabcfa15396bcf581a1296e8e27ad677", + "rev": "52e3e80afff4b16ccb7c52e9f0f5220552f03d04", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-22.05", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1670146390, + "narHash": "sha256-XrEoDpuloRHHbUkbPnhF2bQ0uwHllXq3NHxtuVe/QK4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "86370507cb20c905800527539fc049a2bf09c667", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1670086663, + "narHash": "sha256-hT8C8AQB74tdoCPwz4nlJypLMD7GI2F5q+vn+VE/qQk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "813836d64fa57285d108f0dbf2356457ccd304e3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -40,7 +73,42 @@ "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "sops-nix": "sops-nix" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1670149631, + "narHash": "sha256-rwmtlxx45PvOeZNP51wql/cWjY3rqzIR3Oj2Y+V7jM0=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "da98a111623101c64474a14983d83dad8f09f93d", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index fd62266..ac3bb43 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,9 @@ { inputs = { - nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05; + nixpkgs.url = github:NixOS/nixpkgs/nixos-22.11; home-manager = { - url = github:nix-community/home-manager/release-22.05; + url = github:nix-community/home-manager/release-22.11; inputs.nixpkgs.follows = "nixpkgs"; }; }; diff --git a/home-manager/neovim/default.nix b/home-manager/neovim/default.nix index 49fd5f9..733cc8a 100644 --- a/home-manager/neovim/default.nix +++ b/home-manager/neovim/default.nix @@ -75,7 +75,7 @@ in project-nvim auto-session - nvim-treesitter + nvim-treesitter.withAllGrammars markdown-preview-nvim # use({ "iamcco/markdown-preview.nvim", run = ":call mkdp#util#install()" }) toggleterm-nvim nvim-notify @@ -120,7 +120,7 @@ in nvim-lspconfig lsp-status-nvim rust-tools-nvim - lua-dev-nvim + neodev-nvim null-ls-nvim lsp_lines-nvim diff --git a/home-manager/neovim/lspconfig.lua b/home-manager/neovim/lspconfig.lua index 3c77588..f2a45d8 100644 --- a/home-manager/neovim/lspconfig.lua +++ b/home-manager/neovim/lspconfig.lua @@ -32,7 +32,7 @@ local on_attach = function(client, bufnr) group = augroup, buffer = bufnr, callback = function() - vim.lsp.buf.formatting_sync(nil, 3000) + vim.lsp.buf.format({ timeout_ms = 3000, async = false }) end, }) end @@ -49,8 +49,17 @@ lsp_status.config({ }) lsp_status.register_progress() -local capabilities = vim.tbl_extend("keep", vim.lsp.protocol.make_client_capabilities(), lsp_status.capabilities) -capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities) +-- setup lua language server for init.nvim and nvim plugin development +require("neodev").setup({ + override = function(root_dir, library) + if require("neodev.util").has_file(root_dir, "/etc/nixos") then + library.enabled = true + library.plugins = true + end + end, +}) + +local capabilities = require("cmp_nvim_lsp").default_capabilities(lsp_status.capabilities) local servers = { ["bashls"] = {}, @@ -66,6 +75,7 @@ local servers = { }, ["pyright"] = {}, ["rnix"] = {}, + ["sumneko_lua"] = {}, ["terraformls"] = {}, ["tflint"] = {}, ["tsserver"] = {}, diff --git a/home-manager/neovim/treesitter.lua b/home-manager/neovim/treesitter.lua index 8c259f9..a061730 100644 --- a/home-manager/neovim/treesitter.lua +++ b/home-manager/neovim/treesitter.lua @@ -1,10 +1,4 @@ require('nvim-treesitter.configs').setup({ - ensure_installed = { - "bash", "c", "cpp", "css", "dockerfile", "hcl", "html", "javascript", - "json", "latex", "lua", "markdown", "nix", "python", "rust", "svelte", - "toml", "tsx", "typescript", "vim", "vue", "yaml" - }, - auto_install = true, highlight = { enable = true, additional_vim_regex_highlighting = false