{ inputs = { 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"; agenix-flake.url = "github:ryantm/agenix"; nurl-flake.url = "github:nix-community/nurl"; nil-flake = { url = "github:oxalica/nil"; }; rust-overlay-flake = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; jj-flake.url = "github:martinvonz/jj"; harpoon-src = { url = "github:ThePrimeagen/harpoon/harpoon2"; flake = false; }; # We need to pin to this version of treesitter because it breaks after this revision treesitter-context = { url = "github:nvim-treesitter/nvim-treesitter-context/e6b743ccd4e780bc9cd85b707de67df72eea1a23"; flake = false; }; # We need to pin to this version of treesitter because it breaks after this revision roslyn-lsp = { url = "github:zaphar/roslyn.nvim/non_nightly"; flake = false; }; }; outputs = { sile-flake, runwhen-flake, durnitisp-flake, rust-overlay-flake, jj-flake, agenix-flake, nil-flake, nurl-flake, harpoon-src, treesitter-context, roslyn-lsp, nixpkgs, ... # We don't use the self or nixpkgs args here so we just glob it. }: { vimModule = system: let nixPkgs = import nixpkgs { inherit system; }; nil-pkg = nil-flake.packages."${system}".default; in { config, ...}: let pkgs = nixPkgs; possession-nvim = pkgs.callPackage ./possession-nvim.nix { inherit (pkgs.vimUtils) buildVimPlugin; inherit (pkgs) fetchFromGitHub; }; harpoon-nvim = pkgs.callPackage ./harpoon-nvim.nix { inherit (pkgs.vimUtils) buildVimPlugin; harpoonSrc = harpoon-src; }; nvim-treesitter-context = pkgs.vimUtils.buildVimPlugin { name = "nvim-treesitter-context"; src = treesitter-context; }; roslyn-nvim = pkgs.vimUtils.buildVimPlugin { name = "roslyn-nvim"; src = roslyn-lsp; }; # 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; #}; in { imports = [ ./program-neovim.nix ]; config = { environment.variables = { EDITOR="nvim"; PAGER="less -R"; OMNISHARP_BIN = "${pkgs.omnisharp-roslyn}/bin/OmniSharp"; }; 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} EOF"; packages.myVimPackage = { start = (with pkgs.vimPlugins; [ nvim-tree-lua nvim-lspconfig packer-nvim vim-ps1 vim-lsp vim-vsnip nvim-cmp cmp-nvim-lua cmp-nvim-lsp cmp-vsnip cmp-buffer cmp-path cmp-nvim-lsp-signature-help nvim-dap # Debug Adapter Protocol support #nvim-dap-ui vimagit hoon-vim nvim-treesitter roslyn-nvim nvim-treesitter-context nvim-treesitter-textobjects nvim-treesitter-parsers.ini nvim-treesitter-parsers.rust nvim-treesitter-parsers.c nvim-treesitter-parsers.c_sharp nvim-treesitter-parsers.cpp nvim-treesitter-parsers.clojure nvim-treesitter-parsers.latex nvim-treesitter-parsers.terraform nvim-treesitter-parsers.hcl nvim-treesitter-parsers.yaml nvim-treesitter-parsers.lua nvim-treesitter-parsers.vim nvim-treesitter-parsers.go nvim-treesitter-parsers.toml nvim-treesitter-parsers.tlaplus nvim-treesitter-parsers.typescript nvim-treesitter-parsers.starlark nvim-treesitter-parsers.python nvim-treesitter-parsers.sql nvim-treesitter-parsers.javascript nvim-treesitter-parsers.ocaml nvim-treesitter-parsers.haskell nvim-treesitter-parsers.css nvim-treesitter-parsers.promql nvim-treesitter-parsers.nix nvim-treesitter-parsers.hoon omnisharp-extended-lsp-nvim #neotest-dotnet nix-develop-nvim trouble-nvim nightfox-nvim melange-nvim julia-vim # TODO I should get julia language server support set up instead. telescope-nvim telescope-lsp-handlers-nvim plenary-nvim vim-dadbod vim-dadbod-ui vim-dadbod-completion ]) ++ [ 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; [ args.pkgs.isabelle args.pkgs.terraform # TODO(jeremy): Replace with opentofu when that is an option. consul consul-template nomad postgresql oha nodejs tmux gnumake # TODO find a version of the julia package that will install # on darwin and add it as an overlay python310 python310Packages.pip python310Packages.virtualenv emacs git mercurial curl wget jq trippy coreutils watch iterm2 go htop colima ghidra #podman-desktop # Broken on darwin right now with electron build issues. # Note that podman expects qemu to be installed in order to use the podman machine setup. qemu podman lima rlwrap docker-client google-cloud-sdk awscli2 alloy6 tlaplus jdk d2-lang plantuml-c4 nssTools packer nomad mkcert kubo dotnet-sdk_7 netcoredbg powershell #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 args.pkgs.ocamlPackages; [ dune_3 odoc ocaml-lsp merlin utop ]) ++ [ sile runwhen durnitisp jj age nurl ]; }; }; }; }