Last active
July 7, 2026 11:28
-
-
Save sortofsleepy/16d35365b3148f1f1e03181ecc5584e7 to your computer and use it in GitHub Desktop.
Example of packaging a non-existant package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fetches the specified version of Odin | |
| odin-fetch = pkgs.stdenv.mkDerivation { | |
| pname = "odin-source"; | |
| version = odin-version; | |
| src = pkgs.fetchurl { | |
| url="https://github.com/odin-lang/Odin/releases/download/dev-2026-05/odin-linux-amd64-${odin-version}.tar.gz"; | |
| # When you change versions, you should get an error pointing to the correct SHA | |
| # TODO not sure if there's a better way to get the right hash without needing to get Nix to tell you. | |
| hash = "sha256-zX7CzRqyhAoLfrwY5ctBxnG86HsS8Fb92+8/CAtN3n0="; | |
| }; | |
| buildInputs = [ | |
| pkgs.llvm | |
| pkgs.clang | |
| pkgs.libiconv | |
| ]; | |
| installPhase = '' | |
| mkdir -p $out/bin $out/share/odin | |
| cp odin $out/bin | |
| cp -r base core vendor $out/share/odin/ | |
| ''; | |
| }; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A small snippet from a flake of mine that demonstrates a basic way of pulling in a package that doesn't already exist on nix packages. Likely not the only way.