Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ed168aa16df4
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 831ffe26a759
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 6, 2020

  1. nanorc: 2020-01-25 -> 2020-10-10

    Add update script
    NeQuissimus committed Nov 6, 2020
    Copy the full SHA
    adf334a View commit details
  2. Merge pull request #102978 from NeQuissimus/nanorc_update

    nanorc: 2020-01-25 -> 2020-10-10
    NeQuissimus authored Nov 6, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    831ffe2 View commit details
Showing with 36 additions and 7 deletions.
  1. +36 −7 pkgs/applications/editors/nano/nanorc/default.nix
43 changes: 36 additions & 7 deletions pkgs/applications/editors/nano/nanorc/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{ stdenv, fetchFromGitHub }:
{ stdenv, fetchFromGitHub, writeScript, nixosTests, common-updater-scripts
, coreutils, git, gnused, nix, nixfmt }:

stdenv.mkDerivation {
let
owner = "scopatz";
repo = "nanorc";
in stdenv.mkDerivation rec {
pname = "nanorc";
version = "2020-01-25";
version = "2020-10-10";

src = fetchFromGitHub {
owner = "scopatz";
repo = "nanorc";
rev = "2020.1.25";
sha256 = "1y8jk3jsl4bd6r4hzmxzcf77hv8bwm0318yv7y2npkkd3a060z8d";
inherit owner repo;
rev = builtins.replaceStrings [ "-" ] [ "." ] version;
sha256 = "3B2nNFYkwYHCX6pQz/hMO/rnVqlCiw1BSNmGmJ6KCqE=";
};

dontBuild = true;
@@ -19,6 +22,32 @@ stdenv.mkDerivation {
install *.nanorc $out/share/
'';

passthru.updateScript = writeScript "update.sh" ''
#!${stdenv.shell}
set -o errexit
PATH=${
stdenv.lib.makeBinPath [
common-updater-scripts
coreutils
git
gnused
nix
nixfmt
]
}
oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion ${pname}" | tr -d '"' | sed 's|\\.|-|g')"
latestTag="$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags git@github.com:${owner}/${repo} '*.*.*' | tail --lines=1 | cut --delimiter='/' --fields=3)"
if [ "$oldVersion" != "$latestTag" ]; then
nixpkgs="$(git rev-parse --show-toplevel)"
default_nix="$nixpkgs/pkgs/applications/editors/nano/nanorc/default.nix"
newTag=$(echo $latestTag | sed 's|\.|-|g')
update-source-version ${pname} "$newTag" --version-key=version --print-changes
nixfmt "$default_nix"
else
echo "${pname} is already up-to-date"
fi
'';

meta = {
description = "Improved Nano Syntax Highlighting Files";
homepage = "https://github.com/scopatz/nanorc";