diff --git a/system/configuration.nix b/system/configuration.nix index 0745a3c..04a06c6 100755 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -87,6 +87,13 @@ in # List services that you want to enable: + services.avahi = { + enable = true; + nssmdns = true; + publish.enable = true; + publish.userServices = true; + }; + # Enable the OpenSSH daemon. services.openssh.enable = true; diff --git a/users/flake.nix b/users/flake.nix index 5e6bf86..d452eb9 100755 --- a/users/flake.nix +++ b/users/flake.nix @@ -16,55 +16,59 @@ homeDirectory = "/home/sherub"; username = "sherub"; configuration = { config, lib, pkgs, ... }@configInput: - { - _module.args = { - colorscheme = (import ./colorschemes/dracula.nix); - }; + let + rpiplay = pkgs.callPackage ./modules/rpiplay.nix {}; + in + { + _module.args = { + colorscheme = (import ./colorschemes/dracula.nix); + }; - nixpkgs.config = { allowUnfree = true; }; - nixpkgs.overlays = overlays; + nixpkgs.config = { allowUnfree = true; }; + nixpkgs.overlays = overlays; - # This value determines the Home Manager release that your - # configuration is compatible with. This helps avoid breakage - # when a new Home Manager release introduces backwards - # incompatible changes. - # - # You can update Home Manager without changing this value. See - # the Home Manager release notes for a list of state version - # changes in each release. - home.stateVersion = "20.09"; + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "20.09"; - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; - imports = [ - ./modules/browser.nix - ./modules/git.nix - ./modules/desktop-environment/index.nix - ./modules/nvim/index.nix - ./modules/cli/index.nix - ./modules/fonts.nix - ./modules/kitty.nix - ./modules/alacritty.nix - ./modules/system-management/index.nix - ]; + imports = [ + ./modules/browser.nix + ./modules/git.nix + ./modules/desktop-environment/index.nix + ./modules/nvim/index.nix + ./modules/cli/index.nix + ./modules/fonts.nix + ./modules/kitty.nix + ./modules/alacritty.nix + ./modules/system-management/index.nix + ]; - home.packages = with pkgs; [ - # GUI Apps - slack - discord - p3x-onenote + home.packages = with pkgs; [ + # GUI Apps + slack + discord + p3x-onenote + rpiplay - # Busybox replacements - pciutils - usbutils - less - stress + # Busybox replacements + pciutils + usbutils + less + stress - openvpn - gnome3.networkmanager-openvpn - ]; - }; + openvpn + gnome3.networkmanager-openvpn + ]; + }; }; macbook-pro = inputs.home-manager.lib.homeManagerConfiguration { diff --git a/users/modules/rpiplay.nix b/users/modules/rpiplay.nix new file mode 100644 index 0000000..5555776 --- /dev/null +++ b/users/modules/rpiplay.nix @@ -0,0 +1,85 @@ +# { lib, stdenv, pkg-config, fetchFromGitHub, fetchpatch, cmake, wrapGAppsHook, avahi, avahi-compat, openssl, gst_all_1, libplist }: +{ stdenv, lib, fetchgit, cmake, openssl, avahi-compat, libplist, gst_all_1, pkg-config, pcre, libunwind, elfutils, avfs, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "rpiplay"; + version = "unstable-2021-02-27"; + + src = fetchFromGitHub { + owner = "FD-"; + repo = "RPiPlay"; + rev = "35dd995fceed29183cbfad0d4110ae48e0635786"; + sha256 = "sha256-qe7ZTT45NYvzgnhRmz15uGT/FnGi9uppbKVbmch5B9A="; + }; + + # patches = [ + # # allow rpiplay to be used with firewall enabled. + # # sets static ports 7000 7100 (tcp) and 6000 6001 7011 (udp) + # ( + # fetchpatch { + # name = "use-static-ports.patch"; + # url = "https://github.com/FD-/RPiPlay/commit/2ffc287ba822e1d2b2ed0fc0e41a2bb3d9dab105.patch"; + # sha256 = "08dy829gyhyzw2n54zn5m3176cmd24k5hij24vpww5bhbwkbabww"; + # } + # ) + # ]; + + # nativeBuildInputs = [ + # cmake + # openssl + # libplist + # pkg-config + # wrapGAppsHook + # ]; + # + # buildInputs = [ + # avahi + # avahi-compat + # gst_all_1.gstreamer + # gst_all_1.gst-plugins-base + # gst_all_1.gst-plugins-good + # gst_all_1.gst-plugins-bad + # gst_all_1.gst-plugins-ugly + # ]; + + buildInputs = [ + cmake + avfs + elfutils + libunwind.dev + pcre.dev + pkg-config + openssl + avahi-compat + libplist + gst_all_1.gstreamer + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-base + gst_all_1.gst-libav + gst_all_1.gst-vaapi + ]; + + runtimeDependencies = [ + avfs + elfutils + libunwind.dev + pcre.dev + pkg-config + openssl + avahi-compat + libplist + gst_all_1.gstreamer + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-base + gst_all_1.gst-libav + gst_all_1.gst-vaapi + ]; + + meta = with lib; { + homepage = "https://github.com/FD-/RPiPlay"; + description = "An open-source implementation of an AirPlay mirroring server."; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ mschneider ]; + platforms = platforms.unix; + }; +}