profiles/dev: simplify the configuration

Now with host-specific and user-specific modules, we can now start
remove parts of the modules with my configurations on them that are
otherwise intended for the entire cluster.
This commit is contained in:
Gabriel Arazas 2023-12-18 00:00:55 +08:00
parent c57695bd7c
commit 3d94c89bea
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 28 additions and 47 deletions

View File

@ -13,7 +13,7 @@ in
# Bring all of the software development goodies.
profiles.dev = {
enable = true;
shell.enable = true;
extras.enable = true;
virtualization.enable = true;
neovim.enable = true;
};

View File

@ -4,17 +4,14 @@
let cfg = config.profiles.dev;
in {
options.profiles.dev = {
enable = lib.mkEnableOption
"configurations of foo-dogsquared's barebones requirement for a development environment.";
shell.enable = lib.mkEnableOption
"installation of the shell utilities foo-dogsquared rely on";
virtualization.enable =
lib.mkEnableOption "virtualization-related stuff for development";
enable = lib.mkEnableOption "basic configuration for software development";
extras.enable = lib.mkEnableOption "additional shell utilities";
containers.enable = lib.mkEnableOption "containers setup";
neovim.enable = lib.mkEnableOption "Neovim setup";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
({
{
# Hey! Wanna see some of <INSERT APPLICATION'S NAME> big dark dump?
systemd.coredump = {
enable = true;
@ -41,18 +38,6 @@ in {
enable = true;
lfs.enable = true;
package = pkgs.gitFull;
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"
'';
};
# It's a given at life to have a GPG key.
@ -83,20 +68,13 @@ in {
services.lorri.enable = true;
environment.systemPackages = with pkgs; [
bind.dnsutils # A bunch of things to make sense with DNS.
cachix # Compile no more by using someone's binary cache!
curl # Our favorite network client.
cmake # The poster boy for the hated build system.
diffoscope # Oversized caffeine grinder.
direnv # The power of local development environment.
ipcalc # Calculate your IP without going to the web.
gcc # The usual toolchain.
gdb # The usual debugger.
gnumake # The other poster boy for the hated build system.
man-pages # Extra manpages.
man-pages-posix # More POSIX manpages.
moreutils # Less is more but more utilities, the merrier.
sshfs # Make others' home your own.
quilt # Patching right up yer' alley.
whois # Doctor, are you not?
valgrind # Making sure your applications don't pee as much.
@ -108,42 +86,45 @@ in {
lsof # View every single open connections.
lshw # View your hardware.
pciutils # View your peripherals.
# All of the documentation.
man-pages # Extra manpages.
man-pages-posix # More POSIX manpages.
];
}
(lib.mkIf cfg.extras.enable {
environment.systemPackages = with pkgs; [
bandwhich # Sniffing your packets.
cachix # Compile no more by using someone's binary cache!
direnv # The power of local development environment.
lazygit # Git interface for the lazy.
lazydocker # Git interface for the lazy.
fd # Oh nice, a more reliable `find`.
ripgrep # On nice, a more reliable `grep`.
eza # Oh nice, a shinier `ls`.
bat # dog > sky dog > cat
fzf # A fuzzy finder that enables fuzzy finding not furry finding, a common misconception.
quilt # Patching right up yer' alley.
zoxide # Gain teleportation abilities!
]
# Finally, a local environment for testing out GitHub workflows without
# embarassing yourself pushing a bunch of commits.
++ (lib.optional config.virtualisation.docker.enable pkgs.act)
# Enable all of the gud things.
++ (lib.optionals config.programs.git.enable [
++ (lib.optionals config.programs.git.enable (with pkgs; [
tea # Make some Tea...
hut # ...in the Hut...
github-cli # ...in the GitHub CLI.
git-filter-repo # History is written by the victors (and force-pushers which are surely not victors).
]);
})
(lib.mkIf cfg.shell.enable {
environment.systemPackages = with pkgs; [
bandwhich # Sniffing your packets.
dt # Get that functional gawk.
lazygit # Git interface for the lazy.
lazydocker # Git interface for the lazy.
fd # Oh nice, a more reliable `find`.
recode # Convert between different encodings.
ripgrep # On nice, a more reliable `grep`.
eza # Oh nice, a shinier `ls`.
bat # dog > sky dog > cat
fzf # A fuzzy finder that enables fuzzy finding not furry finding, a common misconception.
gopass # An improved version of the password manager for hipsters.
zoxide # Gain teleportation abilities!
];
]));
})
# !!! Please add your user to the "libvirtd" group.
(lib.mkIf cfg.virtualization.enable {
environment.systemPackages = with pkgs; [
dive # Dive into container images.
virt-manager # An interface for those who are lazy to read a reference manual and create a 1000-line configuration per machine.
];
programs.distrobox = {