From 994325ff950c0a064313504df533ab8ce2306777 Mon Sep 17 00:00:00 2001 From: breezystatic77 Date: Sun, 26 Jan 2025 12:42:38 -0500 Subject: switch to crane asdf --- .envrc | 4 +-- devenv.lock | 100 ------------------------------------------------------------ devenv.nix | 12 -------- devenv.yaml | 15 --------- flake.lock | 77 ++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 43 ++++++++++++++++++++++++++ 6 files changed, 121 insertions(+), 130 deletions(-) delete mode 100644 devenv.lock delete mode 100644 devenv.nix delete mode 100644 devenv.yaml create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc index 894571b..3550a30 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1 @@ -source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k=" - -use devenv +use flake diff --git a/devenv.lock b/devenv.lock deleted file mode 100644 index 4983385..0000000 --- a/devenv.lock +++ /dev/null @@ -1,100 +0,0 @@ -{ - "nodes": { - "devenv": { - "locked": { - "dir": "src/modules", - "lastModified": 1737028622, - "owner": "cachix", - "repo": "devenv", - "rev": "4e5b00134bf03f16af6b25b80abb38c598cfe239", - "type": "github" - }, - "original": { - "dir": "src/modules", - "owner": "cachix", - "repo": "devenv", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1733328505, - "owner": "edolstra", - "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1733477122, - "owner": "cachix", - "repo": "devenv-nixpkgs", - "rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857", - "type": "github" - }, - "original": { - "owner": "cachix", - "ref": "rolling", - "repo": "devenv-nixpkgs", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1737043064, - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "94ee657f6032d913fe0ef49adaa743804635b0bb", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "root": { - "inputs": { - "devenv": "devenv", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/devenv.nix b/devenv.nix deleted file mode 100644 index 234bd79..0000000 --- a/devenv.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - pkgs, - lib, - config, - inputs, - ... -}: let - dictionaryFile = import ./dictionary.nix {pkgs = pkgs;}; -in { - env.DICTIONARY_FILE_PATH = dictionaryFile; - languages.rust.enable = true; -} diff --git a/devenv.yaml b/devenv.yaml deleted file mode 100644 index 116a2ad..0000000 --- a/devenv.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json -inputs: - nixpkgs: - url: github:cachix/devenv-nixpkgs/rolling - -# If you're using non-OSS software, you can set allowUnfree to true. -# allowUnfree: true - -# If you're willing to use a package that's vulnerable -# permittedInsecurePackages: -# - "openssl-1.1.1w" - -# If you have more than one devenv you can merge them -#imports: -# - ./backend diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4c59bb7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,77 @@ +{ + "nodes": { + "crane": { + "locked": { + "lastModified": 1736898272, + "narHash": "sha256-D10wlrU/HCpSRcb3a7yk+bU3ggpMD1kGbseKtO+7teo=", + "owner": "ipetkov", + "repo": "crane", + "rev": "6a589f034202a7c6e10bce6c5d1d392d7bc0f340", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1736916166, + "narHash": "sha256-puPDoVKxkuNmYIGMpMQiK8bEjaACcCksolsG36gdaNQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e24b4c09e963677b1beea49d411cd315a024ad3a", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "crane": "crane", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} 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 = []; + }; + }); +} -- cgit v1.2.3