# Nix environment packages overrides impossible?

**URL:** <https://discourse.flox.dev/t/nix-environment-packages-overrides-impossible/803>\
**Category:** Feature Requests\
**Created:** [October 6, 2023, 11:06am UTC](https://discourse.flox.dev/t/nix-environment-packages-overrides-impossible/803 "2023-10-06T11:06:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon59756714](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anon59756714](https://discourse.flox.dev/u/anon59756714)\
**Post date:** [October 6, 2023, 11:06am UTC](https://discourse.flox.dev/t/nix-environment-packages-overrides-impossible/803/1 "2023-10-06T11:06:27Z")

</div>

I want to install spotifyd with optional PulseAudio support. From what I learned from Environment reference, each package supports only stability and version attributes. It means I cannot override the withPulseAudio attribute to true.

Does that mean that to enable this I have to create my own flake, add it to public Github and use it the same way I installed gimme-aws-creds from their github?

---

<div class="post-metadata">

**Author:** ![anon59756714](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anon59756714](https://discourse.flox.dev/u/anon59756714)\
**Post date:** [October 6, 2023, 11:09am UTC](https://discourse.flox.dev/t/nix-environment-packages-overrides-impossible/803/2 "2023-10-06T11:09:58Z")

</div>

ahh ofc there is inline, I was blind

---

<div class="post-metadata">

**Author:** ![anon59756714](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anon59756714](https://discourse.flox.dev/u/anon59756714)\
**Post date:** [October 6, 2023, 12:04pm UTC](https://discourse.flox.dev/t/nix-environment-packages-overrides-impossible/803/3 "2023-10-06T12:04:46Z")

</div>

```auto
 88 inline.packages.spotifyd = { system, ...}:
 89 let
 90 nixpkgs = builtins.getFlake "github:NixOS/nixpkgs/2c6ae7132ca558f1052da0eececed3cad191b883";
 91 in
 92 nixpkgs.legacyPackages.${system}.spotifyd.override { withPulseAudio = true ; };

```

Although this fetches nixpkgs directly, can’t nixpkgs-flox be passed somehow like a system?

---

<div class="post-metadata">

**Author:** ![ysndr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/ysndr/32/340_2.png) [@ysndr](https://discourse.flox.dev/u/ysndr)\
**Post date:** [October 6, 2023, 1:06pm UTC](https://discourse.flox.dev/t/nix-environment-packages-overrides-impossible/803/4 "2023-10-06T13:06:30Z")

</div>

Disclaimer: we are currently reworking the environment file format so the answer to this might look somewhat different soon.

For the time being:

The function here is in fact called with a context that is a superset of nixpkgs to provide, _inline_ package definitions.  
Think of the function in a way like default.nix files in nixpkgs if you have worked with those.  
The nixpkgs used should match nixpkgs-flox

Thus you should be able to override spotifyd like this:

```plaintext
inline.packages.spotifyd = { spotifyd }: spotifyd.override { withPulseAudio = true ; };

```

Note that the nixpkgs you get here will be locked to the version of when the environment was created or for project environments, the version locked by the project.
