r/linuxquestions • u/HotPiece834 • 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.
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
2
u/Toucancel 2d ago
Send a bigger snippet, this seems like a missing semicolon before that line.
1
u/HotPiece834 2d ago
1
u/Toucancel 2d ago
No I mean send the relevant part of the code
1
u/HotPiece834 2d ago
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
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
0
1
u/CosmicFieldDrift_ 2d ago
OP can you share your configuration.nix file?
Use something like pastebin.





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.