{ inputs = { nixpkgs.url = "github:nixos/nixpkgs/release-23.05"; sile-flake.url = "github:sile-typesetter/sile"; durnitisp-flake.url = "github:zaphar/durnitisp"; runwhen-flake.url = "github:zaphar/runwhen/v0.0.8"; agenix-flake.url = "github:ryantm/agenix"; nil-flake = { url = "github:oxalica/nil"; #inputs.nixpkgs.follows = "nixpkgs"; }; rust-overlay-flake = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; jj-flake.url = "github:martinvonz/jj"; }; outputs = { sile-flake, runwhen-flake, durnitisp-flake, rust-overlay-flake, jj-flake, agenix-flake, nil-flake, ... # We don't use the self or nixpkgs args here so we just glob it. }: { systemModule = system: let runwhen = runwhen-flake.defaultPackage."${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; in { config, pkgs, ... }: let nvim-treesitter-csharp = pkgs.callPackage ./nvim-treesitter-csharp.nix { inherit (pkgs.tree-sitter) buildGrammar; inherit (pkgs) fetchFromGitHub; }; possession-nvim = pkgs.callPackage ./possession-nvim.nix { inherit (pkgs.vimUtils) buildVimPlugin; inherit (pkgs) fetchFromGitHub; }; expected-parsers = (pkgs.lib.attrVals [ "tree-sitter-rust" "tree-sitter-lua" "tree-sitter-toml" "tree-sitter-yaml" "tree-sitter-json" "tree-sitter-html" "tree-sitter-css" "tree-sitter-nix" "tree-sitter-latex" "tree-sitter-ocaml" "tree-sitter-tlaplus" "tree-sitter-julia" ] pkgs.tree-sitter.builtGrammars) ++ [nvim-treesitter-csharp]; in { imports = [ agenix-flake.nixosModules.default ./program-neovim.nix ]; config = { nixpkgs.overlays = [ rust-overlay ]; environment.variables = { EDITOR="nvim"; PAGER="less -R"; 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.configure = { customRC = "lua << EOF ${builtins.readFile ./init.lua} EOF"; packages.myVimPackage = { start = (with pkgs.vimPlugins; [ nvim-tree-lua nvim-lspconfig packer-nvim vim-lsp vim-vsnip nvim-cmp cmp-nvim-lua cmp-nvim-lsp cmp-vsnip cmp-buffer cmp-path cmp-nvim-lsp-signature-help vimspector vimagit hoon-vim (nvim-treesitter.withPlugins (_: expected-parsers)) nvim-treesitter-context nvim-treesitter-parsers.ini 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 ]; }; }; 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; [ postgresql oha nodejs nodePackages.typescript-language-server tmux gnumake # TODO find a version of the julia package that will install # on darwin and add it as an overlay python3 emacs git mercurial bash curl wget jq spacebar 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 nil-pkg alloy6 omnisharp-roslyn (tlaplus.override { adoptopenjdk-bin = jdk; }) lua-language-server jdk plantuml-c4 texlive.combined.scheme-basic nssTools mkcert octave kubo dotnet-sdk_7 powershell rust-analyzer datasette ocaml opam ocamlformat # TODO(jwall): I include these initially for nvim telescope ripgrep fd # TODO add sonic-pi here if it supports the arch ]) ++ (with pkgs.ocamlPackages; [ dune_3 odoc ocaml-lsp merlin utop ]) ++ [ sile runwhen durnitisp jj age ]; }; }; }; }