Skip to content

Instantly share code, notes, and snippets.

@bendanm
Created January 31, 2025 23:55
Show Gist options
  • Save bendanm/fb3ad6b40cd4447ead3ce465b04ea338 to your computer and use it in GitHub Desktop.
Save bendanm/fb3ad6b40cd4447ead3ce465b04ea338 to your computer and use it in GitHub Desktop.
cli
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.myConfig.cli;
in {
imports = [
# Path to other modules.
];
options.myConfig.cli = {
enable = mkOption {
description = "Default packages and settings for cli enviroment";
type = types.bool;
default = true;
defaultText = "true"; # for docs
example = "true"; # for docs
# Less used properties: "apply", "internal", "visible", "readOnly"
};
};
config = mkIf cfg.enable {
console = {
font = lib.mkDefault "Lat2-Terminus16";
};
fonts = {
enableDefaultPackages = true;
fontDir.enable = true;
packages = with pkgs; [
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-monochrome-emoji
nerd-fonts.fira-code
noto-fonts-color-emoji
corefonts
];
fontconfig = {
useEmbeddedBitmaps = true; # Fix for Noto Color Emoji not rendering in Firefox
defaultFonts = {
serif =
[ "Noto Serif SC" "Noto Serif JP" "Noto Serif KR" "Noto Serif" ];
sansSerif =
[ "Noto Sans SC" "Noto Sans JP" "Noto Sans KR" "Noto Sans" ];
monospace = [ "FiraCode Nerd Font" ];
};
};
};
programs.nix-ld.enable = true;
programs.nh.enable = true;
environment.systemPackages = with pkgs; [
vim
# Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
zsh
powershell
oh-my-posh
gnumake
gcc
zig
just
autojump
wget
neovim
helix
helix-gpt
nix-output-monitor
nvd # tool for checking nix version changes
# Provides Nom, a nix replacement with better error messages
nil
# LSP for vscode for nix
marksman
nixfmt-rfc-style
# markdown lsp
glow
# markdown previewer in terminal
alejandra
# nix code formatter
# Console Utilities
tailspin
btop
tree
# diskonaut - great interactive cli disk usage explorer
# diskonaut
neofetch
nnn # terminal file manager
# archives
zip
xz
unzip
p7zip
# utils
ripgrep
# recursively searches directories for a regex pattern
jq
# A lightweight and flexible command-line JSON processor
yq-go
# yaml processor https://github.com/mikefarah/yq
eza
# A modern replacement for ‘ls’
fzf
# A command-line fuzzy finder
xclip
# for copy paste in neovim & others
btop
# replacement of htop/nmon
iotop
# io monitoring
iftop
# network monitoring
lnav
# log file aggrigator
# `lnav ~/.local/share/Steam/logs/*.txt`
nfs-utils
shellcheck # A shell script static analysis tool
# networking tools
mtr
# A network diagnostic tool
iperf3
dnsutils
# `dig` + `nslookup`
ldns
# replacement of `dig`, it provide the command `drill`
aria2
# A lightweight multi-protocol & multi-source command-line download utility
socat
# replacement of openbsd-netcat
nmap
# A utility for network discovery and security auditing
ipcalc
# it is a calculator for the IPv4/v6 addresses
# misc
tmux
fzf
ripgrep
parallel
file
which
tree
gnused
gnutar
gawk
zstd
gnupg
eza
# ls replacement
# lsd
# system tools
sysstat
lm_sensors
# for `sensors` command
ethtool
pciutils
# lspci
usbutils
# lsusb
# system call monitoring
strace
# system call monitoring
ltrace
# library call monitoring
lsof
# list open files
# fira-code-nerdfont
nerd-fonts.fira-code
# terminus-nerdfont
nerd-fonts.terminess-ttf
# sops
# age
# ssh-to-age
direnv
tailscale
lazygit
git
tea
# https://devenv.sh/getting-started/
devenv
# age
# age-plugin-yubikey
bitwarden-cli
# Quick zoxide video:
# https://www.youtube.com/watch?v=aghxkpyRVDY
zoxide
# rclone - an cloud centric rsync for outdrive and others
# https://rclone.org/docs/
rclone
];
environment.shells = lib.mkDefault [ pkgs.bash ];
programs.bash = {
completion.enable = true;
interactiveShellInit = ''
eval "$(${pkgs.oh-my-posh}/bin/oh-my-posh init bash --config ${./kali.omp.json})"
'';
};
programs.zsh = {
enable = lib.mkDefault true;
interactiveShellInit = ''
eval "$(${pkgs.oh-my-posh}/bin/oh-my-posh init zsh --config ${./kali.omp.json})"
'';
enableCompletion = lib.mkDefault true;
autosuggestions.enable = lib.mkDefault true;
syntaxHighlighting.enable = lib.mkDefault true;
zsh-autoenv.enable = true;
};
users.defaultUserShell = lib.mkOverride 500 pkgs.bash;
};
}
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"disable_upgrade_check": true,
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "lightBlue",
"foreground_templates": [
"{{ if .Root }}lightRed{{ end }}"
],
"properties": {
"display_host": true
},
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>\u250c\u2500\u2500(</>{{ .UserName }}{{ if .Root }}💀{{ else }}㉿{{ end }}{{ .HostName }}<{{ if .Root }}lightBlue{{ else }}green{{ end }}>)</>",
"type": "session"
},
{
"foreground": "yellow",
"properties": {
"fetch_version": false,
"fetch_virtual_env": true
},
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[</>\ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }}{{ end }}{{ .Full }}{{ end }}<{{ if .Root }}lightBlue{{ else }}green{{ end }}>]</>",
"type": "python"
},
{
"foreground": "lightWhite",
"properties": {
"folder_separator_icon": "<#c0c0c0>/</>",
"style": "full"
},
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[</>{{ .Path }}<{{ if .Root }}lightBlue{{ else }}green{{ end }}>]</>",
"type": "path"
},
{
"foreground": "white",
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[</>{{ .HEAD }}<{{ if .Root }}lightBlue{{ else }}green{{ end }}>]</>",
"type": "git"
}
],
"type": "prompt"
},
{
"alignment": "right",
"segments": [
{
"foreground": "white",
"properties": {
"always_enabled": true,
"style": "round"
},
"style": "plain",
"template": " {{ .FormattedMs }} ",
"type": "executiontime"
},
{
"foreground": "green",
"foreground_templates": [
"{{ if gt .Code 0 }}red{{ end }}"
],
"properties": {
"always_enabled": true
},
"style": "plain",
"template": " {{ if gt .Code 0 }}\uea76{{else}}\uf42e{{ end }} ",
"type": "status"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"foreground": "lightBlue",
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>\u2514\u2500</>{{ if .Root }}<lightRed>#</>{{ else }}${{ end }} ",
"type": "text"
}
],
"type": "prompt"
}
],
"version": 3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment