Closed nixinator closed 2 years ago
@nixinator I don't use flakes because they're an experimental feature that I don't want to depend on until they're stable. I'm not opposed to supporting this workflow but I cannot do it myself.
Where does this wish come from? Is it you personally, your employer (if so, which one)?
@NorfairKing I wish to import your code in a Flake. I cannot do this, because your Nix code uses builtins.currentSystem
which is considered impure since it refers to the host system (which can vary). If I attempt to import any of your Nix code in a Flake, it results in:
error: attribute 'currentSystem' missing
at /nix/store/2ighdnh07y10my6466cm6rxv629dgyr9-nixpkgs-src/pkgs/top-level/impure.nix:18:43:
17| # (build, in GNU Autotools parlance) platform.
18| localSystem ? { system = args.system or builtins.currentSystem; }
| ^
19|
(use '--show-trace' to show detailed location information)
This is not something I can fix, since your imports ultimately call more impure things. I tried the following for example. where sydtest-src
is your source code:
...
sydtestPurified = pkgs.runCommandNoCC "sydtestPurified" {} ''
cp -r ${sydtest-src} $TMP/src
cd $TMP/src
for f in $(find . -type f); do
substituteInPlace $f \
--replace 'builtins.currentSystem' '"${system}"' \
--replace 'inherit system' 'system = "${system}"'
done
cp -r $TMP/src $out
'';
...
But import sydtestPurified
still results in error: attribute 'currentSystem' missing
.
Related issue: https://github.com/NixOS/nix/issues/3843
@MatthewCroughan Thanks for the details! I think I understand what flakes are and why you need me to provide one if you want to use it.
What I am asking right now is: Where is this ask coming from. Is it a person, is it an organisation. Which project is sydtest used for in this case?
To answer your question: I cannot justify spending the time to set up and maintain a flake setup right now but that may be fixable.
In the case that you want a low maintenance approach and want to continue with niv, this might be useful to you. https://github.com/crazazy/niv-flakes
Seems to be fixed in #20
Great that you provide an overlay, but can you create a flake for this package, with sydtest as an attribute inside
packages
in the flake.nix.