summaryrefslogtreecommitdiffstats
path: root/default.nix
blob: f2231412eab6ffa9d161b440708eab462580c7b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
    config,
    inputs,
    lib,
    pkgs,
    ...
}: {
    imports =
        [inputs.home-manager.nixosModules.home-manager]
        ++ (lib.custom.mapModulesRec' ./modules import);
    
    environment.variables.NIXOSCONFIG = config.nixosConfig.dir;
    environment.variables.NIXPKGS_ALLOW_UNFREE = "1";

    #Timezone
    time.timeZone = "America/New_York";

    #Locale
    i18n.defaultLocale = "en_US.UTF-8";
    i18n.extraLocaleSettings = {
        LC_ADDRESS = "en_US.UTF-8";
        LC_IDENTIFICATION = "en_US.UTF-8";
        LC_MEASUREMENT = "en_US.UTF-8";
        LC_MONETARY = "en_US.UTF-8";
        LC_NAME = "en_US.UTF-8";
        LC_NUMERIC = "en_US.UTF-8";
        LC_PAPER = "en_US.UTF-8";
        LC_TELEPHONE = "en_US.UTF-8";
        LC_TIME = "en_US.UTF-8";
    };

    #Nix package manager configs.
    nix = {
        registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
        nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
        
        settings = {
            experimental-features = "nix-command flakes";
            auto-optimise-store = true;
        };
        
        gc = {
            automatic = true;
            dates = "weekly";
            options = "--delete-older-than 7d";
        };
    };

    boot = {
        kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
        loader = {
            systemd-boot.enable = lib.mkDefault true;
            systemd-boot.configurationLimit = lib.mkDefault 5;
            efi.canTouchEfiVariables = true;
        };
        initrd = {
            verbose = false;
            availableKernelModules = [
                "xhci_pci"
                "ahci"
                "usb_storage"
                "usbhid"
                "sd_mod"
                "dm_mod"
            ];
        };
    };

    system.stateVersion = "23.11";
}