summaryrefslogtreecommitdiff
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
parentef5239fff09622f50e3e227049f2e1ecf0129d63 (diff)
downloadwpa-psk-4bada58a4fb8f8113f2c294c08c717a2357ed5e2.tar
Add experimental Nix flake
-rw-r--r--.gitignore1
-rw-r--r--flake.lock136
-rw-r--r--flake.nix38
3 files changed, 175 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index ea8c4bf..d787b70 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/target
+/result
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..f06ae63
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,136 @@
+{
+ "nodes": {
+ "fenix": {
+ "inputs": {
+ "nixpkgs": [
+ "naersk",
+ "nixpkgs"
+ ],
+ "rust-analyzer-src": "rust-analyzer-src"
+ },
+ "locked": {
+ "lastModified": 1752475459,
+ "narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=",
+ "owner": "nix-community",
+ "repo": "fenix",
+ "rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "fenix",
+ "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"
+ }
+ },
+ "naersk": {
+ "inputs": {
+ "fenix": "fenix",
+ "nixpkgs": "nixpkgs"
+ },
+ "locked": {
+ "lastModified": 1752689277,
+ "narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=",
+ "owner": "nix-community",
+ "repo": "naersk",
+ "rev": "0e72363d0938b0208d6c646d10649164c43f4d64",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "naersk",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1752077645,
+ "narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "be9e214982e20b8310878ac2baa063a961c1bdf6",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs_2": {
+ "locked": {
+ "lastModified": 1755829505,
+ "narHash": "sha256-4/Jd+LkQ2ssw8luQVkqVs9spDBVE6h/u/hC/tzngsPo=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "f937f8ecd1c70efd7e9f90ba13dfb400cf559de4",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "naersk": "naersk",
+ "nixpkgs": "nixpkgs_2"
+ }
+ },
+ "rust-analyzer-src": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1752428706,
+ "narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=",
+ "owner": "rust-lang",
+ "repo": "rust-analyzer",
+ "rev": "591e3b7624be97e4443ea7b5542c191311aa141d",
+ "type": "github"
+ },
+ "original": {
+ "owner": "rust-lang",
+ "ref": "nightly",
+ "repo": "rust-analyzer",
+ "type": "github"
+ }
+ },
+ "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..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.