complete-computing-environment/nixos-settop.org

5.9 KiB
Raw Permalink Blame History

NixOS Set Top Box

I want a machine I can hook to a TV that has a web browser which can play YouTube at high resolution, an ad blocker, and kodi. I'd like to not do that for a thousand dollars.

Past Attempts

Thinkpad t480s

This is a work computer that got "lost" from asset tracking and anyways they told me they'd just e-waste it. I ran kodi on it until the CPU fan died.

Intel NUC

This piece of shit stopped booting one day. They're expensive, noisy, and full screen videos tear when there is moderate CPU load even with the i5 model. I ran kodi on it until the CPU fan died

aborted attempts for Linux on ODROID N2+ with hardware acceleration

ODROID N2 is a pretty powerful roam:ARM Single Board Computer. It comes without an OS out of the box, and has some pretty poor support for OS images right now it runs Android TV on it and can't stream 1080p from the NAS upstairs.

Basically all I want to work on it is KODI and Firefox

  • CoreELEC will probably work great, but no web browser
  • Official Ubuntu image didn't work well:

    • No EGL/GPU Acceleration on X11 (You have to use Minimal image to have a HW GPU acceleration on the framebuffer)
    • Chromium web rendering performance is quite slow while FireFox can play YouTube 1080p videos.1
  • DietPi was X11 based, same issue.
  • these guys funroll their loops
  • Ubuntu 21.04 for ODROID-N2/C4/HC4

    • apt install kubuntu-desktop kwin-wayland
    • from the forum post:2

      sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E6A17451DC058F40
      sudo add-apt-repository -S deb http://ppa.launchpad.net/saiarcot895/chromium-beta/ubuntu/ groovy main
      sudo apt update
      sudo apt-get install chromium-browser chromium-codecs-ffmpeg-extra

      didn't set up the 'add this line to "cat /etc/chromium-browser/default"' tho.

    kodi isn't really installing well there, i'm going to try to install the 20.04 install next with the same steps.

AndroidTV on the ODROID N2+

That thing mostly worked decently and i used it for a while between experiments above. Kodi couldn't stream and play 1080p video. I thought it was Android's fault, but as you can see above it's more a limitation of the hardware's unsupported/undersupported graphics hardware.

Back to the "thinkpad until the CPU fan dies"

Tres Ebow is a computer which I unfortunately had a lot of bad luck with. I guess the CPU fan will die eventually. I've already replaced it once.

Building a simple Set Top box with Arroyo NixOS Generator

{ pkgs, lib, ... }:

let
  endpointCfg = ./default.nix; # this file
in
rec {
  imports = [    ./hardware-configuration.nix ./generated.nix ]  # (ref:imports)
            ++ [
              <<arroyo_nixos_imports()>>
            ];

  environment.etc."nixos/configuration.nix".source = endpointCfg;
}
(->>
 (arroyo-nixos-imports "settop")
     (--map (format "../../%s" it))
     (s-join "\n"))
../../nixos/laptop.nix
../../nixos/audio.nix
../../nixos/fonts.nix
../../nixos/settop.nix
../../nixos/tailscale.nix
../../nixos/nix-path.nix
../../nixos/gnupg-pam.nix
../../nixos/nixpkgs.nix
../../nixos/syncthing.nix
../../nixos/ssh_client.nix
../../nixos/boot.nix
../../nixos/home-manager.nix
../../nixos/mopidy.nix
../../nixos/cachix.nix
../../nixos/location.nix
../../nixos/zfs.nix
../../nixos/ccache.nix
../../nixos/rrix.nix
  • I am providing a stub hardware-configuration.nix and generated.nix. I don't like this at all, it makes me nervous, I know some day I'll accidentally clobber these settings on my remote and end up without a bootloader or some hilarious nonsense. sigh. here we go!3[My NixOS configuration]]]

    {}
    {}

Set Top Box Arroyo NixOS module

{ pkgs, ... }:

{
  services.xserver.desktopManager.kodi = {
    enable = true;
  };
  services.xserver.desktopManager.plasma5 = {
    enable = true;
  };

  users.groups.humans = {
    name = "humans";
    gid = 1000;
  };
  users.users.doomguy = {
    isNormalUser = true;
    home = "/home/doomguy";
    description = "Doom Guy";
    extraGroups = [ "audio" "wheel" "networkmanager" "adbusers" "systemd-journal" ];
    uid = 1001;
    group = "humans";
    initialPassword = "doomguyjohnson";
    openssh.authorizedKeys.keys = pkgs.lib.publicKeys.rrix; 
  };
  users.users.root.openssh.authorizedKeys.keys = pkgs.lib.publicKeys.rrix;

  services.xserver.enable = true;
  services.xserver.displayManager = {
    autoLogin.enable = true;
    autoLogin.user = "doomguy";
    defaultSession = "plasma";
    lightdm.enable = true;
  };

  services.ntp.enable = true;

  environment.systemPackages = with pkgs; [
    htop
    pavucontrol
    firefox
  ];

  programs.kdeconnect.enable = true;
}

1

this was not true, actually

2

love to install random software builds lol. it's a settop box for ublock'd youtube and lichess, idc.

3

this is taken verbatim from [[id:cce/my_nixos_configuration