diff --git a/nix/base-system/flake.lock b/nix/base-system/flake.lock index 7a74cd4..69dbfda 100644 --- a/nix/base-system/flake.lock +++ b/nix/base-system/flake.lock @@ -233,6 +233,23 @@ "type": "github" } }, + "harpoon-src": { + "flake": false, + "locked": { + "lastModified": 1703800925, + "narHash": "sha256-WD93Oq1WHrfkdOVbYDJiExr+MP1Uezl5WKA53jEdwmY=", + "owner": "ThePrimeagen", + "repo": "harpoon", + "rev": "6afc142443f8135329f8dd09b77e229f65001c0c", + "type": "github" + }, + "original": { + "owner": "ThePrimeagen", + "ref": "harpoon2", + "repo": "harpoon", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -408,16 +425,16 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1703646585, - "narHash": "sha256-+opnZCFE4k+EiTNxnpSOHoKcDFV2C6kgD802ApRhp8c=", + "lastModified": 1701282334, + "narHash": "sha256-MxCVrXY6v4QmfTwIysjjaX0XUhqBbxTWWB4HXtDYsdk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9fc0de7eff04a03c9c43f5ff55d97d0e4e8f3141", + "rev": "057f9aecfb71c4437d2b27d3323df7f93c010b7e", "type": "github" }, "original": { "owner": "nixos", - "ref": "release-23.11", + "ref": "23.11", "repo": "nixpkgs", "type": "github" } @@ -490,6 +507,7 @@ "inputs": { "agenix-flake": "agenix-flake", "durnitisp-flake": "durnitisp-flake", + "harpoon-src": "harpoon-src", "jj-flake": "jj-flake", "nil-flake": "nil-flake", "nixpkgs": "nixpkgs_5", diff --git a/nix/base-system/flake.nix b/nix/base-system/flake.nix index 425f1ff..56d716b 100644 --- a/nix/base-system/flake.nix +++ b/nix/base-system/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs/release-23.11"; + nixpkgs.url = "github:nixos/nixpkgs/23.11"; sile-flake.url = "github:sile-typesetter/sile"; durnitisp-flake.url = "github:zaphar/durnitisp"; runwhen-flake.url = "github:zaphar/runwhen"; @@ -14,6 +14,10 @@ inputs.nixpkgs.follows = "nixpkgs"; }; jj-flake.url = "github:martinvonz/jj"; + harpoon-src = { + url = "github:ThePrimeagen/harpoon/harpoon2"; + flake = false; + }; }; outputs = { sile-flake, @@ -24,38 +28,33 @@ agenix-flake, nil-flake, nurl-flake, + harpoon-src, nixpkgs, ... # We don't use the self or nixpkgs args here so we just glob it. }: { - systemModule = system: let - runwhen = runwhen-flake.defaultPackage."${system}"; + vimModule = system: let nixPkgs = import nixpkgs { inherit system; }; - durnitisp = durnitisp-flake.defaultPackage."${system}"; - rust-overlay = rust-overlay-flake.overlays.default; - sile = sile-flake.defaultPackage.${system}; - jj = jj-flake.packages."${system}".jujutsu; - age = agenix-flake.packages."${system}".default; nil-pkg = nil-flake.packages."${system}".default; - nurl = nurl-flake.packages."${system}".default; - in { config, pkgs, ... }: let + in + { config, ...}: let + pkgs = nixPkgs; nvim-treesitter-csharp = pkgs.callPackage ./nvim-treesitter-csharp.nix { inherit (pkgs.tree-sitter) buildGrammar; inherit (pkgs) fetchFromGitHub; }; - d2-lang = pkgs.callPackage ./d2.nix {}; - # TODO(jwall): When this actually builds we should use it. - #nvim-treesitter-powershell = pkgs.callPackage ./nvim-powershell.nix { - # inherit (pkgs.tree-sitter) buildGrammar; - # inherit (pkgs) fetchFromGitHub; - #}; possession-nvim = pkgs.callPackage ./possession-nvim.nix { inherit (pkgs.vimUtils) buildVimPlugin; inherit (pkgs) fetchFromGitHub; }; harpoon-nvim = pkgs.callPackage ./harpoon-nvim.nix { inherit (pkgs.vimUtils) buildVimPluginFrom2Nix; - inherit (pkgs) fetchFromGitHub; + harpoonSrc = harpoon-src; }; + # TODO(jwall): When this actually builds we should use it. + #nvim-treesitter-powershell = pkgs.callPackage ./nvim-powershell.nix { + # inherit (pkgs.tree-sitter) buildGrammar; + # inherit (pkgs) fetchFromGitHub; + #}; expected-parsers = (pkgs.lib.attrVals [ "tree-sitter-rust" "tree-sitter-lua" @@ -70,33 +69,22 @@ "tree-sitter-tlaplus" "tree-sitter-julia" ] pkgs.tree-sitter.builtGrammars) ++ [nvim-treesitter-csharp]; - in { - + in { imports = [ - agenix-flake.nixosModules.default ./program-neovim.nix ]; - config = { - - nixpkgs.overlays = [ - rust-overlay - ]; - environment.variables = { EDITOR="nvim"; PAGER="less -R"; - OMNISHARP_BIN = "${nixPkgs.omnisharp-roslyn}/bin/OmniSharp"; + OMNISHARP_BIN = "${pkgs.omnisharp-roslyn}/bin/OmniSharp"; }; - - environment.etc."nvim.lua" = { - source = ./init.lua; - }; - + programs = with pkgs; { neovim.enable = true; neovim.vimAlias = true; neovim.viAlias = true; + neovim.package = pkgs.neovim-unwrapped; neovim.configure = { customRC = "lua << EOF ${builtins.readFile ./init.lua} @@ -141,24 +129,62 @@ EOF"; ]) ++ [ possession-nvim harpoon-nvim ]; }; }; + }; + environment.systemPackages = (with pkgs; [ + terraform-ls + nodePackages.typescript-language-server + # TODO find a version of the julia package that will install + # on darwin and add it as an overlay + nil-pkg + lua-language-server + rust-analyzer + ]); + }; + }; + systemModule = system: let + runwhen = runwhen-flake.defaultPackage."${system}"; + nixPkgs = import nixpkgs { inherit system; }; + durnitisp = durnitisp-flake.defaultPackage."${system}"; + rust-overlay = rust-overlay-flake.overlays.default; + sile = sile-flake.defaultPackage.${system}; + jj = jj-flake.packages."${system}".jujutsu; + age = agenix-flake.packages."${system}".default; + nurl = nurl-flake.packages."${system}".default; + in { config, pkgs, ... }@args: let + pkgs = nixPkgs; + d2-lang = pkgs.callPackage ./d2.nix {}; + in { + + imports = [ + agenix-flake.nixosModules.default + ./program-neovim.nix + ]; + config = { + + nixpkgs.overlays = [ + rust-overlay + ]; + + environment.etc."nvim.lua" = { + source = ./init.lua; + }; + + programs = with pkgs; { zsh.enable = true; # default shell on catalina # This is a total hack but we don't want the default clobbering it which it does if it's an empty string or null zsh.promptInit = "#noop"; zsh.interactiveShellInit = (builtins.readFile ./.zshrc); }; environment.systemPackages = (with pkgs; [ - isabelle - texlive.combined.scheme-basic - terraform # TODO(jeremy): Replace with opentofu when that is an option. - terraform-ls + args.pkgs.isabelle + args.pkgs.terraform # TODO(jeremy): Replace with opentofu when that is an option. consul consul-template nomad postgresql oha nodejs - nodePackages.typescript-language-server tmux gnumake # TODO find a version of the julia package that will install @@ -169,7 +195,6 @@ EOF"; emacs git mercurial - bash curl wget jq @@ -190,44 +215,37 @@ EOF"; docker-client google-cloud-sdk awscli2 - nil-pkg alloy6 - nixPkgs.omnisharp-roslyn - (tlaplus.override { - adoptopenjdk-bin = jdk; - }) - lua-language-server + tlaplus jdk d2-lang plantuml-c4 - texlive.combined.scheme-basic nssTools packer nomad mkcert - octave kubo - nixPkgs.dotnet-sdk_7 + dotnet-sdk_7 netcoredbg powershell - rust-analyzer - datasette - ocaml - opam - ocamlformat + #args.pkgs.ocaml + #args.pkgs.opam + #args.pkgs.ocamlformat # TODO(jwall): I include these initially for nvim telescope ripgrep fd lldb llvmPackages.bintools-unwrapped # TODO add sonic-pi here if it supports the arch - ]) ++ (with pkgs.ocamlPackages; [ + ]) + ++ (with args.pkgs.ocamlPackages; [ dune_3 odoc ocaml-lsp merlin utop - ]) ++ [ + ]) + ++ [ sile runwhen durnitisp diff --git a/nix/base-system/harpoon-nvim.nix b/nix/base-system/harpoon-nvim.nix index e061fdf..b69b653 100644 --- a/nix/base-system/harpoon-nvim.nix +++ b/nix/base-system/harpoon-nvim.nix @@ -1,10 +1,5 @@ -{buildVimPluginFrom2Nix, fetchFromGitHub, ...}: -buildVimPluginFrom2Nix rec { +{buildVimPluginFrom2Nix, harpoonSrc, ...}: +buildVimPluginFrom2Nix { name = "harpoon"; - src = fetchFromGitHub { - owner = "ThePrimeagen"; - repo = name; - rev = "harpoon2"; - hash = "sha256-vFK9rxa1BoWSTi9zKTNKucUUD3piK8Yfq8DCVio26A4="; - }; + src = harpoonSrc; } diff --git a/nix/base-system/init.lua b/nix/base-system/init.lua index 2cf42f3..138d912 100644 --- a/nix/base-system/init.lua +++ b/nix/base-system/init.lua @@ -111,6 +111,8 @@ cmp.setup({ --vim.lsp.set_log_level('trace') --vim.lsp.log.set_format_func(vim.inspect) +local roslyn_lsp_dll = vim.fs.normlize("~/bin/Microsoft.CodeAnalysis.LanguageServer.dll") + local caps = vim.tbl_deep_extend( 'force', vim.lsp.protocol.make_client_capabilities(), diff --git a/nix/darwin/flake.lock b/nix/darwin/flake.lock index c23ac53..e13f0ee 100644 --- a/nix/darwin/flake.lock +++ b/nix/darwin/flake.lock @@ -24,11 +24,10 @@ "inputs": { "agenix-flake": "agenix-flake", "durnitisp-flake": "durnitisp-flake", + "harpoon-src": "harpoon-src", "jj-flake": "jj-flake", "nil-flake": "nil-flake", - "nixpkgs": [ - "nixpkgs" - ], + "nixpkgs": "nixpkgs_5", "nurl-flake": "nurl-flake", "runwhen-flake": "runwhen-flake", "rust-overlay-flake": "rust-overlay-flake", @@ -36,12 +35,12 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-ZQs3QUQ5pSROCdIjljeekglluVqJTQJPCRhPmagDkUI=", - "path": "/nix/store/42325m36f5gg3jzx45prgxdnnhc9gkg5-source/nix/base-system", + "narHash": "sha256-ddk9o6CPZv/kDzOjgtQHaOi2sDuCv6LXUGblWMRK5DY=", + "path": "/nix/store/hfmdmfna3pcvhjdk2kw2xiz1ppmm8a3l-source/nix/base-system", "type": "path" }, "original": { - "path": "/nix/store/42325m36f5gg3jzx45prgxdnnhc9gkg5-source/nix/base-system", + "path": "/nix/store/hfmdmfna3pcvhjdk2kw2xiz1ppmm8a3l-source/nix/base-system", "type": "path" } }, @@ -70,7 +69,7 @@ }, "darwin_2": { "inputs": { - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_9" }, "locked": { "lastModified": 1692248770, @@ -278,6 +277,23 @@ "type": "github" } }, + "harpoon-src": { + "flake": false, + "locked": { + "lastModified": 1703800925, + "narHash": "sha256-WD93Oq1WHrfkdOVbYDJiExr+MP1Uezl5WKA53jEdwmY=", + "owner": "ThePrimeagen", + "repo": "harpoon", + "rev": "6afc142443f8135329f8dd09b77e229f65001c0c", + "type": "github" + }, + "original": { + "owner": "ThePrimeagen", + "ref": "harpoon2", + "repo": "harpoon", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -356,7 +372,7 @@ }, "naersk_2": { "inputs": { - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1650101877, @@ -453,6 +469,22 @@ } }, "nixpkgs_5": { + "locked": { + "lastModified": 1701282334, + "narHash": "sha256-MxCVrXY6v4QmfTwIysjjaX0XUhqBbxTWWB4HXtDYsdk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "057f9aecfb71c4437d2b27d3323df7f93c010b7e", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { "locked": { "lastModified": 1689850295, "narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=", @@ -468,7 +500,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1650109093, "narHash": "sha256-tqlnKrAdJktRLXTou9le0oTqrYBAFpGscV5RADdpArU=", @@ -482,7 +514,7 @@ "type": "indirect" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1682109806, "narHash": "sha256-d9g7RKNShMLboTWwukM+RObDWWpHKaqTYXB48clBWXI=", @@ -498,7 +530,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1687274257, "narHash": "sha256-TutzPriQcZ8FghDhEolnHcYU2oHIG5XWF+/SUBNnAOE=", @@ -511,25 +543,9 @@ "type": "indirect" } }, - "nixpkgs_9": { - "locked": { - "lastModified": 1701282334, - "narHash": "sha256-MxCVrXY6v4QmfTwIysjjaX0XUhqBbxTWWB4HXtDYsdk=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "057f9aecfb71c4437d2b27d3323df7f93c010b7e", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "23.11", - "repo": "nixpkgs", - "type": "github" - } - }, "nurl-flake": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1695751852, @@ -548,8 +564,7 @@ "root": { "inputs": { "base-system": "base-system", - "darwin": "darwin_2", - "nixpkgs": "nixpkgs_9" + "darwin": "darwin_2" } }, "runwhen-flake": { @@ -654,7 +669,7 @@ "flake-utils": "flake-utils_6", "gitignore": "gitignore", "libtexpdf-src": "libtexpdf-src", - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1692759315, diff --git a/nix/darwin/flake.nix b/nix/darwin/flake.nix index 30dd8bb..263d4cf 100644 --- a/nix/darwin/flake.nix +++ b/nix/darwin/flake.nix @@ -1,10 +1,8 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs/23.11"; darwin.url = "github:lnl7/nix-darwin"; base-system = { url = "../base-system/"; - inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -19,6 +17,7 @@ inherit system; modules = [ (base-system.systemModule system) + (base-system.vimModule system) ./darwin-configuration.nix ]; });