diff --git a/nix-conf/home-manager/base/alacritty.nix b/nix-conf/home-manager/base/alacritty.nix index e69f9b2..8677649 100644 --- a/nix-conf/home-manager/base/alacritty.nix +++ b/nix-conf/home-manager/base/alacritty.nix @@ -5,7 +5,7 @@ }: let inherit (myLib) fromYaml; - actualConfig = fromYaml (builtins.readFile "${proj_root}//alacritty/alacritty.yml"); + actualConfig = fromYaml (builtins.readFile "${proj_root.config.path}//alacritty/alacritty.yml"); cfg = config.base.alacritty; in { diff --git a/nix-conf/home-manager/base/mkModuleArgs.nix b/nix-conf/home-manager/base/mkModuleArgs.nix index c7f970c..64720f7 100644 --- a/nix-conf/home-manager/base/mkModuleArgs.nix +++ b/nix-conf/home-manager/base/mkModuleArgs.nix @@ -5,9 +5,14 @@ let recursiveUpdate = lib.recursiveUpdate; _lib = recursiveUpdate lib (import ../../lib { inherit pkgs lib; }); + proj_root = builtins.toString ./../../..; in # TODO: Unpollute inputs recursiveUpdate inputs { - proj_root = builtins.toString ./../../..; + proj_root = { + path = proj_root; + config.path = "${proj_root}/native_configs"; + scripts.path = "${proj_root}/scripts"; + }; myLib = _lib; } diff --git a/nix-conf/home-manager/base/shells.nix b/nix-conf/home-manager/base/shells.nix index 8f034d2..a4803ea 100644 --- a/nix-conf/home-manager/base/shells.nix +++ b/nix-conf/home-manager/base/shells.nix @@ -36,7 +36,7 @@ in }; }; config = myLib.mkIf cfg.enable { - xdg.configFile."starship.toml".source = "${proj_root}//starship/starship.toml"; + xdg.configFile."starship.toml".source = "${proj_root.config.path}//starship/starship.toml"; # nix: Propagates the environment with packages and vars when enter (children of) # a directory with shell.nix-compatible and .envrc programs.direnv = { @@ -51,7 +51,7 @@ in }; programs.tmux = { enable = true; - extraConfig = builtins.readFile "${proj_root}/tmux/tmux.conf"; + extraConfig = builtins.readFile "${proj_root.config.path}/tmux/tmux.conf"; }; programs.exa = { enable = true; diff --git a/nix-conf/home-manager/base/ssh.nix b/nix-conf/home-manager/base/ssh.nix index aedb1e3..637651e 100644 --- a/nix-conf/home-manager/base/ssh.nix +++ b/nix-conf/home-manager/base/ssh.nix @@ -17,7 +17,7 @@ in config.programs.ssh = { inherit (cfg) enable; forwardAgent = true; - extraConfig = builtins.readFile "${proj_root}/ssh/config"; + extraConfig = builtins.readFile "${proj_root.config.path}/ssh/config"; }; } diff --git a/nix-conf/home-manager/home.nix b/nix-conf/home-manager/home.nix index ea436bd..905ad7c 100644 --- a/nix-conf/home-manager/home.nix +++ b/nix-conf/home-manager/home.nix @@ -8,6 +8,7 @@ , myHome , myLib , option # The options we're given, this might be useful for typesafety? +, proj_root , ... }: let @@ -32,7 +33,25 @@ let # pypkgs.ujson # pylsp seems to rely on this. satisfy it lol # ])) ]; - proj_root = builtins.toString ./../..; + rust_pkgs = (pkgs.rust-bin.selectLatestNightlyWith + ( + toolchain: + toolchain.default.override { + extensions = [ "rust-src" ]; + } + )); + my_neovim = pkgs.neovim-unwrapped.overrideDerivation (old: { +# TODO: is there a more beautiful way to override propagatedBuildInputs? + name = "hungtr-" + old.name; + buildInputs = (old.buildInputs or []) ++ [ + pkgs.tree-sitter # highlighting + rust_pkgs # for potentially rust-analyzer + pkgs.fzf + pkgs.ripgrep + pkgs.zk + pkgs.fd + ]; + }); inherit (myLib) fromYaml; in { @@ -68,8 +87,8 @@ in ] ++ (myHome.packages or [ ]) ++ nvim_pkgs); ## Configs ## - xdg.configFile."nvim/init.lua".source = "${proj_root}//neovim/init.lua"; - xdg.configFile."zk/config.toml".source = "${proj_root}//zk/config.toml"; + xdg.configFile."nvim/init.lua".source = "${proj_root.config.path}//neovim/init.lua"; + xdg.configFile."zk/config.toml".source = "${proj_root.config.path}//zk/config.toml"; ## Programs ## programs.jq = { @@ -78,11 +97,13 @@ in # TODO: override the original package, inject tree-sitter and stuffs programs.neovim = { enable = true; + package = my_neovim; viAlias = true; vimAlias = true; withPython3 = true; withNodeJs = true; extraPackages = nvim_pkgs; + # only for here for archive-documentation # extraPython3Packages = (pypkgs: [ # # pypkgs.python-lsp-server # pypkgs.ujson