Skip to content

Commit

Permalink
fix: move default packages out of std api
Browse files Browse the repository at this point in the history
This avoids a double build in CI.
  • Loading branch information
nrdxp committed Sep 19, 2023
1 parent 72096a0 commit e602e04
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
5 changes: 5 additions & 0 deletions flake.lock

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

16 changes: 12 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@

inputs.nixpkgs.follows = "fenix/nixpkgs";

inputs.nosys.follows = "std/paisano/nosys";

outputs = inputs @ {
self,
std,
nosys,
...
}:
}: let
systems = ["x86_64-linux"];
in
std.growOn {
inherit inputs;
systems = ["x86_64-linux"];
inherit inputs systems;
cellsFrom = ./nix;
cellBlocks = with std.blockTypes; [
(installables "packages" {ci.build = true;})
Expand All @@ -34,7 +38,11 @@
} {
devShells = std.harvest self ["repo" "shells"];
packages = std.harvest self ["bin" "packages"];
};
}
(nosys (inputs // {inherit systems;}) ({self, ...}: {
packages.default = self.packages.cfdyndns;
devShells.default = self.devshells.dev;
}));

nixConfig = {
extra-substituters = [
Expand Down
4 changes: 2 additions & 2 deletions nix/bin/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
inherit (inputs.nixpkgs) pkgs;

crane = inputs.crane.lib.overrideToolchain cells.repo.rust;
in rec {
default = cfdyndns;
in {
cfdyndns = crane.buildPackage {
src = std.incl self [
"${self}/Cargo.lock"
Expand All @@ -16,6 +15,7 @@ in rec {
];

buildInputs = [pkgs.openssl pkgs.pkg-config];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [cells.repo.rust];
meta.description = "CloudFlare Dynamic DNS Client";
};
}
5 changes: 2 additions & 3 deletions nix/repo/shells.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
inherit (inputs.cells) bin;

l = nixpkgs.lib // builtins;
in rec {
default = dev;
in {
dev = lib.dev.mkShell {
packages = [
nixpkgs.pkg-config
Expand Down Expand Up @@ -52,7 +51,7 @@ in rec {
}
{
name = "PKG_CONFIG_PATH";
value = l.makeSearchPath "lib/pkgconfig" bin.packages.default.buildInputs;
value = l.makeSearchPath "lib/pkgconfig" bin.packages.cfdyndns.buildInputs;
}
];
imports = [
Expand Down

0 comments on commit e602e04

Please sign in to comment.