Code Monkey home page Code Monkey logo

mediaserver's Introduction

README

Raspberry Pi Media Server

Setup for non-NixOS operating systems

This has only been tested on a NixOS host. Running make setup should get Nix installed on Fedora, but it still needs to be manually configured as per "Dev Environment Setup" below. Refer to the Nix home page on how to install Nix on other distributions.

Nix Environment Setup

Must have the following in your host nix config to cross compile:

{
  # Enable binfmt emulation of aarch64-linux.
  boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
}

The following will help build speeds:

{
  nix = {
    settings = {
      substituters = [
        "https://arm.cachix.org/"
      ];
      trusted-public-keys = [
        "arm.cachix.org-1:5BZ2kjoL1q6nWhlnrbAl+G7ThY7+HaBRD9PZzqZkbnM="
      ];
    };
  };
}

Configuring

Edit host-params.nix

Building

Building will generate two images, an ARM rasberry pi image, and an x86 VM image. Be aware that building can take a long time, even hours, on slow machines, as it's building the ARM image in a qemu VM.

make build-image

Flashing

Replace /dev/sda with your SD card device

make flash DEVICE=/dev/sda

Running x86 version in local VM

make run

SSH'ing into local VM

make ssh

Rebuilding config on raspberry pi or VM

Once the machine is running, you can edit Nix config and build without generating images. This is much faster and good for making changes. When running a VM, the ~/nixcfg path is shared with the host, so you can commit your changes to git.

cd ~/nixcfg
make build

Connecting to wifi from raspberry pi

Edit host-params.nix to enter wifi credentials before building. You can also manually connect to other networks after ssh'ing into the mediaserver.

sudo nmcli dev wifi connect <network-ssid> --ask
sudo device set wlan0 autoconnect yes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.