Skip to main content

r/dotfiles


I created a dotfiles manager that is configured in lua
I created a dotfiles manager that is configured in lua

I came from yadm. Renaming files into ##os.Linux and dropping into Jinja whenever a machine needed something different always felt like the wrong place to put that decision. I looked at the other options too and none of them really fit me, so I made my own (in lua).

The config is in ~/.config/luadot/config.lua, plain Lua is evaluated before every command.

ld.opt.link("hard")

ld.rules({
  { match = ".ssh/id_*", encrypt = true },
  { match = ".config/nvim", whole = true, link = "symbolic" },
  { match = ".config/mako/**", on_change = "makoctl reload" },
  { match = ".cache/**", track = "never" },
})

if ld.class.get("form-factor") == "laptop" then
  ld.rules({ match = ".config/tlp/**", link = "symbolic" })
end

There is also the bootstrap file ~/.config/luadot/bootstrap.lua and setup files ~/.config/luadot/setup/*.

Rules also cover file mode, owner, Git LFS, what happen copy differs, and whether new files are picked up on their own

There are also directory templates. A directory named `.zshrc.luadot/` produces `~/.zshrc`, and its `luadot.lua` picks what goes there:

.zshrc.luadot/
├── luadot.lua
├── laptop.zsh
└── desktop.zsh

-- .zshrc.luadot/luadot.lua
if ld.class.get("form-factor") == "laptop" then
  return ld.alt.file("laptop.zsh")
end

return ld.alt.file("desktop.zsh")

It also has support for plugin managers, feel free to create one if you feel like.

It is 0.1.0 nightly, so the interface still moves and problably a lot of things will still change.

Happy to hear what breaks or what is missing.

The github url is https://github.com/ItzTas/luadot


Advertisement: Put your hands in the air if you…don’t really see yourself in a cliché retirement like this one. 🙌 It’s your retirement, see how you can get ready for the one you actually want with Prudential.
Put your hands in the air if you…don’t really see yourself in a cliché retirement like this one. 🙌 It’s your retirement, see how you can get ready for the one you actually want with Prudential.
media poster


A declarative dotfile manager based around resources and reconciliation
A declarative dotfile manager based around resources and reconciliation

All,

I've been managing my dotfiles using Dotbot + Jsonnet for a while. As my configuration grew, it started to get overly complicated and uncomfortable to use.

I looked at some of the existing options like stow, home-manager and nix. However, I didn't really want to commit to nix - and for what it's worth nix is great.

I really like declarative config systems, and felt like it worked really well for the problem space. So, I designed a declarative config system for user environments.

Rather than the traditional models, things like:

  • files

  • packages

  • directories

  • symlinks

  • services

  • etc

All form resources, which form a dependency graph, and then the system will reconcile the graph toward the desired state.

Essentially:

Instead of run these commands in this order, you describe the state you want and let the system figure out how to get there.

This project is mostly experimental at the moment, and still evolving but it's getting closer to the point where I'm comfortable using it for my own config.

If existing solutions work for you then that's fine and those are certainly more mature and good solutions.

I feel like this sits somewhere in the middle of stow/dotbot & nix/home-manager.

Feedback, suggestions, improvements, contributions, etc are all welcome.

GitHub: https://github.com/arcadia-de/hypha


I added a pre-commit hook for catching broken SSH configs in dotfiles repos
I added a pre-commit hook for catching broken SSH configs in dotfiles repos

My ~/.ssh/config lives next to the rest of my dotfiles, and I kept finding duplicate Host blocks or old IdentityFile paths long after I had changed them. That turned into sshconfig-lint.

The upcoming v0.5 beta can check several configs in one run and now includes a strict pre-commit hook. For the current beta commit:

repos:
  - repo: https://github.com/Noah4ever/sshconfig-lint
    rev: 7674f40
    hooks:
      - id: sshconfig-lint-strict

It also follows Include files and reports the actual source file and line. I am keeping auto-fixes out for now because changing Host block order can change what OpenSSH actually applies.

There is a browser playground for trying the text-based rules without installing anything. The config stays in your browser:

https://sshconfig-lint.apps.thiering.org/en

Source:

https://github.com/Noah4ever/sshconfig-lint

If you version your SSH config, I would be interested in the checks you would actually want before committing it.