From 4abdb218c7bd88aad8b9178cdaaa6a97079f5ac6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 22 Aug 2018 12:55:30 +0200 Subject: [PATCH] automate nixpkgs update --- krebs/krops.nix | 2 +- krebs/nixpkgs.json | 7 +++++++ krebs/update-channel.sh | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 krebs/nixpkgs.json create mode 100755 krebs/update-channel.sh diff --git a/krebs/krops.nix b/krebs/krops.nix index c2d26812c..c334bc07d 100644 --- a/krebs/krops.nix +++ b/krebs/krops.nix @@ -12,7 +12,7 @@ krebs-source = { nixpkgs.git = { - ref = "e42c07d78a1fefc2d91f11f00e938253b3618a3b"; + ref = (lib.importJSON ./nixpkgs.json).rev; url = https://github.com/NixOS/nixpkgs; }; stockholm.file = toString ../.; diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json new file mode 100644 index 000000000..13bed8bfe --- /dev/null +++ b/krebs/nixpkgs.json @@ -0,0 +1,7 @@ +{ + "url": "https://github.com/NixOS/nixpkgs-channels", + "rev": "4df3426f5a5e78cef4835897a43abd9e2a092b74", + "date": "2018-08-19T09:20:40+02:00", + "sha256": "05k5mssiqxffxi45mss9wjns6k76i248rpasa48akdcriry1mp63", + "fetchSubmodules": true +} diff --git a/krebs/update-channel.sh b/krebs/update-channel.sh new file mode 100755 index 000000000..47d3f29c4 --- /dev/null +++ b/krebs/update-channel.sh @@ -0,0 +1,9 @@ +#!/bin/sh +dir=$(dirname $0) +oldrev=$(cat $dir/nixpkgs.json | jq -r .rev | sed 's/\(.\{7\}\).*/\1/') +nix-shell -p nix-prefetch-git --run 'nix-prefetch-git \ + --url https://github.com/NixOS/nixpkgs-channels \ + --rev refs/heads/nixos-18.03' \ +> $dir/nixpkgs.json +newrev=$(cat $dir/nixpkgs.json | jq -r .rev | sed 's/\(.\{7\}\).*/\1/') +git commit $dir/nixpkgs.json -m "nixpkgs: $oldrev -> $newrev"