maunium-stickerpicker-nix/flake.nix

91 lines
2.3 KiB
Nix
Raw Normal View History

2023-01-02 01:18:49 +00:00
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
2023-01-02 01:18:49 +00:00
maunium-stickerpicker = {
url = "github:maunium/stickerpicker";
flake = false;
};
};
outputs = { self, nixpkgs, maunium-stickerpicker }: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
fetchers = pkgs.callPackage ./fetchers.nix { };
downloadStickers = pkgs.callPackage ./downloadStickers.nix {
2023-01-02 01:18:49 +00:00
inherit maunium-stickerpicker fetchers;
inherit (self.packages.${system}) stickerpicker-tools;
};
in {
inherit downloadStickers;
2023-01-02 01:18:49 +00:00
devShells.${system}.default = pkgs.mkShell {
name = "python-venv";
venvDir = "./.venv";
buildInputs = [
pkgs.python3Packages.python
pkgs.python3Packages.venvShellHook
self.packages.${system}.stickerpicker-tools
self.packages.${system}.sigstickers
];
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
pip install -r requirements.txt
'';
postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
'';
};
packages.${system} =
let
signalstickers-client = (pkgs.python3Packages.callPackage ./python/signalstickers-client.nix {});
in
{
2023-01-02 01:18:49 +00:00
default = self.packages.${system}.stickerpicker-tools;
sigstickers = (pkgs.python3Packages.callPackage ./python/sigstickers.nix { inherit signalstickers-client; });
pub-solar-stickers = downloadStickers {
homeserver = "https://matrix.pub.solar";
userId = "@hakkonaut:pub.solar";
sha256 = "sha256-e5KNPhtrETzgcJxbVZtlWwBXK3RlNKXCZPPZ5Zk46ok=";
packs = [
{
type = "chatsticker";
name = "donald-and-friends";
}
{
type = "chatsticker";
name = "heartwarming-cat-world";
}
{
type = "chatsticker";
name = "kawaii-potato-1";
}
];
};
2023-01-02 01:18:49 +00:00
stickerpicker-tools = pkgs.python3Packages.buildPythonPackage {
name = "stickerpicker-tools";
src = maunium-stickerpicker;
propagatedBuildInputs = with pkgs.python3Packages; [
aiohttp
yarl
pillow
telethon
cryptg
python-magic
pkgs.cacert
];
doCheck = false;
};
};
};
}