generated from srid/ema-template
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
90 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
cabal-version: 2.4 | ||
name: emanote | ||
version: 1.3.18.0 | ||
version: 1.3.18.1 | ||
license: AGPL-3.0-only | ||
copyright: 2022 Sridhar Ratnakumar | ||
maintainer: [email protected] | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
imports = [ | ||
./small-closure.nix | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# To make sure that Emanote's closure size is small. | ||
{ root, inputs, ... }: | ||
let | ||
allowedSystems = [ | ||
"x86_64-linux" | ||
|
||
# Disabling on macOS due to upstream bug: | ||
# - https://github.com/NixOS/nixpkgs/issues/318013 | ||
# - https://github.com/NixOS/nixpkgs/pull/304352 | ||
# - Related: https://github.com/NixOS/nix/pull/10877 | ||
# "aarch64-darwin" | ||
]; | ||
in | ||
{ | ||
perSystem = { pkgs, lib, config, system, ... }: lib.mkIf (lib.elem system allowedSystems) { | ||
haskellProjects.default = { | ||
settings = { | ||
emanote = { name, pkgs, self, super, ... }: { | ||
separateBinOutput = false; # removeReferencesTo.nix doesn't work otherwise | ||
justStaticExecutables = true; | ||
removeReferencesTo = [ | ||
self.ghc | ||
self.pandoc | ||
self.pandoc-types | ||
self.warp | ||
]; | ||
}; | ||
}; | ||
}; | ||
|
||
apps.check-closure-size = rec { | ||
inherit (program) meta; | ||
program = pkgs.writeShellApplication { | ||
name = "emanote-check-closure-size"; | ||
runtimeInputs = [ pkgs.jq pkgs.bc pkgs.nix ]; | ||
meta.description = "Check that emanote's nix closure size remains reasonably small"; | ||
text = '' | ||
MAX_CLOSURE_SIZE=$(echo "600 * 1000000" | bc) | ||
CLOSURE_SIZE=$(nix path-info --json -S .#default | jq 'first(.[])'.closureSize) | ||
echo "Emanote closure size: $CLOSURE_SIZE" | ||
echo " Max closure size: $MAX_CLOSURE_SIZE" | ||
if [ "$CLOSURE_SIZE" -gt "$MAX_CLOSURE_SIZE" ]; then | ||
echo "ERROR: Emanote's nix closure size has increased" | ||
exit 3 | ||
else | ||
echo "OK: Emanote's nix closure size is within limits" | ||
fi | ||
''; | ||
}; | ||
}; | ||
}; | ||
|
||
flake.om.ci.default.emanote = { | ||
dir = "."; | ||
steps.custom = { | ||
closure-size = { | ||
type = "app"; | ||
name = "check-closure-size"; | ||
systems = allowedSystems; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters