Giter Club home page Giter Club logo

template-nix's Introduction

A Nix template on Gitpod

This is a nix template configured for ephemeral nix-based cloud development environments on Gitpod.

Next Steps

Click the button below to start a new development environment:

Open in Gitpod

Get Started With Your Own Project

A new project

Click the above "Open in Gitpod" button to start a new workspace. Once you're ready to push your first code changes, Gitpod will guide you to fork this project so you own it.

An existing project

To get started with nix on Gitpod, copy the contents of this folder to your own project. To learn more, please see the Getting Started documentation.

Notes & caveats

When the environment first starts up use the direnv allow command to activate the environment.

See also: An opinionated guide for developers getting things done using the Nix ecosystem.

template-nix's People

Contributors

flokli avatar ghuntley avatar siddhant-k-code avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

template-nix's Issues

Build and containerize the nix-shell at build time

Hi! I was looking at this template and it seems that it installs Nix at build-time and then builds & enters the nix-shell at runtime.

However, it would be nicer if the nix-shell could be built and containerized at build time. Is this possible?

In that case, the container image wouldn't even need to have Nix installed, because it's not required at runtime. This is just like a nix-shell with --pure where Nix is not installed by default. Users who want to have Nix in their development environment can add nix to the nativeBuildInputs in shell.nix.

get rid of direnenv allow

Add direnv whitelist configuration in dockerfile

&& mkdir -p .config/direnv
&& echo '[whitelist]' > .config/direnv/config.toml
&& echo prefix = [ "/workspace" ] >> .config/direnv/config.toml \

Support an "unstable" variant?

Hi, I have a new Dockerfile that I've modified for flakes and a nix-shell ps1 indicator. I'm interested in using this across many projects, and hopefully not having to copy/paste that Dockerfile across projects.

Since I'm still in Docker land and not Nix, that means figuring out infra for publishing a new "nix base" image and then using that as my .gitpod.Dockerfile base.

Does GitPod already have infra for publishing these images regularly, or is it manual? If it's automated, is there interest in having another named/tagged gitpod base image for nix that includes unstable nix?

lots of things don't work inside of a nix-shell

I am inside nixpkgs-wayland's shell environment in an environment based on this GitPod template and am having a smattering of random weird failures that I can't seem to correlate.


strip is /nix/store/fh9f7pr9kxfwvs8lm4479lvhrkzmmkdw-binutils-2.35.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/rhxfzai0ljwa6fiq27s8yjxplc09zsbm-meson-0.58.1/lib  /nix/store/rhxfzai0ljwa6fiq27s8yjxplc09zsbm-meson-0.58.1/bin 
patching script interpreter paths in /nix/store/rhxfzai0ljwa6fiq27s8yjxplc09zsbm-meson-0.58.1
checking for references to /tmp/nix-build-meson-0.58.1.drv-0/ in /nix/store/rhxfzai0ljwa6fiq27s8yjxplc09zsbm-meson-0.58.1...
Rewriting #!/nix/store/yqjhkdarf7p74wcha7aypzsb751n7wl2-python3-3.9.5/bin/python3.9 to #!/nix/store/yqjhkdarf7p74wcha7aypzsb751n7wl2-python3-3.9.5
wrapping `/nix/store/rhxfzai0ljwa6fiq27s8yjxplc09zsbm-meson-0.58.1/bin/meson'...

Builder called die: Cannot wrap '/nix/store/rhxfzai0ljwa6fiq27s8yjxplc09zsbm-meson-0.58.1/bin/meson' because it is not an executable file
Backtrace:

or

+ exit 0
+ rm /tmp/tmp.VWQdM2Mfbx
rm: cannot remove '/tmp/tmp.VWQdM2Mfbx': Operation not permitted


[nix-shell:/workspace/nixpkgs-wayland]$ ls -al /tmp/tmp.VWQdM2Mfbx 
-rw------- 1 gitpod gitpod 0 Jul 27 22:10 /tmp/tmp.VWQdM2Mfbx

[nix-shell:/workspace/nixpkgs-wayland]$ rm /tmp/tmp.VWQdM2Mfbx 
rm: cannot remove '/tmp/tmp.VWQdM2Mfbx': Operation not permitted

So far I can't seem to get much working in general.

Presumably this is executing as a privileged container since I can use sudo, etc. I wonder if it's the base or how nix is setup? Have you tried a nixos-based base container? (I'm not sure how much it takes to fulfill gitpod's workspace requirements)

Failed when opening

I got the following error:

error: syntax error, unexpected DOLLAR_CURLY, expecting ';', at /nix/store/5vs1z0gaws5529mip9d1m5srm66sgd41-nixpkgs-23.11pre527787.e12483116b3b/nixpkgs/pkgs/development/compilers/cudatoolkit/redist/extension.nix:92:65
#11 ERROR: process "/bin/sh -c . /home/gitpod/.nix-profile/etc/profile.d/nix.sh   && nix-env -i git git-lfs" did not complete successfully: exit code: 1
error: failed to solve: process "/bin/sh -c . /home/gitpod/.nix-profile/etc/profile.d/nix.sh   && nix-env -i git git-lfs" did not complete successfully: exit code: 1
{"@type":"type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent","command":"build","error":"exit status 1","file":"build.go:44","func":"func1","level":"error","message":"build failed","serviceContext":{"service":"bob","version":""},"severity":"ERROR","time":"2023-09-27T07:30:48.692878121Z"}
exit

Error: headless task failed: exit status 1

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.