exfetch.nix

nix packaging for Izder456/exfetch

exfetch.nix

nix packaging for Izder456/exfetch

Dependencies

  • nix

Any packaging dependencies should be provided by nix/nixpkgs through the nix expression.

The package source repository itself is referenced by the nix expression and pulled in during the build, along with all its dependencies.

Build

From repository root:

$ nix-build .

or (using flake interface)

$ nix build

This would build the package from source, producing a derivation and putting the resulting build package in the nix store, along with a symlink to it at ./result.

Check the symlink to inspect the resulting package tree:

$ readlink ./result
$ tree ./result/

To check the deriver(.drv file):

$ nix-store -q -d (readlink result)

Maintenance

Updating dependencies

Crystal dependencies are converted to nix dependencies using crystal2nix.

To update the shards.nix file:

  1. clone the source repository: git clone <repo url>(see default.nix for source repo url);
  2. checkout the desired ref(commit, tag, branch head);
  3. inside the source repository, run nix-shell -p pkgs.crystal2nix --run crystal2nix;
  4. copy over the new shards.nix to this repository;
  5. build and test, i.e. nix-build; ./result/bin/exfetch;
  6. commit and publish the updated shards.nix.

Updating package version

To provide a new version of the source package:

  1. follow above procedure to generate shards.nix from a checkout of the source repository at the desired version;
  2. update the default.nix file with the new version, i.e. sed -ir "s/version = '.+';/version = '$version';/";
  3. build and test, i.e. nix-build; ./result/bin/exfetch;
  4. commit and publish updated nix files.

Using nix flake

The flake.nix enables support for flake-based workflow.

  • try out this package with a single nix command: nix run 'git+https://codeberg.org/DrPyser/exfetch.nix#exfetch'
  • enter a shell with the target package available:
    $ nix shell 'git+https://codeberg.org/DrPyser/exfetch.nix'
    
Repository

exfetch.nix

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • 7 months ago
  • June 29, 2025
License

Links
Synced at

Fri, 30 Jan 2026 12:58:29 GMT

Languages