Code Monkey home page Code Monkey logo

Comments (7)

n4074 avatar n4074 commented on May 27, 2024 1

I am affected by the same issue trying to use hotpot with nix. The nix-compat branch works for me.

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

Hotpot ships with a bootstrapper that will compile hotpot itself, it basically traverses hotpot/fnl/* and writes it to hotpot/lua/* (except for hotpot.fnl which is the pre-compiled bootstrapper). Looks like that is having trouble with permissions? I wonder if homemanager sets up some restrictive permissions somewhere?

Cannot create directory /nix/store/silam09pv3pvvvx4zrpkjvccllfxggpn-vim-pack-dir/pack/home-manager/start/vimplugin-hotpot.nvim/lua/hotpot/api: permission denied

The SHA that works is basically just before 0.2.0 which included the re-written bootstrapper.

Per your last nix issue, I wonder if you can run a post-install command to enforce hotpot/lua as writable, before you run nvim the first time and the code gets compiled?

Relevant code, patches welcome, perhaps it's naive to assume it inherits a good umask.

The other option is to patch the build.sh to compile everything over barring I think only macros.fnl. The code for that is sort of here in 0.1.0 but it needs modifications to not dump the bootstrapper which also acts as the "package.path installer", which you could then call in the post-install, not sure if that would be more "nixy".

from hotpot.nvim.

muni-corn avatar muni-corn commented on May 27, 2024

So I found here is where that error is being thrown. This is where Nix and home-manager "wrap" neovim and build its configuration. But for the life of me, I can't figure out why this "remote plugin manifest generation" script is being included in the first place :P

Anyway--

The SHA that works is basically just before 0.2.0 which included the re-written bootstrapper.

My guess is that the bootstrapper from before didn't run during/before this :UpdateRemotePlugins invocation of nvim (and it is now)? It seems to me that this isn't a matter of how the bootstrapper runs but rather when (or why)

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

Yeah previously hotpot would compile itself to ~/.cache/nvim/home/<you>/<your-nvim-plugins-dir>/hotpot/ but now it compiles directly into ~/<your-nvim-plugins-dir>/hotpot/lua/, but nix sets that folder to be read only I guess.

Can you do something like this?

home.activation = {
  unlockHotpotLua = home-manager.lib.hm.dag.entryAfter ["writeBoundary"] ''
    HOTPOT_DIR="${config.xdg.localHome}/share/nvim/site/pack/hotpot/lua" # no idea where the real dir is
    if [[ -d "$HOTPOT_DIR" ]]; then
      $DRY_RUN_CMD chmod 744 "$HOTPOT_DIR"
    fi
  '';
};

from hotpot.nvim.

mixedCase avatar mixedCase commented on May 27, 2024

Is there any way to revert to the previous behavior? Nix stores hotpot (and every other package) in a read-only store, not unlike most system-level package managers that store files as root-owned.

If it's possible to configure the folder the bootstrapping takes place in (or having it go back by $XDG_CACHE_HOME) we can fix this without breaking the permission model.

EDIT: ended up switching to Tangerine which makes this rather easy:

require("tangerine").setup({
  target = vim.fn.stdpath("cache") .. "/tangerine",
  compiler = {
    hooks = {
      "oninit"
    },
  },
})

probably better to redirect home-manager users there in case this would be annoying to implement in hotpot, I'm assuming there was a reason to move away from XDG_CACHE_HOME...

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

We compile to lua/ to avoid having the extra search target in package.path (and we don't ship a full lua/ package for my own QOL).

I have added a branch, https://github.com/rktjmp/hotpot.nvim/tree/nix-compat which will check for a global __hotpot_bootstrap_target_dir which should be set before hotpot is required. It should be a full path to somewhere you can write to, probably you would want:

-- __hotpot_bootstrap_target_dir = vim.fn.stdpath("cache") .. "/some/path"
-- require("hotpot")

If someone wants to test the branch that would be useful. Hotpot has always (will always?) had the "just require("hotpot")" minimal setup, so we can't really pass options to the bootstrapper without globals 🤮.

Edit: Configuration no longer required. @harrisonthorne, can you try the nix-compat branch?

I'm curious how home-manager handles programs that write their own config files or update local data, do you just not put those applications under it or what?

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

Thanks for testing, merged.

from hotpot.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.