Giter VIP home page Giter VIP logo

nix-devcontainer's People

Contributors

atry avatar offlinehacker avatar rizary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nix-devcontainer's Issues

Improve readme

  • check spelling
  • add description how it works
  • add additional instructions how to use this template
  • information about dotfiles

`writeTextFile` does not work in the devcontainer

Reproduction steps:

  1. Start a Github Codespace for this repository
  2. Open a terminal
    direnv: loading /workspaces/nix-devcontainer/.envrc
    these 70 paths will be fetched (216.61 MiB download, 956.36 MiB unpacked):
      /nix/store/02bgry99266rwag84b4dy48siy8dq9qd-perl5.34.0-Test-RequiresInternet-0.05
      /nix/store/0hyhkjp6lh67ypbqdp5p4v3zl70ihsdr-binutils-wrapper-2.35.2
      /nix/store/10ixax5vz5a3mzinkxxp2llkbpw4k3qc-readline-6.3p08
      /nix/store/13b8kc6nxq316yfrhrprzkcw9m84zvbw-gcc-10.3.0
      /nix/store/166jpssn6pmvk4l65vam5r44a8aw1wd2-docker-compose-2.0.1
      /nix/store/16n1xyhvnd6d7rg1xbac78c6f3bcyvax-libssh2-1.10.0
      /nix/store/1qqvh3p1xsxnr8s4jkq1jbzpjawkpw7m-perl5.34.0-HTTP-Message-6.26
      /nix/store/26fqlpj1bv8fqgc3x399qrvac6fvjqn2-patch-2.7.6
      /nix/store/2aj89ra1ykpsq1skpa412ik4shix54n3-perl5.34.0-HTTP-Negotiate-6.01
      /nix/store/2j8d15dahpiz56wd1r197zgpgdi6syzf-perl5.34.0-Try-Tiny-0.30
      /nix/store/2vvsynpbmqjqmzi4f5l2k60z2cq8pfws-kbd-2.4.0
      /nix/store/321lz4qlsx691zan7fhkjbx6q5pk3pnr-sqlite-3.36.0
      /nix/store/3dkyq99l7cv9d1qhy9pikx68kk2gjlkl-git-2.33.3
      /nix/store/3nsyypn767n6svhhm2aw5jy40xzsq13g-pcre2-10.37
      /nix/store/48z1s3ihy3csjlasbfgc592x99hb5aqq-docker-buildx-0.6.3
      /nix/store/4q3jfyza12ydws0lk7pfkgpls5xi729d-xz-5.2.5
      /nix/store/51bhq61bqfbf5ay4m0g925hk4dk72ny0-docker-20.10.14
      /nix/store/59j7n6qfgmvkxaxavfwv58yxqb2pjgh0-perl5.34.0-URI-5.05
      /nix/store/5wrmyb8q6bzd1nnyp0q5vm6llb1jwjgx-perl5.34.0-FCGI-ProcManager-0.28
      /nix/store/642h9i68rh2jc00b9prqbslmqpbhaqgr-pcre-8.44
      /nix/store/7iv8vfrk1gyns0rxhr72h6b1lszg0xgn-patchelf-0.13
      /nix/store/7qc9vl7l1ka94f7c864hy6arri5891dk-perl5.34.0-HTML-Tagset-3.20
      /nix/store/8gwhq6w7waw27qn0arf5jzmz425ga0x5-openssl-1.1.1o
      /nix/store/8na450crfa3ww7aqm962cv4wbffg1p62-perl5.34.0-TimeDate-2.33
      /nix/store/8s9195da7hqyvl89qzd1604q5vfawccb-readline-8.1p0
      /nix/store/8x25mhcdrnglaj55n80w8pnkwaqcp3sw-binutils-2.35.2
      /nix/store/a1xyj4h0h6ada51g6raf69f9z678y242-perl5.34.0-HTML-TagCloud-0.38
      /nix/store/ap1y75r44h84l6alcn2qz0wpl1f8kz6a-perl5.34.0-HTTP-Date-6.05
      /nix/store/aw25jwfd7f6mi2fzh2dvziv3gg4bglzl-kexec-tools-2.0.23
      /nix/store/bafjhxxa3rpy5m98sc86mis2vfy1bxzn-kmod-29
      /nix/store/c77rram4jd4c81mzvqb5wbdfk69v500z-xz-5.2.5-bin
      /nix/store/c8znzla3i7zdh3q369dapy2bwkh24y9r-perl5.34.0-CGI-4.51
      /nix/store/cd1zc2327zfych72cb1gc7hyk80h2akz-perl5.34.0-LWP-MediaTypes-6.04
      /nix/store/dxr63dkq0p1xqwi2zbjv6aj81hrkmw7k-zstd-1.5.2-bin
      /nix/store/dyqg5rscbzic93c9haligrp3y1pj8w15-go-1.16.13
      /nix/store/fhrhinafqlm2r2q9s65g96qzadrm9qch-perl5.34.0-HTTP-Daemon-6.01
      /nix/store/fvclchzwcqhckx2j43ymqbl0m58278kh-curl-7.79.1
      /nix/store/gqicc6kxah7f8j54hp80qxpk16898lj9-bash-interactive-5.1-p8
      /nix/store/gvvw3shxbymvwqqc8z2zb84bh5dbzn99-bash-interactive-5.1-p16-dev
      /nix/store/hdqd3p5izlag3lb3km5qf96s3jg1hsyz-systemd-minimal-249.7
      /nix/store/hihv37mizj3xglhykjqxlr5gw724dhbm-gcc-wrapper-10.3.0
      /nix/store/hq0dj7mrf3nn4xppyg4ypmm2jb2cpfla-gnugrep-3.7
      /nix/store/hqw4095nkcc2f0snvfps2yh6y98ay7ss-util-linux-2.37.4-bin
      /nix/store/hqxi1dyr1vrpgjkyqh94pvfipcd73pzy-docker-plugins
      /nix/store/hrl9vphamg65r77296kj272a1wn13qbm-libfido2-1.8.0
      /nix/store/ibgbp5b8djfj6xhsjxr7i0lrs0cw3h87-perl5.34.0-libwww-perl-6.49
      /nix/store/ikpfh53kar73mf98gy0rqmdy2h03bkbh-perl5.34.0-Encode-Locale-1.05
      /nix/store/is04rv2r68acsas8jq8d0ik7fnmcs0g9-perl5.34.0-WWW-RobotRules-6.02
      /nix/store/izida45x5809k8pxx7nwnlnvfgi3k6q3-tzdata-2022a
      /nix/store/kxvk23ddqc515xlrds1a818qsqcf8faj-zstd-1.5.2
      /nix/store/l92k17lisyv8m1wc0i1sr112yh9ir50g-perl5.34.0-CGI-Fast-2.15
      /nix/store/n1i6nf02jdwq84c7yz840jvif78cx2ql-util-linux-2.37.4-lib
      /nix/store/nfbxdafi7y4r780lvba4j0h30b8lhbx5-zlib-1.2.12
      /nix/store/nm84y23si9cf5afwhjk5117i88khlk1a-shadow-4.8.1
      /nix/store/npi66rs8m27qhjh1gbxwnycrj5v3dahw-readline-8.1p2
      /nix/store/nvxp3xmlrxj9sw66dk7l0grz9m4889jn-python3-3.9.12
      /nix/store/nym7mlhprxsld2c0p6gjmmiy7al8mi49-rnix-lsp-0.2.3
      /nix/store/qxs7qq6x296dmlaf4cpqx7ay7qw0qa9w-perl5.34.0-IO-HTML-1.004
      /nix/store/r2lllb3drbrakll6nwyajcjjmd19g7hl-bash-interactive-5.1-p16
      /nix/store/rg1m4j567q7l5vbbgbwnk05cj2g16j54-perl5.34.0-Net-HTTP-6.19
      /nix/store/rl79by6imjdgjdrmq8h3w5jax9ifn59s-perl5.34.0-HTML-Parser-3.75
      /nix/store/rvphzz60742adrkjr4dq113wx7amah2m-perl5.34.0-TermReadKey-2.38
      /nix/store/s6fq89zsw9wildllcbz4g83rcbvqp9zz-perl5.34.0-File-Listing-6.14
      /nix/store/sd3b5l9qhvk2fmawsjzvm83hym1akg4x-openssh-8.8p1
      /nix/store/snvrd4gahbx3m1g4as87jn63dv0akq5p-perl-5.34.0
      /nix/store/wpkwwh474q858zl8235y4k9r1vdrj9lb-perl5.34.0-Test-Needs-0.002006
      /nix/store/x2sy8g83kg7x397p9igczn57wgqw6hfx-perl5.34.0-HTTP-Cookies-6.09
      /nix/store/x9407cqwbb57xjn29km2b1jsmghr38yr-perl5.34.0-FCGI-0.79
      /nix/store/y24bjff2mim83sf2dymbm5a51x8s05kn-perl5.34.0-Test-Fatal-0.016
      /nix/store/ydi7m5hgm1qd4r67z0vp8vjr14s8jh3p-stdenv-linux
    copying path '/nix/store/5wrmyb8q6bzd1nnyp0q5vm6llb1jwjgx-perl5.34.0-FCGI-ProcManager-0.28' from 'https://cache.nixos.org'...
    copying path '/nix/store/8gwhq6w7waw27qn0arf5jzmz425ga0x5-openssl-1.1.1o' from 'https://cache.nixos.org'...
    copying path '/nix/store/26fqlpj1bv8fqgc3x399qrvac6fvjqn2-patch-2.7.6' from 'https://cache.nixos.org'...
    copying path '/nix/store/7iv8vfrk1gyns0rxhr72h6b1lszg0xgn-patchelf-0.13' from 'https://cache.nixos.org'...
    copying path '/nix/store/642h9i68rh2jc00b9prqbslmqpbhaqgr-pcre-8.44' from 'https://cache.nixos.org'...
    copying path '/nix/store/3nsyypn767n6svhhm2aw5jy40xzsq13g-pcre2-10.37' from 'https://cache.nixos.org'...
    copying path '/nix/store/hq0dj7mrf3nn4xppyg4ypmm2jb2cpfla-gnugrep-3.7' from 'https://cache.nixos.org'...
    copying path '/nix/store/snvrd4gahbx3m1g4as87jn63dv0akq5p-perl-5.34.0' from 'https://cache.nixos.org'...
    copying path '/nix/store/ikpfh53kar73mf98gy0rqmdy2h03bkbh-perl5.34.0-Encode-Locale-1.05' from 'https://cache.nixos.org'...
    copying path '/nix/store/x9407cqwbb57xjn29km2b1jsmghr38yr-perl5.34.0-FCGI-0.79' from 'https://cache.nixos.org'...
    copying path '/nix/store/a1xyj4h0h6ada51g6raf69f9z678y242-perl5.34.0-HTML-TagCloud-0.38' from 'https://cache.nixos.org'...
    copying path '/nix/store/7qc9vl7l1ka94f7c864hy6arri5891dk-perl5.34.0-HTML-Tagset-3.20' from 'https://cache.nixos.org'...
    copying path '/nix/store/qxs7qq6x296dmlaf4cpqx7ay7qw0qa9w-perl5.34.0-IO-HTML-1.004' from 'https://cache.nixos.org'...
    copying path '/nix/store/cd1zc2327zfych72cb1gc7hyk80h2akz-perl5.34.0-LWP-MediaTypes-6.04' from 'https://cache.nixos.org'...
    copying path '/nix/store/rvphzz60742adrkjr4dq113wx7amah2m-perl5.34.0-TermReadKey-2.38' from 'https://cache.nixos.org'...
    copying path '/nix/store/wpkwwh474q858zl8235y4k9r1vdrj9lb-perl5.34.0-Test-Needs-0.002006' from 'https://cache.nixos.org'...
    copying path '/nix/store/02bgry99266rwag84b4dy48siy8dq9qd-perl5.34.0-Test-RequiresInternet-0.05' from 'https://cache.nixos.org'...
    copying path '/nix/store/8na450crfa3ww7aqm962cv4wbffg1p62-perl5.34.0-TimeDate-2.33' from 'https://cache.nixos.org'...
    copying path '/nix/store/2j8d15dahpiz56wd1r197zgpgdi6syzf-perl5.34.0-Try-Tiny-0.30' from 'https://cache.nixos.org'...
    copying path '/nix/store/ap1y75r44h84l6alcn2qz0wpl1f8kz6a-perl5.34.0-HTTP-Date-6.05' from 'https://cache.nixos.org'...
    copying path '/nix/store/y24bjff2mim83sf2dymbm5a51x8s05kn-perl5.34.0-Test-Fatal-0.016' from 'https://cache.nixos.org'...
    copying path '/nix/store/s6fq89zsw9wildllcbz4g83rcbvqp9zz-perl5.34.0-File-Listing-6.14' from 'https://cache.nixos.org'...
    copying path '/nix/store/59j7n6qfgmvkxaxavfwv58yxqb2pjgh0-perl5.34.0-URI-5.05' from 'https://cache.nixos.org'...
    copying path '/nix/store/10ixax5vz5a3mzinkxxp2llkbpw4k3qc-readline-6.3p08' from 'https://cache.nixos.org'...
    copying path '/nix/store/1qqvh3p1xsxnr8s4jkq1jbzpjawkpw7m-perl5.34.0-HTTP-Message-6.26' from 'https://cache.nixos.org'...
    copying path '/nix/store/rg1m4j567q7l5vbbgbwnk05cj2g16j54-perl5.34.0-Net-HTTP-6.19' from 'https://cache.nixos.org'...
    copying path '/nix/store/rl79by6imjdgjdrmq8h3w5jax9ifn59s-perl5.34.0-HTML-Parser-3.75' from 'https://cache.nixos.org'...
    copying path '/nix/store/x2sy8g83kg7x397p9igczn57wgqw6hfx-perl5.34.0-HTTP-Cookies-6.09' from 'https://cache.nixos.org'...
    copying path '/nix/store/c8znzla3i7zdh3q369dapy2bwkh24y9r-perl5.34.0-CGI-4.51' from 'https://cache.nixos.org'...
    copying path '/nix/store/fhrhinafqlm2r2q9s65g96qzadrm9qch-perl5.34.0-HTTP-Daemon-6.01' from 'https://cache.nixos.org'...
    copying path '/nix/store/l92k17lisyv8m1wc0i1sr112yh9ir50g-perl5.34.0-CGI-Fast-2.15' from 'https://cache.nixos.org'...
    copying path '/nix/store/2aj89ra1ykpsq1skpa412ik4shix54n3-perl5.34.0-HTTP-Negotiate-6.01' from 'https://cache.nixos.org'...
    copying path '/nix/store/is04rv2r68acsas8jq8d0ik7fnmcs0g9-perl5.34.0-WWW-RobotRules-6.02' from 'https://cache.nixos.org'...
    copying path '/nix/store/8s9195da7hqyvl89qzd1604q5vfawccb-readline-8.1p0' from 'https://cache.nixos.org'...
    copying path '/nix/store/ibgbp5b8djfj6xhsjxr7i0lrs0cw3h87-perl5.34.0-libwww-perl-6.49' from 'https://cache.nixos.org'...
    copying path '/nix/store/gqicc6kxah7f8j54hp80qxpk16898lj9-bash-interactive-5.1-p8' from 'https://cache.nixos.org'...
    copying path '/nix/store/npi66rs8m27qhjh1gbxwnycrj5v3dahw-readline-8.1p2' from 'https://cache.nixos.org'...
    copying path '/nix/store/nym7mlhprxsld2c0p6gjmmiy7al8mi49-rnix-lsp-0.2.3' from 'https://cache.nixos.org'...
    copying path '/nix/store/r2lllb3drbrakll6nwyajcjjmd19g7hl-bash-interactive-5.1-p16' from 'https://cache.nixos.org'...
    copying path '/nix/store/nm84y23si9cf5afwhjk5117i88khlk1a-shadow-4.8.1' from 'https://cache.nixos.org'...
    copying path '/nix/store/gvvw3shxbymvwqqc8z2zb84bh5dbzn99-bash-interactive-5.1-p16-dev' from 'https://cache.nixos.org'...
    copying path '/nix/store/izida45x5809k8pxx7nwnlnvfgi3k6q3-tzdata-2022a' from 'https://cache.nixos.org'...
    copying path '/nix/store/n1i6nf02jdwq84c7yz840jvif78cx2ql-util-linux-2.37.4-lib' from 'https://cache.nixos.org'...
    copying path '/nix/store/48z1s3ihy3csjlasbfgc592x99hb5aqq-docker-buildx-0.6.3' from 'https://cache.nixos.org'...
    copying path '/nix/store/166jpssn6pmvk4l65vam5r44a8aw1wd2-docker-compose-2.0.1' from 'https://cache.nixos.org'...
    copying path '/nix/store/dyqg5rscbzic93c9haligrp3y1pj8w15-go-1.16.13' from 'https://cache.nixos.org'...
    copying path '/nix/store/hqxi1dyr1vrpgjkyqh94pvfipcd73pzy-docker-plugins' from 'https://cache.nixos.org'...
    copying path '/nix/store/4q3jfyza12ydws0lk7pfkgpls5xi729d-xz-5.2.5' from 'https://cache.nixos.org'...
    copying path '/nix/store/51bhq61bqfbf5ay4m0g925hk4dk72ny0-docker-20.10.14' from 'https://cache.nixos.org'...
    copying path '/nix/store/c77rram4jd4c81mzvqb5wbdfk69v500z-xz-5.2.5-bin' from 'https://cache.nixos.org'...
    copying path '/nix/store/nfbxdafi7y4r780lvba4j0h30b8lhbx5-zlib-1.2.12' from 'https://cache.nixos.org'...
    copying path '/nix/store/kxvk23ddqc515xlrds1a818qsqcf8faj-zstd-1.5.2' from 'https://cache.nixos.org'...
    copying path '/nix/store/8x25mhcdrnglaj55n80w8pnkwaqcp3sw-binutils-2.35.2' from 'https://cache.nixos.org'...
    copying path '/nix/store/13b8kc6nxq316yfrhrprzkcw9m84zvbw-gcc-10.3.0' from 'https://cache.nixos.org'...
    copying path '/nix/store/0hyhkjp6lh67ypbqdp5p4v3zl70ihsdr-binutils-wrapper-2.35.2' from 'https://cache.nixos.org'...
    copying path '/nix/store/aw25jwfd7f6mi2fzh2dvziv3gg4bglzl-kexec-tools-2.0.23' from 'https://cache.nixos.org'...
    copying path '/nix/store/hihv37mizj3xglhykjqxlr5gw724dhbm-gcc-wrapper-10.3.0' from 'https://cache.nixos.org'...
    copying path '/nix/store/bafjhxxa3rpy5m98sc86mis2vfy1bxzn-kmod-29' from 'https://cache.nixos.org'...
    copying path '/nix/store/16n1xyhvnd6d7rg1xbac78c6f3bcyvax-libssh2-1.10.0' from 'https://cache.nixos.org'...
    copying path '/nix/store/321lz4qlsx691zan7fhkjbx6q5pk3pnr-sqlite-3.36.0' from 'https://cache.nixos.org'...
    copying path '/nix/store/fvclchzwcqhckx2j43ymqbl0m58278kh-curl-7.79.1' from 'https://cache.nixos.org'...
    copying path '/nix/store/nvxp3xmlrxj9sw66dk7l0grz9m4889jn-python3-3.9.12' from 'https://cache.nixos.org'...
    copying path '/nix/store/ydi7m5hgm1qd4r67z0vp8vjr14s8jh3p-stdenv-linux' from 'https://cache.nixos.org'...
    copying path '/nix/store/hqw4095nkcc2f0snvfps2yh6y98ay7ss-util-linux-2.37.4-bin' from 'https://cache.nixos.org'...
    copying path '/nix/store/dxr63dkq0p1xqwi2zbjv6aj81hrkmw7k-zstd-1.5.2-bin' from 'https://cache.nixos.org'...
    copying path '/nix/store/2vvsynpbmqjqmzi4f5l2k60z2cq8pfws-kbd-2.4.0' from 'https://cache.nixos.org'...
    copying path '/nix/store/hdqd3p5izlag3lb3km5qf96s3jg1hsyz-systemd-minimal-249.7' from 'https://cache.nixos.org'...
    copying path '/nix/store/hrl9vphamg65r77296kj272a1wn13qbm-libfido2-1.8.0' from 'https://cache.nixos.org'...
    copying path '/nix/store/sd3b5l9qhvk2fmawsjzvm83hym1akg4x-openssh-8.8p1' from 'https://cache.nixos.org'...
    copying path '/nix/store/3dkyq99l7cv9d1qhy9pikx68kk2gjlkl-git-2.33.3' from 'https://cache.nixos.org'...
    direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +HOST_PATH +IN_NIX_SHELL +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_BUILD_TOP +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_INDENT_MAKE +NIX_LDFLAGS +NIX_STORE +NM +OBJCOPY +OBJDUMP +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +TEMP +TEMPDIR +TMP +TMPDIR +XDG_DATA_DIRS +buildInputs +builder +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +name +nativeBuildInputs +nobuildPhase +out +outputs +patches +phases +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH
    
  3. Build writeTextFile from nix repl
    code@f6df6ced17f3:/workspaces/nix-devcontainer$ nix repl
    Welcome to Nix 2.8.1. Type :? for help.
    
    nix-repl> :l <nixpkgs>
    Added 16450 variables.
    
    nix-repl> :b writeTextFile { name="file.txt"; text="content"; }
    error: suspicious ownership or permission on '/nix/store/z61znbk1anz48hbsq1i9wcr6z4sdqj79-file.txt' for output 'out'; rejecting this build output
    [0 built (1 failed), 22 copied (22.3 MiB), 5.4 MiB DL]
    nix-repl> 
    

Cache of /nix only seems to work with docker compose

The example devcontainer.json in the source code use docker compose. It works for me as expected - if I rebuild the container the /nix/store is not downloaded again. If I use the example from the README with "dockerFile": "Dockerfile" etc, then the /nix/store is downloaded on every container startup, even though the same volume is definitely mounted (per docker inspect). Any idea why that is, or what I am doing wrong?

P.S. I love what you did here. I might use a simplified version until I understand what all the moving parts are, but it's all great stuff.

Problem with devcontainer.json

devcontainer.json does not build in JetBrains IDE 2024.1 and VSCode.

JetBrains IDE Welcome screen -> DevContainers -> New DevContainer (from VCS Project, Docker must be installed.) Insert the git@ link of the repository with devcontainer.json. -> "Build container and Continue"
image
image

Add rust example configuration

Hi, thank you so much for this image.

I'll add this in, just adding this as a reminder.
I already have one running locally.

Nix builds fail in codespaces

$ nix-build --keep-failed -E 'with import <nixpkgs> {}; writeText "a" "test1234"'
this derivation will be built:
  /nix/store/mn2fsg0fq7ssiwa7p4ra7if14ny82dlk-a.drv
these 28 paths will be fetched (8.34 MiB download, 43.30 MiB unpacked):
  /nix/store/0b6zhyagwcps9qq67sd0qwmsshnjsqs0-findutils-4.9.0
...
  /nix/store/zn25l68l2k0zgsf4vgvyrwsss0axa250-gnumake-4.3
copying path '/nix/store/3j918i1nbwhby0y38bn2r438rjhh8f4d-bash-5.1-p16' from 'https://cache.nixos.org'...
...
copying path '/nix/store/40hd631867iyazhklp24xq9lblpzjvsy-stdenv-linux' from 'https://cache.nixos.org'...
building '/nix/store/mn2fsg0fq7ssiwa7p4ra7if14ny82dlk-a.drv'...
note: keeping build directory '/tmp/nix-build-a.drv-0'
error: suspicious ownership or permission on '/nix/store/3s3d96ls775w952lh5l3iqj76lijzj3w-a' for output 'out'; rejecting this build output

E.g. see NixOS/nix#6680. This comment has a solution: NixOS/nix#6680 (comment), viz run setfacl -k /tmp. Not sure yet if it has to be a postCreateCommand.

UPDATE: setfacl -k /tmp works for me in Dockerfile or in a postCreateCommand.

UPDATE(2): I tried again and it didn't work in Dockerfile. I think maybe the volume for /nix was caching the build when I tried before. So that would say we need an apt-get install acl in Dockerfile and a postCreateCommand, which is less nice for this project, but I can deal with it.

Mention caveat of `network_mode=host` when running docker-in-docker

I have a rust project using this attached configuration.

Setting network_mode=host was the only way I could download crates for compilation.
If it is in the users cache it will use that.

Should we mention something like this in the docs?

docker-compose.yaml
version: "3"

services:
  development:
    build:
      dockerfile: ./Dockerfile
      args:
        USER_UID: ${USER_UID:-1000}
        USER_GID: ${USER_GID:-1000}
    environment:
      DOCKER_HOST: tcp://localhost:2375
      PRELOAD_EXTENSIONS: "arrterian.nix-env-selector"
    volumes:
      - ..:/workspace:cached
      - nix:/nix
    security_opt:
      - label:disable
    network_mode: host

  docker:
    image: docker:dind-rootless
    environment:
      DOCKER_TLS_CERTDIR: ""
      DOCKER_DRIVER: overlay2
    privileged: true
    volumes:
      - ..:/workspace:cached
      - nix:/nix
      - docker:/var/lib/docker
    security_opt:
      - label:disable
    network_mode: host

volumes:
  nix:
  docker:
shell.nix
with builtins;
let
  rust_overlay = import (fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz");

  # Pinning nixpkgs
  # https://github.com/waynevanson/nixpkgs/commits/d66b5294264c19e7ba7f9097356f69c32cbcb24a
  # which contains the following PR's
  # - aws-lambda-cli>=1.7 - cargo-lambda support            - https://github.com/NixOS/nixpkgs/pull/224039
  # - cargo-lambda        - upgrade required (forgot why)   - https://github.com/NixOS/nixpkgs/pull/224814
  pinned_pkgs = import (fetchTarball "https://github.com/waynevanson/nixpkgs/tarball/d66b5294264c19e7ba7f9097356f69c32cbcb24a");

  pkgs = pinned_pkgs {
    overlays = [ rust_overlay ];
  };

  # use toolchain from workspace.
  rust_toolchains = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;

in
with pkgs;
mkShell
{
  nativeBuildInputs = [
    # nix
    nixpkgs-fmt
    rnix-lsp
    docker-client
    gnumake

    # rust
    rust_toolchains

    cargo-cross
    cargo-lambda
    cargo-make
    cargo-xbuild

    cargo-tarpaulin
    kcov


    # rust-dependencies
    pkg-config
    openssl

    #   
    aws-sam-cli
    rustup

    # js
    yarn
  ];
}

Base docker image with flakes support

Currently the default base image is built with latest stable nix. Since more and more users use flakes and stable nix does not have flakes support a new docker image should be created.

Create a separate tagged image that has flakes support. Also create an example, so developers know how to use that image.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.