diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..732e38e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,3 @@ +services: + spammer: + image: git.4o1x5.dev/4o1x5/rendorseg-scam-spammer diff --git a/flake.nix b/flake.nix index 7a6a713..42b143e 100644 --- a/flake.nix +++ b/flake.nix @@ -25,15 +25,27 @@ src = craneLib.cleanCargoSource ./.; strictDeps = true; - buildInputs = [ - # Add additional build inputs here - ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ + buildInputs = with pkgs; [ + openssl + pkg-config + libiconv + curl # for utoipa + ] ++ lib.optionals pkgs.stdenv.isDarwin [ # Additional darwin specific inputs can be set here pkgs.libiconv ]; + nativeBuildInputs = with pkgs;[ + openssl + pkg-config + libiconv + curl + makeWrapper + ]; + + }; - my-crate = craneLib.buildPackage (commonArgs // { + spammer = craneLib.buildPackage (commonArgs // { cargoArtifacts = craneLib.buildDepsOnly commonArgs; # Additional environment variables or build phases/hooks can be set @@ -43,13 +55,33 @@ in { checks = { - inherit my-crate; + inherit spammer; }; - packages.default = my-crate; + packages = { + inherit spammer; + spammer-container = pkgs.dockerTools.buildLayeredImage { + name = "spammer"; + tag = "latest"; + + contents = with pkgs; [ + cacert + openssl + pkg-config + libiconv + ]; + + config = { + WorkingDir = "/app"; + Volumes = { "/app" = { }; }; + Entrypoint = [ "${spammer}/bin/rendorseg-scam-spammer" ]; + }; + }; + + }; apps.default = flake-utils.lib.mkApp { - drv = my-crate; + drv = spammer; }; devShells.default = craneLib.devShell {