Browse Source

nix: spend lots of time for relatively small closure size gains :(

master
eta 2 years ago
parent
commit
6c2a438bf2
  1. 10
      nix/default.nix
  2. 1
      nix/libpurple.nix
  3. 19
      nix/swiften-lightweight.nix

10
nix/default.nix

@ -1,12 +1,6 @@ @@ -1,12 +1,6 @@
{ pkgs ? import <nixpkgs> {}, libpurple ? import ./libpurple.nix {}, pqxx ? import ./libpqxx-lightweight.nix {}, ... }:
{ pkgs ? import <nixpkgs> {}, libpurple ? import ./libpurple.nix {}, pqxx ? import ./libpqxx-lightweight.nix {}, swiften ? import ./swiften-lightweight.nix {}, ... }:
let
pkgs-eta = import (builtins.fetchTarball {
# Descriptive name to make the store path easier to identify
name = "nixos-with-fixed-swiften";
url = "https://github.com/nixos/nixpkgs/archive/557644a1258902d20619679755dfa393b4fdad07.tar.gz";
sha256 = "0ia6c5c1zxmslmdahdrg745jb1vk41l0cl7y0h2xmzf5ls80rx3z";
}) {};
gitignoreSrc = pkgs.fetchFromGitHub {
owner = "hercules-ci";
repo = "gitignore";
@ -23,5 +17,5 @@ stdenv.mkDerivation { @@ -23,5 +17,5 @@ stdenv.mkDerivation {
(path: type: !(lib.strings.hasSuffix (baseNameOf path) "nix") && filter path type)
../.;
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ pkgs-eta.swiften zlib expat boost pqxx pqxx.pkgconfig postgresql.lib libpurple libev sqlite log4cxx glib pcre boost protobuf curl jsoncpp ];
buildInputs = [ swiften zlib expat boost pqxx pqxx.pkgconfig postgresql.lib libpurple libev sqlite log4cxx glib pcre boost protobuf curl jsoncpp ];
}

1
nix/libpurple.nix

@ -12,6 +12,7 @@ pkgs.pidgin.overrideAttrs (origAttrs: rec { @@ -12,6 +12,7 @@ pkgs.pidgin.overrideAttrs (origAttrs: rec {
"--disable-farstream"
"--disable-vv"
"--disable-dbus"
"--disable-perl"
"--disable-schemas-install"
];
propagatedBuildInputs = [];

19
nix/swiften-lightweight.nix

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
{ pkgs ? import <nixpkgs> {} }:
let
pkgs-eta = import (builtins.fetchTarball {
# Descriptive name to make the store path easier to identify
name = "nixos-with-fixed-swiften";
url = "https://github.com/nixos/nixpkgs/archive/557644a1258902d20619679755dfa393b4fdad07.tar.gz";
sha256 = "0ia6c5c1zxmslmdahdrg745jb1vk41l0cl7y0h2xmzf5ls80rx3z";
}) {};
in
pkgs-eta.swiften.overrideAttrs (orig: rec {
outputs = ["out" "dev"];
buildInputs = orig.buildInputs ++ [ pkgs-eta.boost.dev ];
propagatedBuildInputs = [ pkgs-eta.openssl pkgs-eta.boost.out ];
outputBin = "dev";
postFixup = ''
mv -v $out/bin $dev/
'';
})
Loading…
Cancel
Save