nixos-config/configs/home-manager/foo-dogsquared/modules/setups/development.nix

138 lines
3.9 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, options, ... }@attrs:
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 [
2024-01-01 05:56:10 +00:00
{
state.paths.ignoreDirectories = [
"node_modules" # For Node projects.
"result" # For Nix builds.
"target" # For Rust builds.
];
2024-01-01 05:56:10 +00:00
users.foo-dogsquared.programs = {
shell.enable = lib.mkDefault true;
git = {
enable = lib.mkDefault true;
instaweb.enable = true;
};
jujutsu.enable = lib.mkDefault true;
keys.gpg.enable = true;
keys.ssh.enable = true;
2024-01-01 05:56:10 +00:00
terminal-multiplexer.enable = lib.mkDefault true;
terminal-emulator.enable = lib.mkDefault true;
2024-01-01 05:56:10 +00:00
};
suites.dev = {
2024-01-01 05:56:10 +00:00
enable = true;
extras.enable = true;
coreutils-replacement.enable = true;
shell.enable = true;
servers.enable = true;
};
# Rootless podman.
services.podman = {
enable = true;
enableTypeChecks = false;
autoUpdate = {
enable = true;
onCalendar = "weekly";
};
};
users.foo-dogsquared.programs.custom-homepage.sections.services.links =
let
hasCockpitEnabled = attrs.nixosConfig.services.cockpit.enable or false;
in
lib.optionals hasCockpitEnabled (lib.singleton {
url = "http://localhost:${builtins.toString attrs.nixosConfig.services.cockpit.port}";
text = "Cockpit WebUI";
});
2024-01-01 05:56:10 +00:00
systemd.user.sessionVariables = {
MANPAGER = "nvim +Man!";
EDITOR = "nvim";
};
2024-01-01 05:56:10 +00:00
home.packages = with pkgs; [
cachix # Compile no more by using someone's binary cache!
regex-cli # Save some face of confusion for yourself.
dt # Get that functional gawk.
jq # Get that JSON querying tool.
2024-01-01 05:56:10 +00:00
recode # Convert between different encodings.
2024-09-13 09:23:54 +00:00
go-migrate # Go potential migraines.
oils-for-unix # Rev them up, reverent admin.
lnav # Navigate with some logs like what some pirates do.
# Testing REST and all about backend development.
httpie
httpie-desktop
hurl
grpcurl
# Testing out Kubernetes.
kind
# Testing out LLMs.
plandex
2024-01-01 05:56:10 +00:00
];
}
(lib.mkIf (!userCfg.programs.nixvim.enable) {
programs.neovim = {
enable = true;
package = pkgs.neovim-nightly;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withPython3 = true;
withRuby = true;
};
})
2024-11-30 07:07:45 +00:00
(lib.mkIf userCfg.programs.browsers.firefox.enable {
home.packages = with pkgs; [
(lowPrio firefox-devedition)
];
})
2024-01-01 05:56:10 +00:00
(lib.mkIf userCfg.programs.git.enable {
home.packages = with pkgs; [
diffoscope # An oversized caffeine grinder.
meld # Make a terminal dweller melt.
];
2024-01-01 05:56:10 +00:00
programs.git.extraConfig = {
difftool.prompt = false;
diff.tool = "diffoscope";
diff.guitool = "meld";
2024-01-01 05:56:10 +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
difftool."diffoscope".cmd = ''
if [[ $LOCAL = /dev/null ]]; then diffoscope --new-file $REMOTE; else diffoscope $LOCAL $REMOTE; fi
'';
2024-01-01 05:56:10 +00:00
difftool."diffoscope-html".cmd = ''
if [[ $LOCAL = /dev/null ]]; then diffoscope --new-file $REMOTE --html - | cat; else diffoscope $LOCAL $REMOTE --html - | cat; fi
'';
};
})
2024-01-01 05:56:10 +00:00
(lib.mkIf (userCfg.setups.desktop.enable && pkgs.stdenv.isLinux) {
home.packages = with pkgs;
[
d-spy # Some GNOME dev probably developed this.
];
2024-01-01 05:56:10 +00:00
})
]);
}