Add option to build docker image
This commit adds dockerbuild to flakes.nix:
```
nix build .#headscale-docker
```
This uses the Nix infra to build and _does not_ use Dockerfile.
It currently works on Linux (no macOS)
buf
clang-tools # clang-format
];
+
+
+ # Add entry to build a docker image with headscale
+ # caveat: only works on Linux
+ headscale-docker = pkgs.dockerTools.buildLayeredImage {
+ name = "headscale";
+ tag = "latest";
+ contents = [ pkgs.${system}.headscale ];
+ config.Entrypoint = [ (pkgs.${system}.headscale + "/bin/headscale") ];
+ };
in
rec {
# `nix develop`
# `nix build`
packages = with pkgs; {
inherit headscale;
+ inherit headscale-docker;
+
};
defaultPackage = pkgs.headscale;
};
defaultApp = apps.headscale;
+
});
}
