Skip to content

Commit

Permalink
build(nix): add required packages and tools to dev shell
Browse files Browse the repository at this point in the history
  • Loading branch information
errfrom authored and pddshk committed Jul 6, 2023
1 parent 41e1d34 commit 6ca94e8
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,26 @@
};

outputs = { self, nixpkgs }: {
pkgs = import nixpkgs { system = "x86_64-linux"; };

nativeBuildInputs = with self.pkgs; [ clang gnumake pkg-config which libxml2 ];
buildInputs = with self.pkgs; [ gtk3 librsvg glib ];

defaultPackage.x86_64-linux = self.packages.gtkChess;

packages.gtkChess =
with import nixpkgs { system = "x86_64-linux"; };
stdenv.mkDerivation {
name = "GTK-Chess";
version = "dev";
src = ./.;
nativeBuildInputs = [ clang gnumake pkg-config which libxml2 ];
buildInputs = [ gtk3 librsvg glib ];
buildPhase = "make all";
installPhase = "mkdir -p $out/bin; cp GTKChess $out/bin";
};
packages.gtkChess = with self.pkgs; stdenv.mkDerivation {
name = "GTK-Chess";
version = "dev";
src = ./.;
nativeBuildInputs = self.nativeBuildInputs;
buildInputs = self.buildInputs;
buildPhase = "make all";
installPhase = "mkdir -p $out/bin; cp GTKChess $out/bin";
};

devShells.x86_64-linux.default = with self.pkgs; mkShell {
buildInputs = [ cppcheck ] ++ self.nativeBuildInputs ++ self.buildInputs;
};
};

}

0 comments on commit 6ca94e8

Please sign in to comment.