From e602e0416016c49983107f597c26d35fef755fac Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Tue, 19 Sep 2023 17:20:33 -0600 Subject: [PATCH] fix: move `default` packages out of std api This avoids a double build in CI. --- flake.lock | 5 +++++ flake.nix | 16 ++++++++++++---- nix/bin/packages.nix | 4 ++-- nix/repo/shells.nix | 5 ++--- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 26edc6d..0e3b858 100644 --- a/flake.lock +++ b/flake.lock @@ -282,6 +282,11 @@ "fenix", "nixpkgs" ], + "nosys": [ + "std", + "paisano", + "nosys" + ], "std": "std" } }, diff --git a/flake.nix b/flake.nix index 6eda720..00226d2 100644 --- a/flake.nix +++ b/flake.nix @@ -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;}) @@ -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 = [ diff --git a/nix/bin/packages.nix b/nix/bin/packages.nix index f90134d..2c70ab4 100644 --- a/nix/bin/packages.nix +++ b/nix/bin/packages.nix @@ -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" @@ -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"; }; } diff --git a/nix/repo/shells.nix b/nix/repo/shells.nix index 486cc6a..b635a6f 100644 --- a/nix/repo/shells.nix +++ b/nix/repo/shells.nix @@ -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 @@ -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 = [