refactor: vm configuration

This commit is contained in:
Alexander Navarro 2024-09-26 16:23:57 -03:00
parent c0e832a556
commit 8f2aa316c0
Signed by untrusted user who does not match committer: anavarro
GPG key ID: 6426043E9FA3E3B5
8 changed files with 262 additions and 285 deletions

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

@ -0,0 +1,81 @@
{
lib,
pkgs,
...
}: {
# ╭──────────────────────────────────────────────────────────╮
# │ System Config │
# ╰──────────────────────────────────────────────────────────╯
# Allow unfree packages
nixpkgs.config.allowUnfree = lib.mkDefault true;
environment.systemPackages = with pkgs; [
git
curl
neovim
];
# Define a user account. Don't forget to set a password with passwd.
users.users = lib.mkDefault {
aleidk = {
isNormalUser = true;
description = "aleidk";
extraGroups = ["networkmanager" "wheel"];
packages = with pkgs; [];
};
};
# Limit the number of generations to keep
boot.loader.systemd-boot.configurationLimit = lib.mkDefault 10;
# Perform garbage collection weekly to maintain low disk usage
nix.gc = lib.mkDefault {
automatic = true;
dates = "weekly";
options = "--delete-older-than 4w";
};
nix.settings = {
experimental-features = ["nix-command" "flakes"];
# Optimize storage
# You can also manually optimize the store via:
# nix-store --optimise
# Refer to the following link for more details:
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
auto-optimise-store = lib.mkDefault true;
};
# ╭──────────────────────────────────────────────────────────╮
# │ Locale Settings │
# ╰──────────────────────────────────────────────────────────╯
# Set your time zone.
time.timeZone = "America/Santiago";
# Select internationalisation properties.
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "es_CL.UTF-8";
LC_IDENTIFICATION = "es_CL.UTF-8";
LC_MEASUREMENT = "es_CL.UTF-8";
LC_MONETARY = "es_CL.UTF-8";
LC_NAME = "es_CL.UTF-8";
LC_NUMERIC = "es_CL.UTF-8";
LC_PAPER = "es_CL.UTF-8";
LC_TELEPHONE = "es_CL.UTF-8";
LC_TIME = "es_CL.UTF-8";
};
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "latam";
variant = "";
};
# Configure console keymap
console.keyMap = "la-latin1";
}