diff --git a/README.md b/README.md index d808ffd..d5787c6 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,12 @@ Loupe is GNOME's default Image Viewer. This fork adds image annotation support. ![Image Viewer Screenshot](data/screenshots/loupe-annotation.png) +## Nix + +With Nix flakes enabled, run the app from a checkout with `nix run .` or install +it with `nix profile install .`. The flake provides packages for x86_64-linux and +aarch64-linux. Image loading uses the glycin loaders included by the package. + ## Supported Image Formats Image Viewer uses [glycin](https://gitlab.gnome.org/GNOME/glycin) for loading images. You can check [glycin's README](https://gitlab.gnome.org/GNOME/glycin#supported-image-formats) for more details about the formats supported by the default loaders. However, glycin supports adding loaders for additional formats. Therefore, the supported formats on your system may vary and might be changed by installing or removing glycin loaders. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..dd9264b --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1789654592, + "narHash": "sha256-vrwAiXmz+0hs/IWXZalFG/Ws6xQRcW+gClUDlfvcfjQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ecc58f32d1069a3e3f8a991e2233d365689f748d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-26.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..920d0a8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,36 @@ +{ + description = "Loupe image viewer with annotation support"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05"; + + outputs = { self, nixpkgs }: + let + systems = [ "x86_64-linux" "aarch64-linux" ]; + forAllSystems = nixpkgs.lib.genAttrs systems; + in + { + packages = forAllSystems (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + loupe = pkgs.loupe.overrideAttrs (old: { + version = "51.0.0"; + src = self; + + cargoDeps = pkgs.rustPlatform.fetchCargoVendor { + src = self; + name = "loupe-deps-51.0.0"; + hash = "sha256-rq89XiQdOTVLTxrt8PhDC8LdXCaELIDHiwJu+teu6bY="; + }; + + meta = (builtins.removeAttrs old.meta [ "changelog" "maintainers" "teams" ]) // { + homepage = "https://forg.gregersen.it/lazzexus/Loupe"; + description = "Loupe image viewer with screenshot annotation support"; + }; + }); + in + { + default = loupe; + loupe = loupe; + }); + }; +}