wip refactor

This commit is contained in:
Leonardo Eugênio 2025-02-20 22:01:03 -03:00
parent 294f1837d5
commit 321cb97502
10 changed files with 113 additions and 79 deletions

View file

@ -102,10 +102,17 @@
inputs.agenix.nixosModules.default
inputs.home-manager.nixosModules.home-manager
inputs.disko.nixosModules.disko
(
{ config, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.lelgenio = import ./user/home.nix;
home-manager.users.lelgenio = {
my = config.my;
imports = [
./user/home.nix
];
};
home-manager.backupFileExtension = "bkp";
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
@ -113,6 +120,7 @@
inherit inputs;
};
}
)
]
++ lib.optional (desktop == "gnome") ./system/gnome.nix
++ lib.optional (desktop == "kde") ./system/kde.nix;
@ -133,7 +141,6 @@
./system/monolith-gitlab-runner.nix
./system/monolith-forgejo-runner.nix
./system/nix-serve.nix
./system/steam.nix
] ++ common_modules;
};
double-rainbow = lib.nixosSystem {
@ -151,7 +158,6 @@
++ [
{
packages.media-packages.enable = lib.mkOverride 0 false;
programs.steam.enable = lib.mkOverride 0 false;
services.flatpak.enable = lib.mkOverride 0 false;
}
];

View file

@ -41,6 +41,8 @@ in
package = pkgs.unstable.opentabletdriver;
};
my.gaming.enable = true;
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
boot.initrd.kernelModules = [ "amdgpu" ];

View file

@ -1,6 +1,18 @@
{ lib, ... }:
{
options = {
my = lib.mkOption { };
my = {
themes = lib.mkOption { };
key = lib.mkOption { };
theme = lib.mkOption { };
accent = lib.mkOption { };
font = lib.mkOption { };
username = lib.mkOption { };
mail = lib.mkOption { };
dmenu = lib.mkOption { };
desktop = lib.mkOption { };
browser = lib.mkOption { };
editor = lib.mkOption { };
};
};
}

View file

@ -9,7 +9,7 @@
}:
{
imports = [
./gamemode.nix
./gaming.nix
./cachix.nix
./media-packages.nix
./boot.nix

View file

@ -1,27 +0,0 @@
{
config,
pkgs,
inputs,
...
}:
{
programs.gamemode.enable = true;
programs.gamemode.enableRenice = true;
programs.gamemode.settings = {
general = {
renice = 10;
};
# Warning: GPU optimisations have the potential to damage hardware
gpu = {
apply_gpu_optimisations = "accept-responsibility";
gpu_device = 0;
amd_performance_level = "high";
};
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
}

63
system/gaming.nix Normal file
View file

@ -0,0 +1,63 @@
{
config,
pkgs,
lib,
inputs,
...
}:
{
options.my.gaming.enable = lib.mkEnableOption { };
config = lib.mkIf config.my.gaming.enable {
programs.steam.enable = true;
programs.steam.extraPackages =
config.fonts.packages
++ (with pkgs; [
capitaine-cursors
bibata-cursors
mangohud
xdg-user-dirs
gamescope
# gamescope compatibility??
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
]);
environment.systemPackages = with pkgs; [
protontricks
bottles
inputs.dzgui-nix.packages.${pkgs.system}.default
];
programs.gamemode = {
enable = true;
enableRenice = true;
settings = {
general = {
renice = 10;
};
# Warning: GPU optimisations have the potential to damage hardware
gpu = {
apply_gpu_optimisations = "accept-responsibility";
gpu_device = 0;
amd_performance_level = "high";
};
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
};
}

View file

@ -1,36 +0,0 @@
{
config,
pkgs,
inputs,
...
}:
{
programs.steam.enable = true;
programs.steam.extraPackages =
config.fonts.packages
++ (with pkgs; [
capitaine-cursors
bibata-cursors
mangohud
xdg-user-dirs
gamescope
# gamescope compatibility??
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
]);
environment.systemPackages = with pkgs; [
protontricks
bottles
inputs.dzgui-nix.packages.${pkgs.system}.default
];
}

9
user/gaming.nix Normal file
View file

@ -0,0 +1,9 @@
{ config, lib, ... }:
let
cfg = config.my.gaming;
in
{
options.my.gaming.enable = lib.mkEnableOption { };
config = lib.mkIf cfg.enable {
};
}

View file

@ -7,9 +7,13 @@
let
inherit (config.my) accent theme editor;
inherit (theme) color;
cfg = config.my.helix;
in
{
config = {
options.my.helix.enable = lib.mkEnableOption "Enable helix config";
config = lib.mkIf cfg.enable {
programs.helix = {
enable = true;
settings = {

View file

@ -21,6 +21,7 @@
./rofi.nix
./mpv.nix
./mangohud.nix
./gaming.nix
./pipewire.nix
./mimeapps.nix
./desktop-entries.nix