-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.nix
39 lines (37 loc) · 839 Bytes
/
dev.nix
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
36
37
38
39
{
deploy-sh,
pkgs,
self,
system,
...
}:
pkgs.mkShell {
packages = let
update = pkgs.writeShellApplication {
name = "update";
runtimeInputs = builtins.attrValues {inherit (pkgs) nix git openssh;};
text = ''
if [[ $# -eq 0 ]]; then
nix flake update --commit-lock-file
else
args=()
for x in "$@"; do
args+=(--update-input "$x")
done
nix flake lock "''${args[@]}" --commit-lock-file
fi
if [[ $# -eq 0 ]]; then
ssh [email protected] fetch-docker-images > hosts/prod/docker-images.nix
fi
'';
};
in
builtins.attrValues {
inherit (pkgs) sops ssh-to-age nixos-anywhere;
}
++ [
deploy-sh.packages.${system}.default
self.formatter.${system}
update
];
}