Home

rs-spectre @main - refs - log -
-
https://git.jolheiser.com/rs-spectre.git
Rust implementation for Spectre/Masterpassword
tree log patch
nix Signed-off-by: jolheiser <git@jolheiser.com>
Signature
-----BEGIN SSH SIGNATURE----- U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgBTEvCQk6VqUAdN2RuH6bj1dNkY oOpbPWj+jw4ua1B1cAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5 AAAAQEt7S9qv9EK6dlbbYhdMkaVT2At6EV9hWXaZO1HWmwaQJvqMsE1WSzE17iiazlvNgK eSB0NOCtXeFLjIr3M89gw= -----END SSH SIGNATURE-----
jolheiser <git@jolheiser.com>
2 weeks ago
3 changed files, 66 additions(+), 2 deletions(-)
flake.lockflake.nixspectre-cli/src/main.rs
I flake.lock
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000000000000000000000000000000000000..14d9d42e84a9895b6f1a786dda54a3e96e3fda4a
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,27 @@
+{
+  "nodes": {
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1749401433,
+        "narHash": "sha256-HXIQzULIG/MEUW2Q/Ss47oE3QrjxvpUX7gUl4Xp6lnc=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "08fcb0dcb59df0344652b38ea6326a2d8271baff",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "ref": "nixpkgs-unstable",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
I flake.nix
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000000000000000000000000000000000000..b8c141b1b2b64668d2aab853ef0aa2cde2355e14
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,37 @@
+{
+  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
+  outputs =
+    { nixpkgs, ... }:
+    let
+      systems = [
+        "aarch64-darwin"
+        "aarch64-linux"
+        "x86_64-darwin"
+        "x86_64-linux"
+      ];
+      forAllSystems = f: nixpkgs.lib.genAttrs systems f;
+    in
+    {
+      packages = forAllSystems (
+        system:
+        let
+          pkgs = import nixpkgs { inherit system; };
+          name = "spectre";
+        in
+        {
+          default = pkgs.rustPlatform.buildRustPackage {
+            pname = name;
+            version = "0.1.0";
+            src = pkgs.nix-gitignore.gitignoreSource [ ] (
+              builtins.path {
+                inherit name;
+                path = ./.;
+              }
+            );
+            useFetchCargoVendor = true;
+            cargoHash = "sha256-t0FXfIImqQiFbSVbDC+CEBE3IBXpWR4A3DQmhLnaCm0=";
+          };
+        }
+      );
+    };
+}
M spectre-cli/src/main.rsspectre-cli/src/main.rs
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/spectre-cli/src/main.rs b/spectre-cli/src/main.rs
index 25e46db8d1e660994c5b6463228e959e8a0e40e5..b88aef01f17e23658b2ad5190adecff70fe535a5 100644
--- a/spectre-cli/src/main.rs
+++ b/spectre-cli/src/main.rs
@@ -203,7 +203,7 @@     }
 
     #[test]
     fn test_default_values() {
-        let args = Args::parse_from(&["spectre", "example.com"]);
+        let args = Args::parse_from(&["spectre", "--username", "example", "example.com"]);
         assert_eq!(args.base, "com.lyndir.masterpassword");
         assert_eq!(args.counter, 1);
         assert!(!args.print);
@@ -211,7 +211,7 @@     }
 
     #[test]
     fn test_with_site() {
-        let args = Args::parse_from(&["spectre", "example.com"]);
+        let args = Args::parse_from(&["spectre", "--username", "example", "example.com"]);
         assert_eq!(args.site, "example.com".to_string());
     }