diff --git a/.envrc b/.envrc new file mode 100644 index 0000000000000000000000000000000000000000..3550a30f2de389e537ee40ca5e64a77dc185c79b --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 39124a8e01e21e9e560b85f4051da1e6a3f7ea01..20429b415d268cc4b3a7ae50451a90f4e0c2afa9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /run config.toml config.test.toml -/values.yaml \ No newline at end of file +/values.yaml +.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000000000000000000000000000000000..01797d936cb53e67c884cd126090ae7acdde7e44 --- /dev/null +++ b/flake.lock @@ -0,0 +1,94 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1713520724, + "narHash": "sha256-CO8MmVDmqZX2FovL75pu5BvwhW+Vugc7Q6ze7Hj8heI=", + "owner": "nix-community", + "repo": "naersk", + "rev": "c5037590290c6c7dae2e42e7da1e247e54ed2d49", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1716097317, + "narHash": "sha256-1UMrLtgzielG/Sop6gl6oTSM4pDt7rF9j9VuxhDWDlY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8535fb92661f37ff9f0da3007fbc942f7d134b41", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1716097317, + "narHash": "sha256-1UMrLtgzielG/Sop6gl6oTSM4pDt7rF9j9VuxhDWDlY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8535fb92661f37ff9f0da3007fbc942f7d134b41", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "naersk": "naersk", + "nixpkgs": "nixpkgs_2" + } + }, + "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 0000000000000000000000000000000000000000..384936d4fb61f0af8079dd2c3ee1e75049539b7d --- /dev/null +++ b/flake.nix @@ -0,0 +1,37 @@ +{ + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + naersk.url = "github:nix-community/naersk"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = { + self, + flake-utils, + naersk, + nixpkgs, + }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = (import nixpkgs) { + inherit system; + }; + + naersk' = pkgs.callPackage naersk {}; + in rec { + defaultPackage = naersk'.buildPackage { + src = ./.; + buildInputs = with pkgs; [openssl]; + nativeBuildInputs = with pkgs; [pkg-config]; + }; + + devShell = pkgs.mkShell { + buildInputs = with pkgs; [openssl]; + nativeBuildInputs = with pkgs; [rustc cargo rust-analyzer pkg-config clippy]; + }; + + formatter = nixpkgs.legacyPackages.${system}.alejandra; + } + ); +} +