diff --git a/jrpotter/default.nix b/jrpotter/default.nix index aac27b7..b4681f1 100644 --- a/jrpotter/default.nix +++ b/jrpotter/default.nix @@ -1,58 +1,48 @@ -{ config, pkgs, lib, ... }: +{ pkgs, ... }: { - options.home.extraPythonPackages = lib.mkOption { - type = lib.types.listOf lib.types.string; - example = '' - [ debugpy mccabe ] - ''; - description = lib.mdDoc '' - Extra Python packages that should be linked to the topmost Python - interpreter. - ''; - }; - imports = [ ./git.nix + ./lang/bash.nix + ./lang/c.nix + ./lang/elixir.nix + ./lang/lean.nix + ./lang/lua.nix + ./lang/nix.nix + ./lang/python.nix + ./lang/typescript.nix ./neovim ./wezterm ]; - config = { - home = { - username = "jrpotter"; - homeDirectory = "/home/jrpotter"; - - packages = with pkgs; [ - anki-bin - bitwarden - elan - firefox - gnumake - mullvad-vpn - (python3.withPackages - (ps: builtins.map (s: ps.${s}) config.home.extraPythonPackages)) - unzip - wezterm - zotero - ]; - }; - - programs = { - bash.enable = true; - direnv.enable = true; - git.enable = true; - home-manager.enable = true; - neovim.enable = true; - }; - - # This value determines the Home Manager release that - # your configuration is compatible with. This helps avoid - # breakage when a new Home Manager release introduces - # backwards-incompatible changes. - # - # You can update Home Manager without changing this value. - # See the Home Manager release notes for a list of state - # version changes in each release. - home.stateVersion = "23.05"; + home = { + username = "jrpotter"; + homeDirectory = "/home/jrpotter"; + packages = with pkgs; [ + anki-bin + bitwarden + firefox + mullvad-vpn + unzip + wezterm + zotero + ]; }; + + programs = { + bash.enable = true; + direnv.enable = true; + git.enable = true; + home-manager.enable = true; + neovim.enable = true; + }; + + # This value determines the Home Manager release that + # your configuration is compatible with. This helps avoid + # breakage when a new Home Manager release introduces + # backwards-incompatible changes. + # + # You can update Home Manager without changing this value. + # See the Home Manager release notes for a list of state + # version changes in each release. + home.stateVersion = "23.05"; } diff --git a/jrpotter/neovim/lang/bash.nix b/jrpotter/lang/bash.nix similarity index 100% rename from jrpotter/neovim/lang/bash.nix rename to jrpotter/lang/bash.nix diff --git a/jrpotter/neovim/lang/c.nix b/jrpotter/lang/c.nix similarity index 59% rename from jrpotter/neovim/lang/c.nix rename to jrpotter/lang/c.nix index 4649528..feed694 100644 --- a/jrpotter/neovim/lang/c.nix +++ b/jrpotter/lang/c.nix @@ -1,13 +1,17 @@ { pkgs, ... }: +let + codelldb = pkgs.writeShellScriptBin "codelldb" '' + #!/usr/bin/env bash + exec ${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb "$@" + ''; +in { home.packages = with pkgs; [ bear clang clang-tools - (writeShellScriptBin "codelldb" '' - #!/usr/bin/env bash - exec ${vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb "$@" - '') + codelldb + gnumake ]; programs.neovim = { diff --git a/jrpotter/neovim/lang/elixir.nix b/jrpotter/lang/elixir.nix similarity index 100% rename from jrpotter/neovim/lang/elixir.nix rename to jrpotter/lang/elixir.nix diff --git a/jrpotter/neovim/lang/lean.nix b/jrpotter/lang/lean.nix similarity index 75% rename from jrpotter/neovim/lang/lean.nix rename to jrpotter/lang/lean.nix index 51f0414..e94340a 100644 --- a/jrpotter/neovim/lang/lean.nix +++ b/jrpotter/lang/lean.nix @@ -1,9 +1,9 @@ args @ { pkgs, ... }: let - utils = import ../utils.nix args; + neovimUtils = import ../neovim/utils.nix args; lean-nvim = { - plugin = utils.pluginGit + plugin = neovimUtils.pluginGit "47ff75ce2fcc319fe7d8e031bc42a75473919b93" "Julian/lean.nvim"; config = '' @@ -17,6 +17,10 @@ let }; in { + home.packages = with pkgs; [ + elan + ]; + programs.neovim = { plugins = [ lean-nvim diff --git a/jrpotter/neovim/lang/lua.nix b/jrpotter/lang/lua.nix similarity index 100% rename from jrpotter/neovim/lang/lua.nix rename to jrpotter/lang/lua.nix diff --git a/jrpotter/neovim/lang/nix.nix b/jrpotter/lang/nix.nix similarity index 100% rename from jrpotter/neovim/lang/nix.nix rename to jrpotter/lang/nix.nix diff --git a/jrpotter/neovim/lang/python.nix b/jrpotter/lang/python.nix similarity index 58% rename from jrpotter/neovim/lang/python.nix rename to jrpotter/lang/python.nix index 2ac0c6f..9d9195e 100644 --- a/jrpotter/neovim/lang/python.nix +++ b/jrpotter/lang/python.nix @@ -1,12 +1,14 @@ -{ ... }: +{ pkgs, ... }: { - home.extraPythonPackages = [ - "debugpy" - "mccabe" - "pycodestyle" - "pyflakes" - "python-lsp-server" - "python-lsp-black" + home.packages = with pkgs; [ + (python3.withPackages (ps: with ps; [ + debugpy + mccabe + pycodestyle + pyflakes + python-lsp-server + python-lsp-black + ])) ]; programs.neovim = { diff --git a/jrpotter/neovim/lang/typescript.nix b/jrpotter/lang/typescript.nix similarity index 100% rename from jrpotter/neovim/lang/typescript.nix rename to jrpotter/lang/typescript.nix diff --git a/jrpotter/neovim/default.nix b/jrpotter/neovim/default.nix index 50ea5d2..fac5fef 100644 --- a/jrpotter/neovim/default.nix +++ b/jrpotter/neovim/default.nix @@ -68,27 +68,6 @@ in }; }; - # Notice that within our imports we use `home.packages` instead of - # `extraPackages`. The latter is preferable but comes with `$PATH`-related - # problems. - # - # Specifically, Home Manager appends paths specifed in `extraPackages` to the - # end of `$PATH` meaning any already defined instance of some package will be - # used instead. Prepending is not an option either since that would break - # environments like those produced by `direnv` or `nix-shell`. - # - # https://github.com/nix-community/home-manager/pull/1756 - imports = [ - ./lang/bash.nix - ./lang/c.nix - ./lang/elixir.nix - ./lang/lean.nix - ./lang/lua.nix - ./lang/nix.nix - ./lang/python.nix - ./lang/typescript.nix - ]; - config = { programs.neovim = { defaultEditor = true;