nixos-config/nixos/system/all/packages.nix

129 lines
2.4 KiB
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ config, pkgs, lib, ... }:
let
2021-04-19 07:43:55 +02:00
memoryUsage = pkgs.writers.writeDashBin "memory-total-usage" ''
echo " %CPU %MEM MEM : PROCESS"
echo "------- ------- ------------- -------"
ps aux | awk '{mem[$11]+=int($6/1024)}; {cpuper[$11]+=$3};{memper[$11]+=$4}; END {for (i in mem) {printf "%6.2f%% %6.2f%% %10.2f MB : %s\n", cpuper[i],memper[i],mem[i],i}}' | sort -k3nr | head -n 5
'';
2019-12-20 05:54:26 +01:00
prefetch-git-rendered =
2021-04-19 07:43:55 +02:00
pkgs.writeShellScriptBin "nix-prefetch-git-rendered" ''
2019-12-20 05:54:26 +01:00
${pkgs.nix-prefetch-scripts}/bin/nix-prefetch-git "$@" \
| ${pkgs.jq}/bin/jq --raw-output '"pkgs.fetchgit{
url = \"\(.url)\";
rev = \"\(.rev)\";
sha256 = \"\(.sha256)\";
};"'
'';
prefetch-url-rendered =
2021-04-19 07:43:55 +02:00
pkgs.writeShellScriptBin "nix-prefetch-url-rendered" ''
2019-12-20 05:54:26 +01:00
HASH=$( ${pkgs.nix}/bin/nix-prefetch-url "$1" )
cat <<EOF
pkgs.fetchurl {
url = "$1";
sha256 = "$HASH";
};
EOF
'';
2019-10-24 02:20:38 +02:00
2021-11-01 09:20:42 +01:00
storepath =
let
dirname = "${pkgs.coreutils-full}/bin/dirname";
readlink = "${pkgs.coreutils-full}/bin/readlink";
in
pkgs.writers.writeBashBin "storepath" ''
${dirname} $( ${readlink} $( type -p "$1" ) )
'';
2021-04-19 07:43:55 +02:00
2021-11-01 09:20:42 +01:00
in
{
2019-10-24 02:20:38 +02:00
2021-04-08 05:46:06 +02:00
#imports = [ ./packages/llvm-config-dummy.nix ];
2019-10-24 02:20:38 +02:00
programs.tmux = {
enable = true;
clock24 = true;
historyLimit = 150000;
secureSocket = true;
};
environment.systemPackages = with pkgs; [
2022-03-19 16:54:22 +01:00
# to browse logs better
lnav
2022-08-20 21:08:31 +02:00
nix-tree
2022-04-17 20:16:40 +02:00
nixos-option
2021-04-19 07:43:55 +02:00
storepath
2019-10-24 02:20:38 +02:00
prefetch-git-rendered
prefetch-url-rendered
parallel
# windos/mac filesystems
ntfs3g
exfat
2022-06-14 22:56:58 +02:00
silver-searcher
2019-10-24 02:20:38 +02:00
bc
bridge-utils
file
git
htop
lsof
ncdu
tree
vim
wget
2019-12-20 05:54:26 +01:00
zip
unzip
2019-10-24 02:20:38 +02:00
jq
2023-08-22 08:03:33 +02:00
ijq
2019-10-24 02:20:38 +02:00
miller
tmux
screen
2023-05-20 22:31:36 +02:00
tcpdump
2019-10-24 02:20:38 +02:00
duc
memoryUsage
2023-04-26 09:23:56 +02:00
treefmt
shellcheck
shfmt
black
2023-04-27 15:34:50 +02:00
nodePackages.prettier
influxdb2-cli
2023-04-26 09:23:56 +02:00
#gitlog2json
2019-10-24 02:20:38 +02:00
pciutils
2023-05-11 10:35:26 +02:00
(pkgs.writers.writeDashBin "mc" ''
${pkgs.mc}/bin/mc --nocolor "$@"
'')
2020-03-10 04:27:20 +01:00
(pkgs.writers.writeBashBin "ssl-check-cert-of-domain" ''
DOMAIN=$1
echo | \
${pkgs.openssl}/bin/openssl s_client -servername ''${DOMAIN} -connect ''${DOMAIN}:443 2>/dev/null | \
${pkgs.openssl}/bin/openssl x509 -text | \
${pkgs.less}/bin/less
'')
2019-10-24 02:20:38 +02:00
];
2020-03-13 21:22:30 +01:00
# configure navi
2020-11-21 18:56:11 +01:00
#environment.variables.NAVI_PATH = "$HOME/.cheats";
2020-03-13 21:22:30 +01:00
2019-10-24 02:20:38 +02:00
}