The hifi package

[Tags:bsd3, library, program, test]

A CLI tool generating scripts for connecting to WiFi, circumventing big WiFi management tools.

[Skip to Readme]


Dependencies base (>=4.7 && <5), directory, filepath, hifi, mustache, parsec, process, text, unix [details]
License BSD3
Copyright 2017 Rickard Andersson
Author Rickard Andersson
Category CLI
Home page
Source repository head: git clone
Uploaded Tue Jun 27 10:54:52 UTC 2017 by gonz
Distributions NixOS:
Downloads 101 total (61 in the last 30 days)
0 []
Status Docs available [build log]
Last success reported on 2017-06-27 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for hifi

Readme for hifi-


A tool for generating wifi connection scripts. Uses wpa_supplicant to connect.


You will need to have wpa_supplicant, wpa_passphrase and dhcpcd installed, as that is what is used in the connection scripts generated by hifi.


To install, simply do either:

stack install hifi


git clone ./hifi && cd hifi && stack install


hifi <filename> <interface> <ssid> <passphrase>

The filename parameter determines what your data and script files will be called. They are stored in your XDG data directory, which by default (in most distros) will mean your files will end up in $HOME/.local/share/hifi/....

The SSID and passphrase parameters should be obvious enough. They are simply the connection information you would use to connect to your network.

When a script has been generated once it will not have to be generated again. Instead, you should simply run the generated script.

Typical usage looks as follows, for a first run:

$ hifi wifi-home wlp7s0 MyWLANsSSID MyPassphrase
Created /home/yourusername/.local/share/hifi/data/wifi-home and /home/yourusername/.local/share/hifi/scripts/wifi-home
$ wifi-home

Your $PATH variable and connect scripts

If you want to be able to run the scripts without issuing their full path you will need to add your scripts folder to your path. You can do this in several ways, but the most common one is to add the following to your bash_profile, zsh_profile, zsh_env file or the like:

PATH=".local/share/hifi/scripts:$PATH" where $PATH can either refer to the rest of your $PATH environment variable or simply a literal containing all your specified directories.

Folders, templates

hifi will generate a script for connecting and a data portion that will be used in the script.

The scripts are located in $HOME/.local/share/hifi/scripts and the data portion in the data directory of that same hifi root folder.

hifi uses templates that are located in the templates directory, so you can change the template being used to generate both the data files and the scripts.

The templates are copied on cabal install and stack install, so any changes made will carry on to the installed version.

The templateDir function will return the directory where the files end up being stored. This varies, so that is why it uses getDataFileName and the data-files entry in the cabal-file.