diff options
author | Leonardo Santiago <[email protected]> | 2024-09-12 21:44:46 -0300 |
---|---|---|
committer | Leonardo Santiago <[email protected]> | 2024-09-12 23:20:51 -0300 |
commit | 62100c9265a4de389d1ea8060cbddddacde161a7 (patch) | |
tree | 811ca1c5803ccdb2670f0c239214bc0dc30f57c7 /modules/basic.nix | |
parent | f9ddec7952709d7b5d5d79deadca07c573510d49 (diff) |
split users/leonardo.nix into modules with options
in order to be able to deploy just a few of those to iori.nix
Diffstat (limited to 'modules/basic.nix')
-rw-r--r-- | modules/basic.nix | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/modules/basic.nix b/modules/basic.nix new file mode 100644 index 0000000..e2c68c1 --- /dev/null +++ b/modules/basic.nix @@ -0,0 +1,63 @@ +{ config, lib, pkgs, ...}: with lib; { + options.santi-modules.basic.enable = mkOption { + type = types.bool; + default = true; + description = "Enables basic configuration on nix, nixpkgs and bash prompt."; + }; + config = mkIf config.santi-modules.basic.enable { + nix = { + package = pkgs.lib.mkForce pkgs.nixVersions.nix_2_23; + settings = { + trusted-users = [ "root" "leonardo" ]; + auto-optimise-store = true; + }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + }; + + nixpkgs = { + config.allowUnfree = true; + config.allowUnfreePredicate = _: true; + }; + + programs.bash = { + vteIntegration = true; + enableLsColors = true; + completion.enable = true; + promptInit = + '' + PS1="\[\033[1;95m\][\h]\[\033[0m\] \[\033[0;32m\]\w\[\033[0m\] :: " + [ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/bash" + ''; + }; + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + time.timeZone = "America/Sao_Paulo"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "pt_BR.UTF-8"; + LC_IDENTIFICATION = "pt_BR.UTF-8"; + LC_MEASUREMENT = "pt_BR.UTF-8"; + LC_MONETARY = "pt_BR.UTF-8"; + LC_NAME = "pt_BR.UTF-8"; + LC_NUMERIC = "pt_BR.UTF-8"; + LC_PAPER = "pt_BR.UTF-8"; + LC_TELEPHONE = "pt_BR.UTF-8"; + LC_TIME = "pt_BR.UTF-8"; + }; + + services.xserver = { + enable = true; + xkb = { + variant = "abnt2"; + layout = "br"; + }; + }; + console.keyMap = "br-abnt2"; + }; +} |