nixos-config/modules/dev/documentation.nix
Gabriel Arazas 49592d7f01 Use the unstable version for the nth time
I also fixed the long-time occuring error when using the newest version
of the channel (or the unstable one). It turns out to be a simple type
error with the `my.user' attribute. (To be honest the error messages are
quite horrible.)

On another note, I also accidentally bricked my NixOS setup after a
garbage collection and a horrible update. The breakage includes not
being able to use any of the builtin tools of Nix (e.g., nix, nix-env,
nixos-rebuild) due to a shared library error that has been garbage
collected. Which means I have to reinstall it.
(I seem to have a talent for breaking things, if only I'm paid for it.)
2020-10-05 09:38:58 +08:00

56 lines
1.9 KiB
Nix
Executable File

# My stuff for documentation workflows.
# I mean, documentation is part of the development life, right?
# Mainly includes markup languages and whatnot.
{ config, options, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.dev.documentation;
in
{
options.modules.dev.documentation =
let mkBoolOption = bool: mkOption {
type = types.bool;
default = bool;
}; in {
enable = mkBoolOption false;
# Jupyter does need a bit of setup so separate option.
jupyter.enable = mkBoolOption false;
# Since my usual LaTeX needs are somewhat big, I'm keeping it as a separate option.
latex.enable = mkBoolOption false;
};
config = mkIf cfg.enable {
my.packages = with pkgs; [
asciidoctor # An Asciidoctor document keeps a handful of few frustrated users a day.
aspell # The not-opinionated spell checker.
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
hugo # An SSG for your DDD (documentation-driven development) workflow.
languagetool # A grammar checker with a HUGE data set.
pandoc # The Swiss army knife for document conversion.
R # Rated G for accessibility.
vale # The customizable linter for your intended writings.
# TODO: Make Neuron its own package.
(let
neuronRev = "5c37dd3bbfff7d203883417bee2e2970d41cd70d";
neuronSrc = builtins.fetchTarball "https://github.com/srid/neuron/archive/${neuronRev}.tar.gz";
in import neuronSrc {}) # Neurons and zettels are good for the brain.
] ++
(if cfg.jupyter.enable then [
jupyter # The interactive notebook.
iruby # The Ruby kernel for Jupyter.
] else []) ++
(if cfg.latex.enable then [
texlive.combined.scheme-medium # The all-in-one LaTeX distribution for your offline typesetting needs.
] else []);
};
}