# Nixos 21.11 + Plex + Plexpass

**URL:** https://discourse.nixos.org/t/nixos-21-11-plex-plexpass/17011
**Category:** Help
**Created:** [January 6, 2022, 3:29pm UTC](https://discourse.nixos.org/t/nixos-21-11-plex-plexpass/17011 "2022-01-06T15:29:25Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![HiDefender](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/h/ac8455/32.png) [@HiDefender](https://discourse.nixos.org/u/HiDefender)
#### Post date: [January 6, 2022, 3:29pm UTC](https://discourse.nixos.org/t/nixos-21-11-plex-plexpass/17011/1 "2022-01-06T15:29:25Z")

</div>

I can’t seem to get the Plexpass version of Plex working on Nixos. I followed [this](https://discourse.nixos.org/t/nixos-19-03-plex-plexpass/3464) thread, and use the below code in my configuration file. There are no problems when I `nixos-rebuild switch`, however when I log into the PlexMediaServer hosted on the Nixos machine it says that it is running version 1.24.5.5173 not the version I specify in the configuration file. Furthermore the Plexamp functionality of the server lacks features that the Ubuntu version has.

```auto
services.plex = {
    enable = true;
    openFirewall = true;
    package = pkgs.plex.overrideAttrs (x: let
        # see https://www.plex.tv/media-server-downloads/ for 64bit rpm
        version = "1.25.2.5319-c43dc0277";
        sha1 = "7461280af7b2fee330cf59a9d0ba95ff6c58555f";
      in {
        name = "plex-${version}";
        src = pkgs.fetchurl {
          url = "https://downloads.plex.tv/plex-media-server-new/${version}/redhat/plexmediaserver-${version}.x86_64.rpm";
          inherit sha1;
        };
      }
    );
  };

```

Any idea how to fix this? I’d prefer to run the PlexMediaServer on Nixos instead of Ubuntu.

---

<div class="post-metadata">

### Author: ![matthewcroughan](https://discourse.nixos.org/user_avatar/discourse.nixos.org/matthewcroughan/32/9512_2.png) [@matthewcroughan](https://discourse.nixos.org/u/matthewcroughan)
#### Post date: [January 7, 2022, 12:56pm UTC](https://discourse.nixos.org/t/nixos-21-11-plex-plexpass/17011/2 "2022-01-07T12:56:00Z")

</div>

This code will work instead. You can put it in a file named `plex.nix` and put it in your config’s `imports = [./plex.nix]` for example. I just tested it on my laptop, seems to work as intended.

```nix
{ pkgs, lib, ... }:
let
  myPlex = pkgs.plex.overrideAttrs (_: rec {
    version = "1.25.2.5319-c43dc0277";
    src = pkgs.fetchurl {
      url = "https://downloads.plex.tv/plex-media-server-new/${version}/redhat/plexmediaserver-${version}.x86_64.rpm";
      sha256 = "sha256-/Mr7U3L/OPbjORzoFXMtWKn0yV22vi4S4uaranoXuPw=";
    };
  });
in
{
  services.plex = {
    enable = true;
    openFirewall = true;
    package = myPlex;
  };
}

```

---

<div class="post-metadata">

### Author: ![HiDefender](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/h/ac8455/32.png) [@HiDefender](https://discourse.nixos.org/u/HiDefender)
#### Post date: [January 9, 2022, 1:52am UTC](https://discourse.nixos.org/t/nixos-21-11-plex-plexpass/17011/3 "2022-01-09T01:52:49Z")

</div>

Much appreciated thank you.

I may have stumbled across a bug. The above code works when installed a clean Nixos machine (In the case of the above code the Plex Media Server version is `"1.25.2.5319-c43dc0277"`).

However, after `nixos-rebuild switch` I try upgrading the Plex Media Server version. You can grab the latest url from [here](https://www.plex.tv/media-server-downloads/) (Which is `"1.25.3.5385-f05b712b6"`). Now run `nixos-rebuild switch`. I expect to see the new version, but instead I see `"1.24.5.5173"`.

Huh that’s weird. Maybe best to just fall back to `"1.25.2.5319-c43dc0277"`, except I can’t. I am stuck on `"1.24.5.5173"`.

Can someone else replicate?

---

<div class="post-metadata">

### Author: ![philippW](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/p/ed655f/32.png) [@philippW](https://discourse.nixos.org/u/philippW)
#### Post date: [March 23, 2022, 1:48am UTC](https://discourse.nixos.org/t/nixos-21-11-plex-plexpass/17011/4 "2022-03-23T01:48:45Z")

</div>

Try this:

```auto
services.plex = let plexpass = pkgs.plex.override {
  plexRaw = pkgs.plexRaw.overrideAttrs(old: rec {
    version = "1.25.8.5621-7a6fed0cf";
    src = pkgs.fetchurl {
      url = "https://downloads.plex.tv/plex-media-server-new/${version}/debian/plexmediaserver_${version}_amd64.deb";
      sha256 = "sha256-BwPYgO4/My6wk3W7/9gXSKKR5bKM1dDKiTdhHlhyvP0=";
    };
  });
}; 
in {
  enable = true;
  openFirewall = true;
  package = plexpass;
};

```

---

<div class="post-metadata">

### Author: ![HiDefender](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/h/ac8455/32.png) [@HiDefender](https://discourse.nixos.org/u/HiDefender)
#### Post date: [March 30, 2022, 3:35pm UTC](https://discourse.nixos.org/t/nixos-21-11-plex-plexpass/17011/5 "2022-03-30T15:35:18Z")

</div>

That did it, thank you!

Why did it work? Why was it not working before?

---

<div class="post-metadata">

### Author: ![philippW](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/p/ed655f/32.png) [@philippW](https://discourse.nixos.org/u/philippW)
#### Post date: [April 3, 2022, 7:29am UTC](https://discourse.nixos.org/t/nixos-21-11-plex-plexpass/17011/6 "2022-04-03T07:29:38Z")

</div>

Previously you were overriding attributes of plex, not plexRaw. But plexRaw is where the attributes `src` and `version` are defined, see [https://github.com/NixOS/nixpkgs/blob/710fed5a2483f945b14f4a58af2cd3676b42d8c8/pkgs/servers/plex/raw.nix](https://github.com/NixOS/nixpkgs/blob/710fed5a2483f945b14f4a58af2cd3676b42d8c8/pkgs/servers/plex/raw.nix)
