automate nixpkgs update

This commit is contained in:
lassulus 2018-08-22 12:55:30 +02:00
parent 3e327a53b3
commit 4abdb218c7
3 changed files with 17 additions and 1 deletions

View File

@ -12,7 +12,7 @@
krebs-source = { krebs-source = {
nixpkgs.git = { nixpkgs.git = {
ref = "e42c07d78a1fefc2d91f11f00e938253b3618a3b"; ref = (lib.importJSON ./nixpkgs.json).rev;
url = https://github.com/NixOS/nixpkgs; url = https://github.com/NixOS/nixpkgs;
}; };
stockholm.file = toString ../.; stockholm.file = toString ../.;

7
krebs/nixpkgs.json Normal file
View File

@ -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
}

9
krebs/update-channel.sh Executable file
View File

@ -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"