2023-12-18 00:58:34 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
userCfg = config.users.foo-dogsquared;
|
|
|
|
cfg = userCfg.setups.development;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.users.foo-dogsquared.setups.development.enable =
|
|
|
|
lib.mkEnableOption "foo-dogsquared's software development setup";
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
|
|
|
{
|
|
|
|
users.foo-dogsquared.programs = {
|
|
|
|
shell.enable = lib.mkDefault true;
|
|
|
|
git.enable = lib.mkDefault true;
|
|
|
|
terminal-multiplexer.enable = lib.mkDefault true;
|
|
|
|
};
|
|
|
|
|
|
|
|
profiles.dev = {
|
|
|
|
enable = true;
|
|
|
|
extras.enable = true;
|
|
|
|
coreutils-replacement.enable = true;
|
|
|
|
shell.enable = true;
|
|
|
|
servers.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
cachix # Compile no more by using someone's binary cache!
|
|
|
|
diffoscope # Oversized caffeine grinder.
|
|
|
|
regex-cli # Save some face of confusion for yourself.
|
|
|
|
dt # Get that functional gawk.
|
|
|
|
recode # Convert between different encodings.
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
(lib.mkIf userCfg.programs.git.enable {
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
diffoscope
|
|
|
|
];
|
|
|
|
|
2023-12-19 10:00:22 +00:00
|
|
|
programs.git.extraConfig = {
|
|
|
|
difftool.prompt = false;
|
2023-12-18 00:58:34 +00:00
|
|
|
|
|
|
|
# Yeah, let's use this oversized diff tool, shall we?
|
|
|
|
# Also, this config is based from this tip.
|
|
|
|
# https://lists.reproducible-builds.org/pipermail/diffoscope/2016-April/000193.html
|
2023-12-19 10:00:22 +00:00
|
|
|
difftool."diffoscope".cmd = ''
|
2023-12-18 00:58:34 +00:00
|
|
|
"if [ $LOCAL = /dev/null ]; then diffoscope --new-file $REMOTE; else diffoscope $LOCAL $REMOTE; fi"
|
|
|
|
'';
|
|
|
|
|
2023-12-19 10:00:22 +00:00
|
|
|
difftool."diffoscope-html".cmd = ''
|
2023-12-18 00:58:34 +00:00
|
|
|
"if [ $LOCAL = /dev/null ]; then diffoscope --new-file $REMOTE --html - | cat; else diffoscope $LOCAL $REMOTE --html - | cat; fi"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
})
|
|
|
|
]);
|
|
|
|
}
|