Remudularizaçao do codigo

This commit is contained in:
DarkGui
2025-10-19 20:22:15 -03:00
parent 8e7fe043d6
commit 939cff1632
36 changed files with 158 additions and 134 deletions
+13
View File
@@ -0,0 +1,13 @@
{ config, lib, inputs, pkgs, ... }: {
programs.fish.shellAliases = {
# upd = "sudo nix flake update --flake /etc/nixos && sudo nixos-rebuild switch --flake path:/etc/nixos#Alfa";
upd = "nh home switch -a -u && nh os switch -a -u";
updhome = "nh home switch -a -u";
updsystem = "nh os switch -a -u";
nixcf = "kate /etc/nixos/configuration.nix";
nixfk = "kate /etc/nixos/flake.nix";
nixpkg = "kate /etc/nixos/conf/Pkgs/pkgs.nix";
nixalias = "kate /etc/nixos/conf/Alias/alias.nix";
};
}
+14
View File
@@ -0,0 +1,14 @@
{ config, lib, inputs, pkgs, ... }: {
## Configuração de áudio com Pipewire (desativa PulseAudio)
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
#jack.enable = true; # Descomente se usar aplicações JACK
};
}
+25
View File
@@ -0,0 +1,25 @@
{ config, lib, inputs, pkgs, ... }: {
## config fish
environment.systemPackages = with pkgs; [
fishPlugins.done
fishPlugins.fzf-fish
fishPlugins.forgit
fishPlugins.hydro
fzf
fishPlugins.grc
grc
];
programs.fish.enable = true;
## auto start fish com bash
programs.bash = {
interactiveShellInit =
'' if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi '';
};
}
+11
View File
@@ -0,0 +1,11 @@
{ config, lib, inputs, pkgs, ... }: {
## Ativar recursos experimentais do Nix, como flakes
nix.settings.experimental-features = ["nix-command" "flakes"];
## chaotic-nix
nix.nixPath = lib.mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry;
nix.registry = lib.mapAttrs (_: value: {flake = value;}) (lib.filterAttrs (_: value: lib.isType "flake" value) inputs);
nix.settings.flake-registry = "";
}
+19
View File
@@ -0,0 +1,19 @@
{ config, lib, inputs, pkgs, ... }: {
services.flatpak = {
enable = true;
packages = [
"org.vinegarhq.Sober"
];
update.auto = {
enable = true;
onCalendar = "weekly"; # Default value
};
};
xdg.portal = {
enable = true;
extraPortals = [pkgs.kdePackages.xdg-desktop-portal-kde];
config.common.default = "*";
};
}
+26
View File
@@ -0,0 +1,26 @@
{ config, lib, inputs, pkgs, ... }: {
## Definir fuso horário
time.timeZone = "America/Bahia";
## Configurações de idioma e localidade
i18n.defaultLocale = "pt_BR.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";
};
## Configurar layout do teclado no X11 e console
services.xserver.xkb = {
layout = "br";
variant = "";
};
console.keyMap = "br-abnt2";
}
+16
View File
@@ -0,0 +1,16 @@
{ config, lib, inputs, pkgs, ... }: {
imports = [
./alias.nix
./fish.nix
./audio.nix
./idioma.nix
./nixhelper.nix
./flakeconfig.nix
./flatpak.nix
./nvidia.nix
./variables.nix
./wireless.nix
./zstd.nix
];
}
+19
View File
@@ -0,0 +1,19 @@
{ config, lib, inputs, pkgs, ... }: {
## nixLD
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [];
## nixNH
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/etc/nixos"; # sets NH_OS_FLAKE variable for you
};
## Configuração do gerenciador nix
nix.package = pkgs.lixPackageSets.latest.lix;
#nix.package = inputs.nixpkgs-master.legacyPackages.${pkgs.system}.lix;
}
+10
View File
@@ -0,0 +1,10 @@
{ config, lib, inputs, pkgs, ... }: {
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
graphics.enable = true;
nvidia.open = false;
nvidia.package = config.boot.kernelPackages.nvidiaPackages.production;
#nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta;
};
}
+7
View File
@@ -0,0 +1,7 @@
{ config, lib, inputs, pkgs, ... }: {
environment.variables = {
__GL_SHADER_DISK_CACHE_SIZE = "12000000000";
VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
};
}
+13
View File
@@ -0,0 +1,13 @@
{ config, lib, inputs, pkgs, ... }: {
## Configuração da internet
networking.networkmanager.enable = true;
networking.interfaces.enp9s0.wakeOnLan.enable = true;
## Ativar Bluetooth
hardware.bluetooth.enable = true;
## Ativar CUPS para impressão
services.printing.enable = true;
}
+19
View File
@@ -0,0 +1,19 @@
{ config, lib, inputs, pkgs, ... }: {
## compressao brtfs
fileSystems = {
"/" = {
options = [ "compress=zstd:3" ];
};
};
## zram
zramSwap = {
enable = true;
memoryPercent = 70;
algorithm = "zstd";
};
## preload
services.preload.enable = true;
}