zombiezen / codespaces-nix Goto Github PK
View Code? Open in Web Editor NEWDev Container base image with Nix
License: The Unlicense
Dev Container base image with Nix
License: The Unlicense
I commonly use direnv + Lorri to provide Nix shells for my projects. I'd like to verify that lorri watch
can be used without setting up a daemon or otherwise provide a convenient setup for using it.
When using the image without any features on Codespaces, it fails with a Git not found error. This is being masked by the docker-from-docker feature, which weirdly installs Git. I suspect the not found error is because the clone is occurring as root, which won't have the Nix profile set up isn't done in a login shell.
In reading the Nix installer script, I believe that once the tarball is extracted, one does not need curl or xz-utils anymore. I'm imagining I can pull out the download step into a separate image then reference it using RUN --mount
.
After my dotfiles are installed (which invokes nix-env --install
), any subsequent attempt to install more derivations results in an error message of:
error: this derivation has bad 'meta.outputsToInstall'
I don't have a minimal reproduction case, but noting it here until I get a handle on the problem.
Getting this log when trying to use 0.1.1-alpha1:
2022-11-12 19:37:04.509Z: docker: Error response from daemon: invalid mount config for type "tmpfs": field Source must not be specified.
2022-11-12 19:37:04.509Z: See 'docker run --help'.
2022-11-12 19:37:04.510Z: Stop (37 ms): Run: docker run --sig-proxy=false -a STDOUT -a STDERR --mount type=bind,src=/var/lib/docker/codespacemount/workspace,dst=/workspaces --mount type=tmpfs,src=undefined,dst=/run --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker-host.sock --mount source=/root/.codespaces/shared,target=/workspaces/.codespaces/shared,type=bind --mount source=/var/lib/docker/codespacemount/.persistedshare,target=/workspaces/.codespaces/.persistedshare,type=bind --mount source=/.codespaces/agent/mount,target=/.codespaces/bin,type=bind --mount source=/mnt/containerTmp,target=/tmp,type=bind --mount type=bind,src=/.codespaces/agent/mount/cache,dst=/vscode -l Type=codespaces -e CODESPACES=true -e ContainerVersion=12 -e RepositoryName=codespaces-nix --label ContainerVersion=12 --hostname codespaces-fe1f4b --add-host codespaces-fe1f4b:127.0.0.1 --cap-add sys_nice --network host --entrypoint /bin/sh vsc-codespaces-nix-644884b3d78046d30a6c40bd1e516587-features -c echo Container started
While in development and strictly in Docker, the Nix installation appears correct, but I've run into the ACL issue again. This time, I'm now able to isolate it the Codespaces /tmp
mount: it's not anything about how the image is built.
$ getfacl /tmp
getfacl: Removing leading '/' from absolute path names
# file: tmp
# owner: root
# group: root
# flags: --t
user::rwx
group::r-x
other::rwx
default:user::rwx
default:group::r-x
default:other::rw-
The reproduction case:
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/d8f2c4d846a2e65ad3f5a5e842b672f0b81588a2.tar.gz") {}
}:
pkgs.writeText "foo.txt" ''
Hello, World!
''
This ends up resulting in:
$ NIX_REMOTE=daemon nix-build ./foosrc -A hiFile
this derivation will be built:
/nix/store/8xs8zafsi7vf45c2kd13w36jlivqak0b-foo.txt.drv
building '/nix/store/8xs8zafsi7vf45c2kd13w36jlivqak0b-foo.txt.drv'...
error: suspicious ownership or permission on '/nix/store/yb1rykk88bx9psfbwdk1ysh3m905dc1n-foo.txt' for output 'out'; rejecting this build output
$ ls -l /nix/store/yb1rykk88bx9psfbwdk1ysh3m905dc1n-foo.txt
-rw-r--rw- 1 nixbld1 nixbld 14 Nov 18 15:56 /nix/store/yb1rykk88bx9psfbwdk1ysh3m905dc1n-foo.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.