Restructure home and system modules
This commit is contained in:
parent
b86a8b50c7
commit
a03355b3a1
35 changed files with 82 additions and 82 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;
|
||||
};
|
||||
}
|
65
modules/system/hardware/common.nix
Normal file
65
modules/system/hardware/common.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Paris";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "fr_FR.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "fr_FR.UTF-8";
|
||||
LC_IDENTIFICATION = "fr_FR.UTF-8";
|
||||
LC_MEASUREMENT = "fr_FR.UTF-8";
|
||||
LC_MONETARY = "fr_FR.UTF-8";
|
||||
LC_NAME = "fr_FR.UTF-8";
|
||||
LC_NUMERIC = "fr_FR.UTF-8";
|
||||
LC_PAPER = "fr_FR.UTF-8";
|
||||
LC_TELEPHONE = "fr_FR.UTF-8";
|
||||
LC_TIME = "fr_FR.UTF-8";
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
nixd
|
||||
];
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.florian = {
|
||||
isNormalUser = true;
|
||||
description = "florian";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
};
|
||||
|
||||
services.flatpak.enable = true; # Important can't be enabled from home-manager
|
||||
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
# Enable networking
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = true;
|
||||
};
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "24.05"; # Did you read the comment?
|
||||
}
|
17
modules/system/hardware/default.nix
Normal file
17
modules/system/hardware/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./bluetooth
|
||||
./gamingKernel
|
||||
./keymaps
|
||||
./nvidia
|
||||
./pipewire
|
||||
./plymouth
|
||||
./printing
|
||||
./waydroid
|
||||
|
||||
# Common configuration
|
||||
./common.nix
|
||||
];
|
||||
}
|
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