-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
50 lines (42 loc) · 1.1 KB
/
shell.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
40
41
42
43
44
45
46
47
48
49
50
{ doWarn ? false
}:
let
module = import ./default.nix { };
inherit (module) pkgs hosts;
inherit (pkgs) lib;
updateChecker = import ./scripts/update-checker.nix (hosts.kira // {
inherit doWarn;
});
in pkgs.mkShell {
packages = with pkgs; [
git
jq
hosts.kira.config.nix.package
nix-output-monitor
];
shellHook = ''
init() {
git clone gitlab@gitlab.kokakiwi.net:kokakiwi/home-manager-secrets.git secrets
switch
}
switch() {
local workDir=$(mktemp --tmpdir -d)
trap "rm -rf $workDir" EXIT
local generationDir="$workDir/generation"
nom-build --out-link "$generationDir" && \
"$generationDir/activate"
}
listPackages() {
nix-instantiate --eval --strict --json --expr ${lib.escapeShellArg ''
let
env = (import ./default.nix {}).env;
inherit (env) pkgs homePackages;
inherit (pkgs) lib;
in lib.mapAttrs (name: drv: drv.version) homePackages
''} | jq -r 'to_entries | map("\(.key) \(.value)") | .[]'
}
checkUpdates() {
${updateChecker}
}
'';
}