diff --git a/nix/base-system/darwin-configuration.nix b/nix/base-system/darwin-configuration.nix index 9842fbe..1081805 100644 --- a/nix/base-system/darwin-configuration.nix +++ b/nix/base-system/darwin-configuration.nix @@ -6,10 +6,11 @@ in nix = { package = pkgs.nix; + enable = true; # SEE: https://github.com/NixOS/nix/issues/4119#issuecomment-1734738812 settings.sandbox = "relaxed"; extraOptions = '' - experimental-features = nix-command flakes repl-flake + experimental-features = nix-command flakes extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux trusted-users = root zaphar ''; @@ -347,9 +348,6 @@ in vfkit ]; - # Auto upgrade nix package and the daemon service. - services.nix-daemon.enable = true; - #services.spacebar.enable = true; #services.spacebar.package = "${pkgs.spacebar}"; @@ -365,6 +363,7 @@ in (allow file-read* file-write* process-exec mach-lookup (subpath "${builtins.storeDir}")) ''; }; + system.primaryUser = "zaphar"; # Used for backwards compatibility, please read the changelog before changing. # $ darwin-rebuild changelog system.stateVersion = 4; diff --git a/nix/base-system/flake.lock b/nix/base-system/flake.lock index 84af2ff..f24ad9f 100644 --- a/nix/base-system/flake.lock +++ b/nix/base-system/flake.lock @@ -141,15 +141,16 @@ ] }, "locked": { - "lastModified": 1715871485, - "narHash": "sha256-ywapEXmBBI+DVRx/YYC6+6Lk+W8vhShz1uJNvqPKzng=", + "lastModified": 1749744770, + "narHash": "sha256-MEM9XXHgBF/Cyv1RES1t6gqAX7/tvayBC1r/KPyK1ls=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "cb02884fa1ff5a619a44ab5f1bcc4dedd2d623c2", + "rev": "536f951efb1ccda9b968e3c9dee39fbeb6d3fdeb", "type": "github" }, "original": { "owner": "lnl7", + "ref": "nix-darwin-25.05", "repo": "nix-darwin", "type": "github" } @@ -297,24 +298,6 @@ "inputs": { "systems": "systems_9" }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_11": { - "inputs": { - "systems": "systems_10" - }, "locked": { "lastModified": 1687709756, "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=", @@ -329,7 +312,7 @@ "type": "github" } }, - "flake-utils_12": { + "flake-utils_11": { "locked": { "lastModified": 1649676176, "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", @@ -344,9 +327,9 @@ "type": "github" } }, - "flake-utils_13": { + "flake-utils_12": { "inputs": { - "systems": "systems_11" + "systems": "systems_10" }, "locked": { "lastModified": 1705309234, @@ -362,9 +345,9 @@ "type": "github" } }, - "flake-utils_14": { + "flake-utils_13": { "inputs": { - "systems": "systems_12" + "systems": "systems_11" }, "locked": { "lastModified": 1726560853, @@ -380,9 +363,9 @@ "type": "github" } }, - "flake-utils_15": { + "flake-utils_14": { "inputs": { - "systems": "systems_13" + "systems": "systems_12" }, "locked": { "lastModified": 1681202837, @@ -579,23 +562,6 @@ "type": "github" } }, - "harpoon-src": { - "flake": false, - "locked": { - "lastModified": 1706306053, - "narHash": "sha256-RjwNUuKQpLkRBX3F9o25Vqvpu3Ah1TCFQ5Dk4jXhsbI=", - "owner": "ThePrimeagen", - "repo": "harpoon", - "rev": "a38be6e0dd4c6db66997deab71fc4453ace97f9c", - "type": "github" - }, - "original": { - "owner": "ThePrimeagen", - "ref": "harpoon2", - "repo": "harpoon", - "type": "github" - } - }, "heracles-flake": { "inputs": { "flake-compat": "flake-compat_3", @@ -801,7 +767,7 @@ }, "naersk_5": { "inputs": { - "nixpkgs": "nixpkgs_16" + "nixpkgs": "nixpkgs_15" }, "locked": { "lastModified": 1650101877, @@ -819,7 +785,7 @@ }, "naersk_6": { "inputs": { - "nixpkgs": "nixpkgs_17" + "nixpkgs": "nixpkgs_16" }, "locked": { "lastModified": 1721727458, @@ -867,28 +833,6 @@ "type": "github" } }, - "neovim-flake": { - "inputs": { - "flake-utils": "flake-utils_10", - "nixpkgs": "nixpkgs_12" - }, - "locked": { - "dir": "contrib", - "lastModified": 1715862872, - "narHash": "sha256-FCOipXHkAbkuFw9JjEpOIJ8BkyMkjkI0Dp+SzZ4yZlw=", - "owner": "neovim", - "repo": "neovim", - "rev": "27fb62988e922c2739035f477f93cc052a4fee1e", - "type": "github" - }, - "original": { - "dir": "contrib", - "owner": "neovim", - "ref": "stable", - "repo": "neovim", - "type": "github" - } - }, "nil-flake": { "inputs": { "flake-utils": "flake-utils_5", @@ -911,8 +855,8 @@ }, "nil-flake_2": { "inputs": { - "flake-utils": "flake-utils_11", - "nixpkgs": "nixpkgs_13", + "flake-utils": "flake-utils_10", + "nixpkgs": "nixpkgs_12", "rust-overlay": "rust-overlay_6" }, "locked": { @@ -947,16 +891,16 @@ }, "nixpkgs-darwin": { "locked": { - "lastModified": 1735564410, - "narHash": "sha256-HB/FA0+1gpSs8+/boEavrGJH+Eq08/R2wWNph1sM1Dg=", + "lastModified": 1749596380, + "narHash": "sha256-7DEKr2x/jIAKkwHPNNjG6lGUz9nk8SGrbyaeAFMtN34=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1e7a8f391f1a490460760065fa0630b5520f9cf8", + "rev": "210a4a2e3d3853be3a6017e68d2897771fdace35", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixpkgs-24.05-darwin", + "ref": "nixpkgs-25.05-darwin", "repo": "nixpkgs", "type": "github" } @@ -994,22 +938,6 @@ } }, "nixpkgs_12": { - "locked": { - "lastModified": 1715787315, - "narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_13": { "locked": { "lastModified": 1690441914, "narHash": "sha256-Ac+kJQ5z9MDAMyzSc0i0zJDx2i3qi9NjlW5Lz285G/I=", @@ -1025,23 +953,23 @@ "type": "github" } }, - "nixpkgs_14": { + "nixpkgs_13": { "locked": { - "lastModified": 1749123672, - "narHash": "sha256-x8ElRL7SBDDGk282ayqaOs5kVlIB8O1cICeHNKeeNPw=", + "lastModified": 1749747690, + "narHash": "sha256-FPhMfYq+ngKpZiYaOblqR6S9z9JVpTlW8EaQ98xwkkU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "42e9ed325316e9ca4c56dbf44d561823d4defd01", + "rev": "f7d4856c2d1af130193777964535304fdc76e368", "type": "github" }, "original": { "owner": "nixos", - "ref": "release-24.11", + "ref": "release-25.05", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_15": { + "nixpkgs_14": { "locked": { "lastModified": 1689850295, "narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=", @@ -1057,7 +985,7 @@ "type": "github" } }, - "nixpkgs_16": { + "nixpkgs_15": { "locked": { "lastModified": 1650109093, "narHash": "sha256-tqlnKrAdJktRLXTou9le0oTqrYBAFpGscV5RADdpArU=", @@ -1071,6 +999,20 @@ "type": "indirect" } }, + "nixpkgs_16": { + "locked": { + "lastModified": 1729658218, + "narHash": "sha256-9Rg+AqLqvqqJniP/OQB3GtgXoAd8IlazsHp97va042Y=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dfffb2e7a52d29a0ef8e21ec8a0f30487b227f1a", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, "nixpkgs_17": { "locked": { "lastModified": 1729658218, @@ -1086,20 +1028,6 @@ } }, "nixpkgs_18": { - "locked": { - "lastModified": 1729658218, - "narHash": "sha256-9Rg+AqLqvqqJniP/OQB3GtgXoAd8IlazsHp97va042Y=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "dfffb2e7a52d29a0ef8e21ec8a0f30487b227f1a", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_19": { "locked": { "lastModified": 1682109806, "narHash": "sha256-d9g7RKNShMLboTWwukM+RObDWWpHKaqTYXB48clBWXI=", @@ -1253,7 +1181,7 @@ }, "nurl-flake_2": { "inputs": { - "nixpkgs": "nixpkgs_15" + "nixpkgs": "nixpkgs_14" }, "locked": { "lastModified": 1701273941, @@ -1277,14 +1205,12 @@ "d2-vim-src": "d2-vim-src_2", "darwin": "darwin_2", "durnitisp-flake": "durnitisp-flake", - "harpoon-src": "harpoon-src", "heracles-flake": "heracles-flake", "jujutsu-flake": "jujutsu-flake", "mcphub-flake": "mcphub-flake", "neogit-src": "neogit-src_2", - "neovim-flake": "neovim-flake", "nil-flake": "nil-flake_2", - "nixpkgs": "nixpkgs_14", + "nixpkgs": "nixpkgs_13", "nixpkgs-darwin": "nixpkgs-darwin", "nurl-flake": "nurl-flake_2", "roslyn-lsp": "roslyn-lsp_2", @@ -1333,7 +1259,7 @@ "runwhen-flake": { "inputs": { "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_12", + "flake-utils": "flake-utils_11", "naersk": "naersk_5" }, "locked": { @@ -1375,7 +1301,7 @@ }, "rust-overlay-flake": { "inputs": { - "flake-utils": "flake-utils_13", + "flake-utils": "flake-utils_12", "nixpkgs": [ "nixpkgs" ] @@ -1530,9 +1456,9 @@ }, "sheetsui-flake": { "inputs": { - "flake-utils": "flake-utils_14", + "flake-utils": "flake-utils_13", "naersk": "naersk_6", - "nixpkgs": "nixpkgs_18", + "nixpkgs": "nixpkgs_17", "rust-overlay": "rust-overlay_7" }, "locked": { @@ -1552,10 +1478,10 @@ "sile-flake": { "inputs": { "flake-compat": "flake-compat_5", - "flake-utils": "flake-utils_15", + "flake-utils": "flake-utils_14", "gitignore": "gitignore", "libtexpdf-src": "libtexpdf-src", - "nixpkgs": "nixpkgs_19" + "nixpkgs": "nixpkgs_18" }, "locked": { "lastModified": 1694595810, @@ -1631,21 +1557,6 @@ "type": "github" } }, - "systems_13": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "systems_2": { "locked": { "lastModified": 1681028828, diff --git a/nix/base-system/flake.nix b/nix/base-system/flake.nix index d4c591a..8f6c6de 100644 --- a/nix/base-system/flake.nix +++ b/nix/base-system/flake.nix @@ -1,15 +1,15 @@ { inputs = { # Default to sane nixpkgs versions - nixpkgs.url = "github:nixos/nixpkgs/release-24.11"; + nixpkgs.url = "github:nixos/nixpkgs/release-25.05"; unstable.url = "nixpkgs"; - nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin"; + nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-25.05-darwin"; #lean4-flake = { # url = "github:leanprover/lean4/v4.4.0"; # inputs.nixpkgs.follows = "nixpkgs"; #}; darwin = { - url = "github:lnl7/nix-darwin"; + url = "github:lnl7/nix-darwin/nix-darwin-25.05"; # ensure that darwinSystem uses our nixpkgs version inputs.nixpkgs.follows = "nixpkgs-darwin"; }; @@ -31,20 +31,16 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - neovim-flake = { - url = "github:neovim/neovim/stable?dir=contrib"; - # NOTE(jeremy): Currently this needs a newer nixpkgs version - #inputs.nixpkgs.follows = "nixpkgs"; - }; + #neovim-flake = { + # url = "github:neovim/neovim/stable?dir=contrib"; + # # NOTE(jeremy): Currently this needs a newer nixpkgs version + # #inputs.nixpkgs.follows = "nixpkgs"; + #}; jujutsu-flake.url = "github:martinvonz/jj"; custom-flakes = { url = "github:zaphar/nix-flakes"; inputs.nixpkgs.follows = "nixpkgs"; }; - harpoon-src = { - url = "github:ThePrimeagen/harpoon/harpoon2"; - flake = false; - }; neogit-src = { url = "github:NeogitOrg/neogit"; flake = false; @@ -76,11 +72,9 @@ agenix-flake, nil-flake, nurl-flake, - harpoon-src, custom-flakes, unstable, heracles-flake, - neovim-flake, clio-flake, sheetsui-flake, mcphub-flake, @@ -93,15 +87,6 @@ in { config, pkgs, ...}: let unstablePkgs = import unstable { inherit system; }; - possession-nvim = pkgs.callPackage ./possession-nvim.nix { - inherit (pkgs.vimUtils) buildVimPlugin; - inherit (pkgs) fetchFromGitHub; - }; - harpoon-nvim = pkgs.vimUtils.buildVimPlugin { - pname = "harpoon"; - version = "2024-01-28"; - src = harpoon-src; - }; neogit-nvim = custom-flakes.packages."${system}".neogit-nvim; d2-vim = custom-flakes.packages."${system}".d2-vim; hunk-nvim = custom-flakes.packages."${system}".hunk-nvim; @@ -110,7 +95,6 @@ nvim-treesitter-context = custom-flakes.packages."${system}".nvim-treesitter-context; roslyn-nvim = custom-flakes.packages."${system}".roslyn-nvim; ionide-nvim = custom-flakes.packages."${system}".ionide-nvim; - nvim = neovim-flake.packages."${system}".neovim; # TODO(zaphar): Until nixpkgs update to a newer version of tree-sitter the queries will be wrong # for csharp #tree-sitter-csharp = pkgs.callPackage ./nvim-treesitter-csharp.nix { @@ -137,7 +121,6 @@ nixpkgs.overlays = [ (final: prev: { - custom-neovim = nvim; lorri = unstablePkgs.lorri; avante-nvim = unstablePkgs.vimPlugins.avante-nvim; copilot-lua = unstablePkgs.vimPlugins.copilot-lua; @@ -147,7 +130,7 @@ neovim.enable = true; neovim.vimAlias = true; neovim.viAlias = true; - neovim.package = pkgs.custom-neovim; + #neovim.package = pkgs.custom-neovim; neovim.configure = { customRC = "lua << EOF ${builtins.readFile ./init.lua} @@ -225,8 +208,6 @@ EOF"; direnv-vim mcphub-nvim ]) ++ [ - possession-nvim - harpoon-nvim d2-vim hunk-nvim neogit-nvim @@ -319,13 +300,11 @@ EOF"; }; }; environment.systemPackages = (with pkgs; [ - isabelle sheetsui lean4 quint quint-lsp terraform # TODO(jeremy): Replace with opentofu when that is an option. - nomad oha nodejs gnumake diff --git a/nix/base-system/init.lua b/nix/base-system/init.lua index 1592a30..4d2f210 100644 --- a/nix/base-system/init.lua +++ b/nix/base-system/init.lua @@ -164,23 +164,26 @@ local caps = vim.tbl_deep_extend( local lspconfig = require("lspconfig") +local configure_lsp = function(name, config) + vim.lsp.enable(name) + vim.lsp.config(name, config) +end + -- Typst -lspconfig.tinymist.setup { +configure_lsp('tinymist', { capabilities = caps, settings = { exportPdf = "onSave", }, -} +}) -- Terraform lsp setup -lspconfig.terraformls.setup {} +configure_lsp('terraformls', {}) -- Nix language server support -lspconfig.nil_ls.setup { +configure_lsp('nil_ls', { capabilities = caps, -} - -lspconfig.jedi_language_server.setup {} +}) require('roslyn').setup({ -- client, bufnr @@ -193,22 +196,22 @@ require('roslyn').setup({ }); --ocaml -lspconfig.ocamllsp.setup { +configure_lsp('ocamllsp', { capabilities = caps -} +}) -- Java language server support -lspconfig.java_language_server.setup { +configure_lsp('java_language_server', { capabilities = caps -} +}) -- Typescript language server support -lspconfig.tsserver.setup { +configure_lsp('tsserver', { capabilities = caps -} +}) -- Rust language server support -lspconfig.rust_analyzer.setup { +configure_lsp('rust_analyzer', { settings = { -- https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/generated_config.adoc ['rust-analyzer'] = { @@ -216,10 +219,10 @@ lspconfig.rust_analyzer.setup { } }, capabilities = caps -} +}) -- lua language server setup. -lspconfig.lua_ls.setup { +configure_lsp('lua_ls', { settings = { Lua = { runtime = { version = 'LuaJIT', }, @@ -239,7 +242,7 @@ lspconfig.lua_ls.setup { }, }, capabilities = caps -} +}) -- lsp configuration vim.api.nvim_create_autocmd('LspAttach', { @@ -469,33 +472,6 @@ vim.keymap.set("n", "ga", function() vim.cmd("!git add %") end) -require('possession').setup { - commands = { - save = 'SSave', - load = 'SLoad', - delete = 'SDelete', - list = 'SList', - }, - autosave = { - current = true, - on_load = true, - on_quit = true, - }, - telescope = { - list = { - default_action = 'load', - mappings = { - save = { n = '', i = '' }, - load = { n = '', i = '' }, - delete = { n = '', i = '' }, - rename = { n = '', i = '' }, - }, - }, - }, -} - - -telescope.load_extension('possession') -- https://github.com/nvim-telescope/telescope.nvim telescope.setup({ defaults = { @@ -517,9 +493,6 @@ telescope.setup({ }, }) -local harpoon = require('harpoon') - -harpoon:setup() local lean = require 'lean' @@ -538,7 +511,6 @@ lean.setup { } -- telescope keymaps -vim.keymap.set("n", "pl", telescope.extensions.possession.list) -- TODO(zaphar): Remove this once my muscle memory has set in. vim.keymap.set("n", "nff", telescope_builtins.fd) vim.keymap.set("n", "ff", telescope_builtins.fd) @@ -554,11 +526,6 @@ end) vim.keymap.set("n", "lds", telescope_builtins.lsp_document_symbols, { desc = "[D]ocument [S]ymbols" }) vim.keymap.set("n", "lws", telescope_builtins.lsp_dynamic_workspace_symbols, { desc = "[W]orkspace [S]ymbols" }) --- harpoon keymaps -vim.keymap.set("n", "ha", function() harpoon:list():append() end) -vim.keymap.set("n", "he", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) -vim.keymap.set("n", "hj", function() harpoon:list():prev() end) -vim.keymap.set("n", "hk", function() harpoon:list():next() end) -- codelens keymaps vim.keymap.set("n", "rr", vim.lsp.codelens.run)