From 3c5d19c060a8a762ddcd4dcddb52121b4287128e Mon Sep 17 00:00:00 2001 From: Guilherme Hermando <112888817+DarkGuibrine@users.noreply.github.com> Date: Wed, 6 Aug 2025 00:06:34 -0300 Subject: [PATCH] Add files via upload --- conf/Alias/alias.nix | 11 + conf/Audio/audio.nix | 14 ++ conf/Compressao/compressao.nix | 16 ++ conf/Fish/fish.nix | 26 +++ conf/Flakes/flakeconfig.nix | 11 + conf/Flatpak/flatpak.nix | 11 + conf/Kde/kde.nix | 8 + conf/NixHelper/nixhelper.nix | 18 ++ conf/Nvidia/nvidia.nix | 9 + conf/PatchJogos/patch.nix | 21 ++ conf/Pkgs/pkgs.nix | 46 ++++ conf/configidioma/configidioma.nix | 26 +++ conf/environmentvariables/variables.nix | 8 + conf/wireless/wireless.nix | 13 ++ configuration.nix | 37 +++ flake.lock | 287 ++++++++++++++++++++++++ flake.nix | 31 +++ imp.nix | 20 ++ 18 files changed, 613 insertions(+) create mode 100644 conf/Alias/alias.nix create mode 100644 conf/Audio/audio.nix create mode 100644 conf/Compressao/compressao.nix create mode 100644 conf/Fish/fish.nix create mode 100644 conf/Flakes/flakeconfig.nix create mode 100644 conf/Flatpak/flatpak.nix create mode 100644 conf/Kde/kde.nix create mode 100644 conf/NixHelper/nixhelper.nix create mode 100644 conf/Nvidia/nvidia.nix create mode 100644 conf/PatchJogos/patch.nix create mode 100644 conf/Pkgs/pkgs.nix create mode 100644 conf/configidioma/configidioma.nix create mode 100644 conf/environmentvariables/variables.nix create mode 100644 conf/wireless/wireless.nix create mode 100644 configuration.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 imp.nix diff --git a/conf/Alias/alias.nix b/conf/Alias/alias.nix new file mode 100644 index 0000000..af91373 --- /dev/null +++ b/conf/Alias/alias.nix @@ -0,0 +1,11 @@ +{ 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 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"; + }; +} \ No newline at end of file diff --git a/conf/Audio/audio.nix b/conf/Audio/audio.nix new file mode 100644 index 0000000..39ebb2e --- /dev/null +++ b/conf/Audio/audio.nix @@ -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 + }; + +} diff --git a/conf/Compressao/compressao.nix b/conf/Compressao/compressao.nix new file mode 100644 index 0000000..8778099 --- /dev/null +++ b/conf/Compressao/compressao.nix @@ -0,0 +1,16 @@ +{ config, lib, inputs, pkgs, ... }: { + + ## compressao brtfs + fileSystems = { + "/" = { + options = [ "compress=zstd" ]; + }; + }; + + ## zram + zramSwap = { + enable = true; + memoryPercent = 70; + algorithm = "zstd"; + }; +} diff --git a/conf/Fish/fish.nix b/conf/Fish/fish.nix new file mode 100644 index 0000000..21fa22a --- /dev/null +++ b/conf/Fish/fish.nix @@ -0,0 +1,26 @@ +{ 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 ''; +}; +} diff --git a/conf/Flakes/flakeconfig.nix b/conf/Flakes/flakeconfig.nix new file mode 100644 index 0000000..ee7a687 --- /dev/null +++ b/conf/Flakes/flakeconfig.nix @@ -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 = ""; + +} diff --git a/conf/Flatpak/flatpak.nix b/conf/Flatpak/flatpak.nix new file mode 100644 index 0000000..a1c55c8 --- /dev/null +++ b/conf/Flatpak/flatpak.nix @@ -0,0 +1,11 @@ +{ config, lib, inputs, pkgs, ... }: { + + services.flatpak.enable = true; + + xdg.portal = { + enable = true; + extraPortals = [pkgs.kdePackages.xdg-desktop-portal-kde]; + config.common.default = "*"; + }; + +} diff --git a/conf/Kde/kde.nix b/conf/Kde/kde.nix new file mode 100644 index 0000000..7eae3bd --- /dev/null +++ b/conf/Kde/kde.nix @@ -0,0 +1,8 @@ +{ config, lib, inputs, pkgs, ... }: { + + ## Ativar ambiente gráfico KDE Plasma 6 e gerenciador de login SDDM + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.enable = true; + programs.kdeconnect.enable = true; + +} diff --git a/conf/NixHelper/nixhelper.nix b/conf/NixHelper/nixhelper.nix new file mode 100644 index 0000000..8eba0b0 --- /dev/null +++ b/conf/NixHelper/nixhelper.nix @@ -0,0 +1,18 @@ +{ 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; + +} diff --git a/conf/Nvidia/nvidia.nix b/conf/Nvidia/nvidia.nix new file mode 100644 index 0000000..f96999c --- /dev/null +++ b/conf/Nvidia/nvidia.nix @@ -0,0 +1,9 @@ +{ config, lib, inputs, pkgs, ... }: { + + ## Configuração do driver NVIDIA + hardware.graphics.enable = true; + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia.open = false; + hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta; + +} diff --git a/conf/PatchJogos/patch.nix b/conf/PatchJogos/patch.nix new file mode 100644 index 0000000..2bd8305 --- /dev/null +++ b/conf/PatchJogos/patch.nix @@ -0,0 +1,21 @@ +{ config, lib, inputs, pkgs, ... }: { + + ## Config da steam + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; + nixpkgs.config.allowUnfreePredicate = pkg: lib.elem (lib.getName pkg) [ + "steam" + "steam-original" + "steam-unwrapped" + "steam-run" + ]; + + + ## patch jogos + programs.gamescope.enable = true; + programs.gamemode.enable = true; +} diff --git a/conf/Pkgs/pkgs.nix b/conf/Pkgs/pkgs.nix new file mode 100644 index 0000000..78cdfa5 --- /dev/null +++ b/conf/Pkgs/pkgs.nix @@ -0,0 +1,46 @@ +{ config, lib, inputs, pkgs, ... }: { + + ## Permitir pacotes não-livres + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + ## Aplicativos sociais + zapzap + inputs.zen-browser.packages.${system}.default + (discord.override {withVencord = true;}) + + ## Jogos + lutris + heroic + prismlauncher + steam + xclicker + mangojuice + mangohud + inputs.nixpkgs-master.legacyPackages.${pkgs.system}.lsfg-vk + inputs.nixpkgs-master.legacyPackages.${pkgs.system}.lsfg-vk-ui + + ## Utilitários do sistema e dev tools + nh + vscode + cpu-x + flatpak + vulkan-tools-lunarg + vulkan-loader + vulkan-utility-libraries + fastfetch + git + btop + ethtool + appimage-run + wget + gcc + kdePackages.partitionmanager + winetricks + wineWowPackages.staging + + ## repositorio 25.05 + inputs.nixpkgs-stable.legacyPackages.${pkgs.system}.vulkan-tools + ]; +} + diff --git a/conf/configidioma/configidioma.nix b/conf/configidioma/configidioma.nix new file mode 100644 index 0000000..51d18fe --- /dev/null +++ b/conf/configidioma/configidioma.nix @@ -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"; + +} diff --git a/conf/environmentvariables/variables.nix b/conf/environmentvariables/variables.nix new file mode 100644 index 0000000..6df3a50 --- /dev/null +++ b/conf/environmentvariables/variables.nix @@ -0,0 +1,8 @@ +{ config, lib, inputs, pkgs, ... }: { + + environment.variables = { + __GL_SHADER_DISK_CACHE_SIZE = "12000000000"; + GITHUB_TOKEN = ""; # Recomendado manter tokens em segredo + VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d"; + }; +} diff --git a/conf/wireless/wireless.nix b/conf/wireless/wireless.nix new file mode 100644 index 0000000..d14b541 --- /dev/null +++ b/conf/wireless/wireless.nix @@ -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; + +} diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..12be99f --- /dev/null +++ b/configuration.nix @@ -0,0 +1,37 @@ +{ config, lib, inputs, pkgs, ... }: +{ + imports = + [ # Importa a configuração de hardware detectada + ./hardware-configuration.nix + ./imp.nix + ]; + ## Configuração do bootloader + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.systemd-boot.configurationLimit = 10; + + boot.kernelPackages = pkgs.linuxPackages_cachyos-lto; # Kernel customizado + + networking.hostName = "Alfa"; # Defina o nome da sua máquina + + services.xserver.enable = true; # Ativar sistema gráfico X11 + + ## Definição do usuário normal + users.users.gui = { + isNormalUser = true; + description = "Gui"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + kdePackages.kate + kdePackages.kcalc + ]; + }; + + ## Habilitar login automático para o usuário "gui" + services.displayManager.autoLogin.enable = true; + services.displayManager.autoLogin.user = "gui"; + + system.stateVersion = "25.05"; # versao do nix + + security.sudo.package = pkgs.sudo.override {withInsults = true;}; ## errou sudo xingando +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..bf5dfb3 --- /dev/null +++ b/flake.lock @@ -0,0 +1,287 @@ +{ + "nodes": { + "chaotic": { + "inputs": { + "flake-schemas": "flake-schemas", + "home-manager": "home-manager", + "jovian": "jovian", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1754388539, + "narHash": "sha256-Yu9jClB3mjgONUDzHuKr1AnkfX60gyvgMeX/LNP/ZOI=", + "owner": "chaotic-cx", + "repo": "nyx", + "rev": "a3c21f1b39682e698695456666d4e77345ee712e", + "type": "github" + }, + "original": { + "owner": "chaotic-cx", + "ref": "nyxpkgs-unstable", + "repo": "nyx", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-schemas": { + "locked": { + "lastModified": 1721999734, + "narHash": "sha256-G5CxYeJVm4lcEtaO87LKzOsVnWeTcHGKbKxNamNWgOw=", + "rev": "0a5c42297d870156d9c57d8f99e476b738dcd982", + "revCount": 75, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.5/0190ef2f-61e0-794b-ba14-e82f225e55e6/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.1.5.tar.gz" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "chaotic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754365350, + "narHash": "sha256-NLWIkn1qM0wxtZu/2NXRaujWJ4Y1PSZlc7h0y6pOzOQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c5d7e957397ecb7d48b99c928611c6e780db1b56", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "zen-browser", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1752603129, + "narHash": "sha256-S+wmHhwNQ5Ru689L2Gu8n1OD6s9eU9n9mD827JNR+kw=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "e8c19a3cec2814c754f031ab3ae7316b64da085b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "jovian": { + "inputs": { + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "chaotic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754110197, + "narHash": "sha256-N7GWK2084EsNdwzwg6FCIgMrSau1WwzxGSNdPHx5Tak=", + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "rev": "04ce5c103eb621220d69102bc0ee27c3abd89204", + "type": "github" + }, + "original": { + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "chaotic", + "jovian", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729697500, + "narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=", + "owner": "zhaofengli", + "repo": "nix-github-actions", + "rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "matrix-name", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1754214453, + "narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-master": { + "locked": { + "lastModified": 1754444864, + "narHash": "sha256-gft1q7YIOhoCsFj1D3nWtY4m3nmMV0cTEfHEBsikFDQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f7212540bdbcee96fe83171405f6aafa93857081", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1754292888, + "narHash": "sha256-1ziydHSiDuSnaiPzCQh1mRFBsM2d2yRX9I+5OPGEmIE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ce01daebf8489ba97bd1609d185ea276efdeb121", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1754214453, + "narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754433317, + "narHash": "sha256-6k/ZzS+PvzbkpSzfT7lf+RDZGEjjIhNn+66x3JyovnM=", + "owner": "nix-community", + "repo": "NUR", + "rev": "4fcbb42f9696a850b55481ded21c8dab51ed3af5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "root": { + "inputs": { + "chaotic": "chaotic", + "nixpkgs": "nixpkgs_2", + "nixpkgs-master": "nixpkgs-master", + "nixpkgs-stable": "nixpkgs-stable", + "nur": "nur", + "zen-browser": "zen-browser" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "chaotic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754362243, + "narHash": "sha256-QHNTUdI6oIYuuazGuKGhVk5RCOM1nIzDUc/AGgL7Szw=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "3ec3244ffb877f1b7f5d2dbff19241982ab25ff2", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "zen-browser": { + "inputs": { + "home-manager": "home-manager_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754365690, + "narHash": "sha256-je5DVA23UU2RzJB1A7VTNSohPk/FE8HwDJaSK65/UJg=", + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "rev": "ec4909d02fb8c2d3c00ca71ceafb65753b4e3ea6", + "type": "github" + }, + "original": { + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5696435 --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + description = "A very basic flake"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.05"; + nixpkgs-master.url = "github:nixos/nixpkgs"; + chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; + nur = { + url = "github:nix-community/NUR"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + zen-browser = { + url = "github:0xc000022070/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + outputs = { self, nixpkgs, nixpkgs-stable,nixpkgs-master ,chaotic, zen-browser, nur, ...} @ inputs: { + nixosConfigurations = { + "Alfa" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./configuration.nix + chaotic.nixosModules.default + nur.modules.nixos.default + ]; + }; + }; + }; +} + diff --git a/imp.nix b/imp.nix new file mode 100644 index 0000000..a8a6016 --- /dev/null +++ b/imp.nix @@ -0,0 +1,20 @@ +{ config, lib, inputs, pkgs, ... }: { + + imports = [ + ./hardware-configuration.nix + ./conf/Pkgs/pkgs.nix + ./conf/Alias/alias.nix + ./conf/Compressao/compressao.nix + ./conf/PatchJogos/patch.nix + ./conf/Kde/kde.nix + ./conf/environmentvariables/variables.nix + ./conf/Flatpak/flatpak.nix + ./conf/Flakes/flakeconfig.nix + ./conf/Nvidia/nvidia.nix + ./conf/NixHelper/nixhelper.nix + ./conf/Audio/audio.nix + ./conf/configidioma/configidioma.nix + ./conf/wireless/wireless.nix + ./conf/Fish/fish.nix + ]; +}