Git Product home page Git Product logo

toolbelt's Introduction

Toolbelt 🧰

Toolbelt is a collection of useful scripts and other things. Basically a place where we put nifty scripts and such that could be useful to other developers.

Installation 💾

There are two ways to install these scripts. Either by using nix-env or if you are using home-manager to manage your nix packages.

1. Add toolbelt as a nix channel (not needed but recommended)

Having a nix-channel with toolbelt will make it easier to keep toolbelt up-to-date.

$ nix-channel --add https://github.com/goodbyekansas/toolbelt/archive/main.tar.gz toolbelt

followed by

$ nix-channel --update

You now have a nix-channel named toolbelt.

2. Install toolbelt

Imperative (nix-env) 🗺️

If you chose to use a channel (as in 1):

$ nix-env --install -A toolbelt

If you did not want to use a channel:

$ nix-env --install -f https://github.com/goodbyekansas/toolbelt/tarball/main`

Through home manager 🏠

Add a dependency to the git repo through your nix home file.

If you chose to use a channel (as in 1):

# home.nix

let
  toolbelt = import <toolbelt> {};
  # ...
in
# ...
home.packages = [
  # ...
  toolbelt
  # ...
];

If you did not want to use a channel:

# home.nix
let
  toolbelt = import (builtins.fetchTarball https://github.com/goodbyekansas/toolbelt/tarball/main) {};
  ...
in
...
home.packages = [ .. toolbelt .. ];

followed by a home-manager switch.

Updating ⬆️

With nix-env

If you use a channel to track toolbelt:

$ nix-channel --update toolbelt
$ nix-env --upgrade -A toolbelt --always

If you do not use a channel:

$ nix-env --install -f https://github.com/goodbyekansas/toolbelt/tarball/main`

With home-manager

If you use a channel to track toolbelt:

$ nix-channel --update toolbelt
$ home-manager switch

If you do not use a channel:

It will automatically be updated whenever you run home-manager switch,

Usage

Available commands

toolbelt is a convenience command to inspect the collection of installed scripts, use --help to see what it can do.

Authoring scripts

Put a file with a proper shebang inside the scripts folder. Note that you can use nix-shell shebangs to write scripts in python for example:

#! /usr/bin/env nix-shell
#! nix-shell -i python -p python pythonPackages.prettytable

import prettytable

# Print a simple table.
t = prettytable.PrettyTable(["N", "N^2"])
for n in range(1, 10): t.add_row([n, n * n])
print t

Generating man pages

Just drop a .md file next to the script with the same name and it will be generated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.