mirror of
https://github.com/librephoenix/nixos-config
synced 2025-10-19 01:54:02 +05:30
Major config overhaul: use custom modules, setup for multi-host config, and less boilerplate
This commit is contained in:
parent
1fa8b17b07
commit
0453901d17
303 changed files with 3560 additions and 5566 deletions
66
modules/user/shell/term-apps.nix
Normal file
66
modules/user/shell/term-apps.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.userSettings.shell.apps;
|
||||
in {
|
||||
options = {
|
||||
userSettings.shell.apps = {
|
||||
enable = lib.mkEnableOption "Enable a collection of additional useful CLI apps";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Collection of useful CLI apps
|
||||
home.packages = with pkgs; [
|
||||
# Command Line
|
||||
killall
|
||||
libnotify
|
||||
timer
|
||||
brightnessctl
|
||||
gnugrep
|
||||
bat eza fd bottom ripgrep
|
||||
rsync
|
||||
zip unzip
|
||||
w3m
|
||||
pandoc
|
||||
hwinfo
|
||||
pciutils
|
||||
numbat
|
||||
(pkgs.writeShellScriptBin "airplane-mode" ''
|
||||
#!/bin/sh
|
||||
connectivity="$(nmcli n connectivity)"
|
||||
if [ "$connectivity" == "full" ]
|
||||
then
|
||||
nmcli n off
|
||||
else
|
||||
nmcli n on
|
||||
fi
|
||||
'')
|
||||
(pkgs.writeScriptBin "comma" ''
|
||||
if [ "$#" = 0 ]; then
|
||||
echo "usage: comma PKGNAME... [EXECUTABLE]";
|
||||
elif [ "$#" = 1 ]; then
|
||||
nix-shell -p $1 --run $1;
|
||||
elif [ "$#" = 2 ]; then
|
||||
nix-shell -p $1 --run $2;
|
||||
else
|
||||
echo "error: too many arguments";
|
||||
echo "usage: comma PKGNAME... [EXECUTABLE]";
|
||||
fi
|
||||
'')
|
||||
(pkgs.writeScriptBin "comma-shell" ''
|
||||
if [ "$#" = 0 ]; then
|
||||
echo "usage: comma-shell PKGNAME1 [PKGNAME2 PKGNAME3...]";
|
||||
else
|
||||
nix-shell -p $@
|
||||
fi
|
||||
'')
|
||||
];
|
||||
|
||||
programs.zsh.shellAliases = {
|
||||
w3m = "w3m -no-cookie -v";
|
||||
"," = "comma";
|
||||
",," = "comma-shell";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue