~cyplo/bakare

bakare/flake.nix -rw-r--r-- 1.4 KiB
2c3fb1b1 — Cyryl Płotnicki Update cargo dependencies 2 months ago
                                                                                
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
{
  description = "Bakare: modern and simple, yet efficient backup solution";
  inputs = {
    utils.url = "github:numtide/flake-utils";
    naersk.url = "github:nix-community/naersk";
    flake-compat = {
      url = "github:edolstra/flake-compat";
      flake = false;
    };
  };

  outputs = { self, nixpkgs, utils, naersk, flake-compat }:
    utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages."${system}";
        naersk-lib = naersk.lib."${system}";
      in rec {
        # `nix build`
        packages.bakare = naersk-lib.buildPackage {
          pname = "bakare";
          root = ./.;
        };
        defaultPackage = packages.bakare;

        # `nix run`
        apps.bakare = utils.lib.mkApp { drv = packages.bakare; };
        defaultApp = apps.bakare;

        # `nix develop`
        devShell = pkgs.mkShell {
          nativeBuildInputs = with pkgs; [
            cacert
            cargo
            cargo-edit
            cargo-outdated
            cargo-release
            cargo-tarpaulin
            cargo-watch
            clippy
            git
            llvmPackages_13.llvm
            nixpkgs-fmt
            openssh
            openssl
            pkg-config
            rustc
            rustfmt
          ];
          RUST_SRC_PATH =
            "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
        };
      });
}