From 8329531ac7df278f3a51b9ea9d7fb4883442b277 Mon Sep 17 00:00:00 2001 From: DarkGuibrine Date: Sun, 19 Apr 2026 15:17:37 -0300 Subject: [PATCH] adicionando a VPS --- .gitignore | 1 + flake.lock | 80 ++++++++++++ flake.nix | 12 ++ hosts/darkgui-vps/Alfa/conf/GM/DE/cosmic.nix | 46 +++++++ hosts/darkgui-vps/Alfa/conf/GM/DE/gnome.nix | 56 +++++++++ hosts/darkgui-vps/Alfa/conf/GM/DE/impde.nix | 18 +++ hosts/darkgui-vps/Alfa/conf/GM/DE/kde.nix | 43 +++++++ .../darkgui-vps/Alfa/conf/GM/DE/niri/dms.nix | 41 +++++++ .../darkgui-vps/Alfa/conf/GM/DE/niri/niri.nix | 88 ++++++++++++++ .../Alfa/conf/GM/DE/niri/noctalia.nix | 13 ++ .../Alfa/conf/GM/DE/niri/thunar.nix | 27 +++++ .../Alfa/conf/GM/Pkgs/imp_pkgs.nix | 14 +++ hosts/darkgui-vps/Alfa/conf/GM/Pkgs/pkgs.nix | 74 ++++++++++++ .../Alfa/conf/GM/Pkgs/pkgsconfig.nix | 74 ++++++++++++ .../Alfa/conf/GM/configs/cfsystem.nix | 79 ++++++++++++ .../darkgui-vps/Alfa/conf/GM/configs/imp.nix | 18 +++ .../Alfa/conf/GM/configs/kernel.nix | 25 ++++ .../Alfa/conf/GM/configs/nixhelper.nix | 62 ++++++++++ .../Alfa/conf/GM/configs/nvidia.nix | 34 ++++++ .../Alfa/conf/GM/configs/patchs.nix | 114 ++++++++++++++++++ .../Alfa/conf/GM/configs/self-host.nix | 71 +++++++++++ hosts/darkgui-vps/Alfa/conf/GM/imp.nix | 8 ++ .../Alfa/conf/HM/configs/cfhome.nix | 49 ++++++++ hosts/darkgui-vps/Alfa/conf/HM/imp.nix | 14 +++ hosts/darkgui-vps/Alfa/conf/HM/pkgs/pkgs.nix | 75 ++++++++++++ hosts/darkgui-vps/Alfa/configuration.nix | 71 +++++++++++ .../Alfa/hardware-configuration.nix | 53 ++++++++ hosts/darkgui-vps/Alfa/home.nix | 61 ++++++++++ hosts/darkgui-vps/config/imp.nix | 16 +++ hosts/darkgui-vps/config/nix-helper.nix | 26 ++++ hosts/darkgui-vps/config/pkgs.nix | 28 +++++ .../darkgui-vps/config/self-host/firewall.nix | 31 +++++ .../config/self-host/self-host.nix | 59 +++++++++ hosts/darkgui-vps/configuration.nix | 82 +++++++++++++ hosts/darkgui-vps/disk-config.nix | 32 +++++ hosts/darkgui-vps/hardware-configuration.nix | 28 +++++ hosts/darkgui-vps/vars.nix | 7 ++ 37 files changed, 1630 insertions(+) create mode 100644 .gitignore create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/DE/cosmic.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/DE/gnome.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/DE/impde.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/DE/kde.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/DE/niri/dms.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/DE/niri/niri.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/DE/niri/noctalia.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/DE/niri/thunar.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/Pkgs/imp_pkgs.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/Pkgs/pkgs.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/Pkgs/pkgsconfig.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/configs/cfsystem.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/configs/imp.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/configs/kernel.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/configs/nixhelper.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/configs/nvidia.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/configs/patchs.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/configs/self-host.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/GM/imp.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/HM/configs/cfhome.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/HM/imp.nix create mode 100644 hosts/darkgui-vps/Alfa/conf/HM/pkgs/pkgs.nix create mode 100644 hosts/darkgui-vps/Alfa/configuration.nix create mode 100644 hosts/darkgui-vps/Alfa/hardware-configuration.nix create mode 100644 hosts/darkgui-vps/Alfa/home.nix create mode 100644 hosts/darkgui-vps/config/imp.nix create mode 100644 hosts/darkgui-vps/config/nix-helper.nix create mode 100644 hosts/darkgui-vps/config/pkgs.nix create mode 100644 hosts/darkgui-vps/config/self-host/firewall.nix create mode 100644 hosts/darkgui-vps/config/self-host/self-host.nix create mode 100644 hosts/darkgui-vps/configuration.nix create mode 100644 hosts/darkgui-vps/disk-config.nix create mode 100644 hosts/darkgui-vps/hardware-configuration.nix create mode 100644 hosts/darkgui-vps/vars.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..637cf86 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +./etc/nixos/hosts/darkgui-vps/vars.nix diff --git a/flake.lock b/flake.lock index 25721ab..2919fad 100644 --- a/flake.lock +++ b/flake.lock @@ -52,10 +52,35 @@ "type": "github" } }, +<<<<<<< HEAD "dms": { "inputs": { "flake-compat": "flake-compat_2", "nixpkgs": "nixpkgs_3", +======= + "disko": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1776613567, + "narHash": "sha256-gC9Cp5ibBmGD5awCA9z7xy6MW6iJufhazTYJOiGlCUI=", + "owner": "nix-community", + "repo": "disko", + "rev": "32f4236bfc141ae930b5ba2fb604f561fed5219d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, + "dms": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs": "nixpkgs_4", +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) "quickshell": "quickshell" }, "locked": { @@ -221,7 +246,11 @@ "inputs": { "niri-stable": "niri-stable", "niri-unstable": "niri-unstable", +<<<<<<< HEAD "nixpkgs": "nixpkgs_4", +======= + "nixpkgs": "nixpkgs_5", +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) "nixpkgs-stable": "nixpkgs-stable", "xwayland-satellite-stable": "xwayland-satellite-stable", "xwayland-satellite-unstable": "xwayland-satellite-unstable" @@ -279,7 +308,11 @@ "cachyos-kernel-patches": "cachyos-kernel-patches", "flake-compat": "flake-compat_3", "flake-parts": "flake-parts", +<<<<<<< HEAD "nixpkgs": "nixpkgs_5" +======= + "nixpkgs": "nixpkgs_6" +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) }, "locked": { "lastModified": 1776535646, @@ -391,6 +424,25 @@ }, "nixpkgs_3": { "locked": { +<<<<<<< HEAD +======= + "lastModified": 1773628058, + "narHash": "sha256-hpXH0z3K9xv0fHaje136KY872VT2T5uwxtezlAskQgY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f8573b9c935cfaa162dd62cc9e75ae2db86f85df", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) "lastModified": 1776169885, "narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=", "owner": "nixos", @@ -405,7 +457,11 @@ "type": "github" } }, +<<<<<<< HEAD "nixpkgs_4": { +======= + "nixpkgs_5": { +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) "locked": { "lastModified": 1776169885, "narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=", @@ -421,7 +477,11 @@ "type": "github" } }, +<<<<<<< HEAD "nixpkgs_5": { +======= + "nixpkgs_6": { +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) "locked": { "lastModified": 1776475594, "narHash": "sha256-mxLieVl5lqjd+QUvgHbvpVrvb9d8zox7m+MiRO6FHu8=", @@ -437,7 +497,11 @@ "type": "github" } }, +<<<<<<< HEAD "nixpkgs_6": { +======= + "nixpkgs_7": { +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) "locked": { "lastModified": 1776329215, "narHash": "sha256-a8BYi3mzoJ/AcJP8UldOx8emoPRLeWqALZWu4ZvjPXw=", @@ -453,7 +517,11 @@ "type": "github" } }, +<<<<<<< HEAD "nixpkgs_7": { +======= + "nixpkgs_8": { +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) "locked": { "lastModified": 1776169885, "narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=", @@ -516,7 +584,11 @@ "preload-ng": { "inputs": { "flake-utils": "flake-utils", +<<<<<<< HEAD "nixpkgs": "nixpkgs_7" +======= + "nixpkgs": "nixpkgs_8" +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) }, "locked": { "lastModified": 1768356181, @@ -577,12 +649,20 @@ "root": { "inputs": { "aagl": "aagl", +<<<<<<< HEAD +======= + "disko": "disko", +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) "dms": "dms", "dms-plugin-registry": "dms-plugin-registry", "home-manager": "home-manager", "niri": "niri", "nix-cachyos-kernel": "nix-cachyos-kernel", +<<<<<<< HEAD "nixpkgs": "nixpkgs_6", +======= + "nixpkgs": "nixpkgs_7", +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) "nixpkgs-master": "nixpkgs-master", "nixpkgs-stable": "nixpkgs-stable_2", "noctalia": "noctalia", diff --git a/flake.nix b/flake.nix index 645b7f1..a93799e 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,10 @@ #chaotic.url = "github:lonerOrz/nyx-loner"; nix-cachyos-kernel.url = "github:xddxdd/nix-cachyos-kernel"; aagl.url = "github:ezKEa/aagl-gtk-on-nix"; +<<<<<<< HEAD +======= + disko.url = "github:nix-community/disko"; +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) home-manager = { url = "github:nix-community/home-manager/"; inputs.nixpkgs.follows = "nixpkgs"; @@ -50,6 +54,10 @@ aagl, noctalia, niri, +<<<<<<< HEAD +======= + disko, +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) ... }@inputs: { @@ -81,7 +89,11 @@ system = "aarch64-linux"; specialArgs = { inherit inputs; }; modules = [ +<<<<<<< HEAD #./configuration.nix +======= + ./hosts/darkgui-vps/configuration.nix +>>>>>>> d196fd5 (Adicionado a configuraçao da VPS) ]; }; diff --git a/hosts/darkgui-vps/Alfa/conf/GM/DE/cosmic.nix b/hosts/darkgui-vps/Alfa/conf/GM/DE/cosmic.nix new file mode 100644 index 0000000..f1a927c --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/DE/cosmic.nix @@ -0,0 +1,46 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + services = { + displayManager.cosmic-greeter.enable = true; + desktopManager.cosmic.enable = true; + desktopManager.cosmic.xwayland.enable = true; + desktopManager.cosmic.showExcludedPkgsWarning = false; + system76-scheduler.enable = true; + }; + + environment.sessionVariables.COSMIC_DATA_CONTROL_ENABLED = 1; + environment.systemPackages = with pkgs; [ + gnome-disk-utility + ]; + environment.cosmic.excludePackages = with pkgs; [ + cosmic-files + cosmic-term + cosmic-player + cosmic-screenshot + ]; + programs.kdeconnect = { + enable = true; + }; + + xdg.portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-cosmic ]; + config.common.default = "*"; + }; + + programs.firefox.preferences = { + # disable libadwaita theming for Firefox + "widget.gtk.libadwaita-colors.enabled" = false; + }; + + imports = [ + ./thunar.nix + ]; +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/DE/gnome.nix b/hosts/darkgui-vps/Alfa/conf/GM/DE/gnome.nix new file mode 100644 index 0000000..7d3fc68 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/DE/gnome.nix @@ -0,0 +1,56 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + services = { + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + # Para desabilitar a instalação do conjunto de aplicativos do GNOME e ficar apenas com o shell do GNOME. + gnome.core-apps.enable = false; + gnome.core-developer-tools.enable = false; + gnome.games.enable = false; + udev.packages = [ pkgs.gnome-settings-daemon ]; + }; + + environment.systemPackages = with pkgs; [ + gnomeExtensions.blur-my-shell + gnomeExtensions.dash-to-dock + gnomeExtensions.just-perfection + gnomeExtensions.arc-menu + gnomeExtensions.appindicator + gnomeExtensions.valent + gnomeExtensions.forge + gnomeExtensions.clipboard-indicator + gnomeExtensions.media-controls + gnomeExtensions.sound-output-device-chooser + gnomeExtensions.quick-settings-audio-panel + xdg-desktop-portal-gnome + valent + gnome-tweaks + gnome-shell + gnome-extension-manager + refine + alacarte + dconf + ]; + environment.gnome.excludePackages = with pkgs; [ + gnome-tour + gnome-user-docs + ]; + + qt = { + enable = true; + platformTheme = "gnome"; + style = "adwaita-dark"; + }; + + programs.kdeconnect = { + enable = true; + package = pkgs.valent; + }; +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/DE/impde.nix b/hosts/darkgui-vps/Alfa/conf/GM/DE/impde.nix new file mode 100644 index 0000000..95e1f89 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/DE/impde.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + imports = [ + #./cosmic.nix + #./gnome.nix + #./kde.nix + ./niri/niri.nix + + ]; + +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/DE/kde.nix b/hosts/darkgui-vps/Alfa/conf/GM/DE/kde.nix new file mode 100644 index 0000000..0f68456 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/DE/kde.nix @@ -0,0 +1,43 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + ## Ativar ambiente gráfico KDE Plasma 6 e gerenciador de login + services = { + desktopManager.plasma6.enable = true; + }; + services.displayManager.plasma-login-manager = { + enable = true; + }; + + programs.kdeconnect.enable = true; + + environment.systemPackages = with pkgs; [ + kdePackages.partitionmanager + kdePackages.filelight + kdePackages.qtmultimedia + kdePackages.kcalc + kdePackages.sddm-kcm + kdePackages.wallpaper-engine-plugin + kdePackages.krdp + kdePackages.accounts-qt + ]; + + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + plasma-browser-integration + # konsole + elisa + ]; + + xdg.portal = { + enable = true; + extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde ]; + config.common.default = "*"; + }; + +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/dms.nix b/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/dms.nix new file mode 100644 index 0000000..8ee3829 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/dms.nix @@ -0,0 +1,41 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + programs.dms-shell = { + enable = true; + package = inputs.dms.packages.${pkgs.stdenv.hostPlatform.system}.default; + #quickshell.package = inputs.quickshell.packages.${pkgs.stdenv.hostPlatform.system}.quickshell; + + systemd = { + enable = true; # Systemd service for auto-start + restartIfChanged = true; # Auto-restart dms.service when dms-shell changes + }; + + plugins = { + dankBitwarden.enable = true; + dankKDEConnect.enable = true; + linuxWallpaperEngine.enable = true; + nvidiaGpuMonitor.enable = true; + }; + + # Core features + enableSystemMonitoring = true; # System monitoring widgets (dgop) + enableVPN = true; # VPN management widget + enableDynamicTheming = true; # Wallpaper-based theming (matugen) + enableAudioWavelength = true; # Audio visualizer (cava) + enableCalendarEvents = false; # Calendar integration (khal) + }; + + imports = [ + inputs.dms.nixosModules.dank-material-shell + inputs.dms-plugin-registry.modules.default + inputs.dms.nixosModules.greeter + ]; + +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/niri.nix b/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/niri.nix new file mode 100644 index 0000000..6592262 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/niri.nix @@ -0,0 +1,88 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + nixpkgs.overlays = [ inputs.niri.overlays.niri ]; + programs.niri = { + enable = true; + package = pkgs.niri-unstable; + }; + + imports = [ + ./thunar.nix + ./dms.nix + #./noctalia.nix + ]; + + services.dbus.enable = true; + security.polkit.enable = true; + systemd.user.services.niri-flake-polkit.enable = false; + programs.xwayland.enable = true; + programs.kdeconnect.enable = true; + + services = { + greetd = + let + session = { + #command = "${pkgs.hyprland}/bin/Hyprland"; + command = "${pkgs.niri}/bin/niri-session"; + user = "gui"; + }; + in + { + enable = true; + settings = { + terminal.vt = 1; + default_session = session; + initial_session = session; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + dgop + ]; + + #systemd.user.services.polkit-gnome-authentication-agent-1 = { + #description = "polkit-gnome-authentication-agent-1"; + #wantedBy = [ "graphical-session.target" ]; + #after = [ "graphical-session.target" ]; + #serviceConfig = { + # Type = "simple"; + # ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + # Restart = "on-failure"; + # RestartSec = 1; + # TimeoutStopSec = 10; + #}; + #}; + + #xdg.portal = { + # enable = true; + # config = { + # niri."org.freedesktop.impl.portal.FileChooser" = "gtk"; + # niri.default = "gnome"; + # common.default = "gnome"; + # obs.default = "gnome"; + # }; + # extraPortals = with pkgs; [ + # xdg-desktop-portal-gnome + # xdg-desktop-portal-gtk + # ]; + #}; + + #xdg.portal = { + # enable = true; + # extraPortals = [ + # pkgs.xdg-desktop-portal-gnome + # pkgs.xdg-desktop-portal-gtk + # pkgs.xdg-desktop-portal-wlr + # ]; + # config.common.default = "*1"; + #}; + +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/noctalia.nix b/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/noctalia.nix new file mode 100644 index 0000000..5d86b9c --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/noctalia.nix @@ -0,0 +1,13 @@ +{ pkgs, inputs, ... }: +{ + environment.systemPackages = with pkgs; [ + inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; + + nix.settings = { + extra-substituters = [ "https://noctalia.cachix.org" ]; + extra-trusted-public-keys = [ + "noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4=" + ]; + }; +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/thunar.nix b/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/thunar.nix new file mode 100644 index 0000000..ad4cee9 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/DE/niri/thunar.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + programs.xfconf.enable = true; + + programs.thunar = { + enable = true; + + plugins = with pkgs; [ + thunar-archive-plugin + thunar-vcs-plugin + thunar-volman + ]; + }; + + services = { + gvfs.enable = true; + tumbler.enable = true; + }; + +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/Pkgs/imp_pkgs.nix b/hosts/darkgui-vps/Alfa/conf/GM/Pkgs/imp_pkgs.nix new file mode 100644 index 0000000..46815f6 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/Pkgs/imp_pkgs.nix @@ -0,0 +1,14 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + imports = [ + ./pkgsconfig.nix + ./pkgs.nix + ]; +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/Pkgs/pkgs.nix b/hosts/darkgui-vps/Alfa/conf/GM/Pkgs/pkgs.nix new file mode 100644 index 0000000..64869cd --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/Pkgs/pkgs.nix @@ -0,0 +1,74 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + ## Permitir pacotes não-livres + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + ## Aplicativos sociais + bitwarden-desktop + sunshine + tailscale + + ## inputs + inputs.zen-browser.packages.${stdenv.hostPlatform.system}.default + inputs.shiru.packages.${pkgs.stdenv.hostPlatform.system}.default + + ## Utilitários do sistema e dev tools + nh + home-manager + vulkan-tools + vulkan-loader + vulkan-utility-libraries + gcc + ethtool + efibootmgr + docker-compose + distroshelf + distrobox + freerdp + dmidecode + i2c-tools + gitFull + kdePackages.partitionmanager + usbutils + openrgb + winetricks + #wineWowPackages.staging + wine + haguichi + logmein-hamachi + zerotierone + kdePackages.ark + loupe + lazygit + gnumake + onlyoffice-desktopeditors + adwaita-qt + adwaita-qt6 + winboat + xwayland-satellite + linux-wallpaperengine + #kdePackages.polkit-qt-1 + kdePackages.krdp + cloudflared + + ## inputs stable + #inputs.nixpkgs-stable.legacyPackages.${pkgs.stdenv.hostPlatform.system} + ]; + + programs.gpu-screen-recorder.enable = true; + services.logmein-hamachi.enable = true; + programs.haguichi.enable = true; + + nixpkgs.config.permittedInsecurePackages = [ + "electron-38.8.4" + ]; + +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/Pkgs/pkgsconfig.nix b/hosts/darkgui-vps/Alfa/conf/GM/Pkgs/pkgsconfig.nix new file mode 100644 index 0000000..ac66a16 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/Pkgs/pkgsconfig.nix @@ -0,0 +1,74 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + ## configuraçao da steam + programs = { + steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; + gamescope.enable = true; + gamemode.enable = true; + }; + + ## Configuraçoes do obs + + #programs.obs-studio = { + # enable = true; + # #optional Nvidia hardware acceleration + # package = ( + # pkgs.obs-studio.override { + # cudaSupport = true; + # } + # ); + # plugins = with pkgs.obs-studio-plugins; [ + # wlrobs + # obs-pipewire-audio-capture + # obs-gstreamer + # obs-vkcapture + # ]; + # #enableVirtualCamera = true; + #}; + + ## Configuraçoes do LACT + environment.systemPackages = with pkgs; [ lact ]; + systemd.services.lact = { + description = "GPU Control Daemon"; + after = [ "multi-user.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = "${pkgs.lact}/bin/lact daemon"; + }; + enable = true; + }; + + ## Fontes + fonts.fontDir.enable = true; + fonts.fontconfig.enable = true; + fonts.packages = with pkgs; [ + nerd-fonts.jetbrains-mono + nerd-fonts.ubuntu-mono + nerd-fonts.ubuntu-sans + nerd-fonts.dejavu-sans-mono + nerd-fonts.fira-code + nerd-fonts.overpass + noto-fonts + liberation_ttf + dejavu_fonts + ]; + + ## OpenRGB + services.hardware.openrgb = { + enable = true; + motherboard = "amd"; + package = pkgs.openrgb-with-all-plugins; # enable all plugins + }; +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/configs/cfsystem.nix b/hosts/darkgui-vps/Alfa/conf/GM/configs/cfsystem.nix new file mode 100644 index 0000000..bac4c4a --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/configs/cfsystem.nix @@ -0,0 +1,79 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + ## Configuração da internet + networking = { + networkmanager.enable = true; + interfaces.enp9s0.wakeOnLan.enable = true; + firewall.allowedTCPPorts = [ 22 ]; + firewall.allowedUDPPorts = [ + ]; + }; + ## Ativar Bluetooth + hardware.bluetooth.enable = true; + + ## Configuração de áudio + services = { + pulseaudio.enable = false; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + #jack.enable = true; # Descomente se usar aplicações JACK + }; + }; + security.rtkit.enable = true; + + ## Configuraçao de idioma + + ## Definir fuso horário + time.timeZone = "America/Bahia"; + + ## Configurações de idioma e localidade + i18n = { + defaultLocale = "pt_BR.UTF-8"; + 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"; + + ## Alias do fish + 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"; + gitupdate = "git add . && git commit && git push origin main"; + }; + + ## Config do fish + programs.fish.enable = true; + 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/hosts/darkgui-vps/Alfa/conf/GM/configs/imp.nix b/hosts/darkgui-vps/Alfa/conf/GM/configs/imp.nix new file mode 100644 index 0000000..701828c --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/configs/imp.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + imports = [ + ./cfsystem.nix + ./nixhelper.nix + ./nvidia.nix + ./patchs.nix + ./self-host.nix + ./kernel.nix + ]; +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/configs/kernel.nix b/hosts/darkgui-vps/Alfa/conf/GM/configs/kernel.nix new file mode 100644 index 0000000..c2e2a76 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/configs/kernel.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + boot.kernelPackages = + let + customKernel = + inputs.nix-cachyos-kernel.legacyPackages.x86_64-linux.linuxPackages-cachyos-latest.kernel.override + { + processorOpt = "native"; + + lto = "thin"; + + scheduler = "bore"; + + }; + in + pkgs.linuxPackagesFor customKernel; + +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/configs/nixhelper.nix b/hosts/darkgui-vps/Alfa/conf/GM/configs/nixhelper.nix new file mode 100644 index 0000000..218dfa6 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/configs/nixhelper.nix @@ -0,0 +1,62 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + programs = { + ## nix-ld + nix-ld = { + enable = true; + libraries = with pkgs; [ ]; + }; + ## nh + nh = { + enable = true; + clean.enable = true; + clean.extraArgs = "--keep-since 8d --keep 7"; + flake = "/etc/nixos"; # sets NH_OS_FLAKE variable for you + }; + ## appimage + appimage = { + enable = true; + binfmt = true; + }; + ## Cache + ccache.enable = true; + ccache.cacheDir = "/var/cache/ccache"; + }; + + nix = { + settings = { + cores = 0; + max-jobs = "auto"; + auto-optimise-store = true; + extra-sandbox-paths = [ "/var/cache/ccache" ]; + }; + + ## Lix + package = pkgs.lixPackageSets.latest.lix; + + ## ativaçao do flakes + settings.experimental-features = [ + "nix-command" + "flakes" + ]; + nixPath = lib.mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry; + registry = lib.mapAttrs (_: value: { flake = value; }) ( + lib.filterAttrs (_: value: lib.isType "flake" value) inputs + ); + settings.flake-registry = ""; + }; + + services = { + flatpak = { + enable = true; + }; + }; + +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/configs/nvidia.nix b/hosts/darkgui-vps/Alfa/conf/GM/configs/nvidia.nix new file mode 100644 index 0000000..93da9c6 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/configs/nvidia.nix @@ -0,0 +1,34 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + ## Driver da nvidia proprietario + + services.xserver.videoDrivers = [ "nvidia" ]; + hardware = { + graphics.enable = true; + nvidia.open = false; # # Se sua placa for pascal pra cima troque isso para true + nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_580; + }; + + ## Teste sobre o nvk nao recomendo usar + + #services.xserver.videoDrivers = [ "nouveau" ]; + #hardware.graphics = { + # enable = true; + # extraPackages = with pkgs; [ + # mesa + # ]; + #}; + + #hardware.enableRedistributableFirmware = true; + #environment.variables = { + # MESA_VK_DRIVER_OVERRIDE = "nvk"; + # VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/nouveau_icd.x86_64.json"; + #}; +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/configs/patchs.nix b/hosts/darkgui-vps/Alfa/conf/GM/configs/patchs.nix new file mode 100644 index 0000000..4838fb5 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/configs/patchs.nix @@ -0,0 +1,114 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + ## Variaveis de ambiente contendo o aumento de cache para placas da nvidia + environment.variables = { + __GL_SHADER_DISK_CACHE_SIZE = "12000000000"; + VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d"; + }; + + ## Configuraçoes de boot para otimzar o kernel e alguns patchs para nvidia + boot = { + modprobeConfig.enable = true; + kernelModules = [ "tcp_bbr" ]; + extraModprobeConfig = "options nvidia NVreg_UsePageAttributeTable=1 \ + NVreg_InitializeSystemMemoryAllocations=0 \ + NVreg_DynamicPowerManagement=0x02"; + kernel.sysctl = { + "kernel.split_lock_mitigate" = 0; + "kernel.nmi_watchdog" = 0; + "net.core.netdev_max_backlog" = 4096; + "fs.file-max" = 2097152; + "net.ipv4.tcp_congestion_control" = "bbr"; + }; + }; + + services = { + + earlyoom = { + enable = true; + freeSwapThreshold = 2; + freeMemThreshold = 2; + extraArgs = [ + "-g" + "--avoid" + "'^(X|plasma.*|konsole|kwin|wayland|gnome.*)$'" + ]; + }; + + ## Otimizaçao do Udev para placas de Video da Nvidia + udev = { + enable = true; + extraRules = '' + # Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind + ACTION=="add|bind", SUBSYSTEM=="pci", DRIVERS=="nvidia", \ + ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", \ + TEST=="power/control", ATTR{power/control}="auto" + + # Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind + ACTION=="remove|unbind", SUBSYSTEM=="pci", DRIVERS=="nvidia", \ + ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", \ + TEST=="power/control", ATTR{power/control}="on" + + # enable udev xiaomi + SUBSYSTEM=="usb", ATTR{idVendor}=="2717", MODE="0666", GROUP="plugdev" + ''; + }; + + preload-ng = { + enable = true; + settings = { + cycle = 15; + memTotal = -5; + memFree = 70; + memCached = 10; + memBuffers = 50; + minSize = 1000000; + processes = 60; + sortStrategy = 0; + autoSave = 1800; + mapPrefix = "/nix/store/;/run/current-system/;!/"; + exePrefix = "/nix/store/;/run/current-system/;!/"; + }; + }; + }; + + systemd.services.set-min-free-mem = { + description = "Set vm.min_free_kbytes dynamically"; + wantedBy = [ "multi-user.target" ]; + after = [ "local-fs.target" ]; + serviceConfig = { + User = "root"; + RemainAfterExit = true; + }; + script = '' + TOTAL_MEM=$(${pkgs.gawk}/bin/awk '/MemTotal/ {printf "%.0f", $2 * 0.01}' /proc/meminfo) + if [ -z "$TOTAL_MEM" ] || [ "$TOTAL_MEM" -eq 0 ]; then + echo "Failed to calculate memory size" >&2 + exit 1 + fi + ${pkgs.sysctl}/bin/sysctl -w vm.min_free_kbytes=$TOTAL_MEM + ''; + }; + + ## sistema de compressao compressao brtfs + fileSystems = { + "/" = { + options = [ "compress=zstd:3" ]; + }; + }; + + ## confiuraçao da zram + zramSwap = { + enable = true; + memoryPercent = 40; + algorithm = "zstd"; + }; + +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/configs/self-host.nix b/hosts/darkgui-vps/Alfa/conf/GM/configs/self-host.nix new file mode 100644 index 0000000..1a03566 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/configs/self-host.nix @@ -0,0 +1,71 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + ## tailscale + services.tailscale = { + enable = true; + extraUpFlags = [ + "--exit-node-allow-lan-access=true" + "--ssh" + "--accept-dns=true" + ]; + }; + networking.nftables.enable = true; + networking.firewall = { + enable = true; + allowedTCPPorts = [ + 47984 + 47989 + 48910 + ]; + allowedUDPPortRanges = [ + { + from = 47998; + to = 48000; + } + { + from = 48002; + to = 48010; + } + ]; + trustedInterfaces = [ "tailscale0" ]; + allowedUDPPorts = [ config.services.tailscale.port ]; + }; + + ## Configuraçao de Docker + + boot.kernel.sysctl = { + "net.ipv4.ip_unprivileged_port_start" = 53; + "net.ipv6.conf.all.forwarding" = true; + }; + + users.users.gui.extraGroups = [ "docker" ]; + users.groups.docker.gid = 131; + virtualisation.docker = { + enable = true; + + #rootless = { + # enable = true; + # setSocketVariable = true; + #}; + }; + + services.openssh = { + enable = true; + }; + + services.sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + + }; + +} diff --git a/hosts/darkgui-vps/Alfa/conf/GM/imp.nix b/hosts/darkgui-vps/Alfa/conf/GM/imp.nix new file mode 100644 index 0000000..dcf9c4b --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/GM/imp.nix @@ -0,0 +1,8 @@ +{ config, lib, inputs, pkgs, ... }: { + + imports = [ + ./configs/imp.nix + ./DE/impde.nix + ./Pkgs/imp_pkgs.nix + ]; +} diff --git a/hosts/darkgui-vps/Alfa/conf/HM/configs/cfhome.nix b/hosts/darkgui-vps/Alfa/conf/HM/configs/cfhome.nix new file mode 100644 index 0000000..ce12d04 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/HM/configs/cfhome.nix @@ -0,0 +1,49 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + ## starship + programs.starship = { + enable = true; + settings = lib.importTOML "${config.programs.starship.package}/share/starship/presets/nerd-font-symbols.toml"; + enableFishIntegration = true; + }; + + ## Configuraçao Git + programs.git.settings = { + enable = true; + user.email = "darkgui@protonmail.com"; + user.name = "DarkGui"; + credential.helper = "store"; + }; + + ## Pacotes extras + fonts.fontconfig.enable = true; + home.packages = with pkgs; [ + + ## Fish + fishPlugins.done + fishPlugins.fzf-fish + fishPlugins.forgit + fishPlugins.hydro + fzf + fishPlugins.grc + grc + + ## Fontes + nerd-fonts.jetbrains-mono + nerd-fonts.ubuntu-mono + nerd-fonts.ubuntu-sans + nerd-fonts.dejavu-sans-mono + nerd-fonts.fira-code + nerd-fonts.overpass + noto-fonts + liberation_ttf + dejavu_fonts + ]; +} diff --git a/hosts/darkgui-vps/Alfa/conf/HM/imp.nix b/hosts/darkgui-vps/Alfa/conf/HM/imp.nix new file mode 100644 index 0000000..bd14104 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/HM/imp.nix @@ -0,0 +1,14 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + imports = [ + ./configs/cfhome.nix + ./pkgs/pkgs.nix + ]; +} diff --git a/hosts/darkgui-vps/Alfa/conf/HM/pkgs/pkgs.nix b/hosts/darkgui-vps/Alfa/conf/HM/pkgs/pkgs.nix new file mode 100644 index 0000000..bbe72ae --- /dev/null +++ b/hosts/darkgui-vps/Alfa/conf/HM/pkgs/pkgs.nix @@ -0,0 +1,75 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + ## pacotes home-manager + home.packages = with pkgs; [ + + ## aplicativos sociais + telegram-desktop + pear-desktop + teams-for-linux + #(discord.override {withVencord = true;}) + (discord.override { withEquicord = true; }) + jellyfin-desktop + + ## Jogos + lutris + faugus-launcher + heroic + prismlauncher + steam + adwsteamgtk + ryubing + xclicker + #mangojuice + goverlay + mangohud + protonplus + hydralauncher + lsfg-vk + lsfg-vk-ui + android-tools + zed-editor + nil + nixd + + ## Utilitários do sistema e dev tools + fastfetch + flameshot + #handbrake + easyeffects + qbittorrent + cpu-x + git + btop-cuda + vscodium + flatpak + wget + kitty + vlc + tree + python314 + unrar + droidcam + motrix + mission-center + nodejs + lxappearance + nwg-look + #rustdesk + anydesk + libargon2 + openssl_oqs + icu + + ## Dev + godot + + ]; + +} diff --git a/hosts/darkgui-vps/Alfa/configuration.nix b/hosts/darkgui-vps/Alfa/configuration.nix new file mode 100644 index 0000000..10b4a3e --- /dev/null +++ b/hosts/darkgui-vps/Alfa/configuration.nix @@ -0,0 +1,71 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + imports = [ + # Importa a configuração de hardware detectada + ./hardware-configuration.nix + ./conf/GM/imp.nix + ]; + + ## Configuração do bootloader + boot = { + #kernelPackages = pkgs.linuxPackages_latest; + #kernelPackages = pkgs.linuxPackages_cachyos; + #kernelPackages = inputs.nix-cachyos-kernel.legacyPackages.x86_64-linux.linuxPackages-cachyos-latest-lto-x86_64-v3; + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + loader.systemd-boot.configurationLimit = 10; + }; + + networking.hostName = "Alfa"; # Defina o nome da sua máquina + + services = { + xserver.enable = false; # Ativar sistema gráfico X11 + printing.enable = false; + }; + + ## Definição do usuário normal + users.users.gui = { + isNormalUser = true; + description = "Gui"; + extraGroups = [ + "networkmanager" + "wheel" + ]; + packages = with pkgs; [ ]; + }; + + ## sudo-rs + security = { + sudo.enable = false; + sudo-rs = { + enable = true; + execWheelOnly = true; + wheelNeedsPassword = true; + }; + }; + + system.stateVersion = "25.11"; # versao do nix + + networking = { + networkmanager.enable = true; + interfaces.enp9s0.wakeOnLan.enable = true; + firewall.allowedTCPPorts = [ ]; + firewall.allowedUDPPorts = [ + ]; + }; + services = { + displayManager.autoLogin.enable = true; + displayManager.autoLogin.user = "gui"; + }; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; +} diff --git a/hosts/darkgui-vps/Alfa/hardware-configuration.nix b/hosts/darkgui-vps/Alfa/hardware-configuration.nix new file mode 100644 index 0000000..4186cdc --- /dev/null +++ b/hosts/darkgui-vps/Alfa/hardware-configuration.nix @@ -0,0 +1,53 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/adaa7917-2996-4cf5-9664-4832b1fc200b"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/C5F0-5261"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-uuid/f82f33f6-2446-47b7-a612-e3ef776919bd"; + fsType = "xfs"; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/darkgui-vps/Alfa/home.nix b/hosts/darkgui-vps/Alfa/home.nix new file mode 100644 index 0000000..0086ad8 --- /dev/null +++ b/hosts/darkgui-vps/Alfa/home.nix @@ -0,0 +1,61 @@ +{ + pkgs, + config, + lib, + ... +}: +{ + + imports = [ + ./conf/HM/imp.nix + ]; + + home = { + username = "gui"; + homeDirectory = "/home/gui"; + stateVersion = "25.11"; + }; + + programs = { + home-manager.enable = true; + fish.enable = true; + }; + + nixpkgs.config.allowUnfree = true; + + mods = { + kitty.enable = true; + flakePath = "/self"; + }; + + gtk = { + enable = true; + theme = { + name = "Adwaita-dark"; + package = pkgs.gnome-themes-extra; + }; + cursorTheme = { + name = "Adwaita"; + # package = pkgs.Adwaita-awcursors; + }; + gtk3.extraConfig = { + gtk-application-prefer-dark-theme = 1; + "gtk-cursor-theme-name" = "Adwaita"; + }; + gtk4.extraConfig = { + gtk-application-prefer-dark-theme = 1; + Settings = "gtk-cursor-theme-name=Adwaita"; + }; + }; + + qt = { + enable = true; + style = { + name = "adwaita-dark"; + }; + }; + + xdg.configFile."gtk-3.0/settings.ini".force = true; + xdg.configFile."gtk-4.0/settings.ini".force = true; + +} diff --git a/hosts/darkgui-vps/config/imp.nix b/hosts/darkgui-vps/config/imp.nix new file mode 100644 index 0000000..3847202 --- /dev/null +++ b/hosts/darkgui-vps/config/imp.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + imports = [ + ./pkgs.nix + ./nix-helper.nix + ./self-host/self-host.nix + ./self-host/firewall.nix + ]; +} diff --git a/hosts/darkgui-vps/config/nix-helper.nix b/hosts/darkgui-vps/config/nix-helper.nix new file mode 100644 index 0000000..32135cf --- /dev/null +++ b/hosts/darkgui-vps/config/nix-helper.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + programs = { + ## nh + nh = { + enable = true; + clean.enable = true; + clean.extraArgs = "--keep-since 8d --keep 7"; + flake = "/etc/nixos"; # sets NH_OS_FLAKE variable for you + }; + nix-ld = { + enable = true; + libraries = with pkgs; [ ]; + }; + }; + + nix.package = pkgs.lixPackageSets.stable.lix; + +} diff --git a/hosts/darkgui-vps/config/pkgs.nix b/hosts/darkgui-vps/config/pkgs.nix new file mode 100644 index 0000000..a0c5bd6 --- /dev/null +++ b/hosts/darkgui-vps/config/pkgs.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + environment.systemPackages = with pkgs; [ + curl + git + vim + wget + screen + fish + btop + fastfetch + gitFull + unrar + unzip + + ## Zed + nixd + nil + ]; + +} diff --git a/hosts/darkgui-vps/config/self-host/firewall.nix b/hosts/darkgui-vps/config/self-host/firewall.nix new file mode 100644 index 0000000..6368c7b --- /dev/null +++ b/hosts/darkgui-vps/config/self-host/firewall.nix @@ -0,0 +1,31 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + # Open ports in the firewall. + networking.firewall = { + enable = false; + allowedTCPPorts = [ + 80 + 443 + ]; + allowedUDPPortRanges = [ + { + from = 47998; + to = 48000; + } + { + from = 48002; + to = 48010; + } + ]; + trustedInterfaces = [ "tailscale0" ]; + allowedUDPPorts = [ config.services.tailscale.port ]; + }; + +} diff --git a/hosts/darkgui-vps/config/self-host/self-host.nix b/hosts/darkgui-vps/config/self-host/self-host.nix new file mode 100644 index 0000000..24c3963 --- /dev/null +++ b/hosts/darkgui-vps/config/self-host/self-host.nix @@ -0,0 +1,59 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +{ + + # Enable the OpenSSH daemon. + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; + + # Open ports in the firewall. + networking.firewall = { + enable = false; + allowedTCPPorts = [ + 80 + 443 + ]; + allowedUDPPortRanges = [ + { + from = 47998; + to = 48000; + } + { + from = 48002; + to = 48010; + } + ]; + trustedInterfaces = [ "tailscale0" ]; + allowedUDPPorts = [ config.services.tailscale.port ]; + }; + + boot.kernel.sysctl = { + "net.ipv4.ip_unprivileged_port_start" = 53; + "net.ipv6.conf.all.forwarding" = true; + }; + + users.groups.docker.gid = 131; + virtualisation.docker = { + enable = true; + }; + + services.tailscale = { + enable = true; + extraUpFlags = [ + "--ssh" + "--accept-dns=true" + "--advertise-exit-node" + ]; + }; + +} diff --git a/hosts/darkgui-vps/configuration.nix b/hosts/darkgui-vps/configuration.nix new file mode 100644 index 0000000..6c258a2 --- /dev/null +++ b/hosts/darkgui-vps/configuration.nix @@ -0,0 +1,82 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: +let + vars = import ./vars.nix; +in +{ + imports = [ + ./hardware-configuration.nix + inputs.disko.nixosModules.disko + ./disk-config.nix + ./config/imp.nix + ]; + + boot = { + loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + }; + initrd.systemd.enable = true; + }; + + systemd.targets.multi-user.enable = true; + + networking.hostName = vars.hostname; + networking.networkmanager.enable = true; + + time.timeZone = vars.timezone; + i18n.defaultLocale = vars.locale; + + users = { + mutableUsers = false; + users.${vars.username} = { + isNormalUser = true; + extraGroups = [ + "networkmanager" + "wheel" + "docker" + ]; + openssh.authorizedKeys.keys = [ vars.sshKey ]; + }; + }; + + # Enable passwordless sudo. + security.sudo.extraRules = [ + { + users = [ vars.username ]; + commands = [ + { + command = "ALL"; + options = [ "NOPASSWD" ]; + } + ]; + } + ]; + + ## Config do fish + programs.fish.enable = true; + 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 ''; + }; + + services.getty.autologinUser = null; + nixpkgs.config.allowUnfree = true; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + system.stateVersion = "25.11"; # Did you read the comment? +} diff --git a/hosts/darkgui-vps/disk-config.nix b/hosts/darkgui-vps/disk-config.nix new file mode 100644 index 0000000..39599f4 --- /dev/null +++ b/hosts/darkgui-vps/disk-config.nix @@ -0,0 +1,32 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/darkgui-vps/hardware-configuration.nix b/hosts/darkgui-vps/hardware-configuration.nix new file mode 100644 index 0000000..bddf5a4 --- /dev/null +++ b/hosts/darkgui-vps/hardware-configuration.nix @@ -0,0 +1,28 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "virtio_pci" + "virtio_scsi" + "usbhid" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} diff --git a/hosts/darkgui-vps/vars.nix b/hosts/darkgui-vps/vars.nix new file mode 100644 index 0000000..b14591f --- /dev/null +++ b/hosts/darkgui-vps/vars.nix @@ -0,0 +1,7 @@ +{ + hostname = "darkgui-vps"; # Replace with your desired hostname. + username = "nixos"; # Replace with your desired username. + sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHr63aXlTSmorypxb689ApdqjEmyTKJbLtelYsvQpBdu darkgui@protonmail.com"; # Replace with your SSH public key. + locale = "pt_BR.UTF-8"; + timezone = "America/Bahia"; +}