about summary refs log tree commit diff stats
path: root/c/flake.nix
blob: 0eab217687a5f42bd1f6bb38081e6fd5786f172c (plain) (blame)
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
{
  description = "<Project description>";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

    # inputs for following
    systems = {
      url = "github:nix-systems/x86_64-linux"; # only evaluate for this system
    };
    flake-compat = {
      url = "github:edolstra/flake-compat";
      flake = false;
    };
    flake-utils = {
      url = "github:numtide/flake-utils";
      inputs = {
        systems.follows = "systems";
      };
    };
  };

  outputs = {
    self,
    nixpkgs,
    flake-utils,
    ...
  }:
    flake-utils.lib.eachDefaultSystem (system: let
      pkgs = nixpkgs.legacyPackages."${system}";

      nativeBuildInputs = with pkgs; [valgrind];
    in {
      packages.default = pkgs.stdenv.mkDerivation {
        src = ./.;
        pname = "<pkgs_name>";
        version = "0.1";
        makeFlags = ["PREFIX=${placeholder "out"}"];
        inherit nativeBuildInputs;
      };
      apps.default = {
        type = "app";
        program = "${self.packages.${system}.default}/bin/<pkgs_name>";
      };
      devShells.default = pkgs.mkShell {
        packages = with pkgs; [
          cocogitto
        ];
        inherit nativeBuildInputs;
      };
    });
}
# vim: ts=2