about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/nix-channel.in8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in
index b3251975b52b..64e5aa01282b 100755
--- a/scripts/nix-channel.in
+++ b/scripts/nix-channel.in
@@ -108,7 +108,13 @@ sub update {
         die "cannot fetch `$fullURL'" if $? != 0;
         chomp $path;
 
-        $exprs .= "'f: f { name = \"$name\"; src = builtins.storePath \"$path\"; }' ";
+        # If the URL contains a version number, append it to the name
+        # attribute (so that "nix-env -q" on the channels profile
+        # shows something useful).
+        my $cname = $name;
+        $cname .= $1 if basename($url) =~ /(-\d.*)$/;
+
+        $exprs .= "'f: f { name = \"$cname\"; channelName = \"$name\"; src = builtins.storePath \"$path\"; }' ";
     }
 
     # Unpack the channel tarballs into the Nix store and install them