Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add flake.nix #15

wants to merge 2 commits into from

Conversation

krscott
Copy link

@krscott krscott commented Aug 11, 2024

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.

flake.nix Outdated
Comment on lines 23 to 48
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
'';
Copy link

@Artturin Artturin Aug 31, 2024

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.

Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants