71 lines
3.8 KiB
Nix
71 lines
3.8 KiB
Nix
|
{ system ? builtins.currentSystem
|
||
|
, nix-thunk ? import ./dep/nix-thunk {}
|
||
|
, obelisk ? import ./.obelisk/impl {
|
||
|
inherit system;
|
||
|
iosSdkVersion = "13.2";
|
||
|
# This argument (which is new, but was easy to add to Obelisk, thankfully), allows one to specify nixpkgs overlays.
|
||
|
# We'll use it to ensure we have the appropriate version of botan.
|
||
|
nixpkgsOverlays =
|
||
|
[
|
||
|
(self: super: rec {
|
||
|
botan2 =
|
||
|
(super.botan2.overrideAttrs (old: {
|
||
|
# Get rid of some patches that nixpkgs was applying to botan2 and which didn't apply to the branch.
|
||
|
patches = [];
|
||
|
# The --with-openssl flag didn't work for some reason, might need further figuring out.
|
||
|
configurePhase = builtins.replaceStrings [ "--with-openssl" ] [ " " ] old.configurePhase;
|
||
|
# Here, we use nix-thunk to get the source of the correct branch of the botan repo via a thunk.
|
||
|
# Nix thunks are essentially references to git repositories that can be unpacked to their
|
||
|
# source in-place when working on the project, or packed up into a few small files.
|
||
|
# After installing the nix-thunk command from https://github.com/obsidiansystems/nix-thunk
|
||
|
# you can run:
|
||
|
# nix-thunk unpack dep/botan
|
||
|
# from the top level of this repo to clone a copy of the botan git repo at the appropriate
|
||
|
# commit, and work on it from there. Similarly,
|
||
|
# nix-thunk pack dep/botan
|
||
|
# will pack it back up again, provided that the changes have been pushed somewhere.
|
||
|
# Note: there's a bug in the current version of Obelisk which occasionally gives it some trouble
|
||
|
# if certain repos are unpacked. If you have any trouble running an ob command
|
||
|
# (ob run, ob repl, etc.) with a thunk unpacked, try adding the flag --no-interpret dep
|
||
|
# and hopefully that will sort it out.
|
||
|
src = nix-thunk.thunkSource ./dep/botan;
|
||
|
})).override (old: {
|
||
|
# Also, turn on debugging.
|
||
|
extraConfigureFlags = "--debug-mode";
|
||
|
});
|
||
|
# For whatever reason, it seems callCabal2nix below wants to use the botan package rather than botan2.
|
||
|
# We could override the pkgconfigDepends of the resulting package, but this is easier.
|
||
|
botan = self.botan2;
|
||
|
})
|
||
|
];
|
||
|
|
||
|
# You must accept the Android Software Development Kit License Agreement at
|
||
|
# https://developer.android.com/studio/terms in order to build Android apps.
|
||
|
# Uncomment and set this to `true` to indicate your acceptance:
|
||
|
# config.android_sdk.accept_license = false;
|
||
|
|
||
|
# In order to use Let's Encrypt for HTTPS deployments you must accept
|
||
|
# their terms of service at https://letsencrypt.org/repository/.
|
||
|
# Uncomment and set this to `true` to indicate your acceptance:
|
||
|
# terms.security.acme.acceptTerms = false;
|
||
|
}
|
||
|
}:
|
||
|
with obelisk;
|
||
|
project ./. ({ pkgs, hackGet, ... }: {
|
||
|
android.applicationId = "systems.obsidian.obelisk.examples.minimal";
|
||
|
android.displayName = "Obelisk Minimal Example";
|
||
|
ios.bundleIdentifier = "systems.obsidian.obelisk.examples.minimal";
|
||
|
ios.bundleName = "Obelisk Minimal Example";
|
||
|
overrides = self: super:
|
||
|
with pkgs.haskell.lib; {
|
||
|
# Here, we get the tahoe-chk package from the chk.hs thunk, and use callCabal2nix to get a nix derivation to build it.
|
||
|
tahoe-chk = self.callCabal2nix "tahoe-chk" (nix-thunk.thunkSource ./dep/chkhs) {};
|
||
|
# We also ended up needing an override of the base32 library, which we obtain from Hackage.
|
||
|
base32 = self.callHackageDirect {
|
||
|
pkg = "base32";
|
||
|
ver = "0.2.2.0";
|
||
|
sha256 = "1qx7n2jyb9h1082434r90hfrjw5fab2j1yg0qzxh856fpksbh811";
|
||
|
};
|
||
|
};
|
||
|
})
|