-
-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #335989 from aidalgol/oama
oama: init at 0.14
- Loading branch information
Showing
5 changed files
with
146 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# This file has been autogenerate with cabal2nix. | ||
# Update via ./update.sh | ||
{ | ||
mkDerivation, | ||
aeson, | ||
base, | ||
bytestring, | ||
containers, | ||
directory, | ||
fetchgit, | ||
hsyslog, | ||
http-conduit, | ||
lib, | ||
mtl, | ||
network, | ||
network-uri, | ||
optparse-applicative, | ||
pretty-simple, | ||
process, | ||
streaming-commons, | ||
string-qq, | ||
strings, | ||
text, | ||
time, | ||
twain, | ||
unix, | ||
utf8-string, | ||
warp, | ||
yaml, | ||
}: | ||
mkDerivation { | ||
pname = "oama"; | ||
version = "0.14"; | ||
src = fetchgit { | ||
url = "https://github.com/pdobsan/oama.git"; | ||
sha256 = "1hdhkc6hh4nvx31vkaii7hd2rxlwqrsvr6i1i0a9r1xlda05ffq0"; | ||
rev = "4e1ffd3001034771d284678f0160060c1871707c"; | ||
fetchSubmodules = true; | ||
}; | ||
isLibrary = true; | ||
isExecutable = true; | ||
libraryHaskellDepends = [ | ||
aeson | ||
base | ||
bytestring | ||
containers | ||
directory | ||
hsyslog | ||
http-conduit | ||
mtl | ||
network | ||
network-uri | ||
optparse-applicative | ||
pretty-simple | ||
process | ||
streaming-commons | ||
string-qq | ||
strings | ||
text | ||
time | ||
twain | ||
unix | ||
utf8-string | ||
warp | ||
yaml | ||
]; | ||
executableHaskellDepends = [ | ||
aeson | ||
base | ||
bytestring | ||
containers | ||
directory | ||
hsyslog | ||
http-conduit | ||
mtl | ||
network | ||
network-uri | ||
optparse-applicative | ||
pretty-simple | ||
process | ||
streaming-commons | ||
string-qq | ||
strings | ||
text | ||
time | ||
twain | ||
unix | ||
utf8-string | ||
warp | ||
yaml | ||
]; | ||
license = lib.licenses.bsd3; | ||
mainProgram = "oama"; | ||
} |
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,29 @@ | ||
{ | ||
haskell, | ||
haskellPackages, | ||
lib, | ||
}: | ||
let | ||
inherit (haskell.lib.compose) overrideCabal justStaticExecutables; | ||
|
||
overrides = { | ||
description = "OAuth credential MAnager"; | ||
homepage = "https://github.com/pdobsan/oama"; | ||
maintainers = with lib.maintainers; [ aidalgol ]; | ||
|
||
passthru.updateScript = ./update.sh; | ||
}; | ||
|
||
raw-pkg = (haskellPackages.callPackage ./generated-package.nix { }).overrideScope ( | ||
final: prev: { | ||
# Dependency twain requires an older version of http2, and we cannot mix | ||
# versions of transitive dependencies. | ||
http2 = final.http2_3_0_3; | ||
warp = final.warp_3_3_30; | ||
} | ||
); | ||
in | ||
lib.pipe raw-pkg [ | ||
(overrideCabal overrides) | ||
justStaticExecutables | ||
] |
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,22 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -i bash -p cabal2nix curl jq nixfmt-rfc-style | ||
|
||
set -euo pipefail | ||
|
||
# This is the directory of this update.sh script. | ||
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
derivation_file="${script_dir}/generated-package.nix" | ||
latest_version="$(curl --silent https://api.github.com/repos/pdobsan/oama/releases/latest | jq --raw-output '.tag_name')" | ||
|
||
echo "Updating oama to version ${latest_version}." | ||
echo "Running cabal2nix and outputting to ${derivation_file}..." | ||
|
||
cat > "${derivation_file}" << EOF | ||
# This file has been autogenerate with cabal2nix. | ||
# Update via ./update.sh | ||
EOF | ||
|
||
cabal2nix --revision "${latest_version}" https://github.com/pdobsan/oama.git >> "${derivation_file}" | ||
nixfmt "${derivation_file}" | ||
|
||
echo "Finished." |
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