diff --git a/home/modules/gpg/default.nix b/home/modules/gpg/default.nix index f70087f..1862db3 100644 --- a/home/modules/gpg/default.nix +++ b/home/modules/gpg/default.nix @@ -26,7 +26,7 @@ { enable = true; enableSshSupport = true; - pinentryPackage = pkgs.pinentry-qt; + pinentryPackage = pkgs.pinentry-curses; } (lib.mkIf config.youthlic.programs.fish.enable { enableFishIntegration = true; diff --git a/nixos/configurations/Tytonidae/default.nix b/nixos/configurations/Tytonidae/default.nix index bfabfcd..6cfce14 100644 --- a/nixos/configurations/Tytonidae/default.nix +++ b/nixos/configurations/Tytonidae/default.nix @@ -1,13 +1,16 @@ -{ pkgs, inputs, ... }: +{ + lib, + pkgs, + inputs, + ... +}: { imports = (with inputs; [ nixos-hardware.nixosModules.asus-fx506hm ]) ++ [ - ./gui.nix ./users - ./steam.nix # Include the hardware related config ./hardware-configuration.nix @@ -26,6 +29,16 @@ openssh.enable = true; steam.enable = true; }; + gui.enabled = "niri"; + }; + + specialisation = { + cosmic = { + inheritParentConfig = true; + configuration = { + youthlic.gui.enabled = lib.mkForce "cosmic"; + }; + }; }; programs.gnupg.agent = { @@ -55,6 +68,7 @@ wechat-uos nvtopPackages.full spotify + localsend ]; environment.variables.EDITOR = "hx"; diff --git a/nixos/configurations/Tytonidae/gui.nix b/nixos/configurations/Tytonidae/gui.nix deleted file mode 100644 index c5a3268..0000000 --- a/nixos/configurations/Tytonidae/gui.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ pkgs, ... }: -{ - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - services.xserver = { - display = 0; - enable = true; - }; - # Enable the KDE Plasma Desktop Environment. - # services.displayManager.sddm.enable = true; - # services.desktopManager.plasma6.enable = true; - services.desktopManager.cosmic.enable = true; - services.displayManager.cosmic-greeter.enable = true; - programs.niri = { - enable = true; - package = pkgs.niri-unstable; - }; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "cn"; - variant = ""; - }; - - environment.systemPackages = with pkgs; [ - fontconfig - ]; - programs.firefox.enable = true; - programs.localsend.enable = true; - - fonts = { - enableDefaultPackages = false; - packages = with pkgs; [ - nerd-fonts.fira-code - noto-fonts - noto-fonts-cjk-sans - noto-fonts-cjk-serif - noto-fonts-emoji - lxgw-wenkai - ]; - fontconfig.defaultFonts = pkgs.lib.mkForce { - serif = [ - "LXGW WenKai" - "Noto Serif CJK SC" - "Noto Serif" - ]; - sansSerif = [ - "Noto Serif CJK SC" - "Noto Serif" - ]; - monospace = [ - "FiraCode Nerd Font" - ]; - emoji = [ "Noto Color Emoji" ]; - }; - }; - - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; -} diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index ea1ddad..b1763c2 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -20,6 +20,9 @@ ./dae ./openssh.nix ./nh.nix + ./i18n.nix + ./gui.nix + ./steam.nix ]; config = { diff --git a/nixos/modules/gui.nix b/nixos/modules/gui.nix new file mode 100644 index 0000000..ce97af9 --- /dev/null +++ b/nixos/modules/gui.nix @@ -0,0 +1,103 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.youthlic.gui; +in +{ + options = { + youthlic.gui = { + enabled = lib.mkOption { + type = lib.types.nullOr ( + lib.types.enum [ + "cosmic" + "niri" + ] + ); + default = null; + example = "cosmic"; + }; + }; + }; + config = lib.mkMerge [ + (lib.mkIf (cfg.enabled == "cosmic") { + # Enable the X11 windowing system. + # You can disable this if you're only using the Wayland session. + services.xserver = { + display = 0; + enable = true; + xkb = { + layout = "cn"; + variant = ""; + }; + }; + + services.desktopManager.cosmic.enable = true; + services.displayManager.cosmic-greeter.enable = true; + }) + (lib.mkIf (cfg.enabled == "niri") { + services.displayManager.sddm = { + enable = true; + wayland = { + enable = true; + compositorCommand = "niri"; + }; + }; + programs.niri = { + enable = true; + package = pkgs.niri-unstable; + }; + }) + (lib.mkIf (cfg.enabled != null) { + environment.systemPackages = with pkgs; [ + fontconfig + ]; + programs.firefox.enable = true; + + fonts = { + enableDefaultPackages = false; + packages = with pkgs; [ + nerd-fonts.fira-code + noto-fonts + noto-fonts-cjk-sans + noto-fonts-cjk-serif + noto-fonts-emoji + lxgw-wenkai + ]; + fontconfig.defaultFonts = pkgs.lib.mkForce { + serif = [ + "LXGW WenKai" + "Noto Serif CJK SC" + "Noto Serif" + ]; + sansSerif = [ + "Noto Serif CJK SC" + "Noto Serif" + ]; + monospace = [ + "FiraCode Nerd Font" + ]; + emoji = [ "Noto Color Emoji" ]; + }; + }; + + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + }) + ]; +}