summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..b848bd2
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,38 @@
+{
+ description = "A command-line utility and Rust library to compute the WPA pre-shared key of a Wi-Fi SSID and passphrase";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ naersk.url = "github:nix-community/naersk";
+ };
+
+ outputs = { self, nixpkgs, flake-utils, naersk, ... }@inputs:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = import nixpkgs {
+ inherit system;
+ config = { };
+ overlays = [ ];
+ };
+ naersk' = pkgs.callPackage naersk { };
+ in rec {
+ # nix build
+ # nix run . -- --help
+ defaultPackage = packages.wpa-psk-cli;
+
+ # nix build .#wpa-psk-cli
+ # nix run .#wpa-psk-cli -- --help
+ packages.wpa-psk-cli = naersk'.buildPackage {
+ pname = "wpa-psk-cli";
+ src = builtins.path { path = ./.; name = "wpa-psk"; };
+ meta.mainProgram = "wpa-psk";
+ };
+
+ # nix develop
+ devShell = pkgs.mkShell {
+ nativeBuildInputs = with pkgs; [ rustc cargo cargo-edit ];
+ };
+ }
+ );
+}
Generated by cgit. See skreutz.com for my tech blog and contact information.