aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
blob: 8a1ef5992378ebf8b758ab53e6e4ab3cd935a9b6 (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
{
  inputs = {
    #   dlang-nix.url = "github:PetarKirov/dlang-nix";
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-parts = {
      url = "github:hercules-ci/flake-parts";
      inputs.nixpkgs-lib.follows = "nixpkgs";
    };
  };

  outputs = inputs @ {flake-parts, ...}:
    flake-parts.lib.mkFlake {inherit inputs;} {
      systems = ["x86_64-linux" "x86_64-darwin" "aarch64-darwin"];
      perSystem = {
        inputs',
        pkgs,
        ...
      }: {
        packages = {
          boobbot = pkgs.buildDubPackage rec {
            pname = "boobbot";
            version = "0.0.0";
            src = ./.;
            dubLock = ./dub-lock.json;
            installPhase = ''
              runHook preInstall
              install -Dm755 boobbot -t $out/bin
							patchelf --set-rpath ${pkgs.lib.makeLibraryPath buildInputs} $out/bin/boobbot
              runHook postInstall
            '';
            buildInputs = [pkgs.openssl];
          };
        };
        formatter = pkgs.alejandra;
        devShells.default = pkgs.mkShell rec {
          buildInputs = [
            pkgs.openssl
          ];
          LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
          packages = [
            pkgs.ldc
            pkgs.dub
            pkgs.lldb
            pkgs.dub-to-nix
          ];
        };
      };
    };
}