-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.nix
More file actions
35 lines (33 loc) · 1.02 KB
/
scripts.nix
File metadata and controls
35 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
perSystem =
{ self', pkgs, ... }:
{
packages = {
edict = pkgs.writeShellApplication {
name = "edict";
runtimeInputs = [
pkgs.nix
pkgs.jq
];
text = ''
if nix flake metadata --json 2>/dev/null | jq -e '.locks.nodes.monarch' >/dev/null; then
echo "🦋 Updating monarch input..."
nix flake update monarch --no-warn-dirty
echo "✅ Monarch input updated successfully!"
else
echo "❌ Error: This flake does not have a \`monarch' input" >&2
echo "Please add monarch to your flake inputs and add the \`edict' app to the \`apps' output." >&2
exit 1
fi
'';
};
};
apps = {
edict = {
type = "app";
program = "${self'.packages.edict}/bin/edict";
meta.description = "Script for updating monarch flake input. Only intended to be used by contributors.";
};
};
};
}