summaryrefslogtreecommitdiff
path: root/pkgs/update-lock
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/update-lock')
-rwxr-xr-xpkgs/update-lock9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/update-lock b/pkgs/update-lock
new file mode 100755
index 0000000..8690241
--- /dev/null
+++ b/pkgs/update-lock
@@ -0,0 +1,9 @@
+#!/usr/bin/ruby
+require "json"
+
+dir = File.dirname $0
+lock = JSON.parse(File.read(File.expand_path "#{dir}/../flake.lock"))
+lock.merge!({"nodes" => lock["nodes"]
+ .filter {|k| ["nixpkgs", "root"].include? k }
+ .merge({"root" => {"inputs" => {"nixpkgs" => "nixpkgs"}}})})
+File.write "#{dir}/flake.lock", JSON.pretty_generate(lock)+"\n"