1{ 2 "name": "nixpkgs", 3 "image": "mcr.microsoft.com/devcontainers/universal:2-linux", 4 "features": { 5 "ghcr.io/devcontainers/features/nix:1": { 6 // fails in the devcontainer sandbox, enable sandbox via config instead 7 "multiUser": false, 8 // TODO: nixfmt-rfc-style → nixfmt (once it's in a stable release) 9 // https://github.com/NixOS/nixpkgs/issues/425583 10 "packages": "nixpkgs.nixd,nixpkgs.nixfmt-rfc-style", 11 "useAttributePath": true, 12 "extraNixConfig": "experimental-features = nix-command flakes,sandbox = true" 13 } 14 }, 15 // Fixup permissions inside container. 16 // https://github.com/NixOS/nix/issues/6680#issuecomment-1230902525 17 "postCreateCommand": "sudo apt-get install -y acl", 18 "postStartCommand": "sudo setfacl -k /tmp; if [ -e /dev/kvm ]; then sudo chgrp $(id -g) /dev/kvm; fi", 19 "customizations": { 20 "vscode": { 21 "extensions": [ 22 "jnoortheen.nix-ide" 23 ], 24 "settings": { 25 "[nix]": { 26 "editor.formatOnSave": true 27 }, 28 "nix.enableLanguageServer": true, 29 "nix.serverPath": "nixd" 30 } 31 } 32 }, 33 "remoteEnv": { 34 "NIXPKGS": "/workspaces/nixpkgs" 35 } 36}