-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tools for updating flake inputs. Update inputs. Update documentation
- Loading branch information
1 parent
c24f570
commit 414f9ae
Showing
11 changed files
with
116 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#! /usr/bin/env nix-shell | ||
#! nix-shell -i perl --packages perlPackages.JSON | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use JSON; | ||
|
||
use Term::ANSIColor; | ||
use File::Slurp; | ||
use Time::Piece; | ||
|
||
# Decode the lock files | ||
my $old_lock = decode_json `git show HEAD:flake.lock`; | ||
my $new_lock = decode_json(read_file('flake.lock')); | ||
|
||
print "\n"; | ||
|
||
foreach my $key (keys %{$new_lock->{nodes}}) { | ||
if ( | ||
exists $old_lock->{nodes}{$key} && | ||
exists $new_lock->{nodes}{$key}{locked} && | ||
defined $old_lock->{nodes}{$key}{locked}{type} && | ||
defined $old_lock->{nodes}{$key}{locked}{rev} && | ||
$new_lock->{nodes}{$key}{locked}{type} eq "github" | ||
) { | ||
my $new = $new_lock->{nodes}{$key}{locked}; | ||
my $old = $old_lock->{nodes}{$key}{locked}; | ||
|
||
# Compare 'rev' values | ||
if ($new->{rev} ne $old->{rev}) { | ||
my $old_modified_date = localtime($old->{lastModified}); | ||
my $days_since_modified = int(($new->{lastModified} - $old->{lastModified}) / (60 * 60 * 24)); | ||
|
||
print color('bold'), "Updated input '$key':", color('reset'), "\n"; | ||
print "Last modified: " . $old_modified_date->strftime("%d-%m-%Y") . " ($days_since_modified days ago)" . "\n"; | ||
print "Compare: " . color('blue') . "https://github.com/$new->{owner}/$new->{repo}/compare/$old->{rev}...$new->{rev}?diff=unified&w=" . color("reset") . "\n\n"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#! /usr/bin/env nix-shell | ||
#! nix-shell -i bash --packages curl jq | ||
|
||
set -x | ||
|
||
NIXPKGS_REV="$( \ | ||
curl -s "https://prometheus.nixos.org/api/v1/query?query=channel_revision" | \ | ||
jq -r '.data.result[] | select(.metric.channel == "nixpkgs-unstable") | .metric.revision'\ | ||
)" | ||
|
||
nix flake update --override-input nixpkgs "github:NixOS/nixpkgs/${NIXPKGS_REV}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
console.log("Hello world") | ||
console.log("Hello world"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"module": "nodenext", | ||
"allowImportingTsExtensions": true, | ||
"rewriteRelativeImportExtensions": true, | ||
"verbatimModuleSyntax": true | ||
"target": "esnext", | ||
"module": "nodenext", | ||
"allowImportingTsExtensions": true, | ||
"rewriteRelativeImportExtensions": true, | ||
"verbatimModuleSyntax": true | ||
} | ||
} |