diff --git a/config/nixos/programs/games.nix b/config/nixos/programs/games.nix deleted file mode 100644 index a825437..0000000 --- a/config/nixos/programs/games.nix +++ /dev/null @@ -1,15 +0,0 @@ -_: { - programs = { - steam = { - enable = true; - }; - - gamemode.enable = true; - gamescope.enable = true; - - coolercontrol = { - enable = true; - nvidiaSupport = true; - }; - }; -} diff --git a/config/nixos/programs/gnome.nix b/config/nixos/programs/gnome.nix deleted file mode 100644 index 773e712..0000000 --- a/config/nixos/programs/gnome.nix +++ /dev/null @@ -1,40 +0,0 @@ -{pkgs, ...}: { - services.xserver = { - enable = true; - displayManager.gdm.enable = true; - desktopManager.gnome = { - enable = true; - extraGSettingsOverridePackages = [pkgs.mutter]; - extraGSettingsOverrides = '' - [org.gnome.mutter] - experimental-features=['scale-monitor-framebuffer'] - ''; - }; - }; - - environment.gnome.excludePackages = with pkgs; [ - gnome-console - gnome-photos - gnome-tour - gnome-software - iagno - hitori - atomix - gnome-contacts - gnome-initial-setup - gnome-terminal - gnome-music - gedit - cheese - tali - epiphany - geary - yelp - ]; - - environment.systemPackages = with pkgs; [ - gnome-tweaks - gnome-power-manager - rhythmbox - ]; -} diff --git a/config/nixos/programs/hyprland.nix b/config/nixos/programs/hyprland.nix deleted file mode 100644 index 9cf85c2..0000000 --- a/config/nixos/programs/hyprland.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - inputs, - config, - lib, - pkgs, - ... -}: { - environment.systemPackages = [ - inputs.hyprland-qtutils.packages.${pkgs.system}.default - ]; - programs.hyprland = { - enable = true; - package = inputs.hyprland.packages.${pkgs.system}.hyprland; - portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; - withUWSM = true; - systemd.setPath.enable = true; - }; - - # copied from https://github.com/linyinfeng/dotfiles/blob/91b0363b093303f57885cbae9da7f8a99bbb4432/nixos/profiles/graphical/niri/default.nix#L17-L29 - security.pam.services.hyprlock.text = lib.mkIf config.services.fprintd.enable '' - account required pam_unix.so - - # check passwork before fprintd - auth sufficient pam_unix.so try_first_pass likeauth - auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so - auth required pam_deny.so - - password sufficient pam_unix.so nullok yescrypt - - session required pam_env.so conffile=/etc/pam/environment readenv=0 - session required pam_unix.so - ''; -} diff --git a/config/nixos/programs/niri/default.nix b/config/nixos/programs/niri/default.nix deleted file mode 100644 index 6f8bb7b..0000000 --- a/config/nixos/programs/niri/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - inputs, - lib, - pkgs, - config, - ... -}: { - imports = [ - inputs.niri.nixosModules.niri - ]; - - programs.niri = { - enable = true; - }; - - # copied from https://github.com/linyinfeng/dotfiles/blob/91b0363b093303f57885cbae9da7f8a99bbb4432/nixos/profiles/graphical/niri/default.nix#L17-L29 - security.pam.services.swaylock.text = lib.mkIf config.services.fprintd.enable '' - account required pam_unix.so - - # check passwork before fprintd - auth sufficient pam_unix.so try_first_pass likeauth - auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so - auth required pam_deny.so - - password sufficient pam_unix.so nullok yescrypt - - session required pam_env.so conffile=/etc/pam/environment readenv=0 - session required pam_unix.so - ''; - - environment.systemPackages = [pkgs.xwayland-satellite]; -} diff --git a/config/nixos/programs/xdg.nix b/config/nixos/programs/xdg.nix deleted file mode 100644 index 209796f..0000000 --- a/config/nixos/programs/xdg.nix +++ /dev/null @@ -1,14 +0,0 @@ -{pkgs, ...}: { - xdg.portal = { - enable = true; - xdgOpenUsePortal = true; - config = { - common.default = ["gtk"]; - hyprland.default = ["gtk" "hyprland"]; - }; - - extraPortals = [ - pkgs.xdg-desktop-portal-gtk - ]; - }; -} diff --git a/hosts/default.nix b/hosts/default.nix index 7d513ee..4e7f61d 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -39,8 +39,6 @@ "${self}/config/nixos/services/logind.nix" "${self}/config/nixos/services/greetd.nix" - "${self}/config/nixos/programs/hyprland.nix" - "${self}/config/nixos/programs/xdg.nix" "${self}/config/nixos/services/gnome.nix" ({config, ...}: { home-manager.users.${config.local.systemVars.username}.imports = [ @@ -58,7 +56,6 @@ ]; gaming = [ - ../config/nixos/programs/games.nix ../config/nixos/services/flatpak.nix ({config, ...}: { home-manager.users.${config.local.systemVars.username}.imports = [ diff --git a/hosts/solaire/default.nix b/hosts/solaire/default.nix index f55160f..a3f60af 100644 --- a/hosts/solaire/default.nix +++ b/hosts/solaire/default.nix @@ -15,6 +15,10 @@ _: { desktop.enable = true; gaming.enable = true; }; + + modules = { + hyprland.enable = true; + }; }; environment.variables.FLAKE = "/home/nezia/.dotfiles"; diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index 8d120c8..350eb3e 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -16,6 +16,10 @@ _: { desktop.enable = true; laptop.enable = true; }; + + modules = { + hyprland.enable = true; + }; }; environment.variables.FLAKE = "/home/nezia/.dotfiles"; diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 95dcc30..c1e62b1 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -1,6 +1,7 @@ { imports = [ ./core + ./programs ./style ]; } diff --git a/modules/nix/programs/default.nix b/modules/nix/programs/default.nix new file mode 100644 index 0000000..11b433e --- /dev/null +++ b/modules/nix/programs/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./hyprland.nix + ./games.nix + ./xdg.nix + ]; +} diff --git a/modules/nix/programs/games.nix b/modules/nix/programs/games.nix new file mode 100644 index 0000000..8d1a05e --- /dev/null +++ b/modules/nix/programs/games.nix @@ -0,0 +1,21 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.profiles.gaming.enable { + programs = { + steam = { + enable = true; + }; + + gamemode.enable = true; + gamescope.enable = true; + + coolercontrol = { + enable = true; + nvidiaSupport = true; + }; + }; + }; +} diff --git a/modules/nix/programs/hyprland.nix b/modules/nix/programs/hyprland.nix new file mode 100644 index 0000000..60bfea0 --- /dev/null +++ b/modules/nix/programs/hyprland.nix @@ -0,0 +1,35 @@ +{ + inputs, + config, + lib, + pkgs, + ... +}: { + config = lib.mkIf config.local.modules.hyprland.enable { + environment.systemPackages = [ + inputs.hyprland-qtutils.packages.${pkgs.system}.default + ]; + programs.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + withUWSM = true; + systemd.setPath.enable = true; + }; + + # copied from https://github.com/linyinfeng/dotfiles/blob/91b0363b093303f57885cbae9da7f8a99bbb4432/nixos/profiles/graphical/niri/default.nix#L17-L29 + security.pam.services.hyprlock.text = lib.mkIf config.services.fprintd.enable '' + account required pam_unix.so + + # check passwork before fprintd + auth sufficient pam_unix.so try_first_pass likeauth + auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so + auth required pam_deny.so + + password sufficient pam_unix.so nullok yescrypt + + session required pam_env.so conffile=/etc/pam/environment readenv=0 + session required pam_unix.so + ''; + }; +} diff --git a/modules/nix/programs/xdg.nix b/modules/nix/programs/xdg.nix new file mode 100644 index 0000000..1724017 --- /dev/null +++ b/modules/nix/programs/xdg.nix @@ -0,0 +1,21 @@ +{ + lib, + pkgs, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + config = { + common.default = ["gtk"]; + hyprland.default = ["gtk" "hyprland"]; + }; + + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + ]; + }; + }; +} diff --git a/modules/options/modules/hyprland.nix b/modules/options/modules/hyprland.nix index 495f249..928dc76 100644 --- a/modules/options/modules/hyprland.nix +++ b/modules/options/modules/hyprland.nix @@ -1,5 +1,5 @@ {lib, ...}: let - inherit (lib.types) mkEnableOption; + inherit (lib) mkEnableOption; in { options.local.modules.hyprland = { enable = mkEnableOption "Hyprland modules";