diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ee7d65b --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "Endless honeypot for web crawlers"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + flake-utils.url = "github:numtide/flake-utils"; + crane.url = "github:ipetkov/crane"; + }; + outputs = { + self, + nixpkgs, + crane, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = nixpkgs.legacyPackages.${system}; + craneLib = crane.mkLib pkgs; + commonArgs = { + src = craneLib.cleanCargoSource ./.; + strictDeps = true; + buildInputs = [] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin []; + }; + dictionaryFile = import ./dictionary.nix {pkgs = pkgs;}; + pitch-lake = craneLib.buildPackage (commonArgs + // { + cargoArtifacts = craneLib.buildDepsOnly commonArgs; + DICTIONARY_FILE_PATH = dictionaryFile; + }); + in { + checks = { + inherit pitch-lake; + }; + packages.default = pitch-lake; + apps.default = flake-utils.lib.mkApp { + drv = pitch-lake; + }; + devShells.default = craneLib.devShell { + checks = self.checks.${system}; + DICTIONARY_FILE_PATH = dictionaryFile; + packages = []; + }; + }); +} |