diff options
author | breezystatic77 | 2025-01-26 12:42:38 -0500 |
---|---|---|
committer | breezystatic77 | 2025-01-26 12:42:38 -0500 |
commit | 994325ff950c0a064313504df533ab8ce2306777 (patch) | |
tree | 465bb534a9a9676d8fd85d0ac3e760488dccec2a /flake.nix | |
parent | 38a8771857ae1b366afb0952888eaa3c631df11e (diff) |
switch to crane
asdf
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 = []; + }; + }); +} |