treewide: config/nixos/programs -> modules/nix/programs

Here, we also use the option we just added, `local.modules.hyprland.enable` to toggle Hyprland, as well as the profiles. Also removed other unused configuration, such as KDE/Gnome.
This commit is contained in:
Anthony Rodriguez 2025-01-14 13:58:52 +01:00
parent 76a2caa9c7
commit ec285bcc52
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
14 changed files with 94 additions and 138 deletions

View file

@ -1,15 +0,0 @@
_: {
programs = {
steam = {
enable = true;
};
gamemode.enable = true;
gamescope.enable = true;
coolercontrol = {
enable = true;
nvidiaSupport = true;
};
};
}

View file

@ -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
];
}

View file

@ -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
'';
}

View file

@ -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];
}

View file

@ -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
];
};
}

View file

@ -39,8 +39,6 @@
"${self}/config/nixos/services/logind.nix" "${self}/config/nixos/services/logind.nix"
"${self}/config/nixos/services/greetd.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" "${self}/config/nixos/services/gnome.nix"
({config, ...}: { ({config, ...}: {
home-manager.users.${config.local.systemVars.username}.imports = [ home-manager.users.${config.local.systemVars.username}.imports = [
@ -58,7 +56,6 @@
]; ];
gaming = [ gaming = [
../config/nixos/programs/games.nix
../config/nixos/services/flatpak.nix ../config/nixos/services/flatpak.nix
({config, ...}: { ({config, ...}: {
home-manager.users.${config.local.systemVars.username}.imports = [ home-manager.users.${config.local.systemVars.username}.imports = [

View file

@ -15,6 +15,10 @@ _: {
desktop.enable = true; desktop.enable = true;
gaming.enable = true; gaming.enable = true;
}; };
modules = {
hyprland.enable = true;
};
}; };
environment.variables.FLAKE = "/home/nezia/.dotfiles"; environment.variables.FLAKE = "/home/nezia/.dotfiles";

View file

@ -16,6 +16,10 @@ _: {
desktop.enable = true; desktop.enable = true;
laptop.enable = true; laptop.enable = true;
}; };
modules = {
hyprland.enable = true;
};
}; };
environment.variables.FLAKE = "/home/nezia/.dotfiles"; environment.variables.FLAKE = "/home/nezia/.dotfiles";

View file

@ -1,6 +1,7 @@
{ {
imports = [ imports = [
./core ./core
./programs
./style ./style
]; ];
} }

View file

@ -0,0 +1,7 @@
{
imports = [
./hyprland.nix
./games.nix
./xdg.nix
];
}

View file

@ -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;
};
};
};
}

View file

@ -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
'';
};
}

View file

@ -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
];
};
};
}

View file

@ -1,5 +1,5 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.types) mkEnableOption; inherit (lib) mkEnableOption;
in { in {
options.local.modules.hyprland = { options.local.modules.hyprland = {
enable = mkEnableOption "Hyprland modules"; enable = mkEnableOption "Hyprland modules";