AppImage / Derivation

I’m trying to run an AppImage and have read the manual on Nix about it Nix - Nixpkgs 22.05 manual The Image I’m trying to get to run is from https://everdo.net/ right on the main page.

Preferably I’d like to have it setup as a derivation. I believe from the manual I’m suppose to wrap it looking something like:

appimageTools.wrapType2 { # or wrapType1
name = “everdo”;
src = fetchurl {
url = “https://github.com/ssbc/patchwork/releases/download/v3.11.4/Patchwork-3.11.4-linux-x86_64.AppImage”;
sha256 = “1blsprpkvm0ws9b96gb36f0rbf8f5jgmw4x6dsb1kswr4ysf591s”;
};
extraPkgs = pkgs: with pkgs; ;
}

My question is how do I get the correct sha256 number? What do I put in my nixos config file to automatically load the derivation?

I’m a complete Nixos noob, but trying to learn. Thanks for being patient with me.

We generally just put a wrong hash in, wait for nix to complain, then copy and paste the hash nix says is correct.

You can put the derivation anywhere you could put pkgs.something, including directly into environment.systemPackages, like so:

environment.systemPackages = with pkgs; [ (appimageTools.wrapType2 { ... }) ];

(Note the parentheses. Without them, it will be parsed as 2 distinct list elements)

If you want to keep the derivation in its own file, you can introduce some extra indirection, such as using callPackage, but the general idea is the same.

1 Like

The default patchwork was able to run, but when I replace it with mine it fails because of hash.

error: hash mismatch in fixed-output derivation ‘/nix/store/idd0c9q94dvl9ymmc4haf1g49dwzjzqn-Everdo-1.8.2.AppImage.drv’:
specified: sha256-OqTitCeZ6xmWbqYTXp8sDrmVgTNjPZNW0hzUPW++mq4=
got: sha256-JYrZ+rFFIwugn/QmikU/jpujodvh0EgqRwheT5svWv0=
error: 1 dependencies of derivation ‘/nix/store/pfb54nx3x6gfk8yphlxbyzrymn62qvaj-everdo1-extracted.drv’ failed to build
error: 1 dependencies of derivation ‘/nix/store/4m2cw0j3987yvw2kiaxjz7m6cbm108g9-everdo1-init.drv’ failed to build
error: 1 dependencies of derivation ‘/nix/store/fpl6mx734znsn5rx18kmyqdb254qabxk-everdo1.drv’ failed to build
error: 1 dependencies of derivation ‘/nix/store/0ppgn59vqb9a3qkffnglignmfg8apmij-everdo1.drv’ failed to build
error: 1 dependencies of derivation ‘/nix/store/zgbvz9inbi7iz2ks4i2kpip1yr5faqpy-system-path.drv’ failed to build
error: 1 dependencies of derivation ‘/nix/store/2agwax5f3m4ch2sw0v4iph6nmwmd8s40-nixos-system-nixos-22.05.2397.5c211b47aea.drv’ failed to build

I copied the hash from that terminal output directly, but no go. What am I missing?

Edit: changing the hash name itself resolved my issue. Also had to add parathesis (beginning and end) which was lacking from the wiki. Thanks a lot for the help tejing! Was really starting to struggle with this program and knew it’d be the harder one to resolve.

(appimageTools.wrapType2 { # or wrapType1
name = “everdo1”;
src = fetchurl {
url = “https://release.everdo.net/1.8.2/Everdo-1.8.2.AppImage”;
hash = “sha256-JYrZ+rFFIwugn/QmikU/jpujodvh0EgqRwheT5svWv0=”;
};
extraPkgs = pkgs: with pkgs; ;
})