# A NixOS module to create arbitrary symlinks

**URL:** https://discourse.nixos.org/t/a-nixos-module-to-create-arbitrary-symlinks/78730
**Category:** Announcements
**Created:** [July 3, 2026, 7:47am UTC](https://discourse.nixos.org/t/a-nixos-module-to-create-arbitrary-symlinks/78730 "2026-07-03T07:47:31Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![volty](https://discourse.nixos.org/user_avatar/discourse.nixos.org/volty/32/37973_2.png) [@volty](https://discourse.nixos.org/u/volty)
#### Post date: [July 3, 2026, 7:47am UTC](https://discourse.nixos.org/t/a-nixos-module-to-create-arbitrary-symlinks/78730/1 "2026-07-03T07:47:31Z")

</div>

I have created a module which you can use to create any symlinks. I mainly made this because I wanted to manage my hyprland config while preserving hot-reload without using home-manager but it can be used to create any symlinks and manage any dotfiles. The reason I made this is because nix lacks a way of creating arbitrary symlinks(i guess its because of its declarative nature) without external tools and using home-manager just for this felt bloated ☹ Now, I know `tmp-files` already exits but it has a big problem, it doesnt clear symlinks that you have removed from your configuration meaning you will have to go and remove them manually ☹ That’s why I created this module it automatically cleans up the symlinks that you have removed from your configuration. I would like feedback on this \<3.

> **[createSymlink](https://codeberg.org/volty/createSymlink)**
>
> A NixOS module which allows for creation of arbitrary symlinks

---

<div class="post-metadata">

### Author: ![mightyiam](https://discourse.nixos.org/user_avatar/discourse.nixos.org/mightyiam/32/33998_2.png) [@mightyiam](https://discourse.nixos.org/u/mightyiam)
#### Post date: [July 3, 2026, 8:11am UTC](https://discourse.nixos.org/t/a-nixos-module-to-create-arbitrary-symlinks/78730/2 "2026-07-03T08:11:04Z")

</div>

Technically, a good documentation example would be not of creating symlinks in user homes, because those might not be mounted at activation. They might be decrypted by user login, for example.

Essentially, if the intended usage is in user homes, perhaps it should be a home-manager module, instead?

Also, should it create user systemd units, instead?

---

<div class="post-metadata">

### Author: ![Sigmanificient](https://discourse.nixos.org/user_avatar/discourse.nixos.org/sigmanificient/32/10706_2.png) [@Sigmanificient](https://discourse.nixos.org/u/Sigmanificient)
#### Post date: [July 3, 2026, 10:25am UTC](https://discourse.nixos.org/t/a-nixos-module-to-create-arbitrary-symlinks/78730/3 "2026-07-03T10:25:57Z")

</div>

I changed this to `announcements` because it does not seems to belong into the RFC announcements category

---

<div class="post-metadata">

### Author: ![ElvishJerricco](https://discourse.nixos.org/user_avatar/discourse.nixos.org/elvishjerricco/32/984_2.png) [@ElvishJerricco](https://discourse.nixos.org/u/ElvishJerricco)
#### Post date: [July 3, 2026, 11:51am UTC](https://discourse.nixos.org/t/a-nixos-module-to-create-arbitrary-symlinks/78730/4 "2026-07-03T11:51:47Z")

</div>

> `systemd-tmpfiles` already exists which also allows for arbitrary symlink creation but it has a few problems:
> 
> 1. It runs on every boot not just on system rebuild,

So do activation scripts. In fact they do so at a far more sensitive time during boot, which is just one of the reasons activation scripts are _strongly_ recommended against. We really want to deprecate those once we’ve gotten rid of all the uses of them within nixpkgs.

---

<div class="post-metadata">

### Author: ![TLATER](https://discourse.nixos.org/user_avatar/discourse.nixos.org/tlater/32/4257_2.png) [@TLATER](https://discourse.nixos.org/u/TLATER)
#### Post date: [July 3, 2026, 12:00pm UTC](https://discourse.nixos.org/t/a-nixos-module-to-create-arbitrary-symlinks/78730/5 "2026-07-03T12:00:44Z")

</div>

You might also be interested in [hjem](https://github.com/feel-co/hjem), or at least [smfh](https://github.com/feel-co/smfh) to avoid reinventing the wheel completely.

In particular, if the only reason you’re avoiding home-manager is “bloat”, hjem should be exactly what you’re looking for:

> The interface for the hjem module is conceptually very similar to prior art (e.g., Home Manager), but it does not act as a collection of modules like Home Manager. Instead, we implement minimal features, and leave application-specific abstractions to the user to do as they see fit.

---

<div class="post-metadata">

### Author: ![bme](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@bme](https://discourse.nixos.org/u/bme)
#### Post date: [July 3, 2026, 3:12pm UTC](https://discourse.nixos.org/t/a-nixos-module-to-create-arbitrary-symlinks/78730/6 "2026-07-03T15:12:26Z")

</div>

second for smfh, I have started using it outside of hejm, it’s pretty nice!

---

<div class="post-metadata">

### Author: ![mipmip](https://discourse.nixos.org/user_avatar/discourse.nixos.org/mipmip/32/5026_2.png) [@mipmip](https://discourse.nixos.org/u/mipmip)
#### Post date: [July 4, 2026, 6:41am UTC](https://discourse.nixos.org/t/a-nixos-module-to-create-arbitrary-symlinks/78730/7 "2026-07-04T06:41:12Z")

</div>

I created hmrice for this reason. [GitHub - mipmip/hm-ricing-mode: Ricing mode utility for Home Manager · GitHub](https://github.com/mipmip/hm-ricing-mode)

---

<div class="post-metadata">

### Author: ![kiara](https://discourse.nixos.org/user_avatar/discourse.nixos.org/kiara/32/37249_2.png) [@kiara](https://discourse.nixos.org/u/kiara)
#### Post date: [July 5, 2026, 7:03am UTC](https://discourse.nixos.org/t/a-nixos-module-to-create-arbitrary-symlinks/78730/8 "2026-07-05T07:03:42Z")

</div>

what of [`pkgs.linkfarm`](https://noogle.dev/f/pkgs/linkFarm)?

---

<div class="post-metadata">

### Author: ![NotAShelf](https://discourse.nixos.org/user_avatar/discourse.nixos.org/notashelf/32/11135_2.png) [@NotAShelf](https://discourse.nixos.org/u/NotAShelf)
#### Post date: [July 5, 2026, 10:14am UTC](https://discourse.nixos.org/t/a-nixos-module-to-create-arbitrary-symlinks/78730/9 "2026-07-05T10:14:02Z")

</div>

It could be a good idea to add a NixOS module to [smfh](https://github.com/feel-co/smfh) that lets you create symlinks with tmpfiles-like module interface.
