This Nix flake provides a robust and automated solution for managing dotfiles for multiple users on NixOS systems. It is centered around tuckr and leverages NixOS modules and systemd services for automation.
- Convention over configuration: Follows a declarative management philosophy, reducing tedious configuration.
- Link status visibility: You can easily check which dotfiles have been successfully linked.
- JSON output for link status: Useful for further processing and automation.
- Multi-user dotfiles management: Easily configure and manage
tuckrfor each user on NixOS. - Automatic conflict handling: Existing files or directories are automatically backed up before attempting to create symbolic links.
- Systemd integration: Works closely with systemd services, automatically handling dotfiles with logs after system boot or rebuild.
- Configurable backups: Custom suffixes can be specified for backup files and directories.
- Instant configuration application: Changes take effect automatically after a system rebuild—no manual intervention needed.
- Add the input to your
flake.nix:
{
description = "Your NixOS configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
tuckr-nix.url = "github:lonerOrz/tuckr-nix";
};
outputs = { self, nixpkgs, tuckr-nix, ... }: {
nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
tuckr-nix.tuckrModules.tuckr
];
};
};
}- Configure users in
configuration.nix:
{ config, pkgs, lib, ... }:
{
tuckr.enable = true;
tuckr.users = {
loner = {
enable = true;
dotPath = "~/.config/tuckr";
backupSuffix = "bakup";
group = {
fzf.enable = true;
nvim.enable = false;
};
};
# Other users
# anotheruser = { ... };
};
}- Rebuild the system:
sudo nixos-rebuild switchAfter rebuilding, the tuckr-auto-resolver-<username> systemd service will automatically activate and manage the configured users' dotfiles.
- Declarative generation of dotfiles
- Support for Nix store
- Additional automation strategies
- Git integration
Contributions are welcome! You can submit issues or pull requests.
GPL-3.0-or-later
For the specific license of the tuckr binary, please refer to tuckr.nix.