aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
blob: 3f12c8268670b0840df464e07ee18f0c98400532 (plain)
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
{
  description = "A command saver";

  inputs = {
    nixpkgs.url = "nixpkgs/nixos-22.11";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs { inherit system; };
        lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
        version = builtins.substring 0 8 lastModifiedDate;
        doe = pkgs.buildGoModule {
          pname = "doe";
          inherit version;

          src = ./.;

          vendorSha256 = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
        };
      in
        {

          # Provide some binary packages for selected system types.
          packages.default = doe;
          apps.default = {
            drv = doe;
            name = "doe";
          };

          devShells.default = pkgs.mkShell {
            nativeBuildInputs = with pkgs; [
              go
              gopls
            ];
          };
        }

    );
}