Closed alerque closed 2 years ago
In score+=1
for debugging, I can at least reproduce this in NixOS!
$ docker run -it nixos/nix:latest
$ nix run --extra-experimental-features 'nix-command flakes' github:sile-typesetter/sile -- --version
error: attribute 'defaultApp.x86_64-linux' should have type 'derivation'
I don't understand why it works for me locally (Arch Linux w/ nix
).
Adding the app name #sile
to the command works both for me locally and in NixOS.
$ nix run --extra-experimental-features 'nix-command flakes' github:sile-typesetter/sile#sile -- --version
SILE v0.12.5-72b25f3-flake (Lua 5.3)
I will push that through as a fix to get the website updating, but I don't pretend to understand why.
I read this: https://github.com/NixOS/nix/issues/6448 and I think your solution is:
diff --git i/flake.nix w/flake.nix
index dd0da117..b32ba0fc 100644
--- i/flake.nix
+++ w/flake.nix
@@ -139,9 +139,12 @@
};
packages.sile = sile;
defaultPackage = sile;
- apps.sile = {
- type = "app";
- program = "${sile}/bin/sile";
+ apps = rec {
+ default = sile;
+ sile = {
+ type = "app";
+ program = "${sile}/bin/sile";
+ };
};
defaultApp = apps.sile;
}
The change done in the newer nix version is the fact that nix run
now searches for app.default
attribute and not defaultPackage
, so it seems.
Thanks! That wasn't quite the right syntax because ${sile}
isn't set there and needed to be ${self.defaultPackage.${system}}
instead, but it was close enough to get on the right track. I agree with that issue you linked, this error is too cryptic and points completely the wrong direction—at least for this specific cause.
From the mostly obsolete SILE issue:
We use both the last stable release and the HEAD to generate examples on the website. The stable version comes out of Nix packages, the HEAD version from the flake.
For some reason while I can run it locally the Flake doesn't work from CI.
Before trying to use it we double check that we can run it:
https://github.com/sile-typesetter/sile-typesetter.github.io/blob/master/.github/workflows/deploy.yml#L40
That's the line that's failing.
Note I've been testing this on my fork.
Any ideas @doronbehar?