diff --git a/flake.lock b/flake.lock index 944d0b4..71b8480 100644 --- a/flake.lock +++ b/flake.lock @@ -17,7 +17,23 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "utils": { + "locked": { + "lastModified": 1629481132, + "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "997f7efcb746a9c140ce1f13c72263189225f482", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 570b6a6..da81899 100644 --- a/flake.nix +++ b/flake.nix @@ -3,27 +3,37 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs"; + utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs }: { - packages.x86_64-linux.p2pool = with import nixpkgs { system = "x86_64-linux";}; stdenv.mkDerivation { - pname = "p2pool"; - version = "0.0.1"; - src = self; + outputs = { self, nixpkgs, utils }: + utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + rec { + packages = utils.lib.flattenTree { + p2pool = pkgs.stdenv.mkDerivation { + pname = "p2pool"; + version = "0.0.1"; + src = self; - nativeBuildInputs = [ cmake pkg-config ]; + nativeBuildInputs = builtins.attrValues { + inherit (pkgs) cmake pkg-config; + }; - buildInputs = [ - libuv zeromq - libsodium gss - ]; + buildInputs = builtins.attrValues { + inherit (pkgs) libuv zeromq libsodium gss; + }; - installPhase = '' - mkdir -p $out/bin - cp -r ./p2pool $out/bin/ - ''; - }; + installPhase = '' + mkdir -p $out/bin + cp -r ./p2pool $out/bin/ + ''; + }; + }; - defaultPackage.x86_64-linux = self.packages.x86_64-linux.p2pool; - }; + defaultPackage = packages.p2pool; + } + ); }