This repository has been archived by the owner on Dec 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
stdProfile.nix
85 lines (80 loc) · 3.07 KB
/
stdProfile.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{ stdProfilePath, pkgs, lib, budUtils, ... }:
let
# pkgs.nixos-install-tools does not build on darwin
installPkgs = (import "${toString pkgs.path}/nixos/lib/eval-config.nix" {
inherit (pkgs) system;
modules = [ { nix.package = pkgs.nixUnstable; } ];
}).config.system.build;
in
{
bud.cmds = with pkgs; {
# Onboarding
up = {
writer = budUtils.writeBashWithPaths [ installPkgs.nixos-generate-config git mercurial coreutils ];
synopsis = "up";
help = "Generate $FLAKEROOT/hosts/\${HOST//\./\/}/default.nix";
script = ./scripts/onboarding-up.bash;
};
# Utils
update = {
writer = budUtils.writeBashWithPaths [ nixUnstable git mercurial ];
synopsis = "update [INPUT]";
help = "Update and commit $FLAKEROOT/flake.lock file or specific input";
script = ./scripts/utils-update.bash;
};
burn = {
writer = budUtils.writeBashWithPaths [ nixUnstable git mercurial coreutils gawk util-linux fzf pv ];
synopsis = "burn";
help = "Burn an ISO on a removable device that you interactively choose (build the iso first)";
script = ./scripts/burn.bash;
};
repl = {
writer = budUtils.writeBashWithPaths [ nixUnstable gnused git mercurial coreutils ];
synopsis = "repl [FLAKE]";
help = "Enter a repl with the flake's outputs";
script = (import ./scripts/utils-repl pkgs).outPath;
};
ssh-show = {
writer = budUtils.writeBashWithPaths [ openssh coreutils ];
synopsis = "ssh-show HOST USER | USER@HOSTNAME";
help = "Show target host's SSH ed25519 key";
description = ''
Use this script to quickly determine the target host
key for which to encrypt an agenix secret.
'';
script = ./scripts/utils-ssh-show.bash;
};
# Home-Manager
home = {
writer = budUtils.writeBashWithPaths [ nixUnstable git mercurial coreutils ];
synopsis = "home [switch] (user@fqdn | USER HOST | USER)";
help = "Home-manager config of USER from HOST or host-less portable USER for current architecture";
script = ./scripts/hm-home.bash;
};
# Hosts
build = {
writer = budUtils.writeBashWithPaths [ nixUnstable git mercurial coreutils ];
synopsis = "build HOST BUILD";
help = "Build a variant of your configuration from system.build";
script = ./scripts/hosts-build.bash;
};
vm = {
writer = budUtils.writeBashWithPaths [ nixUnstable git mercurial coreutils ];
synopsis = "vm HOST";
help = "Generate & run a one-shot vm for HOST";
script = ./scripts/hosts-vm.bash;
};
install = {
writer = budUtils.writeBashWithPaths [ installPkgs.nixos-install git mercurial coreutils ];
synopsis = "install HOST [ARGS]";
help = "Shortcut for nixos-install";
script = ./scripts/hosts-install.bash;
};
rebuild = {
writer = budUtils.writeBashWithPaths [ installPkgs.nixos-rebuild git mercurial coreutils ];
synopsis = "rebuild HOST (switch|boot|test)";
help = "Shortcut for nixos-rebuild";
script = ./scripts/hosts-rebuild.bash;
};
};
}