-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flake.nix #15
base: master
Are you sure you want to change the base?
Add flake.nix #15
Conversation
flake.nix
Outdated
name = binName; | ||
src = ./.; | ||
|
||
buildInputs = with pkgs; [ | ||
cairo | ||
cmake | ||
meson | ||
ninja | ||
pkg-config | ||
]; | ||
|
||
configurePhase = '' | ||
meson build | ||
''; | ||
|
||
buildPhase = '' | ||
( | ||
cd build | ||
meson compile | ||
) | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp build/src/${binName} $out/bin | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use name
use pname
.
There's build time tools in buildInputs
.
The phases are unneeded because of meson's hook. (after #16)
It would make more sense to override
the stdenv to clang and overrideAttrs
the src of the package from nixpkgs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. I've switched to pname
and nativeBuildInputs
.
I'm a flake noob. Could you elaborate on the override suggestion or point me to an example? Are you suggesting I override from an existing package in nixpkgs?
Adds a flake.nix file so the repo can be built and run with nix.
I added this to my fork in order to include it in my nix config--submitting a PR in case it is useful to anyone else.