summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorStefan Kreutz <mail@skreutz.com>2025-08-23 23:37:47 +0200
committerStefan Kreutz <mail@skreutz.com>2025-08-23 23:38:52 +0200
commit4bada58a4fb8f8113f2c294c08c717a2357ed5e2 (patch)
treef0c3d3003b22021e6f88ce8e4f0a37f86fe6beba /flake.nix
parentef5239fff09622f50e3e227049f2e1ecf0129d63 (diff)
downloadwpa-psk-4bada58a4fb8f8113f2c294c08c717a2357ed5e2.tar
Add experimental Nix flake
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.