# Changing permission of /etc/nix

**URL:** https://discourse.nixos.org/t/changing-permission-of-etc-nix/30519
**Category:** Uncategorized
**Created:** [July 16, 2023, 5:08pm UTC](https://discourse.nixos.org/t/changing-permission-of-etc-nix/30519 "2023-07-16T17:08:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dch82](https://discourse.nixos.org/user_avatar/discourse.nixos.org/dch82/32/8996_2.png) [@dch82](https://discourse.nixos.org/u/dch82)
#### Post date: [July 16, 2023, 5:08pm UTC](https://discourse.nixos.org/t/changing-permission-of-etc-nix/30519/1 "2023-07-16T17:08:02Z")

</div>

Hello, following up from [this thread](https://discourse.nixos.org/t/nix-with-flakes-does-not-recognise-home-config-nix-registry-json), I need to figure out how to declaratively change the permission of /etc/nix to something sane so I can use some Nix commands correctly.

Please help!  
Thanks!

---

<div class="post-metadata">

### Author: ![NobbZ](https://discourse.nixos.org/user_avatar/discourse.nixos.org/nobbz/32/7022_2.png) [@NobbZ](https://discourse.nixos.org/u/NobbZ)
#### Post date: [July 16, 2023, 6:59pm UTC](https://discourse.nixos.org/t/changing-permission-of-etc-nix/30519/2 "2023-07-16T18:59:22Z")

</div>

As that thread is quite long, can you give a summary about what your current problem is?

Usually `/etc/nix/nix.conf` is managed and created by the `nix.*` settings, and its permissions should be totally correct.

---

<div class="post-metadata">

### Author: ![dch82](https://discourse.nixos.org/user_avatar/discourse.nixos.org/dch82/32/8996_2.png) [@dch82](https://discourse.nixos.org/u/dch82)
#### Post date: [July 16, 2023, 7:36pm UTC](https://discourse.nixos.org/t/changing-permission-of-etc-nix/30519/3 "2023-07-16T19:36:22Z")

</div>

Ok, so for some reason `/etc/nix` is set to file permission `700` instead of a more usual `755`. `chmod` is not very useful as I have impermance setup and my system is erased on reboot.

---

<div class="post-metadata">

### Author: ![NobbZ](https://discourse.nixos.org/user_avatar/discourse.nixos.org/nobbz/32/7022_2.png) [@NobbZ](https://discourse.nixos.org/u/NobbZ)
#### Post date: [July 16, 2023, 7:46pm UTC](https://discourse.nixos.org/t/changing-permission-of-etc-nix/30519/4 "2023-07-16T19:46:04Z")

</div>

Impermanence seem to have a `mode` field.

Though what exactly are you managing using impermanence here?

I have not much experience with ephemeral roots, though from all what I’ve heard `/etc` and its childs should be created with correct permissions by NixOS.

---

<div class="post-metadata">

### Author: ![dch82](https://discourse.nixos.org/user_avatar/discourse.nixos.org/dch82/32/8996_2.png) [@dch82](https://discourse.nixos.org/u/dch82)
#### Post date: [July 19, 2023, 1:39pm UTC](https://discourse.nixos.org/t/changing-permission-of-etc-nix/30519/5 "2023-07-19T13:39:46Z")

</div>

Ahh… It turns out that the permissions of /etc/nix were already set (incorrectly).  
Thanks!

---

<div class="post-metadata">

### Author: ![ericgundrum](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/e/e19adc/32.png) [@ericgundrum](https://discourse.nixos.org/u/ericgundrum)
#### Post date: [July 21, 2023, 2:42pm UTC](https://discourse.nixos.org/t/changing-permission-of-etc-nix/30519/6 "2023-07-21T14:42:37Z")

</div>

If you are using NixOS, then why are you touching anything in `/etc/nix`? The OS config is driven from the content of `/etc/nixos`.

---

<div class="post-metadata">

### Author: ![Solene](https://discourse.nixos.org/user_avatar/discourse.nixos.org/solene/32/5738_2.png) [@Solene](https://discourse.nixos.org/u/Solene)
#### Post date: [July 21, 2023, 3:51pm UTC](https://discourse.nixos.org/t/changing-permission-of-etc-nix/30519/7 "2023-07-21T15:51:16Z")

</div>

See [Nix does not use /etc/nix/nix.conf anymore - #11 by jisponitra](https://discourse.nixos.org/t/nix-does-not-use-etc-nix-nix-conf-anymore/29505/11)
