with one click
new-module
// Use this skill when the user asks to add a new NixOS module, create a module for an application, or install a new package with persistent state in this nixos config repository.
// Use this skill when the user asks to add a new NixOS module, create a module for an application, or install a new package with persistent state in this nixos config repository.
Use this skill when the user wants to add a new agenix secret to this NixOS config repository.
Use this skill when the user wants to enable an existing NixOS module on one or more hosts in this config repository.
Use this skill when the user wants to add a new host (workstation, laptop, server, or VPS) to this NixOS config repository.
| name | new-module |
| description | Use this skill when the user asks to add a new NixOS module, create a module for an application, or install a new package with persistent state in this nixos config repository. |
| argument-hint | <module-name> [category] |
| allowed-tools | ["Read","Write","Edit","Glob","Grep","Bash"] |
The user wants to add a new module to this NixOS config. Arguments: $ARGUMENTS
Modules live under modules/nixos/<category>/. Each module is a directory with a default.nix. The root module at modules/nixos/default.nix imports all category directories, and each category's default.nix imports its sub-modules.
Categories and their top-level enable option:
graphical/ — gated on config.etu.graphical.enabledevelopment/ — gated on config.etu.development.enablegames/ — gated on config.etu.games.enablebase/ — always activeservices/ — always active{
config,
lib,
pkgs,
...
}:
{
options.etu.<category>.<module-name>.enable =
lib.mkEnableOption "Enable <description>";
config = lib.mkIf config.etu.<category>.<module-name>.enable {
# Install packages via home-manager user packages
etu.user.extraUserPackages = [
pkgs.<package-name>
];
# Persist config directories (backed up via ZFS safe dataset)
etu.base.zfs.user.directories = [
".config/<app-name>"
];
# Persist local/cache directories (not backed up, ZFS local dataset)
# etu.base.zfs.localUser.directories = [
# ".cache/<app-name>"
# ];
# Persist specific files instead of whole directories
# etu.base.zfs.user.files = [
# ".config/<app-name>/settings.ini"
# ];
};
}
| Option | Mount | Snapshotted | Use for |
|---|---|---|---|
etu.base.zfs.user.directories | /data | Yes | Config, important data |
etu.base.zfs.user.files | /data | Yes | Single config files |
etu.base.zfs.localUser.directories | /data/local | No | Caches, ephemeral state |
etu.base.zfs.system.directories | /data | Yes | System-level dirs |
etu.base.zfs.local.directories | /data/local | No | System-level local dirs |
Root is tmpfs — nothing persists unless declared here.
modules/nixos/<category>/<module-name>/default.nixmodules/nixos/<category>/default.nixhosts/<hostname>/configuration.nixRun nix search nixpkgs <keyword> in the terminal to find the exact package attribute name.
{
config,
lib,
pkgs,
...
}:
{
options.etu.graphical.<name>.enable = lib.mkEnableOption "Enable <name>";
config = lib.mkIf config.etu.graphical.<name>.enable {
etu.user.extraUserPackages = [ pkgs.<name> ];
etu.base.zfs.user.directories = [
".config/<name>"
];
};
}
config = lib.mkIf config.etu.graphical.<name>.enable {
etu.user.extraUserPackages = [ pkgs.<name> ];
etu.user.extraGroups = [ "dialout" ]; # e.g., for serial/USB devices
etu.base.zfs.user.directories = [ ".config/<name>" ];
};
config = lib.mkIf ... {
etu.user.extraUserPackages = [ pkgs.<name> ];
etu.base.zfs.user.directories = [ ".config/<name>" ];
etu.base.zfs.localUser.directories = [ ".cache/<name>" ];
};
config = lib.mkIf ... {
services.<name>.enable = true;
etu.base.zfs.system.directories = [ "/var/lib/<name>" ];
};
The main hosts for Elis are:
hosts/laptop-private-elis/configuration.nixhosts/desktop-elis/configuration.nixEnable options are set directly in the etu = { ... } block of each host's configuration.nix.
modules/nixos/graphical/audacity/default.nix ← new module
modules/nixos/graphical/default.nix ← added ./audacity to imports
hosts/laptop-private-elis/configuration.nix ← added graphical.audacity.enable = true
hosts/desktop-elis/configuration.nix ← added graphical.audacity.enable = true