mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
Add a `programs.atuin` module to enable atuin shell history
integration system-wide, without requiring home-manager.
Features:
- Shell integration for bash, zsh, and fish (enabled by default)
- Configuration via `settings` (written to /etc/atuin/config.toml,
using ATUIN_CONFIG_DIR since atuin does not support XDG_CONFIG_DIRS)
- Custom themes support
- Package selection via `package` option
- Additional flags via `flags` option
- Daemon option with systemd user service and socket activation
(Linux only), required for some configurations such as root-on-zfs
Example usage:
programs.atuin = {
enable = true;
settings = {
auto_sync = true;
search_mode = "prefix";
};
};
39 lines
987 B
Nix
39 lines
987 B
Nix
{ pkgs, ... }:
|
|
{
|
|
name = "atuin";
|
|
meta.maintainers = pkgs.atuin.meta.maintainers;
|
|
|
|
nodes.machine = {
|
|
programs = {
|
|
bash.enable = true;
|
|
fish.enable = true;
|
|
zsh.enable = true;
|
|
|
|
atuin = {
|
|
enable = true;
|
|
settings = {
|
|
auto_sync = false;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
start_all()
|
|
machine.wait_for_unit("default.target")
|
|
|
|
# Check atuin is installed
|
|
machine.succeed("atuin --version")
|
|
|
|
# Check shell integration - verify the init scripts can be sourced without error
|
|
machine.succeed("bash -c 'eval \"$(atuin init bash)\"'")
|
|
machine.succeed("zsh -c 'eval \"$(atuin init zsh)\"'")
|
|
machine.succeed("fish -c 'atuin init fish | source'")
|
|
|
|
# Verify config file was created
|
|
machine.succeed("grep -q 'auto_sync = false' /etc/atuin/config.toml")
|
|
|
|
# Verify daemon socket unit is enabled
|
|
machine.succeed("systemctl --user --machine=root@ is-enabled atuin-daemon.socket")
|
|
'';
|
|
}
|