Add codeium and mundo to vim

Also: Expose packages in self#packagename for installation elsewhere on-system
Also: Reformat flake.nix
diff --git a/flake.nix b/flake.nix
index 0f79ccd..8ee4f1c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,6 +3,9 @@
   inputs = {
     nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
 
+    nix-index-database.url = "github:Mic92/nix-index-database";
+    nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
+
     nixpkgs-unfree.url = "github:numtide/nixpkgs-unfree";
     nixpkgs-unfree.inputs.nixpkgs.follows = "nixpkgs";
 
@@ -124,7 +127,8 @@
               (
                 if traceHead == "home"
                 then [ "home-manager" "users" username ]
-                else lib.throwIfNot (traceHead == "config") ''You need to trace either home.** or config.** (found "${traceHead}" in "${trace}")'' [ ])
+                else lib.throwIfNot (traceHead == "config") ''You need to trace either home.** or config.** (found "${traceHead}" in "${trace}")'' [ ]
+              )
               ++ traceTail;
           in
           (
@@ -141,9 +145,10 @@
                   }
                   else {
                     value = { };
-                    error = if error == false 
-                            then ''"${key}" does not exist in set "${builtins.toJSON value}"''
-                            else error;
+                    error =
+                      if error == false
+                      then ''"${key}" does not exist in set "${builtins.toJSON value}"''
+                      else error;
                   })
                 {
                   value = config;
@@ -173,38 +178,43 @@
           );
       in
       {
-        packages.nixosConfigurations =
-          let
-            nixosSystem = (nixpkgs.lib.nixosSystem
-              {
-                inherit system;
+        packages = {
+          nixosConfigurations =
+            let
+              nixosSystem = (nixpkgs.lib.nixosSystem
+                {
+                  inherit system;
 
-                modules = [
-                  (nixpkgs.lib.pipe ./modules [
-                    utils.nixFilesIn
-                    (utils.interpretNonstandardModule (args:
-                      args
-                      // {
-                        home = args.config.home-manager.users.${username};
-                        home-options =
-                          nixpkgs.lib.traceVal (normalizeOptions
-                            (args.options.home-manager.users.type.getSubOptions [ ]));
-                        inherit system utils;
-                      }))
-                  ])
-                  {
-                    minion = import ./config.nix;
-                  }
-                ];
+                  modules = [
+                    (nixpkgs.lib.pipe ./modules [
+                      utils.nixFilesIn
+                      (utils.interpretNonstandardModule (args:
+                        args
+                          // {
+                          home = args.config.home-manager.users.${username};
+                          home-options =
+                            nixpkgs.lib.traceVal (normalizeOptions
+                              (args.options.home-manager.users.type.getSubOptions [ ]));
+                          inherit system utils;
+                        }))
+                    ])
+                    {
+                      minion = import ./config.nix;
+                    }
+                  ];
 
-                specialArgs = inputs // { inherit inputs username; };
-              });
-          in
-          {
-            default = builtins.deepSeq
-              (map (evalTrace nixosSystem.config) nixosSystem.config.internal.traces)
-              nixosSystem;
-          };
+                  specialArgs = inputs // { inherit inputs username; };
+                });
+            in
+            {
+              default = builtins.deepSeq
+                (map (evalTrace nixosSystem.config) nixosSystem.config.internal.traces)
+                nixosSystem;
+            };
+        } // (import ./overlays/packages.nix
+          { inherit (inputs) fenix crane; }
+          pkgs
+          pkgs);
         devShell = pkgs.mkShell {
           nativeBuildInputs = with pkgs; [ nodePackages.prettier nixpkgs-fmt ];
           buildInputs = [ ];
diff --git a/modules/neovim/codeium/default.nix b/modules/neovim/codeium/default.nix
new file mode 100644
index 0000000..b00bc2e
--- /dev/null
+++ b/modules/neovim/codeium/default.nix
@@ -0,0 +1,3 @@
+{ pkgs, ... }: {
+  programs.neovim.plugins = [ pkgs.codeium-vim ];
+}
diff --git a/modules/neovim/undo/default.nix b/modules/neovim/undo/default.nix
new file mode 100644
index 0000000..e560e7e
--- /dev/null
+++ b/modules/neovim/undo/default.nix
@@ -0,0 +1,8 @@
+{ pkgs, ... }: {
+  programs.neovim = {
+    plugins = [
+      pkgs.vimPlugins.vim-mundo
+    ];
+    extraConfig = builtins.readFile ./undo.vim;
+  };
+}
diff --git a/modules/neovim/undo/undo.vim b/modules/neovim/undo/undo.vim
new file mode 100644
index 0000000..73a30e7
--- /dev/null
+++ b/modules/neovim/undo/undo.vim
@@ -0,0 +1,4 @@
+set undofile
+set undodir=~/.config/nvim/undo
+
+nnoremap U :MundoToggle<CR>
diff --git a/packages/codeium-vim.nix b/packages/codeium-vim.nix
new file mode 100644
index 0000000..53abe4e
--- /dev/null
+++ b/packages/codeium-vim.nix
@@ -0,0 +1,11 @@
+{ vimUtils
+, fetchFromGitHub
+}: vimUtils.buildVimPluginFrom2Nix { 
+  name = "codeium.vim";
+  src = fetchFromGitHub {
+    owner = "Exafunction";
+    repo = "codeium.vim";
+    rev = "cf3bbfa52658fa4380ea2bb764493356f04768c3";
+    sha256 = "sha256-HoTw330lS4bvJJaukZgbTTzr8t5O8mMkpHqi+dF8jqY=";
+  };
+}
diff --git a/patches/codeium-vim/wrap-with-steam-run.patch b/patches/codeium-vim/wrap-with-steam-run.patch
new file mode 100644
index 0000000..90f7c74
--- /dev/null
+++ b/patches/codeium-vim/wrap-with-steam-run.patch
@@ -0,0 +1,21 @@
+From d31c358b1e58cab473593d889fc9b204316a6e57 Mon Sep 17 00:00:00 2001
+From: Skyler <skyler3665@gmail.com>
+Date: Tue, 24 Jan 2023 14:15:42 +0000
+Subject: [PATCH] Wrap codeium with steam-run (for nix)
+
+---
+ autoload/codeium/server.vim | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/autoload/codeium/server.vim b/autoload/codeium/server.vim
+index 2d18adc..08f293a 100644
+--- a/autoload/codeium/server.vim
++++ b/autoload/codeium/server.vim
+@@ -144,6 +144,7 @@ function! codeium#server#Start(timer) abort
+   call mkdir(manager_dir, 'p')
+ 
+   let args = [
++        \ 'steam-run',
+         \ bin,
+         \ '--api_server_host', get(config, 'api_host', 'server.codeium.com'),
+         \ '--api_server_port', get(config, 'api_port', '443'),