Skip to content

ptitfred/posix-toolbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

posix-toolbox

tests

About

A collection of Unix scripts to ease my life. Mostly around git.

It's very personal and you might find some ideas in it but I doubt anybody would properly use it as is.

What's in the toolbox

A collection of script to add to your PATH:

  • git-authors, a git script to list committers other a commit range
  • git-bubbles, a git script to handle pull requests
  • git-checkout-log, a git script to browser reflog and follow checkouts
  • git-prd, a git script to display the path of the root of a git repository relative to your HOME directory
  • git-pwd, a git script to display the path relative to the root of a git repository
  • git-rm-others, a git script to clean the working copy from untracked files
  • git-search, a git script to search the diff other a commit range
  • git-short, a git script to display short SHA1 of a given commit
  • git-std-init, a git script to setup a repository with an initial empty commit and a base and master branches
  • git-tree, a git script to tree files handled by git
  • prd, a script to print the working directory relative to your HOME directory
  • repeat, a script to repeat a command some times
  • short-path, a script to abbreviate every directory unless the last part of a path
  • wait-tcp, a script to wait for some server sockets to be opened on a TCP

2 source-able bash scripts to customize your terminal:

How-to install

This project relies on nix, and flakes must be enabled.

Test from a shell

nix shell github:ptitfred/posix-toolbox

Install via a profile

I would recommend you to use home-manager instead (see below), but if you prefer a more classic approach, you can install it in your user's path this way:

nix profile install github:ptitfred/posix-toolbox

Install via home-manager

The flake exposes an overlay, let's first configure it (via a flake input for instance):

{ inputs, ... }:

{
  nixpkgs.overlays = [ inputs.posix-toolbox.overlay ];
}

We can now add the scripts we'd like in our PATH via the home.packages list:

{ pkgs, ... }:

{
  home.packages = with pkgs; [
    posix-toolbox.git-bubbles
    posix-toolbox.git-checkout-log
    posix-toolbox.ls-colors
  ];
}

You can also configure bash to use the PS1 provided by this project via home-manager:

{ pkgs, ... }:

{
  programs.bash = {
    enable = true;

    initExtra = ''
      source ${pkgs.posix-toolbox.git-ps1}/share/posix-toolbox/git-ps1
    '';
  };
}

It's exactly the same for the ls-colors:

{ pkgs, ... }:

{
  programs.bash = {
    enable = true;

    initExtra = ''
      source ${pkgs.posix-toolbox.ls-colors}/share/ls-colors/bash.sh
    '';
  };
}

If you're curious about home-manager you can learn about it via their official documentation or by examples via my own configuration.


Copyright © 2010-, Frédéric Menou and Céline Louvet. Licensed under MIT License.

About

Some posix scripts including various bash & git utilities

Resources

License

Stars

Watchers

Forks

Packages

No packages published