Skip to content

Commit

Permalink
Merge pull request #335989 from aidalgol/oama
Browse files Browse the repository at this point in the history
oama: init at 0.14
  • Loading branch information
cdepillabout authored Aug 24, 2024
2 parents 0b6e944 + fc086f1 commit 0e4fd9c
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 7 deletions.
94 changes: 94 additions & 0 deletions pkgs/by-name/oa/oama/generated-package.nix
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";
}
29 changes: 29 additions & 0 deletions pkgs/by-name/oa/oama/package.nix
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
]
22 changes: 22 additions & 0 deletions pkgs/by-name/oa/oama/update.sh
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."
1 change: 1 addition & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ mapAliases ({

ma1sd = throw "ma1sd was dropped as it is unmaintained"; # Added 2024-07-10
MACS2 = macs2; # Added 2023-06-12
mailctl = throw "mailctl has been renamed to oama"; # Added 2024-08-19
mailman-rss = throw "The mailman-rss package was dropped since it was unmaintained."; # Added 2024-06-21
mariadb_104 = throw "mariadb_104 has been removed from nixpkgs, please switch to another version like mariadb_106"; # Added 2023-09-11
mariadb_1010 = throw "mariadb_1010 has been removed from nixpkgs, please switch to another version like mariadb_1011"; # Added 2023-11-14
Expand Down
7 changes: 0 additions & 7 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2642,13 +2642,6 @@ with pkgs;

mainsail = callPackage ../applications/misc/mainsail { };

mailctl = (haskellPackages.callPackage ../tools/networking/mailctl {}).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;
});

mame = libsForQt5.callPackage ../applications/emulators/mame { };

mame-tools = lib.addMetaAttrs {
Expand Down

0 comments on commit 0e4fd9c

Please sign in to comment.