mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 16:57:55 +00:00
58 lines
1.8 KiB
Nix
58 lines
1.8 KiB
Nix
|
{ 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
|
||
|
];
|
||
|
|
||
|
programs.git.settings = {
|
||
|
config.difftool.prompt = false;
|
||
|
|
||
|
# 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
|
||
|
config.difftool."diffoscope".cmd = ''
|
||
|
"if [ $LOCAL = /dev/null ]; then diffoscope --new-file $REMOTE; else diffoscope $LOCAL $REMOTE; fi"
|
||
|
'';
|
||
|
|
||
|
config.difftool."diffoscope-html".cmd = ''
|
||
|
"if [ $LOCAL = /dev/null ]; then diffoscope --new-file $REMOTE --html - | cat; else diffoscope $LOCAL $REMOTE --html - | cat; fi"
|
||
|
'';
|
||
|
};
|
||
|
})
|
||
|
]);
|
||
|
}
|