From 61321c40cf3e7738dc57041d2614447a03fa7957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Wygoda?= Date: Wed, 2 Jun 2021 18:32:52 +0200 Subject: [PATCH] Add doi flk command --- src/modules.nix | 1 - src/pkgs-lib/shell/flk.sh | 7 +++++++ tests/fullFlake/modules/customBuilds.nix | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/modules.nix b/src/modules.nix index 0749ac5..4f2bf9d 100644 --- a/src/modules.nix +++ b/src/modules.nix @@ -113,6 +113,5 @@ }; }; }; - } diff --git a/src/pkgs-lib/shell/flk.sh b/src/pkgs-lib/shell/flk.sh index 9887692..c701b59 100755 --- a/src/pkgs-lib/shell/flk.sh +++ b/src/pkgs-lib/shell/flk.sh @@ -19,6 +19,7 @@ usage () { "up" "Generate $DEVSHELL_ROOT/hosts/up-$HOSTNAME.nix" \ "update [INPUT]" "Update and commit the lock file, or specific input" \ "get (core|community) [DEST]" "Copy the desired template to DEST" \ + "doi HOST" "Generate DigitalOcean image of HOST" \ "iso HOST" "Generate an ISO image of HOST" \ "install HOST [ARGS]" "Shortcut for nixos-install" \ "home HOST USER [switch]" "Home-manager config of USER from HOST" \ @@ -72,6 +73,12 @@ case "$1" in fi ;; + "doi") + nix build \ + "$DEVSHELL_ROOT#nixosConfigurations.$2.config.system.build.digitalOcean" \ + "${@:3}" + ;; + "iso") nix build \ "$DEVSHELL_ROOT#nixosConfigurations.$2.config.system.build.iso" \ diff --git a/tests/fullFlake/modules/customBuilds.nix b/tests/fullFlake/modules/customBuilds.nix index e343c80..7181f65 100644 --- a/tests/fullFlake/modules/customBuilds.nix +++ b/tests/fullFlake/modules/customBuilds.nix @@ -25,5 +25,9 @@ in } ]; })).config.home-manager.users; + + digitalOcean = (mkBuild ({ modulesPath, ... }: { + imports = [ "${modulesPath}/virtualisation/digital-ocean-image.nix" ]; + })).config.system.build.digitalOceanImage; }; }