flake: add help
program
This commit is contained in:
22
flake.nix
22
flake.nix
@@ -249,34 +249,46 @@
|
|||||||
nixos-rebuild --flake '.#${host}' ${action} --target-host colin@${host} --use-remote-sudo $@
|
nixos-rebuild --flake '.#${host}' ${action} --target-host colin@${host} --use-remote-sudo $@
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
help = {
|
||||||
|
type = "app";
|
||||||
|
program = let
|
||||||
|
helpMsg = builtins.toFile "nixos-config-help-message" ''
|
||||||
|
commands:
|
||||||
|
- `nix run '.#help'`
|
||||||
|
- show this message
|
||||||
|
- `nix run '.#update-feeds'`
|
||||||
|
- updates metadata for all feeds
|
||||||
|
- `nix run '.#init-feed' <url>`
|
||||||
|
- `nix run '.#deploy-{lappy,moby,moby-test,servo}' [nixos-rebuild args ...]`
|
||||||
|
- `nix run '.#check-nur'`
|
||||||
|
'';
|
||||||
|
in builtins.toString (pkgs.writeShellScript "nixos-config-help" ''
|
||||||
|
cat ${helpMsg}
|
||||||
|
'');
|
||||||
|
};
|
||||||
update-feeds = {
|
update-feeds = {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = "${pkgs.feeds.updateScript}";
|
program = "${pkgs.feeds.updateScript}";
|
||||||
};
|
};
|
||||||
|
|
||||||
init-feed = {
|
init-feed = {
|
||||||
# use like `nix run '.#init-feed' uninsane.org`
|
|
||||||
type = "app";
|
type = "app";
|
||||||
program = "${pkgs.feeds.initFeedScript}";
|
program = "${pkgs.feeds.initFeedScript}";
|
||||||
};
|
};
|
||||||
|
|
||||||
deploy-lappy = {
|
deploy-lappy = {
|
||||||
# `nix run '.#deploy-lappy'`
|
|
||||||
type = "app";
|
type = "app";
|
||||||
program = ''${deployScript "lappy" "switch"}'';
|
program = ''${deployScript "lappy" "switch"}'';
|
||||||
};
|
};
|
||||||
deploy-moby-test = {
|
deploy-moby-test = {
|
||||||
# `nix run '.#deploy-moby-test'`
|
|
||||||
type = "app";
|
type = "app";
|
||||||
program = ''${deployScript "moby" "test"}'';
|
program = ''${deployScript "moby" "test"}'';
|
||||||
};
|
};
|
||||||
deploy-moby = {
|
deploy-moby = {
|
||||||
# `nix run '.#deploy-moby'`
|
|
||||||
type = "app";
|
type = "app";
|
||||||
program = ''${deployScript "moby" "switch"}'';
|
program = ''${deployScript "moby" "switch"}'';
|
||||||
};
|
};
|
||||||
deploy-servo = {
|
deploy-servo = {
|
||||||
# `nix run '.#deploy-servo'`
|
|
||||||
type = "app";
|
type = "app";
|
||||||
program = ''${deployScript "servo" "switch"}'';
|
program = ''${deployScript "servo" "switch"}'';
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user