Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Feb 1, 2025
1 parent f10aa83 commit d6a15f1
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions modules/flake-parts/incus-image/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
incus-image-vm-import.program = pkgs.writeShellApplication {
name = "incus-image-vm-import";
text = ''
NAME=$1
NAME=$1
echo "Building image ... "
METADATA=$(nix build --no-link --print-out-paths ${inputs.self}#nixosConfigurations."$NAME".config.system.build.metadata)/tarball/
IMG=$(nix build --no-link --print-out-paths ${inputs.self}#nixosConfigurations."$NAME".config.system.build.qemuImage)/nixos.qcow2
echo "Building image ... "
METADATA=$(nix build --no-link --print-out-paths ${inputs.self}#nixosConfigurations."$NAME".config.system.build.metadata)/tarball/
IMG=$(nix build --no-link --print-out-paths ${inputs.self}#nixosConfigurations."$NAME".config.system.build.qemuImage)/nixos.qcow2
echo "Importing ... "
set -x
sudo incus image import --alias srid/"$NAME" "$METADATA"/*.tar.xz "$IMG"
echo "Importing ... "
set -x
sudo incus image import --alias srid/"$NAME" "$METADATA"/*.tar.xz "$IMG"
'';
};

incus-image-container-import.program = pkgs.writeShellApplication {
name = "incus-image-container-import";
text = ''
NAME=$1
NAME=$1
echo "Building image ... "
METADATA=$(nix build --no-link --print-out-paths ${inputs.self}#nixosConfigurations."$NAME".config.system.build.metadata)/tarball/
IMG=$(nix build --no-link --print-out-paths ${inputs.self}#nixosConfigurations."$NAME".config.system.build.squashfs)/nixos-lxc-image-${system}.squashfs
echo "Building image ... "
METADATA=$(nix build --no-link --print-out-paths ${inputs.self}#nixosConfigurations."$NAME".config.system.build.metadata)/tarball/
IMG=$(nix build --no-link --print-out-paths ${inputs.self}#nixosConfigurations."$NAME".config.system.build.squashfs)/nixos-lxc-image-${system}.squashfs
echo "Importing ... "
set -x
sudo incus image import --alias srid/"$NAME" "$METADATA"/*.tar.xz "$IMG"
echo "Importing ... "
set -x
sudo incus image import --alias srid/"$NAME" "$METADATA"/*.tar.xz "$IMG"
'';
};
};
Expand Down

0 comments on commit d6a15f1

Please sign in to comment.