From 17b406b87872c6d6bcafb437ac1003ea3c7552d2 Mon Sep 17 00:00:00 2001 From: Vali Date: Sat, 13 Jul 2024 23:22:14 +0200 Subject: [PATCH] wording mpd! --- flake.lock | 55 ----------------------- flake.nix | 82 +++++++++++++++++------------------ modules/services/mpd.nix | 50 +++++++++++---------- modules/services/pipewire.nix | 1 + modules/tui/ncmpcpp.nix | 7 +-- 5 files changed, 72 insertions(+), 123 deletions(-) diff --git a/flake.lock b/flake.lock index 6317e62..8b97132 100644 --- a/flake.lock +++ b/flake.lock @@ -293,27 +293,6 @@ "type": "github" } }, - "fenix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1720333712, - "narHash": "sha256-qZmpIPUe4mwdBGmKPBJ5KzvXH6GOCXheiusTAgNjAAA=", - "owner": "nix-community", - "repo": "fenix", - "rev": "b78c98c53a46e2a2d6479a920f98aa0aeae56281", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -1934,21 +1913,6 @@ "type": "sourcehut" } }, - "nur": { - "locked": { - "lastModified": 1720340553, - "narHash": "sha256-yltkWY9tbcTO1E9lsegEUcqcHdF+F3Yb8O79CjSAHrg=", - "owner": "nix-community", - "repo": "NUR", - "rev": "64eb60afcb54464e61d34fda417e7a5c7a935c21", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "NUR", - "type": "github" - } - }, "plugin-alpha-nvim": { "flake": false, "locked": { @@ -3566,7 +3530,6 @@ "doom-emacs-config": "doom-emacs-config", "doomemacs": "doomemacs", "emacs-overlay": "emacs-overlay", - "fenix": "fenix", "home-manager": "home-manager_2", "hyprland": "hyprland", "hyprland-plugins": "hyprland-plugins", @@ -3578,7 +3541,6 @@ "nixpkgs": "nixpkgs_8", "nixpkgs-wayland": "nixpkgs-wayland", "nixvim": "nixvim", - "nur": "nur", "quickshell": "quickshell", "schizofox": "schizofox", "spicetify-nix": "spicetify-nix", @@ -3586,23 +3548,6 @@ "stylix": "stylix" } }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1720292183, - "narHash": "sha256-CPcdVpsgmNXYVsw4nKPrM23J5mYXtiotYMz2BjPDIKU=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "058c88da66797eb588b47a4aac3e42847d1333d7", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - }, "rust-overlay": { "inputs": { "flake-utils": [ diff --git a/flake.nix b/flake.nix index db41866..f3057f3 100644 --- a/flake.nix +++ b/flake.nix @@ -7,63 +7,75 @@ inputs = { # Unstable nixpkgs baby! nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - # Hyprland, my main compositor - hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; - #hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1&ref=aquamarine"; - # Plugins for hyprland - hyprland-plugins = { - url = "github:hyprwm/hyprland-plugins"; - inputs.hyprland.follows = "hyprland"; + # nixpkgs for wayland + nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; + # Sandboxing + nixpak = { + url = "github:nixpak/nixpak"; + inputs.nixpkgs.follows = "nixpkgs"; }; - nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - # Plugin to get split monitor workspaces - split-monitor-workspaces = { - url = "github:Duckonaut/split-monitor-workspaces"; - inputs.hyprland.follows = "hyprland"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; }; # Lix because fast rebuild times are cool lix-module = { url = "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0-rc1.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; }; - # Sandboxing - nixpak = { - url = "github:nixpak/nixpak"; - inputs.nixpkgs.follows = "nixpkgs"; + + # Hardware for my laptop + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + + # Secret management + agenix.url = "github:ryantm/agenix"; + + # Hyprland, my main compositor + hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; + # Plugins for hyprland + hyprland-plugins = { + url = "github:hyprwm/hyprland-plugins"; + inputs.hyprland.follows = "hyprland"; }; - # Wayland packages - nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; - neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; - doomemacs = { - url = "github:doomemacs/doomemacs"; - flake = false; + # Plugin to get split monitor workspaces + split-monitor-workspaces = { + url = "github:Duckonaut/split-monitor-workspaces"; + inputs.hyprland.follows = "hyprland"; }; + neovim-flake = { url = "github:notashelf/nvf"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; + + doomemacs = { + url = "github:doomemacs/doomemacs"; + flake = false; + }; + emacs-overlay.url = "github:nix-community/emacs-overlay"; doom-emacs-config = { url = "github:bloxx12/doom-emacs-config"; flake = false; }; - emacs-overlay.url = "github:nix-community/emacs-overlay"; + anyrun = { url = "github:Kirottu/anyrun"; inputs.nixpkgs.follows = "nixpkgs"; }; - # kakoune.url = "github:mawww/kakoune"; + stylix.url = "github:danth/stylix"; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; ags.url = "github:Aylur/ags"; - quickshell = { url = "git+https://git.outfoxxed.me/outfoxxed/quickshell"; inputs.nixpkgs.follows = "nixpkgs"; }; + schizofox = { url = "github:schizofox/schizofox"; inputs = { @@ -72,17 +84,5 @@ }; }; spicetify-nix.url = "github:the-argus/spicetify-nix"; - nur = {url = "github:nix-community/NUR";}; - nixvim = { - url = "github:nix-community/nixvim"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - agenix.url = "github:ryantm/agenix"; - - fenix = { - url = "github:nix-community/fenix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; } diff --git a/modules/services/mpd.nix b/modules/services/mpd.nix index 5769b47..31c461a 100644 --- a/modules/services/mpd.nix +++ b/modules/services/mpd.nix @@ -18,30 +18,36 @@ in { }; config = mkIf cfg.enable { + systemd.services.mpd.environment = { + # https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/609 + XDG_RUNTIME_DIR = "/run/user/1000"; + }; + services.mpd = { + enable = true; + inherit (cfg) musicDirectory; + user = username; + extraConfig = '' + user "${username}" + restore_paused "yes" + + follow_outside_symlinks "yes" + follow_inside_symlinks "yes" + + audio_output { + type "pipewire" + name "PipeWire Sound Server" + } + + audio_output { + type "fifo" + name "FIFO" + path "/tmp/mpd.fifo" + format "44100:16:2" + } + ''; + }; home-manager.users.${username} = { services = { - mpd = { - enable = true; - inherit (cfg) musicDirectory; - extraConfig = '' - user "${username}" - restore_paused "yes" - - follow_outside_symlinks "yes" - follow_inside_symlinks "yes" - - audio_output { - type "pipewire" - name "PipeWire Sound Server" - } - audio_output { - type "fifo" - name "FIFO" - path "/tmp/mpd.fifo" - format "44100:16:2" - } - ''; - }; mpd-mpris = { enable = true; mpd = { diff --git a/modules/services/pipewire.nix b/modules/services/pipewire.nix index 9fd29a8..918de1c 100644 --- a/modules/services/pipewire.nix +++ b/modules/services/pipewire.nix @@ -12,6 +12,7 @@ in { hardware.pulseaudio.enable = false; services.pipewire = { enable = true; + alsa.enable = true; pulse.enable = true; }; security.rtkit.enable = true; diff --git a/modules/tui/ncmpcpp.nix b/modules/tui/ncmpcpp.nix index 2aa9841..ad89f41 100644 --- a/modules/tui/ncmpcpp.nix +++ b/modules/tui/ncmpcpp.nix @@ -7,6 +7,7 @@ with lib; let cfg = config.modules.programs.ncmpcpp; inherit (config.modules.other.system) username; + inherit (config.modules.services.mpd) musicDirectory; in { options.modules.programs.ncmpcpp.enable = mkEnableOption "ncmpcpp"; @@ -16,11 +17,8 @@ in { programs.ncmpcpp = { enable = true; package = pkgs.ncmpcpp.override {visualizerSupport = true;}; - mpdMusicDir = "/home/${username}/Nextcloud/Media/Music"; + mpdMusicDir = "${musicDirectory}"; settings = { - mpd_host = "127.0.0.1"; - mpd_port = "6600"; - /* alternative_header_first_line_format = "$5{$b%t$/b}$9"; alternative_header_second_line_format = "$3by $7{$b%a$/b}$9 $3from $7{$b%b$/b}$9 $5{(%y)}"; song_list_format = "♫ $2%n$(end) $9 $3%a$(end) $(245)-$9 $(246)%t$9 $R{ $5%y$9}$(end) $(246)%lq$(end)"; @@ -79,7 +77,6 @@ in { visualizer_data_source = "/tmp/mpd.fifo"; visualizer_type = "wave_filled"; visualizer_look = "▉▋"; - */ }; }; };