Skip to content
Sign UpLog In
Profile icon

Ryoidenshi Aokigahara

@NEKRA
Repls
Community
NEKRA
NEKRA
published an Update
1 year ago
1
replit-nix-configuration
replit-nix-configuration
How to setup the tasks that should run only once, when the repl is loaded?
I created a simple Nix template from https://replit.com/new/nix Now I see the file called as replit.nix with next content: {pkgs}: { deps = [ pkgs.cowsay ]; } It's ok and enough while talking only about system dependencies (at least for installing languages), but when we need to do more than just specify required software, there is my question - how to do that? Yes, I checked for introduction at https://docs.replit.com/programming-ide/getting-started-nix and info about priorities (replit.nix -> shell.nix -> default.nix) But I also searched a bit for that question and found this question on StackOverflow: https://stackoverflow.com/questions/44088192/when-and-how-should-default-nix-shell-nix-and-release-nix-be-used where described such files as: default.nix derivation.nix shell.nix module.nix test.nix release.nix And provided link to example of all these files at https://github.com/Tokyo-NixOS/presentations/tree/master/2017/02/examples/binserver I though that I will find something similar to replit.nix, but no, there's nothing similar. I've tried to replace replit.nix with shell.nix(example from https://nixos.org/#asciinema-demo-cover on moment 01:00) to be able use pkgs.mkShell: { pkgs ? import {} # here we import the nixpkgs package set }: mkShell is a helper function pkgs.mkShell { that requires a name name="dev-environment"; and a list of packages buildInputs = [ pkgs.nodejs ]; bash to run when you enter the shell shellHook = '' export SOME_KEY=SoMeVaLuE alias la="ls -a" echo "Start developing..." ''; } But it works a bit strange: Dependencies (nodejs in example above) are installed and available from both Console and Shell tabs Exported environment variable is has value in the Shell tab only. For the Console tab it's empty and not even exist (checked with env | grep SOME_KEY) Alias created only after manual running nix-shell. The same behaviour for both Console and Shell tabs Command echo "Start developing..." also executed only after manual running nix-shell. How finally I have to setup the task that should be executed only once, when the repl is loaded? To which type of .nix files is replit.nix similar to?
NEKRA
NEKRA
shared a Post
2 years ago
Have you ever launched the normal VueJS application on Repl? I mean the one maid with vue create myapp with node_modules and etc. I've seen here a tem
NEKRA
NEKRA
Difference in these two templates is that first is more "raw", I just tried to find a way launch vue correctly, added readme and etc., an in second template vue basic project is created2 years ago
NEKRA
NEKRA
@Patrity, I've already forgot about this question here. I've got the same error while tried to launch vue dev server on remote machine and trying to access it via domain. You can solve this problem this way module.exports = { devServer: { disableHostCheck: true } }; or this way module.exports = { devServer: { public: 'subdomain.domain.ext:port' } }; by placing this code at vue.config.js. As a result use these templates to make your project: https://repl.it/@NEKRA/VueJS https://re2 years ago
Patrity
Patrity
Having this same issue right now. A fix would be great...2 years ago