mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-08-21 10:45:49 +02:00
Waybar here i come (#58)
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;
|
||||
}
|
||||
|
||||
+6
-2
@@ -1,5 +1,9 @@
|
||||
{config, pkgs, ...}: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.docker.package = pkgs.docker_29;
|
||||
users.users."${config.var.username}".extraGroups = ["docker"];
|
||||
environment.systemPackages = [pkgs.lazydocker];
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Home-manager configuration for NixOS
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
home-manager = {
|
||||
@@ -9,12 +9,7 @@
|
||||
useUserPackages = true;
|
||||
backupFileExtension = "hm-backup";
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
pkgs-stable = import inputs.nixpkgs-stable {
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
pkgs-nur-hadi = inputs.nur-anotherhadi.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
inherit inputs pkgs-unstable;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
+10
-8
@@ -1,14 +1,16 @@
|
||||
# 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;
|
||||
};
|
||||
|
||||
# Generic Wayland hints (Chromium/Electron and Firefox), applied on every
|
||||
# Hyprland host regardless of the GPU.
|
||||
environment.variables = {
|
||||
NIXOS_OZONE_WL = "1";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
};
|
||||
|
||||
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 = {
|
||||
|
||||
+19
-45
@@ -5,67 +5,47 @@
|
||||
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";
|
||||
__GL_GSYNC_ALLOWED = "1";
|
||||
__GL_VRR_ALLOWED = "1";
|
||||
NVD_BACKEND = "direct";
|
||||
};
|
||||
|
||||
# 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 +53,8 @@ in {
|
||||
nvidia-vaapi-driver
|
||||
libva-vdpau-driver
|
||||
libvdpau-va-gl
|
||||
mesa
|
||||
egl-wayland
|
||||
vulkan-loader
|
||||
vulkan-validation-layers
|
||||
libva
|
||||
];
|
||||
};
|
||||
@@ -90,13 +68,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;
|
||||
}
|
||||
|
||||
+7
-3
@@ -13,12 +13,16 @@
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hp-omen-linux-module";
|
||||
version = "rebase-6.14";
|
||||
version = "rebase-6.15";
|
||||
# Upstream only rebases per kernel branch and currently tops out at
|
||||
# rebase-6.15, while linuxPackages_latest is already on 7.x. If the
|
||||
# module ever fails to build against a newer kernel, either bump this
|
||||
# to a fresh upstream branch or fall back to a stable kernel.
|
||||
src = fetchFromGitHub {
|
||||
owner = "ranisalt";
|
||||
repo = "hp-omen-linux-module";
|
||||
rev = finalAttrs.version;
|
||||
sha256 = "sha256-2zCm29bdboSjRm/caMjBPGNc0tZXPUnIIYlHxxfhAok=";
|
||||
rev = "d4b9b5adb84581c3874ca3985dc749c40c3ece67"; # rebase-6.15
|
||||
sha256 = "sha256-IOXHzcCB0n1InMjeIu3XYEJ4bhbHS3NIlS8/+4XIwkQ=";
|
||||
};
|
||||
setSourceRoot = ''
|
||||
export sourceRoot=$(pwd)/${finalAttrs.src.name}/src
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Systemd-boot configuration for NixOS
|
||||
{pkgs, ...}: {
|
||||
boot = {
|
||||
bootspec.enable = true;
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
systemd-boot = {
|
||||
@@ -24,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
|
||||
|
||||
+4
-2
@@ -43,10 +43,14 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
security.pam.services.greetd.enableGnomeKeyring = true;
|
||||
|
||||
# this is a life saver.
|
||||
# literally no documentation about this anywhere.
|
||||
# might be good to write about this...
|
||||
# https://www.reddit.com/r/NixOS/comments/u0cdpi/tuigreet_with_xmonad_how/
|
||||
# Unlock the gnome-keyring with the login password so apps (browser
|
||||
# secrets via libsecret, ProtonVPN credentials, …) don't reprompt.
|
||||
systemd.services.greetd.serviceConfig = {
|
||||
Type = "idle";
|
||||
StandardInput = "tty";
|
||||
@@ -57,6 +61,4 @@ in {
|
||||
TTYVHangup = true;
|
||||
TTYVTDisallocate = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = [tuigreet];
|
||||
}
|
||||
|
||||
+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
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
+68
-78
@@ -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,66 +72,70 @@ 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;
|
||||
xdgOpenUsePortal = false;
|
||||
config = {
|
||||
common.default = ["gtk"];
|
||||
hyprland.default = [
|
||||
"gtk"
|
||||
"hyprland"
|
||||
];
|
||||
hyprland = {
|
||||
default = [
|
||||
"gtk"
|
||||
"hyprland"
|
||||
];
|
||||
# Pick files / choose download paths with elio instead of the GTK dialog.
|
||||
# Key MUST use the "impl" interface name, else xdg-desktop-portal
|
||||
# ignores it and falls back to the default (gtk). See portals.conf(5).
|
||||
"org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"];
|
||||
};
|
||||
};
|
||||
|
||||
extraPortals = [pkgs.xdg-desktop-portal-gtk];
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
pkgs.xdg-desktop-portal-termfilechooser
|
||||
];
|
||||
};
|
||||
|
||||
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