add a couple of scripts

This commit is contained in:
Sridhar Ratnakumar 2023-01-05 10:24:57 +05:30
parent fb40a057fb
commit 2ff4d6ef8c

View file

@ -25,6 +25,8 @@
#rosettaPkgs.coq
# (rosettaPkgs.haskellPackages.callHackage "agda-language-server" "0.2.1" { })
# TODO: These should be moved to a separte file?
# Kill the process with the port open
# Used only to kill stale ghc.
(pkgs.writeShellApplication {
@ -39,6 +41,24 @@
'';
})
# Spit out the nixpkgs rev pinned by the given flake.
(pkgs.writeShellApplication {
name = "nixpkgs-rev";
text = ''
NIXPKGS=$(nix flake metadata --json "$1" | jq -r .locks.nodes.root.inputs.nixpkgs)
nix flake metadata --json "$1" | \
jq -r .locks.nodes."$NIXPKGS".locked.rev
'';
})
(pkgs.writeShellApplication {
name = "nixpkgs-update-using";
text = ''
REV=$(nixpkgs-rev "$1")
nix flake lock --update-input nixpkgs --override-input nixpkgs github:nixos/nixpkgs/"$REV"
'';
})
];
nix = {