Nix flake to python app

Trying to create a flake to build a simple python app.
When running nix flake show it returns

cannot coerce a set to a string

on line 45

 program = "${self.defaultPackage}/bin/scramgit";

my project

not really sure what I am missing here, so if anyone can help I would appreciate it.

Your problem is about the way you deal with system. First, packages should be in packages.${system}.yourPackage, not in packages.yourPackage.${system} as you do right now. Secondly, as far as I know it’s apps.${system}.default, not sure why you use defaultApp (same for programs). Finally, your path should include the system like

   program = "${self.packages.${system}.yourprogram}/bin/scramgit";

Thank you for taking the time to help.
I have rebuild the flake, and now i get no errors when running nix flake show or build, however there is no binary build, after running nix build . What am I missing now?

updated flake

error: unable to execute '/nix/store/a7ahwlmlqg692w79zd43r133vnvbag9n-scramgit-0.1.0/bin/scramgit': No such file or directory

The error was my lack of understanding of how to use, it is now working.

1 Like

That’s a deprecated form from when flakes were just introduced. It lingers in blog posts, so I can see why someone would accidentally pick it up. It should still work in modern nixes, but maybe very modern has finally done away with it.

What’s in /nix/store/a7ahwlmlqg692w79zd43r133vnvbag9n-scramgit-0.1.0/bin/scramgit? That directory will contain the output of your build.

It looks fine at a glance, but your is very simple. Perhaps the name is just different from what you expect, or you need more configuration to actually create a binary; so check what the build output currently is.


yes, my problem was the, thank you for helping, much appreciated