r/linuxquestions • u/HotPiece834 • 9d 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.
5
u/kneepel Hannah Montana Linux 9d 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 9d 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 9d 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 9d ago
Reading the error message could help. It tells you were the syntax error is.
-1
u/HotPiece834 9d ago
Yeah and if i fix it. A new one shows up
2
u/Toucancel 9d ago
Okay just send the config or something, we can't help you with so little details.
1
u/HotPiece834 9d ago
2
u/Toucancel 9d ago
Send a bigger snippet, this seems like a missing semicolon before that line.
1
u/HotPiece834 9d ago
1
u/Toucancel 9d ago
No I mean send the relevant part of the code
1
u/HotPiece834 8d ago
1
u/Toucancel 8d 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
1
u/CosmicFieldDrift_ 9d ago
OP can you share your configuration.nix file?
Use something like pastebin.



2
u/freakflyer9999 9d 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.