From 44831a972450cc6ebf3a9b738e508a68f665fd42 Mon Sep 17 00:00:00 2001 From: Dmitriy Holkin Date: Sun, 29 Sep 2019 14:45:51 +0400 Subject: [PATCH] mopidy --- modules/applications/packages.nix | 6 +++++- modules/hardware.nix | 4 ++++ modules/packages.nix | 27 +++++++++++++++++++------ modules/services.nix | 33 +++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 7 deletions(-) diff --git a/modules/applications/packages.nix b/modules/applications/packages.nix index d5f0f1a..4bebc22 100644 --- a/modules/applications/packages.nix +++ b/modules/applications/packages.nix @@ -1,6 +1,6 @@ { pkgs, config, lib, ... }: with rec { - inherit (config) deviceSpecific; + inherit (config) device deviceSpecific; }; with deviceSpecific; { # programs.adb.enable = true; @@ -49,6 +49,7 @@ with deviceSpecific; { setroot maim mupdf + ncmpcpp ] ++ lib.optionals isLaptop [ # Important acpi @@ -58,12 +59,15 @@ with deviceSpecific; { blueman ] ++ lib.optionals (!isVM) [ libreoffice + ] ++ lib.optionals (device == "AMD-Workstation") [ + xonar-fp ]; home-manager.users.alukard.home.packages = with pkgs; [ nix-zsh-completions qbittorrent vscodium + # vscode-with-extensions xarchiver tdesktop spotifywm diff --git a/modules/hardware.nix b/modules/hardware.nix index 482f5a4..af34d5a 100644 --- a/modules/hardware.nix +++ b/modules/hardware.nix @@ -53,6 +53,10 @@ with deviceSpecific; { # package = pkgs.pulseaudioFull; support32Bit = true; # systemWide = true; + tcp = { + enable = true; + anonymousClients.allowedIpRanges = ["127.0.0.1"]; + }; }; # SSD Section diff --git a/modules/packages.nix b/modules/packages.nix index b8a64a5..04e3c94 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -1,11 +1,26 @@ { pkgs, config, lib, ... }: { nixpkgs.overlays = [ - (self: old: - rec { - # nerdfonts = nur.balsoft.pkgs.roboto-mono-nerd; - youtube-to-mpv = pkgs.callPackage ./applications/youtube-to-mpv.nix {}; - } - ) + (self: old: rec { + # nerdfonts = nur.balsoft.pkgs.roboto-mono-nerd; + youtube-to-mpv = pkgs.callPackage ./applications/youtube-to-mpv.nix {}; + xonar-fp = pkgs.writers.writeBashBin "xonar-fp" '' + CURRENT_STATE=`amixer -c 0 sget "Front Panel" | egrep -o '\[o.+\]'` + if [[ $CURRENT_STATE == '[on]' ]]; then + amixer -c 0 sset "Front Panel" mute + else + amixer -c 0 sset "Front Panel" unmute + fi + ''; + }) + (self: super: { + vscode-with-extensions = super.vscode-with-extensions.override { + # When the extension is already available in the default extensions set. + vscodeExtensions = with super.vscode-extensions; [ + bbenoist.Nix + ms-python.python + ]; + }; + }) ]; nixpkgs.config = { packageOverrides = pkgs: { diff --git a/modules/services.nix b/modules/services.nix index 9fcf4e4..0fcd22a 100644 --- a/modules/services.nix +++ b/modules/services.nix @@ -1,6 +1,39 @@ { config, lib, pkgs, ... }: { # services.acpid.enable = true; + users.users.mopidy = { + isNormalUser = false; + extraGroups = [ + "smbgrp" + ]; + }; + services.mopidy = { + enable = true; + extensionPackages = with pkgs; [ mopidy-local-sqlite ]; + configuration = '' + [local] + enabled = true + library = sqlite + media_dir = /shared/files/Music + scan_timeout = 1000 + scan_flush_threshold = 100 + scan_follow_symlinks = false + + [local-sqlite] + enabled = true + + [audio] + output = pulsesink server=127.0.0.1 + + [mpd] + hostname = 0.0.0.0 + ''; + }; + home-manager.users.alukard.home.file.".ncmpcpp/config".text = '' + mpd_host = 127.0.0.1 + mpd_port = 6600 + mpd_music_dir = "/shared/files/Music" + ''; # services.mopidy = { # enable = true;