I was here. It really works now.
FROM mcr.microsoft.com/vscode/devcontainers/base:0.202.7-bullseye
ARG USER=vscode
ARG UID=1000
ARG GID=${UID}
ARG NIX_VERSION=2.14.1
ARG NIX_INSTALLER=https://releases.nixos.org/nix/nix-${NIX_VERSION}/install
ARG CHANNEL_URL=https://github.com/NixOS/nixpkgs/archive/aaa1c973c8c189195e1b1a702d3b74dbcde91538.tar.gz
ARG CACHIX_NAME=composable-community
SHELL [ "/bin/bash", "-o", "pipefail", "-o", "errexit", "-c" ]
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install --yes --no-install-recommends \
ca-certificates \
curl \
sudo \
xz-utils
RUN usermod --append --groups sudo ${USER} --shell /bin/bash && \
This file has been truncated. show original
{
"name": "composable",
"hostRequirements": {
"memory": "20gb",
"cpus": 8
},
"build": {
"dockerfile": "Dockerfile",
"context": "."
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
},
"postStartCommand": "sudo chmod +x /home/vscode/.nix-profile/bin/setfacl && sudo chmod 1777 /tmp/ && sudo /home/vscode/.nix-profile/bin/setfacl --remove-default /tmp",
"customizations": {
"vscode": {
"extensions": [
"adam-bender.commit-message-editor",
"bbenoist.Nix",
"bierner.markdown-mermaid",
This file has been truncated. show original
{ self, withSystem, inputs, lib, options, flake-parts-lib, specialArgs, config
}: {
flake = {
homeConfigurations = let user = "vscode";
in (withSystem "x86_64-linux"
({ config, self', inputs', pkgs, devnetTools, this, subnix, ... }: {
vscode = let codespace = with pkgs; [ cachix acl direnv ];
in self.inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [{
home = {
username = user;
sessionVariables = subnix.subattrs;
homeDirectory = "/home/${user}";
stateVersion = "22.11";
packages = with pkgs;
with self'.packages;
[
clang
nodejs
This file has been truncated. show original
We fixed lot of things, including backing same nix store cache into docker as used by default dev shell and making tmp/nix folder work. So I can nix develop/run/build and arion docker in Codespace pretty well.
The only still fixing how to init envvars well. As far as I see there is question on how to do it with home-manager
Started here Home-manager doesn't seem to recognize sessionVariables
Ended trying to run on Codespace hooks source /home/vscode/.nix-profile/etc/profile.d/hm-session-vars.sh
, always fails.
2 Likes