diff --git a/.Rprofile b/.Rprofile deleted file mode 100644 index 7617f61..0000000 --- a/.Rprofile +++ /dev/null @@ -1,5 +0,0 @@ -if (Sys.getenv("RNVIM_TMPDIR") == "") { - options(defaultPackages = c("utils", "grDevices", "graphics", "stats", "methods")) -} else { - options(defaultPackages = c("utils", "grDevices", "graphics", "stats", "methods", "nvimcom")) -} diff --git a/.commandcode/taste/taste.md b/.commandcode/taste/taste.md deleted file mode 100644 index 4b588b2..0000000 --- a/.commandcode/taste/taste.md +++ /dev/null @@ -1,8 +0,0 @@ -# nix -- For R.nvim in the Nix wrapper, both RNVIM_COMPLDIR (C server compilation) and a writable R_LIBS_USER directory (nvimcom R package installation) must be configured — fixing only one leaves permission errors in the other. Confidence: 0.65 -- For R.nvim writable directories (RNVIM_COMPLDIR, R_LIBS_USER, TMPDIR), prefer project-local paths (e.g., $PWD/.Rlibs) over global cache paths — the cache approach may let the build succeed but still fail at runtime. Confidence: 0.70 - -# Taste (Continuously Learned by [CommandCode][cmd]) - -[cmd]: https://commandcode.ai/ - diff --git a/flake.lock b/flake.lock index b67b913..bc20095 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1778443072, - "narHash": "sha256-zi7/fsqM/kFdNuED//4WOCUtezGtKKqRNORjMvfwjnA=", + "lastModified": 1777954456, + "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "da5ad661ba4e5ef59ba743f0d112cbc30e474f32", + "rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1", "type": "github" }, "original": { @@ -69,42 +69,19 @@ "type": "github" } }, - "r-nvim-nix": { - "inputs": { - "nixpkgs": [ - "rixpkgs" - ], - "rnvimsrc": [ - "plugins-r" - ] - }, - "locked": { - "lastModified": 1778643549, - "narHash": "sha256-dJBdYawL+/IVtmXLFZ+kQGOo5fd1cliDJJdJEi0Mqqw=", - "owner": "dwinkler1", - "repo": "r_nvim_nix", - "rev": "c7b880dde56b4fcef09938e311415b63f2262498", - "type": "github" - }, - "original": { - "owner": "dwinkler1", - "repo": "r_nvim_nix", - "type": "github" - } - }, "rixpkgs": { "locked": { - "lastModified": 1771303851, - "narHash": "sha256-tgveHozOJ2D/mi3LxVy/FcmLFDlM5XKZxsNB2XpvzaM=", + "lastModified": 1778520264, + "narHash": "sha256-OjpxoQsZSsyXJxtgKJsbNKX5KaSZRaEeaqQj3rmI5uM=", "owner": "dwinkler1", "repo": "rixpkgs", - "rev": "af2dd3f7b4b172077747c0869d4e30702fb71b0e", + "rev": "88147cbbf4be689ea32ed5cbf9370a6aa95fd08e", "type": "github" }, "original": { "owner": "dwinkler1", + "ref": "nixpkgs", "repo": "rixpkgs", - "rev": "af2dd3f7b4b172077747c0869d4e30702fb71b0e", "type": "github" } }, @@ -114,7 +91,6 @@ "nixpkgs": "nixpkgs", "plugins-cmp-pandoc-references": "plugins-cmp-pandoc-references", "plugins-r": "plugins-r", - "r-nvim-nix": "r-nvim-nix", "rixpkgs": "rixpkgs", "wrappers": "wrappers" } diff --git a/flake.nix b/flake.nix index 1ffa69a..8482605 100644 --- a/flake.nix +++ b/flake.nix @@ -10,11 +10,7 @@ url = "github:BirdeeHub/nix-wrapper-modules"; inputs.nixpkgs.follows = "nixpkgs"; }; - rixpkgs.url = "github:dwinkler1/rixpkgs/af2dd3f7b4b172077747c0869d4e30702fb71b0e"; - - r-nvim-nix.url = "github:dwinkler1/r_nvim_nix"; - r-nvim-nix.inputs.rnvimsrc.follows = "plugins-r"; - r-nvim-nix.inputs.nixpkgs.follows = "rixpkgs"; + rixpkgs.url = "github:dwinkler1/rixpkgs/nixpkgs"; fran = { url = "github:dwinkler1/fran"; @@ -50,7 +46,7 @@ nix = true; optional = false; python = false; - r = true; + r = false; }; settings = { lang_packages = { @@ -65,7 +61,6 @@ janitor languageserver styler - pkgs.nvimcom ]; julia = ["DataFramesMeta" "QuackIO"]; }; @@ -192,8 +187,6 @@ air-formatter yaml-language-server updateR - nvimcom - rnvimserver ]; juliaPackages = let @@ -206,8 +199,7 @@ zk ]; - shellPackages = - [nvimPkg] + shellPackages = [nvimPkg] ++ pkgs.lib.optionals cfg.cats.python pythonPackages ++ pkgs.lib.optionals cfg.cats.r rPackages ++ pkgs.lib.optionals cfg.cats.julia juliaPackages @@ -218,13 +210,7 @@ packages = shellPackages; nativeBuildInputs = with pkgs; [] ++ (pkgs.lib.optionals cfg.cats.optional [devenv]); inputsFrom = []; - shellHook = '' - echo 'I am a NixShell' - export R_HOME=$(R RHOME) - export R_LIBS_SITE=$(strings "$(command -v R)" | grep -oP '/nix/store/[^:]+/library' | sort -u | paste -sd: -) - export R_LIBS_USER="$PWD/.r-libs" - mkdir -p "$R_LIBS_USER" - ''; + shellHook = ""; }; } ); diff --git a/modules/module/settings/cats.nix b/modules/module/settings/cats.nix index 3da043e..22b3638 100644 --- a/modules/module/settings/cats.nix +++ b/modules/module/settings/cats.nix @@ -43,7 +43,7 @@ nix = lib.mkDefault true; optional = lib.mkDefault false; python = lib.mkDefault false; - r = lib.mkDefault true; + r = lib.mkDefault false; test = lib.mkDefault false; treesitterParsers = lib.mkDefault true; utils = lib.mkDefault true; diff --git a/modules/module/settings/env.nix b/modules/module/settings/env.nix index 14e0a32..2ae4b9c 100644 --- a/modules/module/settings/env.nix +++ b/modules/module/settings/env.nix @@ -11,17 +11,12 @@ UV_PYTHON_DOWNLOADS = "never"; UV_PYTHON = pkgs.python.interpreter; }) - (lib.mkIf (config.cats.r or false) { - RNVIM_COMPLDIR = "$PWD/.r-compl"; - R_LIBS_USER = "${pkgs.nvimcom}/library:$PWD/.Rlibs"; - TMPDIR = "$PWD/.r-tmp"; - }) ]; # Environment variables with defaults (can be overridden by user) config.envDefault = lib.mkMerge [ (lib.mkIf (config.cats.r or false) { - R_LIBS_USER = "${pkgs.nvimcom}/library:$PWD/.Rlibs"; + R_LIBS_USER = "./.Rlibs"; }) ]; } diff --git a/modules/module/specs/plugins.nix b/modules/module/specs/plugins.nix index a47ba65..ded8195 100644 --- a/modules/module/specs/plugins.nix +++ b/modules/module/specs/plugins.nix @@ -11,13 +11,7 @@ config.specs.r = { data = with pkgs.vimPlugins; [ - (config.nvim-lib.neovimPlugins.r.overrideAttrs (old: { - postInstall = (old.postInstall or "") + '' - mkdir -p $out/rnvimserver - cp ${pkgs.rnvimserver}/bin/rnvimserver $out/rnvimserver/rnvimserver - chmod +x $out/rnvimserver/rnvimserver - ''; - })) + config.nvim-lib.neovimPlugins.r quarto-nvim { data = otter-nvim; diff --git a/overlays/default.nix b/overlays/default.nix index ebb6518..821ff88 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -3,14 +3,12 @@ let lib = nixpkgs.lib; rOverlay = import ./r.nix {inherit inputs;}; - rNvimNixOverlay = inputs.r-nvim-nix.overlays.default; franOverlay = inputs.fran.overlays.default; pythonOverlay = import ./python.nix inputs; pluginsOverlay = import ./plugins.nix inputs; dependencyOverlays = [ rOverlay - rNvimNixOverlay pythonOverlay pluginsOverlay ]; @@ -19,7 +17,6 @@ in { inherit rOverlay - rNvimNixOverlay franOverlay pythonOverlay pluginsOverlay @@ -33,7 +30,6 @@ in overlays = { inherit rOverlay - rNvimNixOverlay franOverlay pythonOverlay pluginsOverlay diff --git a/overlays/r.nix b/overlays/r.nix index a9961fb..2fb71c8 100644 --- a/overlays/r.nix +++ b/overlays/r.nix @@ -33,9 +33,6 @@ overlays = [inputs.fran.overlays.default]; }; # rixpkgs.legacyPackages.${prev.stdenv.hostPlatform.system}; - # nvimcom and rnvimserver are provided by the r-nvim-nix flake overlay - # (inputs.r-nvim-nix.overlays.default) - # Standard R packages used by default in rWrapper and quarto reqPkgs = with rpkgs.rPackages; [ # languageserver diff --git a/plugin/21_datascience.lua b/plugin/21_datascience.lua index 62d8f49..118ee20 100644 --- a/plugin/21_datascience.lua +++ b/plugin/21_datascience.lua @@ -44,12 +44,6 @@ end) -- r now(function() if nix.get_cat("r", false) then - local cwd = vim.fn.getcwd(-1) - vim.env.RNVIM_COMPLDIR = cwd .. "/.r-compl" - vim.env.R_LIBS_USER = (vim.env.R_LIBS_USER or ""):gsub("%$PWD", cwd) - vim.env.TMPDIR = cwd .. "/.r-tmp" - vim.fn.mkdir(vim.env.RNVIM_COMPLDIR, "p") - vim.fn.mkdir(vim.env.TMPDIR, "p") vim.g.rout_follow_colorscheme = true require("r").setup({ -- Create a table with the options to be passed to setup()