2021-11-25 11:55:30 +00:00
|
|
|
# The module for anything dev-related.
|
2023-10-02 06:26:11 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2021-11-25 11:55:30 +00:00
|
|
|
|
2022-01-09 05:38:59 +00:00
|
|
|
let cfg = config.profiles.dev;
|
2021-11-25 11:55:30 +00:00
|
|
|
in {
|
2022-01-09 05:38:59 +00:00
|
|
|
options.profiles.dev = {
|
2021-11-25 13:45:48 +00:00
|
|
|
enable = lib.mkEnableOption
|
2021-12-11 05:16:45 +00:00
|
|
|
"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";
|
2022-10-13 10:32:47 +00:00
|
|
|
neovim.enable = lib.mkEnableOption "Neovim setup";
|
2021-11-25 11:55:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
|
|
|
({
|
2022-10-13 10:32:47 +00:00
|
|
|
# Hey! Wanna see some of <INSERT APPLICATION'S NAME> big dark dump?
|
2022-07-18 23:07:53 +00:00
|
|
|
systemd.coredump = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = ''
|
|
|
|
ProcessSizeMax=10G
|
|
|
|
ExternalSizeMax=10G
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2022-09-25 07:24:47 +00:00
|
|
|
# Debugging time!
|
|
|
|
environment.enableDebugInfo = true;
|
|
|
|
|
2021-11-25 13:45:48 +00:00
|
|
|
# I want to include documentations for my own sanity, OK?
|
|
|
|
documentation = {
|
|
|
|
enable = true;
|
|
|
|
dev.enable = true;
|
|
|
|
nixos.enable = true;
|
2021-12-04 15:27:10 +00:00
|
|
|
man.generateCaches = true;
|
2021-11-25 13:45:48 +00:00
|
|
|
};
|
2021-11-25 11:55:30 +00:00
|
|
|
|
2021-12-08 04:18:37 +00:00
|
|
|
# Install Git, our favorite version control system.
|
|
|
|
# In this case, we want ALL OF THE EXTENSIONS!
|
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
|
|
|
lfs.enable = true;
|
|
|
|
package = pkgs.gitFull;
|
2022-10-10 03:40:19 +00:00
|
|
|
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 = ''
|
2022-11-19 03:05:31 +00:00
|
|
|
"if [ $LOCAL = /dev/null ]; then diffoscope --new-file $REMOTE; else diffoscope $LOCAL $REMOTE; fi"
|
2022-10-10 03:40:19 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
config.difftool."diffoscope-html".cmd = ''
|
|
|
|
"if [ $LOCAL = /dev/null ]; then diffoscope --new-file $REMOTE --html - | cat; else diffoscope $LOCAL $REMOTE --html - | cat; fi"
|
|
|
|
'';
|
2021-12-08 04:18:37 +00:00
|
|
|
};
|
|
|
|
|
2022-10-13 10:32:47 +00:00
|
|
|
# It's a given at life to have a GPG key.
|
|
|
|
programs.gnupg.agent.enable = true;
|
|
|
|
|
|
|
|
# Instrumentate your instrument.
|
2022-09-25 07:24:47 +00:00
|
|
|
programs.systemtap.enable = true;
|
2022-10-13 10:32:47 +00:00
|
|
|
|
2023-02-11 01:01:31 +00:00
|
|
|
# Search around sharks for wires.
|
|
|
|
programs.wireshark.enable = true;
|
|
|
|
|
2022-10-13 10:32:47 +00:00
|
|
|
# Profile your whole system.
|
2022-09-25 07:24:47 +00:00
|
|
|
services.sysprof.enable = true;
|
2021-11-25 11:55:30 +00:00
|
|
|
|
2023-06-30 02:47:17 +00:00
|
|
|
# Make shebangs even more magical.
|
|
|
|
services.envfs.enable = true;
|
|
|
|
|
2021-11-25 13:45:48 +00:00
|
|
|
# Convenience!
|
|
|
|
environment.localBinInPath = true;
|
2021-11-25 11:55:30 +00:00
|
|
|
|
2023-07-16 10:12:18 +00:00
|
|
|
# Find Nix files with these!
|
2023-07-16 11:04:19 +00:00
|
|
|
programs.command-not-found.enable = false;
|
2023-07-16 10:12:18 +00:00
|
|
|
programs.nix-index.enable = true;
|
|
|
|
|
2022-11-19 03:00:15 +00:00
|
|
|
# Additional settings for developing with nix.
|
|
|
|
nix.settings = {
|
|
|
|
keep-outputs = true;
|
|
|
|
keep-derivations = true;
|
|
|
|
};
|
|
|
|
|
2021-11-25 13:45:48 +00:00
|
|
|
# This is set as our system packages for the sake of convenience.
|
|
|
|
services.lorri.enable = true;
|
|
|
|
environment.systemPackages = with pkgs; [
|
2023-01-17 08:09:14 +00:00
|
|
|
bind.dnsutils # A bunch of things to make sense with DNS.
|
2021-11-25 13:45:48 +00:00
|
|
|
cachix # Compile no more by using someone's binary cache!
|
|
|
|
curl # Our favorite network client.
|
|
|
|
cmake # The poster boy for the hated build system.
|
2022-10-10 03:40:19 +00:00
|
|
|
diffoscope # Oversized caffeine grinder.
|
2021-11-25 13:45:48 +00:00
|
|
|
direnv # The power of local development environment.
|
2023-01-19 12:32:25 +00:00
|
|
|
ipcalc # Calculate your IP without going to the web.
|
2021-12-04 15:27:10 +00:00
|
|
|
gcc # The usual toolchain.
|
2022-09-25 07:24:47 +00:00
|
|
|
gdb # The usual debugger.
|
2022-10-13 10:32:47 +00:00
|
|
|
gnumake # The other poster boy for the hated build system.
|
2023-05-20 06:44:53 +00:00
|
|
|
man-pages # Extra manpages.
|
2021-11-30 01:03:05 +00:00
|
|
|
moreutils # Less is more but more utilities, the merrier.
|
2023-09-11 10:19:18 +00:00
|
|
|
quilt # Patching right up yer' alley.
|
2023-01-17 08:09:14 +00:00
|
|
|
whois # Doctor, are you not?
|
2022-10-13 10:32:47 +00:00
|
|
|
valgrind # Making sure your applications don't pee as much.
|
2023-08-19 07:25:15 +00:00
|
|
|
|
|
|
|
# Measuring your bloated tanks power and bandwidth consumption.
|
|
|
|
powertop
|
|
|
|
nethogs
|
2023-09-18 09:57:18 +00:00
|
|
|
|
|
|
|
# Hardware and software diagnostics.
|
|
|
|
lsof # View every single open connections.
|
|
|
|
lshw # View your hardware.
|
|
|
|
pciutils # View your peripherals.
|
2022-10-11 23:03:35 +00:00
|
|
|
]
|
2022-11-19 03:05:31 +00:00
|
|
|
# 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 [
|
2022-12-06 07:54:45 +00:00
|
|
|
tea # Make some Tea...
|
|
|
|
hut # ...in the Hut...
|
|
|
|
github-cli # ...in the GitHub CLI.
|
2023-03-03 09:16:15 +00:00
|
|
|
git-filter-repo # History is written by the victors (and force-pushers which are surely not victors).
|
2022-11-19 03:05:31 +00:00
|
|
|
]);
|
2021-11-25 11:55:30 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
(lib.mkIf cfg.shell.enable {
|
|
|
|
environment.systemPackages = with pkgs; [
|
2022-08-27 05:40:56 +00:00
|
|
|
bandwhich # Sniffing your packets.
|
2021-11-25 13:45:48 +00:00
|
|
|
lazygit # Git interface for the lazy.
|
2023-01-19 12:32:25 +00:00
|
|
|
lazydocker # Git interface for the lazy.
|
2021-11-25 13:45:48 +00:00
|
|
|
fd # Oh nice, a more reliable `find`.
|
|
|
|
ripgrep # On nice, a more reliable `grep`.
|
2023-09-15 04:54:49 +00:00
|
|
|
eza # Oh nice, a shinier `ls`.
|
2022-12-06 07:54:45 +00:00
|
|
|
bat # dog > sky dog > cat
|
2021-11-25 13:45:48 +00:00
|
|
|
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!
|
2021-11-25 11:55:30 +00:00
|
|
|
];
|
|
|
|
})
|
|
|
|
|
|
|
|
# !!! Please add your user to the "libvirtd" group.
|
|
|
|
(lib.mkIf cfg.virtualization.enable {
|
2022-06-09 05:00:07 +00:00
|
|
|
environment.systemPackages = with pkgs; [
|
2022-10-13 10:32:47 +00:00
|
|
|
distrobox # I heard you like Linux...
|
|
|
|
virt-manager # An interface for those who are lazy to read a reference manual and create a 1000-line configuration per machine.
|
2022-06-09 05:00:07 +00:00
|
|
|
];
|
2022-01-25 01:32:17 +00:00
|
|
|
|
2023-07-16 07:28:32 +00:00
|
|
|
# Podman with Docker compatibility which is not 100% but still better
|
|
|
|
# than nothing.
|
|
|
|
virtualisation.podman = {
|
2022-11-05 01:36:33 +00:00
|
|
|
enable = true;
|
2023-07-16 07:28:32 +00:00
|
|
|
dockerCompat = true;
|
2022-11-05 01:36:33 +00:00
|
|
|
autoPrune = {
|
|
|
|
enable = true;
|
|
|
|
dates = "weekly";
|
|
|
|
};
|
2023-07-16 07:28:32 +00:00
|
|
|
defaultNetwork.settings = {
|
|
|
|
dns_enabled = true;
|
|
|
|
};
|
2022-11-05 01:36:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Enable usual containers configuration.
|
|
|
|
virtualisation.containers = {
|
|
|
|
enable = true;
|
|
|
|
registries.search = [
|
|
|
|
"docker.io"
|
|
|
|
"quay.io"
|
|
|
|
"registry.opensuse.org"
|
|
|
|
];
|
|
|
|
};
|
2021-11-25 11:55:30 +00:00
|
|
|
|
2022-10-13 10:32:47 +00:00
|
|
|
# Virtual machines, son. They open in response to physical needs to
|
|
|
|
# foreign environments.
|
2021-11-25 11:55:30 +00:00
|
|
|
virtualisation.libvirtd = {
|
|
|
|
enable = true;
|
2022-01-25 01:32:17 +00:00
|
|
|
qemu.package = pkgs.qemu_full;
|
2021-11-25 13:45:48 +00:00
|
|
|
qemu.ovmf.enable = true;
|
2021-11-25 11:55:30 +00:00
|
|
|
};
|
|
|
|
})
|
2021-12-25 12:35:55 +00:00
|
|
|
|
|
|
|
(lib.mkIf cfg.neovim.enable {
|
2022-10-13 10:32:47 +00:00
|
|
|
# Easier, better, faster, stronger.
|
2021-12-25 12:35:55 +00:00
|
|
|
programs.neovim = {
|
|
|
|
enable = true;
|
|
|
|
defaultEditor = true;
|
|
|
|
withNodeJs = true;
|
|
|
|
withRuby = true;
|
|
|
|
|
|
|
|
# I want the BLEEDING EDGE!
|
|
|
|
package = pkgs.neovim-nightly;
|
|
|
|
};
|
|
|
|
|
2022-04-30 12:30:22 +00:00
|
|
|
environment.systemPackages = with pkgs; [
|
2022-10-13 10:32:47 +00:00
|
|
|
editorconfig-core-c # Consistent canonical coding conventions.
|
|
|
|
tree-sitter # It surely doesn't have a partner to kiss.
|
2022-04-30 12:30:22 +00:00
|
|
|
];
|
2021-12-25 12:35:55 +00:00
|
|
|
})
|
2021-11-25 11:55:30 +00:00
|
|
|
]);
|
|
|
|
}
|