154 lines
2.9 KiB
Nix
154 lines
2.9 KiB
Nix
{
|
|
|
|
hostConfig,
|
|
|
|
pkgs ? (import ./pkgs.nix).stable {},
|
|
pkgs2305 ? (import ./pkgs.nix).stable2305 {},
|
|
pkgsEdge ? (import ./pkgs.nix).edge {},
|
|
|
|
}: let
|
|
|
|
recursiveMerge = with pkgs.lib; attrList:
|
|
let f = attrPath:
|
|
zipAttrsWith (n: values:
|
|
if tail values == []
|
|
then head values
|
|
else if all isList values
|
|
then unique (concatLists values)
|
|
else if all isAttrs values
|
|
then f (attrPath ++ [n]) values
|
|
else last values
|
|
);
|
|
in f [] attrList;
|
|
|
|
config = recursiveMerge [ (import ./config/default.nix) hostConfig ];
|
|
|
|
in rec {
|
|
|
|
gitConfig = pkgs.stdenv.mkDerivation {
|
|
name = "mediocregopher-git-config";
|
|
|
|
gitConfigBase = ./base/gitconfig;
|
|
gitConfigCustom = builtins.toFile "mediocregopher-git-config-custom"
|
|
(pkgs.lib.generators.toGitINI config.git);
|
|
|
|
builder = builtins.toFile "builder.sh" ''
|
|
source $stdenv/setup
|
|
|
|
dir="$out"/git
|
|
mkdir -p "$dir"
|
|
|
|
cp "$gitConfigBase" "$dir"/config
|
|
cp "$gitConfigCustom" "$dir"/custom
|
|
'';
|
|
|
|
};
|
|
|
|
git = pkgs.writeScriptBin "git" ''
|
|
#!${pkgs.bash}/bin/bash
|
|
export XDG_CONFIG_HOME=${gitConfig}
|
|
exec ${pkgs.git}/bin/git "$@"
|
|
'';
|
|
|
|
bin = pkgs.buildEnv {
|
|
name = "mediocregopher-bin";
|
|
paths = [
|
|
(pkgs.runCommand "mediocregopher-default-bin" {} ''
|
|
mkdir -p "$out"
|
|
cp -rL "${./bin}" "$out"/bin
|
|
'')
|
|
] ++ (
|
|
builtins.map (cFn: cFn pkgs) config.binExtra
|
|
);
|
|
};
|
|
|
|
zsh = ((import ./zsh) { inherit config; }).zsh;
|
|
awesome = ((import ./awesome) { inherit config; });
|
|
|
|
loadout = pkgs.buildEnv {
|
|
name = "loadout";
|
|
paths = [
|
|
pkgs2305.nix
|
|
|
|
pkgs.gnugrep
|
|
pkgs.ag
|
|
pkgs.gawk
|
|
pkgs.tree
|
|
pkgs.pv
|
|
pkgs.less
|
|
pkgs.tmux
|
|
|
|
pkgs.man
|
|
pkgs.man-pages
|
|
pkgs.man-pages-posix
|
|
|
|
git
|
|
pkgs.mercurial
|
|
pkgs.breezy # bzr
|
|
|
|
pkgs.gnumake
|
|
pkgs.cmake
|
|
pkgs.strace
|
|
|
|
pkgs.curl
|
|
pkgs.wget
|
|
pkgs.rsync
|
|
|
|
pkgs.hostname
|
|
pkgs.netcat
|
|
pkgs.nmap
|
|
pkgs.dnsutils
|
|
pkgs.openssh
|
|
pkgs.sshfs
|
|
pkgs.fuse3
|
|
pkgs.usbutils
|
|
pkgs.tcpdump
|
|
|
|
pkgs.ncdu
|
|
pkgs.htop
|
|
pkgs.jnettop
|
|
pkgs.iotop
|
|
|
|
pkgs.zip
|
|
pkgs.unzip
|
|
pkgs.unrar
|
|
pkgs.gzip
|
|
|
|
pkgs.jq
|
|
pkgs.yq
|
|
pkgs2305.rsbkb
|
|
|
|
pkgs.tomb
|
|
pkgs.udiskie
|
|
|
|
pkgs.xterm # nice to have a backup
|
|
pkgs2305.libreoffice
|
|
pkgs.gimp
|
|
pkgs.inkscape
|
|
pkgs.vlc
|
|
pkgs.sylpheed
|
|
pkgs.calibre
|
|
pkgsEdge.lagrange
|
|
pkgs.pavucontrol
|
|
pkgs.xdg-utils
|
|
pkgs.arandr
|
|
pkgs.xsel
|
|
pkgs.xorg.xrandr
|
|
|
|
bin
|
|
((import ./nvim) {}).nvim
|
|
zsh
|
|
((import ./alacritty) { inherit config zsh; }).alacritty
|
|
awesome.env
|
|
];
|
|
};
|
|
|
|
fonts = pkgs.buildEnv {
|
|
name = "fonts";
|
|
paths = [
|
|
pkgs.nerdfonts
|
|
pkgs.source-code-pro
|
|
];
|
|
};
|
|
}
|