mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-07-06 16:12:33 +02:00
It's moving
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
rocmPackages.clr.icd
|
||||
# Support VA-API pour AMD
|
||||
libvdpau-va-gl
|
||||
libva-vdpau-driver
|
||||
];
|
||||
|
||||
+1
-13
@@ -1,23 +1,11 @@
|
||||
# Audio configuration for NixOS using PipeWire
|
||||
{
|
||||
security.rtkit.enable = true;
|
||||
services.pulseaudio.enable = false;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
wireplumber = {
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
"10-disable-camera" = {
|
||||
"wireplumber.profiles" = {
|
||||
main."monitor.libcamera" = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
security.rtkit.enable = true;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
pkgs-nur-hadi = inputs.nur-anotherhadi.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
+3
-8
@@ -1,14 +1,9 @@
|
||||
# Hyprland is a dynamic tiling Wayland compositor.
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
{...}: {
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
package = inputs.hyprland.packages."${pkgs.stdenv.hostPlatform.system}".hyprland;
|
||||
portalPackage =
|
||||
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||
};
|
||||
|
||||
security.pam.services.hyprlock = {};
|
||||
}
|
||||
|
||||
@@ -6,22 +6,6 @@
|
||||
}: let
|
||||
autoGarbageCollector = config.var.autoGarbageCollector;
|
||||
in {
|
||||
# Ask for password once per SSH session (tied to the tty, expires when session closes)
|
||||
security.sudo.extraConfig = ''
|
||||
Defaults timestamp_type=tty,timestamp_timeout=-1
|
||||
'';
|
||||
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = [config.var.username];
|
||||
commands = [
|
||||
{
|
||||
command = "/run/current-system/sw/bin/nixos-rebuild";
|
||||
options = ["NOPASSWD"];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
nixpkgs.config = {
|
||||
allowUnfree = true;
|
||||
allowBroken = false;
|
||||
@@ -40,17 +24,10 @@ in {
|
||||
"flakes"
|
||||
];
|
||||
substituters = [
|
||||
# high priority since it's almost always used
|
||||
"https://cache.nixos.org?priority=10"
|
||||
|
||||
"https://hyprland.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://numtide.cachix.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
|
||||
];
|
||||
};
|
||||
gc = {
|
||||
|
||||
+21
-45
@@ -5,67 +5,49 @@
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
# Using beta driver for recent GPUs like RTX 4070
|
||||
nvidiaDriverChannel = config.boot.kernelPackages.nvidiaPackages.production;
|
||||
in {
|
||||
# Video drivers configuration for Xorg and Wayland
|
||||
services.xserver.videoDrivers = ["nvidia"]; # Simplified - other modules are loaded automatically
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
# Kernel parameters for better Wayland and Hyprland integration
|
||||
boot.kernelParams = [
|
||||
"nvidia-drm.modeset=1" # Enable mode setting for Wayland
|
||||
"nvidia.NVreg_PreserveVideoMemoryAllocations=1" # Improves resume after sleep
|
||||
];
|
||||
|
||||
# Blacklist nouveau to avoid conflicts
|
||||
boot.blacklistedKernelModules = ["nouveau"];
|
||||
|
||||
# Environment variables for better compatibility
|
||||
environment.variables = {
|
||||
LIBVA_DRIVER_NAME = "nvidia"; # Hardware video acceleration
|
||||
GBM_BACKEND = "nvidia-drm"; # Graphics backend for Wayland
|
||||
__GLX_VENDOR_LIBRARY_NAME = "nvidia"; # Use Nvidia driver for GLX
|
||||
NIXOS_OZONE_WL = "1"; # Wayland support for Electron apps
|
||||
__GL_GSYNC_ALLOWED = "1"; # Enable G-Sync if available
|
||||
__GL_VRR_ALLOWED = "1"; # Enable VRR (Variable Refresh Rate)
|
||||
NVD_BACKEND = "direct"; # Configuration for new driver
|
||||
MOZ_ENABLE_WAYLAND = "1"; # Wayland support for Firefox
|
||||
LIBVA_DRIVER_NAME = "nvidia";
|
||||
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
__GL_GSYNC_ALLOWED = "1";
|
||||
__GL_VRR_ALLOWED = "1";
|
||||
NVD_BACKEND = "direct";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
};
|
||||
|
||||
# Configuration for proprietary packages
|
||||
nixpkgs.config = {
|
||||
nvidia.acceptLicense = true;
|
||||
};
|
||||
nixpkgs.config.nvidia.acceptLicense = true;
|
||||
|
||||
# Nvidia configuration
|
||||
hardware = {
|
||||
nvidia = {
|
||||
open = false; # Proprietary driver for better performance
|
||||
nvidiaSettings = true; # Nvidia settings utility
|
||||
open = true; # Open kernel modules, recommended for Turing and newer (RTX 4070 = Ada Lovelace)
|
||||
nvidiaSettings = true;
|
||||
powerManagement = {
|
||||
enable = true; # Power management
|
||||
finegrained = true; # More precise power consumption control
|
||||
enable = true;
|
||||
finegrained = true;
|
||||
};
|
||||
modesetting.enable = true; # Required for Wayland
|
||||
modesetting.enable = true;
|
||||
package = nvidiaDriverChannel;
|
||||
forceFullCompositionPipeline = true; # Prevents screen tearing
|
||||
# forceFullCompositionPipeline = true; # Only useful when display is connected directly to Nvidia GPU, not in PRIME offload mode
|
||||
|
||||
# Configuration for hybrid AMD+Nvidia laptop
|
||||
prime = {
|
||||
# Optimized configuration for switchable graphics laptops
|
||||
offload = {
|
||||
enable = true; # Mode optimized for power saving
|
||||
enableOffloadCmd = true; # Allows running applications with dedicated GPU
|
||||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
};
|
||||
# sync.enable disabled as offload is generally better for laptops
|
||||
sync.enable = false;
|
||||
# PCI IDs verified for your hardware
|
||||
amdgpuBusId = "PCI:5:0:0"; # Integrated AMD GPU
|
||||
nvidiaBusId = "PCI:1:0:0"; # Dedicated Nvidia GPU
|
||||
sync.enable = false; # offload mode is better for battery life
|
||||
amdgpuBusId = "PCI:5:0:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
};
|
||||
|
||||
# Enhanced graphics support
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
@@ -73,10 +55,8 @@ in {
|
||||
nvidia-vaapi-driver
|
||||
libva-vdpau-driver
|
||||
libvdpau-va-gl
|
||||
mesa
|
||||
egl-wayland
|
||||
vulkan-loader
|
||||
vulkan-validation-layers
|
||||
libva
|
||||
];
|
||||
};
|
||||
@@ -90,13 +70,9 @@ in {
|
||||
];
|
||||
};
|
||||
|
||||
# Additional useful packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
vulkan-tools
|
||||
mesa-demos
|
||||
libva-utils # VA-API debugging tools
|
||||
libva-utils
|
||||
];
|
||||
|
||||
# Enable Nvidia container toolkit for GPU acceleration in containers (docker)
|
||||
hardware.nvidia-container-toolkit.enable = false;
|
||||
}
|
||||
|
||||
@@ -23,16 +23,6 @@
|
||||
];
|
||||
consoleLogLevel = 0;
|
||||
initrd.verbose = false;
|
||||
|
||||
# plymouth = {
|
||||
# enable = true;
|
||||
# theme = lib.mkForce "cuts_alt";
|
||||
# themePackages = with pkgs; [
|
||||
# (adi1090x-plymouth-themes.override {
|
||||
# selected_themes = ["cuts_alt"];
|
||||
# })
|
||||
# ];
|
||||
# };
|
||||
};
|
||||
|
||||
# To avoid systemd services hanging on shutdown
|
||||
|
||||
+6
-2
@@ -1,10 +1,14 @@
|
||||
{config, ...}: {
|
||||
# USBGuard:
|
||||
# The following line allow all USB devices until a proper policy is configured.
|
||||
# Run `sudo usbguard generate-policy` with your devices plugged in,
|
||||
# then set rules = "<output>" and switch implicitPolicyTarget to "block".
|
||||
# services.usbguard.implicitPolicyTarget = lib.mkForce "allow";
|
||||
{
|
||||
services.usbguard = {
|
||||
enable = true;
|
||||
implicitPolicyTarget = "block";
|
||||
IPCAllowedUsers = [
|
||||
"root"
|
||||
config.var.username
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
+53
-72
@@ -12,11 +12,12 @@
|
||||
extraLocale = config.var.extraLocale;
|
||||
autoUpgrade = config.var.autoUpgrade;
|
||||
in {
|
||||
networking.hostName = hostname;
|
||||
networking = {
|
||||
hostName = hostname;
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
systemd.services.NetworkManager-wait-online.enable = false;
|
||||
|
||||
system.autoUpgrade = {
|
||||
enable = autoUpgrade;
|
||||
dates = "04:00";
|
||||
@@ -32,49 +33,34 @@ in {
|
||||
time = {
|
||||
timeZone = timeZone;
|
||||
};
|
||||
i18n.defaultLocale = defaultLocale;
|
||||
i18n.inputMethod = {
|
||||
enable = true;
|
||||
type = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [fcitx5-gtk];
|
||||
};
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = extraLocale;
|
||||
LC_IDENTIFICATION = extraLocale;
|
||||
LC_MEASUREMENT = extraLocale;
|
||||
LC_MONETARY = extraLocale;
|
||||
LC_NAME = extraLocale;
|
||||
LC_NUMERIC = extraLocale;
|
||||
LC_PAPER = extraLocale;
|
||||
LC_TELEPHONE = extraLocale;
|
||||
LC_TIME = extraLocale;
|
||||
|
||||
i18n = {
|
||||
defaultLocale = defaultLocale;
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = extraLocale;
|
||||
LC_IDENTIFICATION = extraLocale;
|
||||
LC_MEASUREMENT = extraLocale;
|
||||
LC_MONETARY = extraLocale;
|
||||
LC_NAME = extraLocale;
|
||||
LC_NUMERIC = extraLocale;
|
||||
LC_PAPER = extraLocale;
|
||||
LC_TELEPHONE = extraLocale;
|
||||
LC_TIME = extraLocale;
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
libinput.enable = true;
|
||||
xserver = {
|
||||
enable = true;
|
||||
xkb.layout = keyboardLayout;
|
||||
xkb.variant = "";
|
||||
};
|
||||
gnome.gnome-keyring.enable = true;
|
||||
psd = {
|
||||
enable = true;
|
||||
resyncTimer = "10m";
|
||||
};
|
||||
};
|
||||
console.keyMap = keyboardLayout;
|
||||
|
||||
environment.variables = {
|
||||
XDG_DATA_HOME = "$HOME/.local/share";
|
||||
PASSWORD_STORE_DIR = "$HOME/.local/share/password-store";
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
||||
services.libinput.enable = true;
|
||||
programs.dconf.enable = true;
|
||||
services = {
|
||||
dbus = {
|
||||
enable = true;
|
||||
implementation = "broker";
|
||||
packages = with pkgs; [
|
||||
gcr
|
||||
@@ -86,46 +72,50 @@ in {
|
||||
power-profiles-daemon.enable = true;
|
||||
udisks2.enable = true;
|
||||
};
|
||||
console.keyMap = keyboardLayout;
|
||||
|
||||
# enable zsh autocompletion for system packages (systemd, etc)
|
||||
environment.pathsToLink = ["/share/zsh"];
|
||||
environment = {
|
||||
variables = {
|
||||
PASSWORD_STORE_DIR = "$HOME/.local/share/password-store";
|
||||
};
|
||||
# enable zsh autocompletion for system packages (systemd, etc)
|
||||
pathsToLink = ["/share/zsh"];
|
||||
systemPackages = with pkgs; [
|
||||
fd
|
||||
bc
|
||||
gcc
|
||||
file
|
||||
git-ignore
|
||||
xdg-utils
|
||||
wget
|
||||
curl
|
||||
gnupg
|
||||
openssl
|
||||
vim
|
||||
go
|
||||
comma
|
||||
zip
|
||||
unzip
|
||||
optipng
|
||||
jpegoptim
|
||||
pfetch
|
||||
btop
|
||||
unrar
|
||||
p7zip
|
||||
];
|
||||
};
|
||||
|
||||
programs.dconf.enable = true;
|
||||
|
||||
# Faster rebuilding
|
||||
documentation = {
|
||||
enable = true;
|
||||
doc.enable = false;
|
||||
man.enable = true;
|
||||
dev.enable = false;
|
||||
info.enable = false;
|
||||
nixos.enable = false;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
fd
|
||||
bc
|
||||
gcc
|
||||
file
|
||||
git-ignore
|
||||
xdg-utils
|
||||
wget
|
||||
curl
|
||||
gnupg
|
||||
openssl
|
||||
vim
|
||||
go
|
||||
comma
|
||||
zip
|
||||
unzip
|
||||
optipng
|
||||
jpegoptim
|
||||
pfetch
|
||||
btop
|
||||
unrar
|
||||
p7zip
|
||||
];
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
config = {
|
||||
common.default = ["gtk"];
|
||||
@@ -138,14 +128,5 @@ in {
|
||||
extraPortals = [pkgs.xdg-desktop-portal-gtk];
|
||||
};
|
||||
|
||||
security = {
|
||||
# allow wayland lockers to unlock the screen
|
||||
pam.services.hyprlock.text = "auth include login";
|
||||
|
||||
# userland niceness
|
||||
rtkit.enable = true;
|
||||
|
||||
# don't ask for password for wheel group
|
||||
sudo.wheelNeedsPassword = false;
|
||||
};
|
||||
security.rtkit.enable = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user