about summary refs log tree commit diff
path: root/nix/templates/goapp/flake.nix
diff options
context:
space:
mode:
authorEmile <git@emile.space>2025-02-22 22:44:31 +0100
committerEmile <git@emile.space>2025-02-22 22:44:31 +0100
commit4100097801550fe86399453b7922875015f34ff9 (patch)
tree5c5103bf72b5b422278900a90c138e73a0bcfb65 /nix/templates/goapp/flake.nix
parente220cd7ed1ff8b9a84e4660519ca0f74720f9e6e (diff)
goapp frontend now works on corrino
added an overlay (which took quite some time, as I forgot to include
the self parameter in the argument list...) that allows using the
goapp on corrino.

So now you can...
... use the template
... see the package status after it has been built using hydra
... build the package from the packages exposed by the flake
... use the package on machines including it using an overlay

I'm actually quite satisfied with this and hope people find this helpful
Diffstat (limited to 'nix/templates/goapp/flake.nix')
-rw-r--r--nix/templates/goapp/flake.nix16
1 files changed, 11 insertions, 5 deletions
diff --git a/nix/templates/goapp/flake.nix b/nix/templates/goapp/flake.nix
index 1ca876f..385f1bf 100644
--- a/nix/templates/goapp/flake.nix
+++ b/nix/templates/goapp/flake.nix
@@ -12,20 +12,26 @@
           overlays = [ ];
         };
 
+        # take a name and return an attrset with a corresponding package and docker container
         package-and-docker = name: (let
-          pkgname = name + "-pkg";
+          # define the name for the package and docker container
+          pkgname = name;
           dockername = name + "-docker";
 
+          # import the package itself
           package = import ./${name} { inherit pkgs name; };
+
+          # define the container
+          container = pkgs.dockerTools.buildImage {
+            name = "${name}"; # TODO(emile): this could simply be `inherit name;` iinw
+            config.Cmd = [ "${package}/bin/${name}" ];
+          };
         in {
           # the raw package
           ${pkgname} = package;
 
           # the docker image
-          ${dockername} = pkgs.dockerTools.buildImage {
-            name = "${name}";
-            config.Cmd = [ "${package}/bin/${name}" ];
-          };
+          ${dockername} = container;
         });
       in
       {