summaryrefslogtreecommitdiff
path: root/.devcontainer/devcontainer.json
blob: 21413b4fe79e98eb9392f7200511021200123fca (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  "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,
      "packages": "nixpkgs.nixd,nixpkgs.nixfmt",
      "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"
  }
}