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 newdawn pkgs #364975

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

Add newdawn pkgs #364975

wants to merge 20 commits into from

Conversation

NewDawn0
Copy link

Summary of Changes

Hi everyone. Over the years I've created some packages which could be useful, some of which are already in use by some of my colleagues. So I thought I'd distribute the popuplar packages.

This pull request adds the following new packages to nixpkgs:

  • ansi-cheatsheet: A blazingly fast cheatsheet for ANSI escape codes.
  • asciiWeather: A CLI screensaver showing weather states, inspired by ascii-rain.
  • up: A fast utility to navigate up relative directories.
  • Note: A tool to take temporary notes, automatically removed when the editor exits.
  • vocab: A CLI tool to practice vocabulary, featuring auto-correct and auto-translation.
  • Notify: A cross-platform CLI tool to send notifications.
  • dirstack: Quickly switch between directories using a quicklist.
  • Ex: A wrapper for extracting common archive formats.
  • Gen: An extensible project generator.
  • Nixie-clock: A terminal clock displayed in nixie tube style.
  • Shredder: Securely delete files.
  • Translate: Translate text directly from the CLI.

These tools are lightweight, efficient, and designed to improve productivity in the terminal.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

An ansi escape code cheatsheet
An extensible terminal screensaver displaying weather inspired by rain.c
A fast way to cd up n directories
Note a temporary note taking tool
A vocabulary learning tool
Send notifications and forms from your terminal
A cd quicklist interface
A wrapper to extract common archive types
An extensible project generator
A cli inside nixie-tubes
Securely delete files
Translate text using the cli
@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Dec 13, 2024
@NewDawn0
Copy link
Author

I’m facing an issue with some failing tests, specifically the Eval / Outpaths (<system>), where <system> is any of the tested systems like aarch64-linux, for example. It seems to fail because it can't NewDawn0 in maintainer-list.nix, but I’ve double-checked and confirmed that it is correctly listed there.

Could someone help me debug this? Thanks in advance!

@pluiedev
Copy link
Contributor

It's most likely because the commit that adds you to maintainers-list.nix came after the commits where the packages are added, therefore those commits won't evaluate on their own

Copy link
Contributor

@pluiedev pluiedev left a comment

Choose a reason for hiding this comment

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

Welcome to Nixpkgs — theres a few things that need to be addressed

src = fetchFromGitHub {
owner = "NewDawn0";
repo = "ansi";
rev = "6b6d3b991706247af90f3f72c67238144f77a928";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use a named tag?

Copy link
Author

Choose a reason for hiding this comment

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

I'm Woking on it and will submtit a cmmit with all the applied changes soon

};
buildInputs = [ zig ];
buildPhase = ''
export LIBRARY_PATH=/usr/lib
Copy link
Contributor

Choose a reason for hiding this comment

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

? /usr/lib does not exist in Nix(OS)

Comment on lines 24 to 25
mkdir -p $out/bin
cp zig-out/bin/ansi $out/bin
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mkdir -p $out/bin
cp zig-out/bin/ansi $out/bin
install -D zig-out/bin/ansi -t $out/bin

mkdir -p $out/bin
cp zig-out/bin/ansi $out/bin
'';
meta = with lib; {
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid with lib;

cp zig-out/bin/ansi $out/bin
'';
meta = with lib; {
description = "A cheatsheet for ansi escape codes";
Copy link
Contributor

Choose a reason for hiding this comment

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

Use proper capitalization and avoid leading articles (see pkgs/README.md)

Suggested change
description = "A cheatsheet for ansi escape codes";
description = "Cheatsheet for ANSI escape codes";

Comment on lines +25 to +27
shellHook = ''
source $out/lib/SOURCE_ME.sh
'';
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this for?

Copy link
Author

Choose a reason for hiding this comment

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

Packages like up and dirstack have a backend written in C or Rust, this binary cannot change directories. My approach to solving this problem is creating a file which when sourced provides the up and ds functions which executes the cd command the backend provides them with, thereby changing directories in the user's shell. If there is a better approach, I'll gladly change it

inherit meta;
name = "dirStack-wrapped";
version = "1.0.0";
phases = [ "installPhase" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't override phases. Instead set dontConfigure, dontBuild... to true.

pname = "dirStack";
version = "1.0.0";
propagatedBuildInputs = [ fzf ];
cargoLock.lockFile = "${src}/Cargo.lock";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this necessary? (Set cargoHash instead)

Copy link
Author

Choose a reason for hiding this comment

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

I figured If I updated the package, I would have to update less since it would use the new Cargo.Lock from the ${src} and would thereby only have to update the Cargo.lock. Please let me know I should change it to use cargoHash instead of lockFile

Copy link
Contributor

Choose a reason for hiding this comment

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

lockFile is specifically used for lock files we have vendored inside Nixpkgs for whatever reason (upstream's lockfile is missing/wrong/outdated/etc) — if you're using a lock file from the package itself, just use cargoHash.

(Also, I think using lockFile like this will introduce an import-from-derivation (IFD), which is not permitted in Nixpkgs, so there's really no reason to do this)

};
in
rustPlatform.buildRustPackage {
name = "nixie-clock";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
name = "nixie-clock";
pname = "nixie-clock";

lib,
}:
buildGoModule {
name = "shredder";
Copy link
Contributor

Choose a reason for hiding this comment

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

name -> pname, add version

@vcunat vcunat changed the base branch from staging-next to master December 15, 2024 18:58
@NewDawn0
Copy link
Author

I applied all the suggested changes.
Please let me know if more changes need to be applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants