Home

go-spectre @4cca870ec811fcb041519dc2928ecab507f0c788 - refs - log -
-
https://git.jolheiser.com/go-spectre.git
Go implementation for spectre/masterpassword
go-spectre / flake.nix
- raw
 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
44
45
46
47
48
49
50
51
52
53
54
55
{
  description = "spectre";
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  outputs =
    { self, nixpkgs, ... }:
    let
      systems = [
        "aarch64-darwin"
        "aarch64-linux"
        "x86_64-darwin"
        "x86_64-linux"
      ];
      inherit (nixpkgs) lib;
      forEachSystem =
        f:
        (lib.listToAttrs (
          map (system: {
            name = system;
            value = f {
              inherit system;
              pkgs = import nixpkgs { inherit system; };
            };
          }) systems
        ));
    in
    {
      packages = forEachSystem (
        { pkgs, system }:
        {
          default = self.packages.${system}.spectre;
          spectre = pkgs.buildGoModule rec {
            pname = "spectre";
            version = self.rev or "dev";
            src = pkgs.nix-gitignore.gitignoreSource [ ] (
              builtins.path {
                name = pname;
                path = ./.;
              }
            );
            subPackages = [ "cmd/spectre" ];
            vendorHash = nixpkgs.lib.fileContents ./go.mod.sri;
            nativeBuildInputs = [ pkgs.makeWrapper ];
            postInstall = ''
              wrapProgram $out/bin/spectre --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.xclip ]}
            '';
            meta = {
              description = "Spectre CLI";
              homepage = "https://git.jolheiser.com/go-spectre";
              mainProgram = "spectre";
            };
          };
        }
      );
    };
}