nix-dotfiles/nixosModules/automatic/default.nix
2025-11-17 16:16:39 -08:00

70 lines
1.9 KiB
Nix

{ config, pkgs, lib, ... }:
{
options.system = {
timezone = lib.mkOption { default = "America/Los_Angeles"; };
extraFonts = lib.mkOption { default = []; };
extraPkgs = lib.mkOption { default = []; };
isNonEFI = lib.mkEnableOption
"Enable if you are running a non-EFI system";
users.bigWheels = lib.mkOption { default = []; };
};
config = lib.mkMerge [
(lib.mkIf config.system.isNonEFI {
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
})
(lib.mkIf (!config.system.isNonEFI) {
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.systemd-boot.enable = true;
boot.loader.timeout = 1;
boot.loader.efi.canTouchEfiVariables = true;
})
{
system.stateVersion = lib.mkDefault "23.05";
time.timeZone = config.system.timezone;
i18n.defaultLocale = "en_US.UTF-8";
# Packages & Default Packages
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
git
neovim
xdg-user-dirs
] ++ config.system.extraPkgs;
# XDG Compliance
nix.settings.use-xdg-base-directories = true;
# users = {
# users = builtins.listToAttrs (map (
# user: {
# name = user;
# value = {
# name = user;
# isNormalUser = true;
# extraGroups = [ "network" ];
# };
# }
# ) usernameList);
# groups = {
# wheel = {
# members = config.system.users.bigWheels;
# };
# network = { };
# };
# };
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
nerd-fonts.caskaydia-cove
cascadia-code
source-han-sans # Pan-CJK font
] ++ config.system.extraFonts;
};
}
];
}