old nix-conf: update proj_root + failure on hungtr-neovim

top-level-nix
Pegasust 2022-12-26 03:42:14 -07:00
parent 416f0d0c60
commit 9944604a38
5 changed files with 34 additions and 8 deletions

View File

@ -5,7 +5,7 @@
}: }:
let let
inherit (myLib) fromYaml; 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; cfg = config.base.alacritty;
in in
{ {

View File

@ -5,9 +5,14 @@
let let
recursiveUpdate = lib.recursiveUpdate; recursiveUpdate = lib.recursiveUpdate;
_lib = recursiveUpdate lib (import ../../lib { inherit pkgs lib; }); _lib = recursiveUpdate lib (import ../../lib { inherit pkgs lib; });
proj_root = builtins.toString ./../../..;
in in
# TODO: Unpollute inputs # TODO: Unpollute inputs
recursiveUpdate 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; myLib = _lib;
} }

View File

@ -36,7 +36,7 @@ in
}; };
}; };
config = myLib.mkIf cfg.enable { 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) # nix: Propagates the environment with packages and vars when enter (children of)
# a directory with shell.nix-compatible and .envrc # a directory with shell.nix-compatible and .envrc
programs.direnv = { programs.direnv = {
@ -51,7 +51,7 @@ in
}; };
programs.tmux = { programs.tmux = {
enable = true; enable = true;
extraConfig = builtins.readFile "${proj_root}/tmux/tmux.conf"; extraConfig = builtins.readFile "${proj_root.config.path}/tmux/tmux.conf";
}; };
programs.exa = { programs.exa = {
enable = true; enable = true;

View File

@ -17,7 +17,7 @@ in
config.programs.ssh = { config.programs.ssh = {
inherit (cfg) enable; inherit (cfg) enable;
forwardAgent = true; forwardAgent = true;
extraConfig = builtins.readFile "${proj_root}/ssh/config"; extraConfig = builtins.readFile "${proj_root.config.path}/ssh/config";
}; };
} }

View File

@ -8,6 +8,7 @@
, myHome , myHome
, myLib , myLib
, option # The options we're given, this might be useful for typesafety? , option # The options we're given, this might be useful for typesafety?
, proj_root
, ... , ...
}: }:
let let
@ -32,7 +33,25 @@ let
# pypkgs.ujson # pylsp seems to rely on this. satisfy it lol # 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; inherit (myLib) fromYaml;
in in
{ {
@ -68,8 +87,8 @@ in
] ++ (myHome.packages or [ ]) ++ nvim_pkgs); ] ++ (myHome.packages or [ ]) ++ nvim_pkgs);
## Configs ## ## Configs ##
xdg.configFile."nvim/init.lua".source = "${proj_root}//neovim/init.lua"; xdg.configFile."nvim/init.lua".source = "${proj_root.config.path}//neovim/init.lua";
xdg.configFile."zk/config.toml".source = "${proj_root}//zk/config.toml"; xdg.configFile."zk/config.toml".source = "${proj_root.config.path}//zk/config.toml";
## Programs ## ## Programs ##
programs.jq = { programs.jq = {
@ -78,11 +97,13 @@ in
# TODO: override the original package, inject tree-sitter and stuffs # TODO: override the original package, inject tree-sitter and stuffs
programs.neovim = { programs.neovim = {
enable = true; enable = true;
package = my_neovim;
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
withPython3 = true; withPython3 = true;
withNodeJs = true; withNodeJs = true;
extraPackages = nvim_pkgs; extraPackages = nvim_pkgs;
# only for here for archive-documentation
# extraPython3Packages = (pypkgs: [ # extraPython3Packages = (pypkgs: [
# # pypkgs.python-lsp-server # # pypkgs.python-lsp-server
# pypkgs.ujson # pypkgs.ujson