aboutsummaryrefslogtreecommitdiffhomepage
path: root/flake.nix
blob: 48cb435d72c4f768a2529ffc375b6cc2f284279c (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
  description = "ego development environment";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/24.05";
  };

  outputs =
    { self, nixpkgs }:
    let
      supportedSystems = [ "x86_64-linux" ];
      forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
    in
    {
      devShells = forAllSystems (
        system:
        let
          pkgs = import nixpkgs { inherit system; };
        in
        {
          default =
            let
              inherit (pkgs)
                mkShell
                buildGoModule
                acl
                xorg
                ;
            in
            mkShell {
              packages = [
                (buildGoModule rec {
                  pname = "ego";
                  version = "flake";

                  src = ./.;
                  vendorHash = null; # we have no dependencies :3

                  ldflags = [
                    "-s"
                    "-w"
                    "-X"
                    "main.Version=v${version}"
                  ];

                  buildInputs = [
                    acl
                    xorg.libxcb
                  ];
                })
              ];
            };
        }
      );
    };
}