Skip to content

Commit

Permalink
using very latest rust version
Browse files Browse the repository at this point in the history
  • Loading branch information
tanneberger committed Nov 18, 2023
1 parent b16d365 commit 892d698
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 80 deletions.
7 changes: 4 additions & 3 deletions derivation.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{ craneLib, src, lib, cmake, pkg-config, protobuf, grpc, openssl, postgresql}:
{ buildPackage, lib, pkg-config, cmake, protobuf, postgresql, zlib, openssl}:

craneLib.buildPackage {
buildPackage {
pname = "lizard";
version = "0.1.0";

src = ./.;

buildInputs = [ cmake protobuf grpc openssl pkg-config postgresql ];
#cargoSha256 = lib.fakeSha256;
buildInputs = [ cmake protobuf openssl pkg-config postgresql ];

meta = {
description = "Service which serves the current state of the network";
Expand Down
95 changes: 51 additions & 44 deletions flake.lock

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

83 changes: 50 additions & 33 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,45 +1,62 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
utils.url = "github:numtide/flake-utils";
crane = {
url = "github:ipetkov/crane";

naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "utils";
};
};

outputs = inputs@{ self, nixpkgs, utils, crane }:
utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
craneLib = crane.lib.${system};
package = pkgs.callPackage ./derivation.nix { craneLib = craneLib; };
in
rec {
checks = packages;
packages = {
lizard = package;
default = package;
utils = {
url = "github:numtide/flake-utils";
};

devShells.default = pkgs.mkShell {
nativeBuildInputs = (with packages.lizard; nativeBuildInputs ++ buildInputs);
fenix = {
url = "github:nix-community/fenix";
};
};

apps = {
lizard = utils.lib.mkApp { drv = packages.lizard; };
default = apps.lizard;
};
}) // {
nixosModules = rec {
default = funnel;
funnel = import ./nixos-module;
};
overlays.default = final: prev: {
inherit (self.packages.${prev.system})
lizard;
outputs = inputs@{ self, nixpkgs, utils, naersk, fenix }:
utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};

toolchain = with fenix.packages.${system}; combine [
latest.cargo
latest.rustc
];

package = pkgs.callPackage ./derivation.nix {
buildPackage = (naersk.lib.${system}.override {
cargo = toolchain;
rustc = toolchain;
}).buildPackage;
};
in
rec {
checks = packages;
packages = {
lizard = package;
default = package;
};

devShells.default = pkgs.mkShell {
nativeBuildInputs = (with packages.lizard; nativeBuildInputs ++ buildInputs);
};

apps = {
lizard = utils.lib.mkApp { drv = packages.lizard; };
default = apps.lizard;
};
}) // {
nixosModules = rec {
default = funnel;
funnel = import ./nixos-module;
};
overlays.default = final: prev: {
inherit (self.packages.${prev.system})
lizard;
};
};
};
}

0 comments on commit 892d698

Please sign in to comment.