Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

4
Noob question: How do I install a package with a modified argument?
Post Body

hi everyone! I'm completely new to nix and nixos, and i'm struggling to figure a few things out! I beg for patience with my ignorance. I've been trying to install a package, in this instance polybar, with a custom argument.

Reading the polybar nix-expression it seems i should be able to pass an argument i3GapsSupport with a boolean value, and that it defaults to false. now, I cant for the life of me figure out how to actually do that in the nix language!

my first instinct was to just add the arguments to what i had assumed was a function call:

environment.systempackages = with pkgs; [ 
. . . 
(polybar {i3GapsSupport = true;})
. . .  

but when trying to build, that turned out to be an attempt to call something which is not a function but a set

having read (and apparently missunderstood) thenixos guide i also tried the path of declaring a variable and use overrideAttrs, basically doing polybarWithI3Gaps = . . . and that same but prefixed with let, but I get an error telling me either how the option polybarWithI3Gaps does not exist, or how there was an unexpected LET on row such and such.

at this point I'm feeling a little more than confused, how do I pass an argument to a nix statement? is it possible to declare new variables or anything remotely equivalent in nix? if so, how? from the nixpills lessons I have done (the first 5) I get the impresssion that it could be done, but all they tell me as to how is that I should :

Note: ignore the foo = "strval" assignment, special syntax in nix repl

very grateful for any help, and once again, excuse my ignorance, i'm not only new to nix but also to functional languages in general, lots of new concepts to take in!

thanks!

Author
Account Strength
100%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
20,815
Link Karma
1,254
Comment Karma
19,508
Profile updated: 5 days ago
Posts updated: 2 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
5 years ago