refactor: moved common system options to their own file

This commit is contained in:
Mohammad Rafiq 2025-02-28 07:02:16 +08:00
parent e35bc17aa7
commit 66f3c5d32b
2 changed files with 41 additions and 37 deletions

40
modules/common.nix Normal file
View file

@ -0,0 +1,40 @@
# Contains common configration for all machines
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Set your time zone.
time.timeZone = "Asia/Singapore";
# Select internationalisation properties.
i18n.defaultLocale = "en_SG.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_SG.UTF-8";
LC_IDENTIFICATION = "en_SG.UTF-8";
LC_MEASUREMENT = "en_SG.UTF-8";
LC_MONETARY = "en_SG.UTF-8";
LC_NAME = "en_SG.UTF-8";
LC_NUMERIC = "en_SG.UTF-8";
LC_PAPER = "en_SG.UTF-8";
LC_TELEPHONE = "en_SG.UTF-8";
LC_TIME = "en_SG.UTF-8";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Define a user account. Don't forget to set a password with passwd.
users.users.rafiq = {
isNormalUser = true;
description = "rafiq";
extraGroups = [ "networkmanager" "wheel" ];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
}

View file

@ -7,6 +7,7 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
../../modules/common.nix
./hardware-configuration.nix ./hardware-configuration.nix
../../scripts/hyprland-tty-launch.nix ../../scripts/hyprland-tty-launch.nix
../../modules/nvidia.nix # Graphics settings for Nvidia GPUs ../../modules/nvidia.nix # Graphics settings for Nvidia GPUs
@ -23,43 +24,6 @@
options = [ "rw" "uid=rafiq" ]; options = [ "rw" "uid=rafiq" ];
}; };
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Set your time zone.
time.timeZone = "Asia/Singapore";
# Select internationalisation properties.
i18n.defaultLocale = "en_SG.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_SG.UTF-8";
LC_IDENTIFICATION = "en_SG.UTF-8";
LC_MEASUREMENT = "en_SG.UTF-8";
LC_MONETARY = "en_SG.UTF-8";
LC_NAME = "en_SG.UTF-8";
LC_NUMERIC = "en_SG.UTF-8";
LC_PAPER = "en_SG.UTF-8";
LC_TELEPHONE = "en_SG.UTF-8";
LC_TIME = "en_SG.UTF-8";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Define a user account. Don't forget to set a password with passwd.
users.users.rafiq = {
isNormalUser = true;
description = "rafiq";
extraGroups = [ "networkmanager" "wheel" ];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [