Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added nix config files to get builds working on nix/nixos #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# To run this on nix/nixos, just run `nix-build` (or `nix build`) in the directory containing this file
# and then run any executable in the result/bin directory,
# e.g. `./result/bin/mpck`.
# Or, if there is a corresponding flake.nix file and you have "flakes" enabled,
# you can just run "nix run" and it will run the default executable ("mpck").
# If you want to pass arguments to it or run a different executable, run it these ways:
# nix run .#mpck -- arg # put the arguments to be passed to the executable after the --

{ pkgs ? import <nixpkgs> {}}:
with pkgs;
# fastStdenv.mkDerivation { # for faster running times (8-12%) BUT... nondeterministic builds :(
fastStdenv.mkDerivation {
name = "checkmate";
src = ./.;

enableParallelBuilding = true;

# any dependencies/build tools needed at compilation/build time here
nativeBuildInputs = [ pkg-config gcc clang autoconf automake libtool ];

# any runtime dependencies here
buildInputs = [ ];

# the bash shell steps to build it
buildPhase = ''
./autogen.sh
./configure
make
'';

# for a generic copy of all compiled executables:
# cp $(find * -maxdepth 1 -executable -type f) $out/bin/
# to copy specific build outputs:
# cp keyconv oclvanitygen++ oclvanityminer vanitygen++ $out/bin/
installPhase = ''
mkdir -p $out/bin
cp mpck/mpck $out/bin/
'';
}
43 changes: 43 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# If you run with Nix and you have "flakes" enabled,
# you can just run "nix run" in this directory, and it will run the default executable here ("vanitygen++").
# Also see the note(s) at the top of default.nix.
{
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
# nixpkgs.url = "nixpkgs";
flake-utils.url = github:numtide/flake-utils;
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
rec {
packages.default = (import ./default.nix)
{ pkgs = nixpkgs.legacyPackages.${system}; };

apps = rec {
default = checkmate;
checkmate = {
type = "app";
program = "${self.packages.${system}.default}/bin/mpck";
};
};
}
);
}