ResumeI am currently trying to install dot-net-core-sdk 2.0 with the Nix package manager in NixOs.I am very new to both NixOs, Nix, bash scripting and stuff like ELF. Yet I think I've successfully managed to create a valid Nix package description for dot-net-core-sdk 2.0.However, when I try to create a new console project it complains that it can't find the console template:No templates matched the input template name: console.The long story...I have defined my Nix package and build script as follows:dotnet-sdk.nixwith import <nixpkgs> {};stdenv.mkDerivation {  name = dotnet-sdk-2.0;  builder = ./builder.sh;  libPath = stdenv.lib.makeLibraryPath    [ lttng-tools kerberos zlib gettext openssl icu libunwind eject stdenv.cc.cc glib ];  src = fetchurl {    url = https://download.microsoft.com/download/1/B/4/1B4DE605-8378-47A5-B01B-2C79D6C55519/dotnet-sdk-2.0.0-linux-x64.tar.gz;    sha256 = 6059a6f72fb7aa6205ef4b52583e9c041fd128e768870a0fc4a33ed84c98ca6b;  };}builder.shsource $stdenv/setupmkdir -p $out/dotnet-sdkecho unpacking $src...tar xvfa $src -C $out/dotnet-sdkecho unpacking dotnet-sdk...p=$out/libexec/dotnetmkdir -p $out/libexecmv $out/dotnet-sdk $pls -lrth $ppatchelf --interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --force-rpath --set-rpath $libPath --debug $p/dotnetecho libPathecho $libPathmkdir -p $out/binln -s $p/dotnet $out/bin/dotnetI can successfully build the package with$ sudo nix-build dotnet-sdk.nix Which results in a long output that ends with...unpacking dotnet-sdk...total 136K-rw-r--r-- 1 nixbld1 nixbld 8.0K Jul 20 23:06 ThirdPartyNotices.txt-rw-r--r-- 1 nixbld1 nixbld 1.1K Jul 20 23:06 LICENSE.txt-rwxr-xr-x 1 nixbld1 nixbld 104K Jul 20 23:16 dotnetdrwxr-xr-x 3 nixbld1 nixbld 4.0K Aug  3 19:34 storedrwxr-xr-x 3 nixbld1 nixbld 4.0K Aug  3 19:34 shareddrwxr-xr-x 3 nixbld1 nixbld 4.0K Aug  3 19:34 sdkdrwxr-xr-x 3 nixbld1 nixbld 4.0K Aug  3 19:34 hostdrwxr-xr-x 4 nixbld1 nixbld 4.0K Aug  3 19:34 additionalDepspatching ELF file `/nix/store/f1sankahbj7pss7vjrvbmng9z7gd08a6-dotnet-sdk-2.0/libexec/dotnet/dotnet'Kernel page size is 4096 bytesnew rpath is `/nix/store/xdv40bsxp4c7m2nw63nrnkadmivczk24-lttng-tools-2.9.3/lib:/nix/store/b7yiqkykhj3lr7dlb3v81rsdasjg32jw-libkrb5-1.15/lib:/nix/store/sg6ri2jj92sbv7f4rvchzr00d24pi4nq-zlib-1.2.11/lib:/nix/store/s70cbg1lh45h3gl6xplz6bi2qdszi2cf-gettext-0.19.8/lib:/nix/store/b6d4mxvj5wdnf28lpww73pllmm0zd2nv-openssl-1.0.2l/lib:/nix/store/03gqmzrbh1pr5izy24gmyw1bfdzpy6q8-icu4c-58.2/lib:/nix/store/f4xflmvgszhrwa1r1jn5fddz8j196qzv-libunwind-1.1/lib:/nix/store/awxn3kfww8hjnd1pyji4zdmmi2x3kvzb-util-linux-2.29.2/lib:/nix/store/lc9cdddv2xv45ighz8znsanjfgkcdgbx-gcc-5.4.0-lib/lib:/nix/store/75pmwxf02m6i4vd3b0iybc3w54xf4r2z-glib-2.50.3/lib'rpath is too long, resizing...DT_NULL index is 28replacing section `.dynamic' with size 560replacing section `.dynstr' with size 22942replacing section `.interp' with size 80this is an executableusing replaced section `.interp'using replaced section `.dynstr'using replaced section `.dynamic'last replaced is 22looking at section `.interp'looking at section `.note.ABI-tag'replacing section `.note.ABI-tag' which is in the waylooking at section `.note.gnu.build-id'replacing section `.note.gnu.build-id' which is in the waylooking at section `.hash'replacing section `.hash' which is in the waylooking at section `.dynsym'replacing section `.dynsym' which is in the waylooking at section `.dynstr'looking at section `.gnu.version'first reserved offset/addr is 0x8a38/0x408a38first page is 0x400000needed space is 36624needed space is 36680needed pages is 1changing alignment of program header 2 from 2097152 to 4096changing alignment of program header 3 from 2097152 to 4096clearing first 38856 bytesrewriting section `.dynamic' from offset 0x19da8 (size 544) to offset 0x270 (size 560)rewriting section `.dynstr' from offset 0x4308 (size 22320) to offset 0x4a0 (size 22942)rewriting section `.dynsym' from offset 0x1d10 (size 9720) to offset 0x5e40 (size 9720)rewriting section `.hash' from offset 0x1298 (size 2680) to offset 0x8438 (size 2680)rewriting section `.interp' from offset 0x1238 (size 28) to offset 0x8eb0 (size 80)rewriting section `.note.ABI-tag' from offset 0x1254 (size 32) to offset 0x8f00 (size 32)rewriting section `.note.gnu.build-id' from offset 0x1274 (size 36) to offset 0x8f20 (size 36)rewriting symbol table section 3libPath/nix/store/xdv40bsxp4c7m2nw63nrnkadmivczk24-lttng-tools-2.9.3/lib:/nix/store/b7yiqkykhj3lr7dlb3v81rsdasjg32jw-libkrb5-1.15/lib:/nix/store/sg6ri2jj92sbv7f4rvchzr00d24pi4nq-zlib-1.2.11/lib:/nix/store/s70cbg1lh45h3gl6xplz6bi2qdszi2cf-gettext-0.19.8/lib:/nix/store/b6d4mxvj5wdnf28lpww73pllmm0zd2nv-openssl-1.0.2l/lib:/nix/store/03gqmzrbh1pr5izy24gmyw1bfdzpy6q8-icu4c-58.2/lib:/nix/store/f4xflmvgszhrwa1r1jn5fddz8j196qzv-libunwind-1.1/lib:/nix/store/awxn3kfww8hjnd1pyji4zdmmi2x3kvzb-util-linux-2.29.2/lib:/nix/store/lc9cdddv2xv45ighz8znsanjfgkcdgbx-gcc-5.4.0-lib/lib:/nix/store/75pmwxf02m6i4vd3b0iybc3w54xf4r2z-glib-2.50.3/lib/nix/store/f1sankahbj7pss7vjrvbmng9z7gd08a6-dotnet-sdk-2.0I can now successfully execute the help and version functions on the dotnet binary without getting weird errors about missing object files:$ result/bin/dotnet --version2.0.0However, when I try to create a new console application I get following error:$ /etc/nixos/dotnet-sdk/result/bin/dotnet new consoleNo templates matched the input template name: console.Templates      Short Name      Language      Tags-------------------------------------------------I have no idea why it can't find the templates, but I have a weak hypothesis that maybe I screwed something up in the binary by using --force-rpath when I modify the binary with patchelf in the buildscript..Does my package configuration and buildscript look okay? (eg. is the problem unrelated to my Nix package description and buildscript)Is there something obvious I am missing, such as somehow providing a link to some of the auxiliary net core directories when modifyingthe binary with patchelf?Something else I can do to make net core sdk 2.0 work in NixOs?
installing .net core sdk 2.0 on NixOs (can't find templates)
nixos;nix;.net;patchelf