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

feat: add nix flake #1

Merged
merged 13 commits into from
Dec 2, 2023
Merged

feat: add nix flake #1

merged 13 commits into from
Dec 2, 2023

Conversation

getchoo
Copy link
Contributor

@getchoo getchoo commented Oct 17, 2023

this adds a standard nix flake for building both the binary and docker image - all with cross compiling from any system to x86_64 and aarch64

another nice change is redis can now be run from a devShell by entering it and running daemons (see the comment in ./nix/dev.nix)

Copy link
Owner

@ryanccn ryanccn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-compilation from darwin does not work; outputs darwin executable

@ryanccn
Copy link
Owner

ryanccn commented Oct 28, 2023

Building valfisk-docker on macOS still results in a macOS Mach-O binary in a Linux Docker image. Is there any way around this?

Also, how are you supposed to use the cross packages? Doing nix build .#legacyPackages.x86_64-linux.cross.valfisk didn't really work for me.

@getchoo
Copy link
Contributor Author

getchoo commented Oct 28, 2023

Building valfisk-docker on macOS still results in a macOS Mach-O binary in a Linux Docker image. Is there any way around this?

for some reason i thought this would make a macos docker image...lol
anyways, i've made a new set of packages in legacyPackages (since they really shouldn't be used outside of this flake) that will build a static version of valfisk for linux from any system, along with an accompanying docker image. you can build these with nix build .#valfisk-static and nix build .#valfisk-docker

Also, how are you supposed to use the cross packages? Doing nix build .#legacyPackages.x86_64-linux.cross.valfisk didn't really work for me.

see above; i've slightly changed the approach here since we only really need these for docker images and compiling to a static linux binary

.github/workflows/docker.yml Outdated Show resolved Hide resolved
nix/docker.nix Outdated Show resolved Hide resolved
@ryanccn
Copy link
Owner

ryanccn commented Dec 2, 2023

rip

@ryanccn ryanccn merged commit 6addfad into ryanccn:main Dec 2, 2023
9 checks passed
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