From 3afb2e4d56cdcdb887053bce73b40662dff2a046 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 27 Dec 2023 09:27:02 +0800 Subject: [PATCH] workflows: remove conditional config Now this is handled on the host-specific modules. --- .../nixos/workflows/a-happy-gnome/default.nix | 121 +++++++-------- .../nixos/workflows/mosey-branch/default.nix | 142 ++++++++---------- 2 files changed, 123 insertions(+), 140 deletions(-) diff --git a/modules/nixos/workflows/a-happy-gnome/default.nix b/modules/nixos/workflows/a-happy-gnome/default.nix index c8a8b516..67ff894f 100644 --- a/modules/nixos/workflows/a-happy-gnome/default.nix +++ b/modules/nixos/workflows/a-happy-gnome/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, _isfoodogsquaredcustom ? false, ... }: +{ config, lib, pkgs, ... }: let cfg = config.workflows.workflows.a-happy-gnome; @@ -94,69 +94,62 @@ in }; }; - config = lib.mkIf cfg.enable (lib.mkMerge [ - { - # Enable GNOME and GDM. - services.xserver = { - enable = true; - displayManager.gdm.enable = true; - desktopManager.gnome.enable = true; + config = lib.mkIf cfg.enable { + # Enable GNOME and GDM. + services.xserver = { + enable = true; + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + }; + + # All GNOME-related additional options. + services.gnome = { + core-os-services.enable = true; + core-shell.enable = true; + core-utilities.enable = true; + + # It doesn't need to since we're not first-timers, yeah? + gnome-initial-setup.enable = false; + }; + + # It makes Nix store directory read/write so no... + services.packagekit.enable = false; + + # Setting up split DNS with systemd-resolved. The domains should already + # be configured somewhere else. + services.resolved.enable = true; + networking.networkmanager.dns = "systemd-resolved"; + + # Since we're using KDE Connect, we'll have to use gsconnect. + programs.kdeconnect = { + enable = true; + package = pkgs.gnomeExtensions.gsconnect; + }; + + # Bring all of the dconf keyfiles in there. + programs.dconf = { + enable = true; + packages = [ dconfConfig ]; + }; + + xdg.mime = { + enable = true; + defaultApplications = { + # Default application for web browser. + "text/html" = "re.sonny.Junction.desktop"; + + # Default handler for all files. Not all applications will + # respect it, though. + "x-scheme-handler/file" = "re.sonny.Junction.desktop"; + + # Default handler for directories. + "inode/directory" = "re.sonny.Junction.desktop"; }; + }; - # All GNOME-related additional options. - services.gnome = { - core-os-services.enable = true; - core-shell.enable = true; - core-utilities.enable = true; - - # It doesn't need to since we're not first-timers, yeah? - gnome-initial-setup.enable = false; - }; - - # It makes Nix store directory read/write so no... - services.packagekit.enable = false; - - # Setting up split DNS with systemd-resolved. The domains should already - # be configured somewhere else. - services.resolved.enable = true; - networking.networkmanager.dns = "systemd-resolved"; - - # Since we're using KDE Connect, we'll have to use gsconnect. - programs.kdeconnect = { - enable = true; - package = pkgs.gnomeExtensions.gsconnect; - }; - - # Bring all of the dconf keyfiles in there. - programs.dconf = { - enable = true; - packages = [ dconfConfig ]; - }; - - xdg.mime = { - enable = true; - defaultApplications = { - # Default application for web browser. - "text/html" = "re.sonny.Junction.desktop"; - - # Default handler for all files. Not all applications will - # respect it, though. - "x-scheme-handler/file" = "re.sonny.Junction.desktop"; - - # Default handler for directories. - "inode/directory" = "re.sonny.Junction.desktop"; - }; - }; - - environment.systemPackages = with pkgs; [ - # The application menu. - junction - ] ++ cfg.shellExtensions ++ cfg.extraApps; - } - - # Check whether this is inside of my personal configuration or nah. - (lib.mkIf _isfoodogsquaredcustom { - profiles.i18n.setup = "ibus"; - }) - ]); + environment.systemPackages = with pkgs; [ + # The application menu. + junction + ] ++ cfg.shellExtensions ++ cfg.extraApps; + }; } diff --git a/modules/nixos/workflows/mosey-branch/default.nix b/modules/nixos/workflows/mosey-branch/default.nix index 3748a15f..6968e694 100644 --- a/modules/nixos/workflows/mosey-branch/default.nix +++ b/modules/nixos/workflows/mosey-branch/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, _isfoodogsquaredcustom ? false, ... }: +{ config, lib, pkgs, ... }: let cfg = config.workflows.workflows.mosey-branch; @@ -109,81 +109,71 @@ in debug = lib.mkEnableOption "gnome-session debug messages"; }; - config = lib.mkIf cfg.enable (lib.mkMerge [ - { - environment.systemPackages = cfg.extraApps ++ requiredPackages; + config = lib.mkIf cfg.enable { + environment.systemPackages = cfg.extraApps ++ requiredPackages; - # Install all of the required systemd units. - systemd.packages = with pkgs.gnome; [ - customDesktopSession - gnome-session + # Install all of the required systemd units. + systemd.packages = with pkgs.gnome; [ + customDesktopSession + gnome-session + ]; + + # We'll have to include them for gnome-session to recognize it in NixOS + # systems. + environment.pathsToLink = [ "/share/gnome-session" ]; + + environment.sessionVariables.GNOME_SESSION_DEBUG = lib.mkIf cfg.debug "1"; + + # Our preferred display manager. + services.xserver = { + enable = true; + displayManager = { + gdm.enable = lib.mkDefault true; + sessionPackages = [ customDesktopSession ]; + }; + updateDbusEnvironment = true; + }; + + # Setting up some hardware settings. + hardware.opengl.enable = true; + hardware.bluetooth.enable = true; + services.udisks2.enable = true; + services.upower.enable = true; + services.power-profiles-daemon.enable = true; + services.colord.enable = true; + services.system-config-printer.enable = config.services.printing.enable; + + # Setting up some more core services. + security.polkit.enable = true; + services.accounts-daemon.enable = true; + services.dleyna-renderer.enable = true; + services.dleyna-server.enable = true; + programs.dconf.enable = true; + programs.xwayland.enable = true; + + fonts.enableDefaultPackages = true; + + # The phone sync component which is handy. + programs.kdeconnect = { + enable = true; + package = pkgs.valent; + }; + + # Harmonious themes. Since we're making this very similar to GNOME + # appearance-wise, layout-wise, and setup-wise, we may as well make it + # similar. + qt = { + enable = true; + platformTheme = "gnome"; + style = "adwaita"; + }; + + xdg.portal = { + enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-hyprland + xdg-desktop-portal-gtk ]; - - # We'll have to include them for gnome-session to recognize it in NixOS - # systems. - environment.pathsToLink = [ "/share/gnome-session" ]; - - environment.sessionVariables.GNOME_SESSION_DEBUG = lib.mkIf cfg.debug "1"; - - # Our preferred display manager. - services.xserver = { - enable = true; - displayManager = { - gdm.enable = lib.mkDefault true; - sessionPackages = [ customDesktopSession ]; - }; - updateDbusEnvironment = true; - }; - - # Setting up some hardware settings. - hardware.opengl.enable = true; - hardware.bluetooth.enable = true; - services.udisks2.enable = true; - services.upower.enable = true; - services.power-profiles-daemon.enable = true; - services.colord.enable = true; - services.system-config-printer.enable = config.services.printing.enable; - - # Setting up some more core services. - security.polkit.enable = true; - services.accounts-daemon.enable = true; - services.dleyna-renderer.enable = true; - services.dleyna-server.enable = true; - programs.dconf.enable = true; - programs.xwayland.enable = true; - - fonts.enableDefaultPackages = true; - - # The phone sync component which is handy. - programs.kdeconnect = { - enable = true; - package = pkgs.valent; - }; - - # Harmonious themes. Since we're making this very similar to GNOME - # appearance-wise, layout-wise, and setup-wise, we may as well make it - # similar. - qt = { - enable = true; - platformTheme = "gnome"; - style = "adwaita"; - }; - - xdg.portal = { - enable = true; - extraPortals = with pkgs; [ - xdg-desktop-portal-hyprland - xdg-desktop-portal-gtk - ]; - }; - } - - # Setting up my project-specific profiles. This is only to be applied for - # my setup. If you're not foodogsquared and you're using my project as one - # of the flake input, this shouldn't be applied nor be used in the first - # place. - (lib.mkIf _isfoodogsquaredcustom { - profiles.i18n.setup = "ibus"; - }) - ]); + }; + }; }