summaryrefslogtreecommitdiff
path: root/parts/packages.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-09-07 16:18:29 -0400
committerseth <[email protected]>2023-09-07 17:15:26 -0400
commitf741b550612103dafc1b2ff405de6a816ac5d760 (patch)
tree12842ff11c7b9afc91923463f1d1cdde553117f1 /parts/packages.nix
parentd5b333e95878fb895bc6bba402b9a3d920f737a3 (diff)
flake: switch to nixpkgs rust infra
Diffstat (limited to 'parts/packages.nix')
-rw-r--r--parts/packages.nix25
1 files changed, 5 insertions, 20 deletions
diff --git a/parts/packages.nix b/parts/packages.nix
index 6c5d10b..7126a4e 100644
--- a/parts/packages.nix
+++ b/parts/packages.nix
@@ -1,29 +1,14 @@
{self, ...}: {
perSystem = {
- craneLib,
+ lib,
pkgs,
system,
...
}: {
- packages = {
- cargoArtifacts = craneLib.buildDepsOnly {src = craneLib.cleanCargoSource self;};
-
- teawiebot = pkgs.callPackage ./derivation.nix {inherit craneLib self;};
-
- teawiebot-smol =
- self.packages.${system}.teawiebot.overrideAttrs (_: {
- # statically link musl, optimize for size
- CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl";
-
- CARGO_BUILD_RUSTFLAGS = "-C lto=fat -C embed-bitcode=yes \
- -C target-feature=+crt-static -C opt-level=z -C strip=symbols -C codegen-units=1";
-
- CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER = let
- inherit (pkgs.pkgsStatic.stdenv) cc;
- in "${cc}/bin/${cc.targetPrefix}cc";
- });
-
+ packages = lib.fix (f: {
+ teawiebot = pkgs.callPackage ./derivation.nix {inherit self;};
+ teawiebot-smol = f.teawiebot.override {optimizeSize = true;};
default = self.packages.${system}.teawiebot;
- };
+ });
};
}