Commit 150bf4dd0169

Vincent Demeester <vincent@sbr.pm>
2018-11-23 18:18:25
modules: add gaming profile
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 888d27f
Changed files (5)
machine/shikoku.nix
@@ -2,7 +2,6 @@
 
 {
   imports = [
-    ../profiles/gaming.nix
     ../location/home.nix
   ];
 
@@ -13,6 +12,7 @@
   profiles.virtualization.enable = true;
   profiles.ssh.enable = true;
   profiles.dev.enable = true;
+  profiles.gaming.enable = true;
   
   time.timeZone = "Europe/Paris";
 
modules/profiles/gaming.nix
@@ -0,0 +1,29 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+  cfg = config.profiles.gaming;
+in
+{
+  options = {
+    profiles.gaming = {
+      enable = mkOption {
+        default = false;
+        description = "Enable gaming profile";
+        type = types.bool;
+      };
+    };
+  };
+  config = mkIf cfg.enable {
+    hardware = {
+      opengl = {
+        driSupport32Bit = true;
+      };
+    };
+    services.udev.extraRules = ''
+      # Steam controller
+      SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666"
+      KERNEL=="uinput", MODE="0660", GROUP="users", OPTIONS+="static_node=uinput"
+    '';
+  };
+}
modules/profiles/pulseaudio.nix
@@ -35,7 +35,6 @@ in
     };
     sound.mediaKeys.enable = true;
   
-
     security.pam.loginLimits = [
       { domain = "@audio"; item = "memlock"; type = "-"; value = "unlimited"; }
       { domain = "@audio"; item = "rtprio";  type = "-"; value = "99"; }
modules/module-list.nix
@@ -10,6 +10,7 @@
     ./profiles/desktop.nix
     ./profiles/dev.nix
     ./profiles/docker.nix
+    ./profiles/gaming.nix
     ./profiles/git.nix
     ./profiles/i18n.nix
     ./profiles/laptop.nix
profiles/gaming.nix
@@ -1,14 +0,0 @@
-{ config, pkgs, ... }:
-
-{
-  hardware = {
-    opengl = {
-      driSupport32Bit = true;
-    };
-  };
-  services.udev.extraRules = ''
-    # Steam controller
-    SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666"
-    KERNEL=="uinput", MODE="0660", GROUP="users", OPTIONS+="static_node=uinput"
-  '';
-}