# Syntax error "inherit"

**URL:** https://discourse.nixos.org/t/syntax-error-inherit/81480
**Category:** Help
**Created:** [November 28, 2026, 3:52am UTC](https://discourse.nixos.org/t/syntax-error-inherit/81480 "2026-11-28T03:52:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Reactived](https://discourse.nixos.org/user_avatar/discourse.nixos.org/reactived/32/39663_2.png) [@Reactived](https://discourse.nixos.org/u/Reactived)
#### Post date: [November 28, 2026, 3:52am UTC](https://discourse.nixos.org/t/syntax-error-inherit/81480/1 "2026-11-28T03:52:34Z")

</div>

Does anyone know what “error: syntax error, unexpected file end, expected the word ‘inherit’” means? The command `nix-instantiate --parse /etc/nixos/configuration.nix` says there’s an error on line 133, even though there are only 132 lines.

This error occurred after “sudo nixos-rebuild switch --flake /etc/nixos#nixos”

---

<div class="post-metadata">

### Author: ![GraysonTinker](https://discourse.nixos.org/user_avatar/discourse.nixos.org/graysontinker/32/36404_2.png) [@GraysonTinker](https://discourse.nixos.org/u/GraysonTinker)
#### Post date: [November 28, 2026, 3:58am UTC](https://discourse.nixos.org/t/syntax-error-inherit/81480/2 "2026-11-28T03:58:54Z")

</div>

In my experience this most often happens when missing a semicolon somewhere. But there’s no way we can meaningfully give help until you post your configuration.

---

<div class="post-metadata">

### Author: ![Reactived](https://discourse.nixos.org/user_avatar/discourse.nixos.org/reactived/32/39663_2.png) [@Reactived](https://discourse.nixos.org/u/Reactived)
#### Post date: [November 28, 2026, 4:04am UTC](https://discourse.nixos.org/t/syntax-error-inherit/81480/3 "2026-11-28T04:04:57Z")

</div>

![IUaOSKudydSvi8_eGEBeL5aneV5DZtYiK_VPupuYtsLa9y6MSj-l0IDog2vkLOts5kSLCSLkyMhvvV9UaZ1g_iz0MkQdRg](https://discourse.nixos.org/uploads/default/original/3X/2/0/204e4a6ad98f0b354c4baf17027c556e2cc1f7e6.jpeg)

---

<div class="post-metadata">

### Author: ![Reactived](https://discourse.nixos.org/user_avatar/discourse.nixos.org/reactived/32/39663_2.png) [@Reactived](https://discourse.nixos.org/u/Reactived)
#### Post date: [November 28, 2026, 4:06am UTC](https://discourse.nixos.org/t/syntax-error-inherit/81480/4 "2026-11-28T04:06:48Z")

</div>

I added the colon on 131 stroke myself at the end because I thought the problem was with it, but the error occurs both with and without the colon.

---

<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: [November 28, 2026, 7:02am UTC](https://discourse.nixos.org/t/syntax-error-inherit/81480/5 "2026-11-28T07:02:47Z")

</div>

Find a pastebin you can `curl` your file to. I think [termbin](https://termbin.com/) was ok. The issue will be a hanging `let` somewhere, but it’s not visible in that picture.

The last line does not need a semicolon.
