diff --git a/hosts/froidmpa-laptop/default.nix b/hosts/froidmpa-laptop/default.nix index f94369e..a3645bb 100644 --- a/hosts/froidmpa-laptop/default.nix +++ b/hosts/froidmpa-laptop/default.nix @@ -10,7 +10,6 @@ vscode.enable = true; dunst.enable = true; htop.enable = true; - mpd.enable = true; }; editor = { vim.enable = true; @@ -23,6 +22,10 @@ libvirt.enable = true; }; apps = { newsboat.enable = true; }; + media = { + mpd.enable = true; + ncmpcpp.enable = true; + }; }; # Monitor backlight control diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index cd3d534..7bcee70 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -10,7 +10,6 @@ vscode.enable = true; dunst.enable = true; htop.enable = true; - mpd.enable = true; }; editor = { vim.enable = true; @@ -23,6 +22,13 @@ libvirt.enable = true; }; apps = { newsboat.enable = true; }; + media = { + mpd.enable = true; + ncmpcpp.enable = true; + emulators.gc.enable = true; + steam.enable = true; + lutris.enable = true; + }; }; boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index c9c62fa..55951cb 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -114,15 +114,7 @@ in { }; file = { - ".wallpaper.png".source = ./files/wallpaper.png; - ".config/ncmpcpp" = { - source = ./files/ncmpcpp; - recursive = true; - }; - ".xmonad/scripts" = { - source = ./files/scripts; - recursive = true; - }; + ".wallpaper.png".source = ./wallpaper.png; ".themes/oomox-gruvmox-dark-medium-default" = { source = ./files/oomox-gruvmox-dark-medium-default; recursive = true; @@ -146,9 +138,6 @@ in { xorg.xkill numix-gtk-theme - (ncmpcpp.override { visualizerSupport = true; }) - mpc_cli - # Ranger preview utils w3m xclip @@ -180,12 +169,6 @@ in { thefuck atool linuxPackages.perf - - glxinfo - steam - protontricks - lutris - dolphinEmu ]; }; diff --git a/modules/desktop/mpd.nix b/modules/desktop/mpd.nix deleted file mode 100644 index fafab2d..0000000 --- a/modules/desktop/mpd.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; -with lib.my; -let cfg = config.modules.desktop.mpd; -in { - options.modules.desktop.mpd = { - enable = mkBoolOpt false; - }; - config = mkIf cfg.enable { - home-manager.users.${config.user.name} = { config, ... }: { - services.mpd = - { - enable = true; - network.listenAddress = "any"; - musicDirectory = "${config.home.homeDirectory}/Nextcloud/Media/Music"; - playlistDirectory = "${config.home.homeDirectory}/Nextcloud/Playlists"; - extraConfig = '' - max_output_buffer_size "16384" - auto_update "yes" - audio_output { - type "pulse" - name "pulse audio" - device "pulse" - mixer_type "hardware" - } - audio_output { - type "fifo" - name "toggle_visualizer" - path "/tmp/mpd.fifo" - format "44100:16:2" - } - ''; - }; - }; - }; -} diff --git a/modules/desktop/xmonad.nix b/modules/desktop/polybar.nix similarity index 73% rename from modules/desktop/xmonad.nix rename to modules/desktop/polybar.nix index 3512cf4..0fffacc 100644 --- a/modules/desktop/xmonad.nix +++ b/modules/desktop/polybar.nix @@ -3,41 +3,13 @@ with lib; with lib.my; -let cfg = config.modules.desktop.xmonad; +let cfg = config.modules.desktop.polybar; in { - options.modules.desktop.xmonad = { enable = mkBoolOpt false; }; + options.modules.desktop.polybar = { enable = mkBoolOpt false; }; config = mkIf cfg.enable { - services.xserver = { - enable = true; - layout = "fr"; - desktopManager.xterm.enable = false; - windowManager.xmonad.enable = true; - displayManager.lightdm = { - enable = true; - background = ./files/wallpaper.png; - greeters.mini = { - enable = true; - user = config.user.name; - extraConfig = '' - text-color = "#fbf1c7" - password-background-color = "#3c3836" - window-color = "#282828" - border-color = "#458588" - ''; - }; - }; - }; - home-manager.users.${config.user.name} = { - xsession = { - windowManager.xmonad = { - enable = true; - enableContribAndExtras = true; - config = ./files/xmonad.hs; - }; - }; services.polybar = { enable = true; @@ -97,19 +69,18 @@ in { width = "100%"; height = "34"; - offset-x = 0; - offset-y = 0; bottom = true; - padding-left = 2; - padding-right = 2; + padding = 2; font-0 = "MesloLGS Nerd Font Mono:pixelsize=12;2"; font-1 = "MesloLGS Nerd Font Mono:pixelsize=20;5"; - modules-left = "pulseaudio pad cpu memory pad fs pad xwindow"; + modules-left = "pulseaudio cpu memory fs xwindow"; modules-center = "ewmh"; - modules-right = "mpd pad battery pad date"; + modules-right = "mpd battery date"; + + separator = " "; tray-position = "right"; }; @@ -156,16 +127,14 @@ in { label-padding-left = 2; }; - "module/pad" = { - type = "custom/text"; - content = " "; - }; "module/fs" = { type = "internal/fs"; mount-0 = "/"; interval = 30; format-mounted = ""; - format-mounted-prefix = "󰋊 "; + format-mounted-prefix = "󰋊"; + format-mounted-prefix-padding = 1; + # format-mounted-prefix-padding-right = 0; format-mounted-prefix-font = 2; format-mounted-foreground = "\${colors.accent}"; @@ -174,12 +143,16 @@ in { label-unmounted-foreground = "\${colors.fg-alt}"; bar-used-indicator = ""; - bar-used-width = 8; + bar-used-width = 10; bar-used-foreground-0 = "\${colors.fg}"; bar-used-foreground-1 = "\${colors.fg}"; - bar-used-foreground-2 = "\${colors.yellow}"; - bar-used-foreground-3 = "\${colors.red}"; - bar-used-foreground-4 = "\${colors.red}"; + bar-used-foreground-2 = "\${colors.fg}"; + bar-used-foreground-3 = "\${colors.fg}"; + bar-used-foreground-4 = "\${colors.fg}"; + bar-used-foreground-5 = "\${colors.yellow}"; + bar-used-foreground-6 = "\${colors.yellow}"; + bar-used-foreground-7 = "\${colors.yellow}"; + bar-used-foreground-8 = "\${colors.red}"; bar-used-fill = "|"; bar-used-empty = "¦"; bar-used-empty-foreground = "\${colors.fg-alt}"; @@ -188,18 +161,23 @@ in { type = "internal/cpu"; interval = 2; format = ""; - format-prefix = " "; + format-prefix = ""; + format-prefix-padding = 1; + # format-prefix-padding-right = 1; format-prefix-font = 2; format-foreground = "\${colors.accent}"; - format-padding = 1; bar-load-indicator = ""; - bar-load-width = 8; + bar-load-width = 10; bar-load-foreground-0 = "\${colors.fg}"; bar-load-foreground-1 = "\${colors.fg}"; - bar-load-foreground-2 = "\${colors.yellow}"; - bar-load-foreground-3 = "\${colors.red}"; - bar-load-foreground-4 = "\${colors.red}"; + bar-load-foreground-2 = "\${colors.fg}"; + bar-load-foreground-3 = "\${colors.fg}"; + bar-load-foreground-4 = "\${colors.fg}"; + bar-load-foreground-5 = "\${colors.yellow}"; + bar-load-foreground-6 = "\${colors.yellow}"; + bar-load-foreground-7 = "\${colors.yellow}"; + bar-load-foreground-8 = "\${colors.red}"; bar-load-fill = "|"; bar-load-empty = "¦"; bar-load-empty-foreground = "\${colors.fg-alt}"; @@ -208,18 +186,23 @@ in { type = "internal/memory"; interval = 3; format = ""; - format-prefix = " "; + format-prefix = ""; + format-prefix-padding = 1; + # format-prefix-padding-right = 1; format-prefix-font = 2; format-prefix-foreground = "\${colors.accent}"; - format-padding-left = 1; bar-used-indicator = ""; - bar-used-width = 8; + bar-used-width = 10; bar-used-foreground-0 = "\${colors.fg}"; bar-used-foreground-1 = "\${colors.fg}"; - bar-used-foreground-2 = "\${colors.yellow}"; - bar-used-foreground-3 = "\${colors.red}"; - bar-used-foreground-4 = "\${colors.red}"; + bar-used-foreground-2 = "\${colors.fg}"; + bar-used-foreground-3 = "\${colors.fg}"; + bar-used-foreground-4 = "\${colors.fg}"; + bar-used-foreground-5 = "\${colors.yellow}"; + bar-used-foreground-6 = "\${colors.yellow}"; + bar-used-foreground-7 = "\${colors.yellow}"; + bar-used-foreground-8 = "\${colors.red}"; bar-used-fill = "|"; bar-used-empty = "¦"; bar-used-empty-foreground = "\${colors.fg-alt}"; @@ -248,28 +231,24 @@ in { ramp-volume-2 = "󰕾"; ramp-volume-font = 2; }; - "module/mpd" = { + "module/mpd" = (mkIf config.modules.media.mpd.enable { type = "internal/mpd"; host = "127.0.0.1"; port = "6600"; label-song = "%artist% - %title%"; - format-playing-prefix = "󰎈 "; + format-playing-prefix = "󰎈"; + format-palying-prefix-padding = 1; format-playing-prefix-font = 2; format-playing-foreground = "\${colors.fg}"; - format-paused-prefix = "󰎊 "; + format-paused-prefix = "󰎊"; + format-paused-prefix-padding = 1; format-paused-prefix-font = 2; format-paused-foreground = "\${colors.fg-alt}"; - }; + }); }; }; - home.packages = with pkgs.unstable; [ - i3lock - - feh - scrot - ]; }; }; diff --git a/modules/desktop/files/wallpaper.png b/modules/desktop/wallpaper.png similarity index 100% rename from modules/desktop/files/wallpaper.png rename to modules/desktop/wallpaper.png diff --git a/modules/desktop/files/scripts/screenshot.sh b/modules/desktop/xmonad/scripts/screenshot.sh similarity index 100% rename from modules/desktop/files/scripts/screenshot.sh rename to modules/desktop/xmonad/scripts/screenshot.sh diff --git a/modules/desktop/files/xmonad.hs b/modules/desktop/xmonad/xmonad.hs similarity index 100% rename from modules/desktop/files/xmonad.hs rename to modules/desktop/xmonad/xmonad.hs diff --git a/modules/desktop/xmonad/xmonad.nix b/modules/desktop/xmonad/xmonad.nix new file mode 100644 index 0000000..21d9508 --- /dev/null +++ b/modules/desktop/xmonad/xmonad.nix @@ -0,0 +1,60 @@ +{ options, config, lib, pkgs, ... }: + +with lib; +with lib.my; + +let cfg = config.modules.desktop.xmonad; +in { + options.modules.desktop.xmonad = { enable = mkBoolOpt false; }; + + config = mkIf cfg.enable { + + modules.desktop.polybar.enable = true; + + services.xserver = { + enable = true; + layout = "fr"; + desktopManager.xterm.enable = false; + windowManager.xmonad.enable = true; + displayManager.lightdm = { + enable = true; + background = ../wallpaper.png; + greeters.mini = { + enable = true; + user = config.user.name; + extraConfig = '' + text-color = "#fbf1c7" + password-background-color = "#3c3836" + window-color = "#282828" + border-color = "#458588" + ''; + }; + }; + }; + + home-manager.users.${config.user.name} = { + xsession = { + windowManager.xmonad = { + enable = true; + enableContribAndExtras = true; + config = ./xmonad.hs; + }; + }; + + home = { + file.".xmonad/scripts" = { + source = ./scripts; + recursive = true; + }; + + packages = with pkgs.unstable; [ + i3lock + + feh + scrot + ]; + }; + }; + + }; +} diff --git a/modules/media/emulators.nix b/modules/media/emulators.nix new file mode 100644 index 0000000..7ef80dd --- /dev/null +++ b/modules/media/emulators.nix @@ -0,0 +1,24 @@ +{ options, config, lib, pkgs, ... }: + +with lib; +with lib.my; +let cfg = config.modules.media.emulators; +in { + options.modules.media.emulators = { + psx.enable = mkBoolOpt false; # Playstation + ds.enable = mkBoolOpt false; # Nintendo DS + gc.enable = mkBoolOpt false; # GameCube + gb.enable = mkBoolOpt false; # GameBoy + GameBoy Color + gba.enable = mkBoolOpt false; # GameBoy Advance + snes.enable = mkBoolOpt false; # Super Nintendo + }; + + config = { + user.packages = with pkgs; [ + (mkIf cfg.psx.enable epsxe) + (mkIf cfg.ds.enable desmume) + (mkIf cfg.gc.enable dolphinEmu) + (mkIf (cfg.gba.enable || cfg.gb.enable || cfg.snes.enable) higan) + ]; + }; +} diff --git a/modules/media/games.nix b/modules/media/games.nix new file mode 100644 index 0000000..1ab67e2 --- /dev/null +++ b/modules/media/games.nix @@ -0,0 +1,19 @@ +{ options, config, lib, pkgs, ... }: + +with lib; +with lib.my; +let cfg = config.modules.media; +in { + options.modules.media = { + steam.enable = mkBoolOpt false; + lutris.enable = mkBoolOpt false; + }; + + config = { + user.packages = with pkgs; [ + (mkIf cfg.steam.enable steam) + (mkIf cfg.lutris.enable lutris) + (mkIf (cfg.steam.enable || cfg.lutris.enable) protontricks) + ]; + }; +} diff --git a/modules/media/mpd.nix b/modules/media/mpd.nix new file mode 100644 index 0000000..b23376f --- /dev/null +++ b/modules/media/mpd.nix @@ -0,0 +1,34 @@ +{ config, lib, pkgs, ... }: + +with lib; +with lib.my; +let cfg = config.modules.media.mpd; +in { + options.modules.media.mpd = { enable = mkBoolOpt false; }; + config = mkIf cfg.enable { + home-manager.users.${config.user.name} = { config, ... }: { + services.mpd = { + enable = true; + network.listenAddress = "any"; + musicDirectory = "${config.home.homeDirectory}/Nextcloud/Media/Music"; + playlistDirectory = "${config.home.homeDirectory}/Nextcloud/Playlists"; + extraConfig = '' + max_output_buffer_size "16384" + auto_update "yes" + audio_output { + type "pulse" + name "pulse audio" + device "pulse" + mixer_type "hardware" + } + audio_output { + type "fifo" + name "toggle_visualizer" + path "/tmp/mpd.fifo" + format "44100:16:2" + } + ''; + }; + }; + }; +} diff --git a/modules/desktop/files/ncmpcpp/bindings b/modules/media/ncmpcpp/bindings similarity index 100% rename from modules/desktop/files/ncmpcpp/bindings rename to modules/media/ncmpcpp/bindings diff --git a/modules/desktop/files/ncmpcpp/config b/modules/media/ncmpcpp/config similarity index 100% rename from modules/desktop/files/ncmpcpp/config rename to modules/media/ncmpcpp/config diff --git a/modules/media/ncmpcpp/ncmpcpp.nix b/modules/media/ncmpcpp/ncmpcpp.nix new file mode 100644 index 0000000..bc3aafe --- /dev/null +++ b/modules/media/ncmpcpp/ncmpcpp.nix @@ -0,0 +1,24 @@ +{ inputs, config, lib, pkgs, ... }: + +with lib; +with lib.my; +let cfg = config.modules.media.ncmpcpp; +in { + options.modules.media.ncmpcpp = { enable = mkBoolOpt false; }; + + config = mkIf cfg.enable { + home-manager.users.${config.user.name} = { + + home = { + packages = with pkgs.unstable; [ + (ncmpcpp.override { visualizerSupport = true; }) + mpc_cli + ]; + + file.".config/ncmpcpp/config".source = ./config; + file.".config/ncmpcpp/bindings".source = ./bindings; + }; + + }; + }; +}