devcontainer: use the right channel informations
<nixpkgs> is already resolved from channel:nixos-19.09 to a store path as nix evaluation time.
This commit is contained in:
parent
7ed6a50917
commit
5e724edccd
1 changed files with 8 additions and 2 deletions
|
@ -16,6 +16,7 @@
|
||||||
, gzip
|
, gzip
|
||||||
, iana-etc
|
, iana-etc
|
||||||
, iproute
|
, iproute
|
||||||
|
, lib
|
||||||
, nix
|
, nix
|
||||||
, openssh
|
, openssh
|
||||||
, sedutil
|
, sedutil
|
||||||
|
@ -25,6 +26,8 @@
|
||||||
, mkUserEnvironment
|
, mkUserEnvironment
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
channel = builtins.getEnv("NIXPKGS_CHANNEL");
|
||||||
|
|
||||||
# generate a user profile for the image
|
# generate a user profile for the image
|
||||||
profile = mkUserEnvironment {
|
profile = mkUserEnvironment {
|
||||||
derivations = [
|
derivations = [
|
||||||
|
@ -108,11 +111,14 @@ let
|
||||||
"ENV=/nix/var/nix/profiles/default/etc/profile.d/nix.sh"
|
"ENV=/nix/var/nix/profiles/default/etc/profile.d/nix.sh"
|
||||||
"GIT_SSL_CAINFO=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
|
"GIT_SSL_CAINFO=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
|
||||||
"LD_LIBRARY_PATH=/nix/var/nix/profiles/default/lib"
|
"LD_LIBRARY_PATH=/nix/var/nix/profiles/default/lib"
|
||||||
"NIX_PATH=nixpkgs=${toString <nixpkgs>}"
|
|
||||||
"PAGER=cat"
|
"PAGER=cat"
|
||||||
"PATH=/nix/var/nix/profiles/default/bin"
|
"PATH=/nix/var/nix/profiles/default/bin"
|
||||||
"SSL_CERT_FILE=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
|
"SSL_CERT_FILE=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
|
||||||
];
|
]
|
||||||
|
++ lib.optional
|
||||||
|
(channel != "")
|
||||||
|
"NIX_PATH=nixpkgs=channel:${channel}"
|
||||||
|
;
|
||||||
Labels = {
|
Labels = {
|
||||||
# https://github.com/microscaling/microscaling/blob/55a2d7b91ce7513e07f8b1fd91bbed8df59aed5a/Dockerfile#L22-L33
|
# https://github.com/microscaling/microscaling/blob/55a2d7b91ce7513e07f8b1fd91bbed8df59aed5a/Dockerfile#L22-L33
|
||||||
"org.label-schema.vcs-ref" = "master";
|
"org.label-schema.vcs-ref" = "master";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue