initial commit

This commit is contained in:
Youwen Wu 2025-01-03 16:51:50 -08:00
commit 89ff2f3f67
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
7 changed files with 190 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
result

19
LICENSE Normal file
View file

@ -0,0 +1,19 @@
Copyright (c) 2025 Youwen Wu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

13
README.md Normal file
View file

@ -0,0 +1,13 @@
# Betterbird
Provides binary releases of [betterbird](http://betterbird.eu/).
```nix
{
inputs = {
betterbird.url = "git+https://code.youwen.dev/youwen5/betterbird-flake";
# recommended
betterbird.inputs.nixpkgs.follows = "nixpkgs";
};
}
```

90
betterbird-unwrapped.nix Normal file
View file

@ -0,0 +1,90 @@
{
stdenv,
config,
wrapGAppsHook3,
autoPatchelfHook,
patchelfUnstable,
adwaita-icon-theme,
dbus-glib,
libXtst,
curl,
gtk3,
alsa-lib,
libva,
pciutils,
pipewire,
writeText,
fetchurl,
version,
url,
hash,
...
}:
let
policies = {
DisableAppUpdate = true;
};
in
# policiesJson = writeText "firefox-policies.json" (builtins.toJSON { inherit policies; });
stdenv.mkDerivation (finalAttrs: {
inherit version;
pname = "betterbird-unwrapped";
src = fetchurl {
inherit url hash;
};
nativeBuildInputs = [
wrapGAppsHook3
autoPatchelfHook
patchelfUnstable
];
buildInputs = [
gtk3
alsa-lib
adwaita-icon-theme
dbus-glib
libXtst
];
runtimeDependencies = [
curl
libva.out
pciutils
];
appendRunpaths = [
"${pipewire}/lib"
];
installPhase = ''
mkdir -p "$prefix/lib/betterbird-${version}"
cp -r * "$prefix/lib/betterbird-${version}"
mkdir -p $out/bin
ln -s "$prefix/lib/betterbird-${version}/betterbird" $out/bin/betterbird
'';
# mkdir -p "$out/lib/betterbird-${version}/distribution"
# ln -s ${policiesJson} "$out/lib/betterbird-${version}/distribution/policies.json"
patchelfFlags = [ "--no-clobber-old-sections" ];
meta = {
mainProgram = "betterbird";
description = ''
Betterbird is a fine-tuned version of Mozilla Thunderbird, Thunderbird on steroids, if you will.
'';
};
passthru = {
inherit gtk3;
libName = "betterbird-${version}";
binaryName = finalAttrs.meta.mainProgram;
gssSupport = true;
ffmpegSupport = true;
};
})

8
betterbird.nix Normal file
View file

@ -0,0 +1,8 @@
{
wrapFirefox,
betterbird-unwrapped,
...
}:
wrapFirefox betterbird-unwrapped {
pname = "betterbird";
}

27
flake.lock Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1735834308,
"narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6df24922a1400241dae323af55f30e4318a6ca65",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

32
flake.nix Normal file
View file

@ -0,0 +1,32 @@
{
description = "Betterbird binaries provided for NixOS";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs =
{ nixpkgs, ... }:
let
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
];
in
{
packages = forAllSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) callPackage;
in
rec {
default = betterbird;
betterbird-unwrapped = callPackage ./betterbird-unwrapped.nix {
url = "https://www.betterbird.eu/downloads/LinuxArchive/betterbird-128.5.2esr-bb19.en-US.linux-x86_64.tar.bz2";
hash = "sha256-eW6pA1GFvsxFh6uckFUmOhtTn9HqhpGuW4iXTk/k+E8=";
version = "128.5.2esr-bb19";
};
betterbird = callPackage ./betterbird.nix { inherit betterbird-unwrapped; };
}
);
};
}