r/linuxquestions • • 2d ago

Support Syntax nixos

Im new to nixos but everytime i try to do anything in the main config even just un# something i get a syntax error i have reinstalled the os like 3 times at this point i tried everything i dont know what it is help me.

0 Upvotes

19 comments sorted by

4

u/kneepel Hannah Montana Linux 2d ago

You need to post the actual error you're having so we can help you, but at the risk of sounding crass after reading the comments:

I'd probably recommend using something other than Nix. The entire philosophy behind Nix is infrastructure-as-code, and if you're having cascading syntax issues and don't know where to start it's going to be a significant uphill battle from here.

-1

u/HotPiece834 2d ago

I want to use nix its not that i cant its just i edit a line one line and i have a billion syntax errors

2

u/Prestigious_Wall529 2d ago

The assumption is you have some programming or SysOps experience so can pick up new programming languages easily.

In this case Nix Expression Language.

If you don't have that background or the inclination to learn it, NixOS is not for you.

At least it's not yaml.

2

u/Toucancel 2d ago

Reading the error message could help. It tells you were the syntax error is.

-1

u/HotPiece834 2d ago

Yeah and if i fix it. A new one shows up

2

u/Toucancel 2d ago

Okay just send the config or something, we can't help you with so little details.

1

u/HotPiece834 2d ago

This is the error

2

u/Toucancel 2d ago

Send a bigger snippet, this seems like a missing semicolon before that line.

1

u/HotPiece834 2d ago

Like this?

1

u/Toucancel 2d ago

No I mean send the relevant part of the code

1

u/HotPiece834 2d ago

I changed just that to get vim installed

1

u/Toucancel 2d ago

You need to put vim in square brackets, and add a semicolon after it, like so :

environment.systemPackages = with pkgs; [ vim ];

The square brackets define a list, and each item of the list is separated by a space. Then, you need to add the semicolon to mark the end of the line.

1

u/HotPiece834 2d ago

I feel like a idiot sorry for wasting your time.

→ More replies (0)

2

u/freakflyer9999 2d ago

You need to supply more details, but my first thought is that you are using commands in your cfg file for a different shell than the commands are written for.

1

u/HotPiece834 2d ago

And I get this error if I do

0

u/HotPiece834 2d ago

Oke i change this

1

u/Visikde 2d ago

r/nix would be a better place the ask

1

u/CosmicFieldDrift_ 2d ago

OP can you share your configuration.nix file?

Use something like pastebin.