From 40ea98af6bf2d5c55690cbce0edb396693f205d9 Mon Sep 17 00:00:00 2001 From: Jean-Pierre PRUNARET Date: Tue, 9 Aug 2016 13:33:51 +0200 Subject: [PATCH] extraction de x11 comme service --- desktop/desktop.nix | 35 -------------------------------- public/public.nix | 1 + public/service-x11.nix | 45 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 35 deletions(-) create mode 100644 public/service-x11.nix diff --git a/desktop/desktop.nix b/desktop/desktop.nix index 0584220..51dfac5 100644 --- a/desktop/desktop.nix +++ b/desktop/desktop.nix @@ -55,41 +55,6 @@ in mumble = pkgs.mumble.override { pulseSupport = true; }; }; - # Enable the X11 windowing system. - services.xserver = mkIf profiles.isDesktop { - enable = true; - layout = "fr"; - xkbOptions = "eurosign:e"; - displayManager.lightdm.enable = true; - windowManager.awesome.enable = true; - startGnuPGAgent = true; - startOpenSSHAgent = false; # pas compatible avec l'agent GnuPG - inputClassSections = ['' - Identifier "Marble Mouse" - MatchProduct "Logitech USB Trackball" - MatchIsPointer "on" - MatchDevicePath "/dev/input/event*" - Driver "evdev" - # Physical button #s: A b D - - - - B C b = A & D simultaneously; - = no button - #Option "ButtonMapping" "1 8 3 4 5 6 7 2 2" # For right-hand placement - #Option "ButtonMapping" "3 8 1 4 5 6 7 2 2" # For left-hand placement - - # EmulateWheel refers to emulating a mouse wheel using Marble Mouse trackball. - Option "EmulateWheel" "true" - Option "EmulateWheelButton" "8" # Factory default; use "9" for left-side placement. - - # EmulateWheelInertia specifies how far (in pixels) the pointer must move to - # generate button press/release events in wheel emulation mode. - Option "EmulateWheelInertia" "10" # Factory default: 50 - - Option "ZAxisMapping" "4 5" - Option "XAxisMapping" "6 7" # Disable this for vertical-only scrolling. - # Emulate3Buttons refers to the act of pressing buttons A and D - # simultaneously to emulate a middle-click or wheel click. - Option "Emulate3Buttons" "true" # Factory default. - '']; - }; - # Pulse Audio hardware.pulseaudio = mkIf profiles.isDesktop { enable = true; diff --git a/public/public.nix b/public/public.nix index 662819e..0807aa7 100644 --- a/public/public.nix +++ b/public/public.nix @@ -32,5 +32,6 @@ ./app-multimedia.nix # pour gérer le son, l'image et la vidéo ./app-network.nix # de gestion, de diagnostique & surveillance réseau ./app-securite.nix # relatives à la sécurité (chiffrement, gpg, mots de passe, ...) + ./service-x11.nix # activation du serveur graphique X ]; } diff --git a/public/service-x11.nix b/public/service-x11.nix new file mode 100644 index 0000000..5f586c1 --- /dev/null +++ b/public/service-x11.nix @@ -0,0 +1,45 @@ +{ config, pkgs, ... }: + +let + cfg = config.r6d.config-generator; + computers = config.r6d.computers; + profiles = config.r6d.profiles; + mkIf = pkgs.lib.mkIf; +in + +{ + # Enable the X11 windowing system. + services.xserver = mkIf profiles.isDesktop { + enable = true; + layout = "fr"; + xkbOptions = "eurosign:e"; + displayManager.lightdm.enable = true; + windowManager.awesome.enable = true; + startGnuPGAgent = true; + startOpenSSHAgent = false; # pas compatible avec l'agent GnuPG + inputClassSections = ['' + Identifier "Marble Mouse" + MatchProduct "Logitech USB Trackball" + MatchIsPointer "on" + MatchDevicePath "/dev/input/event*" + Driver "evdev" + # Physical button #s: A b D - - - - B C b = A & D simultaneously; - = no button + #Option "ButtonMapping" "1 8 3 4 5 6 7 2 2" # For right-hand placement + #Option "ButtonMapping" "3 8 1 4 5 6 7 2 2" # For left-hand placement + + # EmulateWheel refers to emulating a mouse wheel using Marble Mouse trackball. + Option "EmulateWheel" "true" + Option "EmulateWheelButton" "8" # Factory default; use "9" for left-side placement. + + # EmulateWheelInertia specifies how far (in pixels) the pointer must move to + # generate button press/release events in wheel emulation mode. + Option "EmulateWheelInertia" "10" # Factory default: 50 + + Option "ZAxisMapping" "4 5" + Option "XAxisMapping" "6 7" # Disable this for vertical-only scrolling. + # Emulate3Buttons refers to the act of pressing buttons A and D + # simultaneously to emulate a middle-click or wheel click. + Option "Emulate3Buttons" "true" # Factory default. + '']; + }; +}