Move all files

This commit is contained in:
Florian RICHER 2024-05-25 01:32:48 +02:00
parent d0e303d0f9
commit 34c8b954e5
45 changed files with 352 additions and 645 deletions

View file

@ -0,0 +1,16 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.system.bluetooth;
in
{
options.modules.system.bluetooth = {
enable = mkEnableOption ''
Enable pipewire with my custom configurations
'';
};
config = mkIf cfg.enable {
hardware.bluetooth.enable = true;
};
}

View file

@ -0,0 +1,15 @@
{ config, pkgs, ... }:
{
imports = [
./bluetooth
./keymaps
./nvidia
./pipewire
./plymouth
./printing
# Common configuration
./system.nix
];
}

View file

@ -0,0 +1,23 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.system.keymaps;
in
{
options.modules.system.keymaps = {
layout = mkOption {
default = "fr";
example = "fr";
description = ''
Set key layout (fr, us)
'';
type = types.string;
};
};
config = {
imports = [
./${cfg.layout}
];
};
}

View file

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
# Configure keymap in X11
services.xserver = {
xkb = {
layout = "fr";
variant = "";
};
};
# Configure console keymap
console.keyMap = "fr";
}

View file

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
# Configure keymap in X11
services.xserver = {
xkb = {
layout = "us";
variant = "altgr-intl";
};
};
# Configure console keymap
console.keyMap = "us";
}

View file

@ -0,0 +1,51 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.system.nvidia;
in
{
options.modules.system.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;
};
};
}

View file

@ -0,0 +1,31 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.system.pipewire;
in
{
options.modules.system.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;
};
};
}

View file

@ -0,0 +1,16 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.system.plymouth;
in
{
options.modules.system.plymouth = {
enable = mkEnableOption ''
Enable plymouth with my custom configurations
'';
};
config = mkIf cfg.enable {
boot.plymouth.enable = true;
};
}

View file

@ -0,0 +1,16 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.system.printing;
in
{
options.modules.system.printing = {
enable = mkEnableOption ''
Enable printing with my custom configurations
'';
};
config = mkIf cfg.enable {
services.printing.enable = true;
};
}

63
modules/system/system.nix Normal file
View file

@ -0,0 +1,63 @@
{ config, 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" ];
};
# 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. Its 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?
}