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 support #58

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ lib
, stdenv
, testers
, zig_0_11
}:

stdenv.mkDerivation (finalAttrs: {
pname = "dt";
version = "1.2.4";

src = lib.cleanSource ./.;

nativeBuildInputs = [ zig_0_11.hook ];

passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; };

meta = {
homepage = "https://dt.plumbing";
description = "Duct tape for your unix pipes";
longDescription = ''
dt is a utility and programming language. The utility is intended for
ergonomic in-the-shell execution. The language is straightforward (in
the most literal sense) with a minimal syntax that allows for
high-level, higher-order programming.

It's meant to supplement (not replace!) other tools like awk, sed,
xargs, and shell built-ins. Something like the Perl one-liners popular
yesteryear, but hopefully easier to read and reason through.

In short, dt is intended to be generally useful, with zero pretense of
elegance.
'';
changelog = "https://github.com/so-dang-cool/dt/releases/tag/v${finalAttrs.version}";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ booniepepper ];
platforms = lib.platforms.unix;
mainProgram = "dt";
};
})
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.5)
{
description = "duct tape for your unix pipes";

inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
systems.url = "github:nix-systems/x86_64-linux";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
};

outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs { inherit system; };
dt = pkgs.callPackage ./. { };
in {
packages.default = dt;
devShells.default = pkgs.mkShell {
packages = with pkgs; [ zig_0_11 ];
};
});
}