nixpkgs/.devcontainer/devcontainer.json
Matt Sturgeon 33fdeee5d4
.devcontainer: add TODO for nixfmt-rfc-style alias
The alias should be dropped only once `pkgs.nixfmt` is unlikely to be
nixfmt-classic.

I.e. after nixfmt 1.0 is in a stable release, but before the
nixfmt-rfc-style alias starts warning.

See https://github.com/NixOS/nixpkgs/issues/425583
2025-08-06 16:43:06 +01:00

37 lines
1.2 KiB
JSON

{
"name": "nixpkgs",
"image": "mcr.microsoft.com/devcontainers/universal:2-linux",
"features": {
"ghcr.io/devcontainers/features/nix:1": {
// fails in the devcontainer sandbox, enable sandbox via config instead
"multiUser": false,
// TODO: nixfmt-rfc-style → nixfmt (once it's in a stable release)
// https://github.com/NixOS/nixpkgs/issues/425583
"packages": "nixpkgs.nixd,nixpkgs.nixfmt-rfc-style",
"useAttributePath": true,
"extraNixConfig": "experimental-features = nix-command flakes,sandbox = true"
}
},
// Fixup permissions inside container.
// https://github.com/NixOS/nix/issues/6680#issuecomment-1230902525
"postCreateCommand": "sudo apt-get install -y acl",
"postStartCommand": "sudo setfacl -k /tmp; if [ -e /dev/kvm ]; then sudo chgrp $(id -g) /dev/kvm; fi",
"customizations": {
"vscode": {
"extensions": [
"jnoortheen.nix-ide"
],
"settings": {
"[nix]": {
"editor.formatOnSave": true
},
"nix.enableLanguageServer": true,
"nix.serverPath": "nixd"
}
}
},
"remoteEnv": {
"NIXPKGS": "/workspaces/nixpkgs"
}
}