mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-26 00:15:56 +03:00
[PR #637] [MERGED] Ref/flake #1168
Labels
No labels
bug
compatibility
feature request
fit for beginners
help wanted
hosting
idea
improvement
packaging
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asciinema#1168
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/asciinema/asciinema/pull/637
Author: @Dich0tomy
Created: 6/9/2024
Status: ✅ Merged
Merged: 7/22/2024
Merged by: @ku1ik
Base:
develop← Head:ref/flake📝 Commits (10+)
6233397ref(nix): switch to flake-parts06dcba7ref(nix): make the flake more idiomaticf90a922ref(nix): access package directly81306e9ref(nix): make local path reproducible4d5e221ref(nix): split package to default.nix5f85054ref(nix): move shell to shell.nix48c8903ref(nix): remove unnecessary explicit inputsc094605style(nix): move formatter to the topc299444fix(nix): make the package code correctb2bdcf4chore(nix): bump flake.lock📊 Changes
4 files changed (+120 additions, -76 deletions)
View changed files
➕
default.nix(+35 -0)📝
flake.lock(+31 -34)📝
flake.nix(+30 -42)➕
shell.nix(+24 -0)📄 Description
This PR refactors the recently added flake:
Added shell.nix and default.nix for users that don't use flakes and use Nix2
Removed flake-utils and used flake-parts instead, it's way less volatile and has a couple of nice features that could come in handy later (e.g. debugging, really nice modularization)
Changed up a few things to comply with best practices and conventions - like attribute names (
nativeBuildInputsvspackagesformkShell), name conventions (pname,name,versionfor mkDerivation), etc.Made the source of the derivation reproducible when built locally (
src = ./.relies on the current folder name, which if changed can trigger cache misses)The
default.nixandshell.nixarecallPackaged, which automatically fills their arguments withnixpkgspackages and allows for easy overridingSplit the package's dependencies into correct categories, in this case only 3 matter:
nativeBuildInputs- dependencies which are only needed in the build process and nowhere else (like build tools).buildInputs- dependencies which will be needed by runtime later - static libraries linked into the library, dynamic libraries and such.nativeCheckInputs- native dependencies for tests, this one has a separate category because one may wish to disable checks for the package which would also make the derivation not pull in the unnecessary dependencies.For more info on that matter see - https://nixos.org/manual/nixpkgs/stable/#ssec-stdenv-dependencies
As for the modularization - if you'd like the flake could also be split into actual modules, which would make the flake look something like this and then subsequent modules something like this.
As for maintenance of the package - changes are required if you add Rust libraries that depend on system installed libraries as well or add any kind of resources that would need to be installed into the system later (like man docs, shell completions, icons) - I'm happy to assist with that.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.