Reviewed-on: https://gitea.mrdev023.fr/florian.richer/nixos/pulls/1 Co-authored-by: Florian RICHER <florian.richer@protonmail.com> Co-committed-by: Florian RICHER <florian.richer@protonmail.com>
This commit is contained in:
parent
e9329e63dc
commit
b7f82f87e8
84 changed files with 1100 additions and 1247 deletions
16
modules/system/hardware/bluetooth/default.nix
Normal file
16
modules/system/hardware/bluetooth/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.system.hardware.bluetooth;
|
||||
in
|
||||
{
|
||||
options.modules.system.hardware.bluetooth = {
|
||||
enable = mkEnableOption ''
|
||||
Enable pipewire with my custom configurations
|
||||
'';
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
hardware.bluetooth.enable = true;
|
||||
};
|
||||
}
|
14
modules/system/hardware/default.nix
Normal file
14
modules/system/hardware/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./bluetooth
|
||||
./gamingKernel
|
||||
./keymaps
|
||||
./nvidia
|
||||
./pipewire
|
||||
./plymouth
|
||||
./printing
|
||||
./waydroid
|
||||
];
|
||||
}
|
16
modules/system/hardware/gamingKernel/default.nix
Normal file
16
modules/system/hardware/gamingKernel/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.system.hardware.gamingKernel;
|
||||
in
|
||||
{
|
||||
options.modules.system.hardware.gamingKernel = {
|
||||
enable = mkEnableOption ''
|
||||
Enable gaming kernel with my custom configurations
|
||||
'';
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
boot.kernelPackages = pkgs.linuxPackages_zen;
|
||||
};
|
||||
}
|
23
modules/system/hardware/keymaps/default.nix
Normal file
23
modules/system/hardware/keymaps/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.system.hardware.keymaps;
|
||||
in
|
||||
{
|
||||
options.modules.system.hardware.keymaps = {
|
||||
layout = mkOption {
|
||||
default = "fr";
|
||||
example = "fr";
|
||||
description = ''
|
||||
Set key layout (fr, us)
|
||||
'';
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
config = mkMerge [
|
||||
(mkIf (cfg.layout == "fr") (import ./fr.nix {}))
|
||||
(mkIf (cfg.layout == "us") (import ./us.nix {}))
|
||||
];
|
||||
}
|
||||
|
13
modules/system/hardware/keymaps/fr.nix
Normal file
13
modules/system/hardware/keymaps/fr.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ ... }:
|
||||
{
|
||||
# Configure keymap in X11
|
||||
services.xserver = {
|
||||
xkb = {
|
||||
layout = "fr";
|
||||
variant = "";
|
||||
};
|
||||
};
|
||||
|
||||
# Configure console keymap
|
||||
console.keyMap = "fr";
|
||||
}
|
13
modules/system/hardware/keymaps/us.nix
Normal file
13
modules/system/hardware/keymaps/us.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ ... }:
|
||||
{
|
||||
# Configure keymap in X11
|
||||
services.xserver = {
|
||||
xkb = {
|
||||
layout = "us";
|
||||
variant = "altgr-intl";
|
||||
};
|
||||
};
|
||||
|
||||
# Configure console keymap
|
||||
console.keyMap = "us";
|
||||
}
|
51
modules/system/hardware/nvidia/default.nix
Normal file
51
modules/system/hardware/nvidia/default.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.system.hardware.nvidia;
|
||||
in
|
||||
{
|
||||
options.modules.system.hardware.nvidia = {
|
||||
enable = mkEnableOption ''
|
||||
Enable nvidia with my custom configurations
|
||||
'';
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Enable OpenGL
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
|
||||
# Load nvidia driver for Xorg and Wayland
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
hardware.nvidia = {
|
||||
# Modesetting is required.
|
||||
modesetting.enable = true;
|
||||
|
||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
||||
powerManagement.enable = false;
|
||||
# Fine-grained power management. Turns off GPU when not in use.
|
||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||
powerManagement.finegrained = false;
|
||||
|
||||
# Use the NVidia open source kernel module (not to be confused with the
|
||||
# independent third-party "nouveau" open source driver).
|
||||
# Support is limited to the Turing and later architectures. Full list of
|
||||
# supported GPUs is at:
|
||||
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
||||
# Only available from driver 515.43.04+
|
||||
# Currently alpha-quality/buggy, so false is currently the recommended setting.
|
||||
open = false;
|
||||
|
||||
# Enable the Nvidia settings menu,
|
||||
# accessible via `nvidia-settings`.
|
||||
nvidiaSettings = true;
|
||||
|
||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
};
|
||||
};
|
||||
}
|
31
modules/system/hardware/pipewire/default.nix
Normal file
31
modules/system/hardware/pipewire/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.system.hardware.pipewire;
|
||||
in
|
||||
{
|
||||
options.modules.system.hardware.pipewire = {
|
||||
enable = mkEnableOption ''
|
||||
Enable pipewire with my custom configurations
|
||||
'';
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Enable sound with pipewire.
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
16
modules/system/hardware/plymouth/default.nix
Normal file
16
modules/system/hardware/plymouth/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.system.hardware.plymouth;
|
||||
in
|
||||
{
|
||||
options.modules.system.hardware.plymouth = {
|
||||
enable = mkEnableOption ''
|
||||
Enable plymouth with my custom configurations
|
||||
'';
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
boot.plymouth.enable = true;
|
||||
};
|
||||
}
|
16
modules/system/hardware/printing/default.nix
Normal file
16
modules/system/hardware/printing/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.system.hardware.printing;
|
||||
in
|
||||
{
|
||||
options.modules.system.hardware.printing = {
|
||||
enable = mkEnableOption ''
|
||||
Enable printing with my custom configurations
|
||||
'';
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.printing.enable = true;
|
||||
};
|
||||
}
|
16
modules/system/hardware/waydroid/default.nix
Normal file
16
modules/system/hardware/waydroid/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.system.hardware.waydroid;
|
||||
in
|
||||
{
|
||||
options.modules.system.hardware.waydroid = {
|
||||
enable = mkEnableOption ''
|
||||
Enable waydroid with my custom configurations
|
||||
'';
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.waydroid.enable = true;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue