Rename to play.nix
This commit is contained in:
parent
b9ec00c18c
commit
38beb52fe5
10 changed files with 38 additions and 38 deletions
12
flake.nix
12
flake.nix
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
description = "Wayming - Gaming setup for Wayland with configurable options and working defaults";
|
||||
description = "Play - Gaming setup for Wayland with configurable options and working defaults";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
@ -27,10 +27,10 @@
|
|||
overlays = [ self.overlays.default ];
|
||||
};
|
||||
|
||||
# Extend lib with wayming utilities
|
||||
# Extend lib with play utilities
|
||||
lib = nixpkgs.lib.extend (
|
||||
final: prev: {
|
||||
wayming = import ./lib { lib = final; };
|
||||
play = import ./lib { lib = final; };
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -46,11 +46,11 @@
|
|||
}
|
||||
)
|
||||
// {
|
||||
homeManagerModules.wayming = import ./modules/home-manager.nix;
|
||||
nixosModules.wayming = import ./modules/nixos.nix;
|
||||
homeManagerModules.play = import ./modules/home-manager.nix;
|
||||
nixosModules.play = import ./modules/nixos.nix;
|
||||
|
||||
# Default module (home-manager)
|
||||
homeManagerModules.default = self.homeManagerModules.wayming;
|
||||
homeManagerModules.default = self.homeManagerModules.play;
|
||||
|
||||
# Overlay for packages
|
||||
overlays.default = final: prev: {
|
||||
|
|
|
@ -26,27 +26,27 @@
|
|||
getMonitorDefaults = monitors: {
|
||||
WIDTH =
|
||||
let
|
||||
pm = lib.wayming.getPrimaryMonitor monitors;
|
||||
pm = lib.play.getPrimaryMonitor monitors;
|
||||
in
|
||||
if pm != null then pm.width else 1920;
|
||||
HEIGHT =
|
||||
let
|
||||
pm = lib.wayming.getPrimaryMonitor monitors;
|
||||
pm = lib.play.getPrimaryMonitor monitors;
|
||||
in
|
||||
if pm != null then pm.height else 1080;
|
||||
REFRESH_RATE =
|
||||
let
|
||||
pm = lib.wayming.getPrimaryMonitor monitors;
|
||||
pm = lib.play.getPrimaryMonitor monitors;
|
||||
in
|
||||
if pm != null then pm.refreshRate else 60;
|
||||
VRR =
|
||||
let
|
||||
pm = lib.wayming.getPrimaryMonitor monitors;
|
||||
pm = lib.play.getPrimaryMonitor monitors;
|
||||
in
|
||||
if pm != null then pm.vrr else false;
|
||||
HDR =
|
||||
let
|
||||
pm = lib.wayming.getPrimaryMonitor monitors;
|
||||
pm = lib.play.getPrimaryMonitor monitors;
|
||||
in
|
||||
if pm != null then pm.hdr else false;
|
||||
};
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
}:
|
||||
|
||||
let
|
||||
cfg = config.wayming.gamescoperun;
|
||||
cfg = config.play.gamescoperun;
|
||||
|
||||
# Use shared lib functions
|
||||
inherit (lib.wayming) toCliArgs toEnvCommands getMonitorDefaults;
|
||||
inherit (lib.play) toCliArgs toEnvCommands getMonitorDefaults;
|
||||
|
||||
# Get monitor defaults
|
||||
monitorDefaults = getMonitorDefaults config.wayming.monitors;
|
||||
monitorDefaults = getMonitorDefaults config.play.monitors;
|
||||
inherit (monitorDefaults)
|
||||
WIDTH
|
||||
HEIGHT
|
||||
|
@ -132,7 +132,7 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
options.wayming.gamescoperun = {
|
||||
options.play.gamescoperun = {
|
||||
enable = lib.mkEnableOption "gamescoperun, a wrapper for gamescope";
|
||||
|
||||
useGit = lib.mkOption {
|
||||
|
@ -195,12 +195,12 @@ in
|
|||
# Assertion to ensure monitors are configured if gamescoperun is enabled
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.enable -> (lib.length config.wayming.monitors > 0);
|
||||
message = "wayming.gamescoperun requires at least one monitor to be configured in wayming.monitors";
|
||||
assertion = cfg.enable -> (lib.length config.play.monitors > 0);
|
||||
message = "play.gamescoperun requires at least one monitor to be configured in play.monitors";
|
||||
}
|
||||
{
|
||||
assertion = cfg.enable -> (lib.length (lib.filter (m: m.primary) config.wayming.monitors) == 1);
|
||||
message = "wayming.gamescoperun requires exactly one primary monitor to be configured";
|
||||
assertion = cfg.enable -> (lib.length (lib.filter (m: m.primary) config.play.monitors) == 1);
|
||||
message = "play.gamescoperun requires exactly one primary monitor to be configured";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.wayming.monitors = lib.mkOption {
|
||||
options.play.monitors = lib.mkOption {
|
||||
type = lib.types.listOf (
|
||||
lib.types.submodule {
|
||||
options = {
|
||||
|
@ -64,8 +64,8 @@
|
|||
assertions = [
|
||||
{
|
||||
assertion =
|
||||
((lib.length config.wayming.monitors) != 0)
|
||||
-> ((lib.length (lib.filter (m: m.primary) config.wayming.monitors)) == 1);
|
||||
((lib.length config.play.monitors) != 0)
|
||||
-> ((lib.length (lib.filter (m: m.primary) config.play.monitors)) == 1);
|
||||
message = "Exactly one monitor must be set to primary.";
|
||||
}
|
||||
];
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
}:
|
||||
|
||||
let
|
||||
cfg = config.wayming.wrappers;
|
||||
cfg = config.play.wrappers;
|
||||
|
||||
# Use shared lib function
|
||||
inherit (lib.wayming) toCliArgs;
|
||||
inherit (lib.play) toCliArgs;
|
||||
|
||||
# Function to create a wrapper for an application
|
||||
mkWrapper =
|
||||
|
@ -36,14 +36,14 @@ let
|
|||
${envExports}
|
||||
|
||||
# Execute with gamescoperun
|
||||
exec ${lib.getExe config.wayming.gamescoperun.package} ${extraArgs} ${lib.getExe originalPackage} $argv
|
||||
exec ${lib.getExe config.play.gamescoperun.package} ${extraArgs} ${lib.getExe originalPackage} $argv
|
||||
'';
|
||||
|
||||
in
|
||||
wrapperScript;
|
||||
in
|
||||
{
|
||||
options.wayming.wrappers = lib.mkOption {
|
||||
options.play.wrappers = lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule (
|
||||
{ name, ... }:
|
||||
|
@ -96,7 +96,7 @@ in
|
|||
wrappedPackage = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
readOnly = true;
|
||||
default = mkWrapper name config.wayming.wrappers.${name};
|
||||
default = mkWrapper name config.play.wrappers.${name};
|
||||
description = "The configured wrapper package for this application";
|
||||
};
|
||||
};
|
||||
|
@ -113,6 +113,6 @@ in
|
|||
);
|
||||
|
||||
# Ensure gamescoperun is enabled if any wrappers are enabled
|
||||
wayming.gamescoperun.enable = lib.mkIf (lib.length (lib.attrNames cfg) > 0) true;
|
||||
play.gamescoperun.enable = lib.mkIf (lib.length (lib.attrNames cfg) > 0) true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
}:
|
||||
|
||||
let
|
||||
cfg = config.wayming.amd;
|
||||
cfg = config.play.amd;
|
||||
in
|
||||
{
|
||||
options.wayming.amd = {
|
||||
options.play.amd = {
|
||||
enable = lib.mkEnableOption "AMD GPU configuration with LACT (Linux AMD Control Tool)";
|
||||
};
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
}:
|
||||
|
||||
let
|
||||
cfg = config.wayming.ananicy;
|
||||
cfg = config.play.ananicy;
|
||||
|
||||
# Default extra rules for gaming processes
|
||||
defaultExtraRules = [
|
||||
|
@ -20,7 +20,7 @@ let
|
|||
finalExtraRules = defaultExtraRules ++ cfg.extraRules;
|
||||
in
|
||||
{
|
||||
options.wayming.ananicy = {
|
||||
options.play.ananicy = {
|
||||
enable = lib.mkEnableOption "ananicy process scheduler optimization";
|
||||
|
||||
extraRules = lib.mkOption {
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
}:
|
||||
|
||||
let
|
||||
cfg = config.wayming.gamemode;
|
||||
cfg = config.play.gamemode;
|
||||
in
|
||||
{
|
||||
options.wayming.gamemode = {
|
||||
options.play.gamemode = {
|
||||
enable = lib.mkEnableOption "gamemode configuration for gaming optimization";
|
||||
|
||||
settings = lib.mkOption {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
}:
|
||||
|
||||
let
|
||||
cfg = config.wayming.lutris;
|
||||
cfg = config.play.lutris;
|
||||
|
||||
# Default extra packages
|
||||
defaultExtraPkgs = with pkgs; [
|
||||
|
@ -22,7 +22,7 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
options.wayming.lutris = {
|
||||
options.play.lutris = {
|
||||
enable = lib.mkEnableOption "Install Lutris game manager";
|
||||
|
||||
extraPkgs = lib.mkOption {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
}:
|
||||
|
||||
let
|
||||
cfg = config.wayming.steam;
|
||||
cfg = config.play.steam;
|
||||
|
||||
# Default compatibility packages
|
||||
defaultCompatPackages = with pkgs; [
|
||||
|
@ -23,7 +23,7 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
options.wayming.steam = {
|
||||
options.play.steam = {
|
||||
enable = lib.mkEnableOption "Steam with gaming optimizations";
|
||||
|
||||
extraCompatPackages = lib.mkOption {
|
||||
|
|
Loading…
Add table
Reference in a new issue