From e4c407fb28be38bef072ba21fe2c0ec9ae5159ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 13 Jan 2024 01:51:42 +0100 Subject: [PATCH] Move some things where they belong --- hm/common.nix | 1 - hm/desktop/audio/default.nix | 22 +++++++++++++++++++--- hm/desktop/default.nix | 28 ---------------------------- hm/desktop/mpd/default.nix | 32 +++++++++++++++++++++++++++----- 4 files changed, 46 insertions(+), 37 deletions(-) diff --git a/hm/common.nix b/hm/common.nix index 5fbd7c7..6c7a1da 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -179,7 +179,6 @@ compsize # toolbox - sox imagemagick numbat ]; diff --git a/hm/desktop/audio/default.nix b/hm/desktop/audio/default.nix index 2e80253..1691540 100644 --- a/hm/desktop/audio/default.nix +++ b/hm/desktop/audio/default.nix @@ -5,9 +5,25 @@ let in { config = lib.mkIf config.frogeye.desktop.xorg { - home.packages = with pkgs; [ - pavucontrol # Because can't use Win+F1X on Pinebook 🙃 - ]; + home = { + packages = with pkgs; [ + pavucontrol # Because can't use Win+F1X on Pinebook 🙃 + sox + ]; + sessionVariables = { + ALSA_PLUGIN_DIR = "${pkgs.alsa-plugins}/lib/alsa-lib"; # Fixes an issue with sox (Cannot open shared library libasound_module_pcm_pulse.so) + # UPST Patch this upstream like: https://github.com/NixOS/nixpkgs/blob/216b111fb87091632d077898df647d1438fc2edb/pkgs/applications/audio/espeak-ng/default.nix#L84 + }; + }; + programs.bash.shellAliases = { + beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null''; + noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise''; + }; + xdg.configFile = { + "pulse/client.conf" = { + text = ''cookie-file = .config/pulse/pulse-cookie''; + }; + }; xsession.windowManager.i3.config.keybindings = { "XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; diff --git a/hm/desktop/default.nix b/hm/desktop/default.nix index 64e0b9a..d9b9acd 100644 --- a/hm/desktop/default.nix +++ b/hm/desktop/default.nix @@ -79,11 +79,7 @@ in }; }; bash.shellAliases = { - noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise''; - beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null''; - x = "startx ${config.home.homeDirectory}/${config.xsession.scriptPath}; logout"; - lmms = "lmms --config ${config.xdg.configHome}/lmmsrc.xml"; }; # Backup terminal @@ -153,16 +149,12 @@ in # French, because then it there's a different initial for each, making navigation easier desktop = null; download = "${config.home.homeDirectory}/Téléchargements"; - music = "${config.home.homeDirectory}/Musiques"; pictures = "${config.home.homeDirectory}/Images"; publicShare = null; templates = null; videos = "${config.home.homeDirectory}/Vidéos"; }; configFile = { - "pulse/client.conf" = { - text = ''cookie-file = .config/pulse/pulse-cookie''; - }; "rofimoji.rc" = { text = '' skin-tone = neutral @@ -170,18 +162,6 @@ in action = clipboard ''; }; - "vimpc/vimpcrc" = { - text = '' - map FF :browsegg/ - map à :set add nexta:set add end - map @ :set add nexta:set add end:next - map ° D:browseA:shuffle:play:playlist - set songformat {%a - %b: %t}|{%f}$E$R $H[$H%l$H]$H - set libraryformat %n \| {%t}|{%f}$E$R $H[$H%l$H]$H - set ignorecase - set sort library - ''; - }; }; }; services = { @@ -234,8 +214,6 @@ in }; }; packages = with pkgs; [ - pavucontrol # Because can't use Win+F1X on Pinebook 🙃 - # remote tigervnc @@ -269,16 +247,10 @@ in xorg.xinit # TODO Make this clean. Service? - # organisation - pass thunderbird ]; sessionVariables = { - MPD_PORT = "${toString config.services.mpd.network.port}"; - ALSA_PLUGIN_DIR = "${pkgs.alsa-plugins}/lib/alsa-lib"; # Fixes an issue with sox (Cannot open shared library libasound_module_pcm_pulse.so) - # UPST Patch this upstream like: https://github.com/NixOS/nixpkgs/blob/216b111fb87091632d077898df647d1438fc2edb/pkgs/applications/audio/espeak-ng/default.nix#L84 - RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed # XAUTHORITY = "${config.xdg.configHome}/Xauthority"; # Disabled as this causes lock-ups with DMs }; diff --git a/hm/desktop/mpd/default.nix b/hm/desktop/mpd/default.nix index 618bc95..10683ff 100644 --- a/hm/desktop/mpd/default.nix +++ b/hm/desktop/mpd/default.nix @@ -1,11 +1,16 @@ { pkgs, lib, config, ... }: { config = lib.mkIf config.frogeye.desktop.xorg { - home.packages = with pkgs; [ - ashuffle - mpc-cli - vimpc - ]; + home = { + packages = with pkgs; [ + ashuffle + mpc-cli + vimpc + ]; + sessionVariables = { + MPD_PORT = "${toString config.services.mpd.network.port}"; + }; + }; services.mpd = { enable = true; network = { @@ -17,6 +22,23 @@ restore_paused "yes" ''; }; + xdg = { + configFile = { + "vimpc/vimpcrc" = { + text = '' + map FF :browsegg/ + map à :set add nexta:set add end + map @ :set add nexta:set add end:next + map ° D:browseA:shuffle:play:playlist + set songformat {%a - %b: %t}|{%f}$E$R $H[$H%l$H]$H + set libraryformat %n \| {%t}|{%f}$E$R $H[$H%l$H]$H + set ignorecase + set sort library + ''; + }; + }; + userDirs.music = "${config.home.homeDirectory}/Musiques"; + }; xsession.windowManager.i3.config.keybindings = { "XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev";