feat: separate HM and NixOS configs; try to fix NVIDIA drivers again
This commit is contained in:
parent
25a86c0458
commit
a918e1e2ae
@ -34,14 +34,13 @@
|
||||
in
|
||||
{
|
||||
nixosConfigurations = import ./hosts { inherit self prefs; };
|
||||
homeConfigurations = import ./profiles { inherit self prefs; };
|
||||
|
||||
devShells = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
let pkgs = prefs.nixpkgs system; in {
|
||||
ddt4all = import ./shells/ddt4all.nix { inherit pkgs; };
|
||||
android = import ./shells/android.nix { inherit pkgs android-nixpkgs; };
|
||||
android = import ./shells/android.nix { inherit pkgs; };
|
||||
dioxus = import ./shells/dioxus.nix { inherit pkgs; };
|
||||
rust = import ./shells/rust.nix { inherit pkgs; };
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ config, pkgs, ... }:
|
||||
{ config, prefs, pkgs, ... }:
|
||||
|
||||
{
|
||||
# DO NOT change this unless you know what you're doing!
|
||||
|
@ -2,9 +2,7 @@
|
||||
|
||||
let
|
||||
inherit (self) inputs;
|
||||
|
||||
lib = inputs.nixpkgs.lib;
|
||||
hmProfiles = self + /profiles;
|
||||
|
||||
mkSystem =
|
||||
{
|
||||
@ -12,15 +10,20 @@ let
|
||||
hostname,
|
||||
useHomeManager ? true,
|
||||
modules ? [ ],
|
||||
}:
|
||||
lib.nixosSystem {
|
||||
}: let pkgs = prefs.nixpkgs system; in lib.nixosSystem {
|
||||
inherit pkgs;
|
||||
|
||||
specialArgs = { inherit inputs prefs; };
|
||||
modules = modules
|
||||
++ lib.lists.optionals useHomeManager [ inputs.home-manager.nixosModules.default ]
|
||||
++ [
|
||||
./base-configuration.nix
|
||||
./${hostname}
|
||||
hmProfiles
|
||||
] ++ lib.lists.optionals useHomeManager [
|
||||
{ environment.systemPackages = [ pkgs.home-manager ]; }
|
||||
inputs.home-manager.nixosModules.default {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
in
|
||||
|
@ -22,18 +22,6 @@
|
||||
options = "--delete-older-than 7d";
|
||||
};
|
||||
|
||||
nixpkgs.config = {
|
||||
nvidia.acceptLicense = true;
|
||||
allowUnfreePredicate =
|
||||
pkg:
|
||||
builtins.elem (pkgs.lib.getName pkg) [
|
||||
"nvidia-settings"
|
||||
"nvidia-x11"
|
||||
"nordvpn"
|
||||
"hplip"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/swap";
|
||||
|
@ -8,9 +8,6 @@
|
||||
../../modules/nixos/bluetooth.nix
|
||||
../../modules/nixos/greetd.nix
|
||||
../../modules/nixos/audio.nix
|
||||
|
||||
# Apps & services
|
||||
../../modules/nixos/nordvpn.nix
|
||||
];
|
||||
|
||||
modules.fingerprint.enable = true;
|
||||
@ -25,7 +22,6 @@
|
||||
};
|
||||
|
||||
services = {
|
||||
tlp.enable = false;
|
||||
gvfs.enable = true;
|
||||
upower.enable = true;
|
||||
power-profiles-daemon.enable = true;
|
||||
@ -34,22 +30,17 @@
|
||||
enable = true;
|
||||
drivers = with pkgs; [ hplipWithPlugin ];
|
||||
};
|
||||
|
||||
udev.extraRules = ''
|
||||
SUBSYSTEM=="backlight", KERNEL=="intel_backlight", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness"
|
||||
'';
|
||||
};
|
||||
|
||||
programs = {
|
||||
adb.enable = true;
|
||||
dconf.enable = true;
|
||||
light.enable = true;
|
||||
thunar.enable = true;
|
||||
hyprland.enable = true;
|
||||
|
||||
thunar.plugins = with pkgs.xfce; [
|
||||
thunar-archive-plugin
|
||||
thunar-volman
|
||||
];
|
||||
|
||||
light.enable = true;
|
||||
};
|
||||
}
|
||||
|
@ -10,4 +10,6 @@ in
|
||||
|
||||
networking.wireless.enable = pkgs.lib.mkIf wirelessEnabled true;
|
||||
networking.wireless.userControlled.enable = pkgs.lib.mkIf wirelessEnabled true;
|
||||
|
||||
boot.kernel.sysctl."net.ipv4.ip_forward" = 0;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ in
|
||||
"networkmanager"
|
||||
"plugdev"
|
||||
"adbusers"
|
||||
] ++ optional config.modules.nordvpn.enable [ "nordvpn" ];
|
||||
] ++ optional (config.modules ? nordvpn && config.modules.nordvpn.enable) [ "nordvpn" ];
|
||||
ignoreShellProgramCheck = true;
|
||||
shell = preferredShell pkgs;
|
||||
};
|
||||
|
@ -40,19 +40,18 @@
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
plugins = config.modules.hyprland.plugins;
|
||||
settings = config.modules.hyprland.additionalConfig;
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
extraPortals = with pkgs; [ xdg-desktop-portal-wlr ];
|
||||
config.hyprland = {
|
||||
"default" = [ "hyprland" "wlr" ];
|
||||
"org.freedesktop.impl.portal.ScreenCast" = "wlr";
|
||||
"org.freedesktop.impl.portal.Screenshot" = "wlr";
|
||||
#"org.freedesktop.impl.portal.Settings" = "darkman";
|
||||
};
|
||||
extraPortals = with pkgs; [ xdg-desktop-portal-wlr ];
|
||||
config.hyprland = {
|
||||
"default" = [ "hyprland" "wlr" ];
|
||||
"org.freedesktop.impl.portal.ScreenCast" = "wlr";
|
||||
"org.freedesktop.impl.portal.Screenshot" = "wlr";
|
||||
"org.freedesktop.impl.portal.Settings" = "darkman";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.authentication-agent = {
|
||||
|
@ -4,19 +4,28 @@
|
||||
options.modules.nvidia.enable = lib.mkEnableOption "Enable NVIDIA kernel and modprobe configurations.";
|
||||
|
||||
config = lib.mkIf config.modules.nvidia.enable {
|
||||
boot.kernelPackages = pkgs.linuxPackages_6_1; # LTS
|
||||
environment.systemPackages = with pkgs; [
|
||||
libva
|
||||
nvidia-vaapi-driver
|
||||
];
|
||||
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
boot.kernelParams = ["nvidia.NVreg_PreserveVideoMemoryAllocations=1"];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = true;
|
||||
powerManagement.finegrained = true;
|
||||
prime = {
|
||||
sync.enable = true;
|
||||
offload.enable = true;
|
||||
intelBusId = prefs.hosts.hulk.intelBusId;
|
||||
nvidiaBusId = prefs.hosts.hulk.nvidiaBusId;
|
||||
};
|
||||
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.legacy_470;
|
||||
};
|
||||
};
|
||||
|
10
overlay.nix
Normal file
10
overlay.nix
Normal file
@ -0,0 +1,10 @@
|
||||
inputs: final: prev: {
|
||||
android-sdk = prev.callPackage inputs.android-sdk {};
|
||||
vscodium-wayland = prev.vscodium.override {
|
||||
commandLineArgs = [
|
||||
"--enable-features=UseOzonePlatform"
|
||||
"--ozone-platform-hint=auto"
|
||||
"--ozone-platform=wayland"
|
||||
];
|
||||
};
|
||||
}
|
@ -9,15 +9,23 @@
|
||||
};
|
||||
};
|
||||
|
||||
pkgs = {
|
||||
hulk = {
|
||||
insecure = [
|
||||
nixpkgs = system: import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ (import ./overlay.nix inputs) ];
|
||||
config = {
|
||||
nvidia.acceptLicense = true;
|
||||
permittedInsecurePackages = [
|
||||
"fluffychat-linux-1.22.1"
|
||||
"olm-3.2.16"
|
||||
];
|
||||
unfree = [
|
||||
|
||||
allowUnfreePredicate = pkg: builtins.elem (inputs.nixpkgs.lib.getName pkg) [
|
||||
"davinci-resolve"
|
||||
"anydesk"
|
||||
"nvidia-settings"
|
||||
"nvidia-x11"
|
||||
"nordvpn"
|
||||
"hplip"
|
||||
];
|
||||
};
|
||||
};
|
||||
@ -30,6 +38,6 @@
|
||||
};
|
||||
|
||||
homes = {
|
||||
sadorowo = ./profiles/hulk;
|
||||
sadorowo = ./profiles/sadorowo;
|
||||
};
|
||||
}
|
||||
|
@ -1,18 +1,17 @@
|
||||
{
|
||||
self,
|
||||
prefs,
|
||||
inputs,
|
||||
impurity,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
home-manager = {
|
||||
backupFileExtension = "bak";
|
||||
extraSpecialArgs = {
|
||||
inherit inputs self prefs impurity;
|
||||
};
|
||||
let
|
||||
inherit (self) inputs;
|
||||
|
||||
users = prefs.homes;
|
||||
mkHome = system: profile: inputs.home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = prefs.nixpkgs system;
|
||||
extraSpecialArgs = { inherit self inputs prefs; };
|
||||
modules = [ profile ];
|
||||
};
|
||||
in {
|
||||
sadorowo = mkHome "x86_64-linux" ./sadorowo;
|
||||
}
|
||||
|
@ -1,32 +0,0 @@
|
||||
{
|
||||
webcopy = ''
|
||||
set -l domain (string trim $argv)
|
||||
wget --recursive \
|
||||
--level 5 \
|
||||
--no-clobber \
|
||||
--page-requisites \
|
||||
--adjust-extension \
|
||||
--span-hosts \
|
||||
--convert-links \
|
||||
--domains $domain \
|
||||
--no-parent \
|
||||
$domain
|
||||
'';
|
||||
|
||||
venv = ''
|
||||
if [ -d .venv ]; then
|
||||
source .venv/bin/activate.fish
|
||||
else
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate.fish
|
||||
fi
|
||||
'';
|
||||
|
||||
thunderbird = ''
|
||||
if pgrep -x birdtray > /dev/null
|
||||
birdtray -s
|
||||
else
|
||||
birdtray &
|
||||
end
|
||||
'';
|
||||
}
|
32
profiles/sadorowo/apps/fish/functions.nix
Normal file
32
profiles/sadorowo/apps/fish/functions.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
webcopy = ''
|
||||
set -l domain (string trim $argv)
|
||||
wget --recursive \
|
||||
--level 5 \
|
||||
--no-clobber \
|
||||
--page-requisites \
|
||||
--adjust-extension \
|
||||
--span-hosts \
|
||||
--convert-links \
|
||||
--domains $domain \
|
||||
--no-parent \
|
||||
$domain
|
||||
'';
|
||||
|
||||
venv = ''
|
||||
if [ -d .venv ]; then
|
||||
source .venv/bin/activate.fish
|
||||
else
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate.fish
|
||||
fi
|
||||
'';
|
||||
|
||||
thunderbird = ''
|
||||
if pgrep -x birdtray > /dev/null
|
||||
birdtray -s
|
||||
else
|
||||
birdtray &
|
||||
end
|
||||
'';
|
||||
}
|
@ -10,14 +10,8 @@
|
||||
|
||||
home = {
|
||||
inherit (prefs.users.hulk) username homeDirectory;
|
||||
|
||||
stateVersion = "24.11";
|
||||
packages = import ./packages.nix { inherit pkgs inputs; };
|
||||
};
|
||||
|
||||
nixpkgs.config = {
|
||||
permittedInsecurePackages = prefs.pkgs.hulk.insecure;
|
||||
allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) prefs.pkgs.hulk.unfree;
|
||||
stateVersion = "24.11";
|
||||
};
|
||||
|
||||
programs.home-manager.enable = true;
|
@ -37,6 +37,11 @@
|
||||
"~/.config/hypr/config/workspaces.conf"
|
||||
];
|
||||
|
||||
additionalConfig.env = [
|
||||
"LIBVA_DRIVER_NAME,nvidia"
|
||||
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
|
||||
];
|
||||
|
||||
additionalConfig = {
|
||||
"$terminal" = "alacritty";
|
||||
"$fileManager" = "thunar";
|
||||
@ -83,7 +88,7 @@
|
||||
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
package = pkgs.vscodium;
|
||||
package = pkgs.vscodium-wayland;
|
||||
profiles.default.extensions = with pkgs.vscode-extensions; [
|
||||
rust-lang.rust-analyzer
|
||||
bbenoist.nix
|
@ -18,7 +18,7 @@ with pkgs;
|
||||
element-desktop
|
||||
thunderbird-bin
|
||||
libreoffice-qt6-fresh
|
||||
gimp
|
||||
gimp3
|
||||
git
|
||||
anydesk
|
||||
fastfetch
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 1.8 MiB |
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 2.4 MiB |
@ -1,8 +1,7 @@
|
||||
{ pkgs, android-nixpkgs }:
|
||||
{ pkgs }:
|
||||
|
||||
let
|
||||
android = pkgs.callPackage android-nixpkgs { };
|
||||
androidSdk = android.sdk (
|
||||
androidSdk = pkgs.android-sdk.sdk (
|
||||
sdkPkgs: with sdkPkgs; [
|
||||
cmdline-tools-latest
|
||||
build-tools-35-0-0
|
||||
@ -10,9 +9,7 @@ let
|
||||
platforms-android-35
|
||||
]
|
||||
);
|
||||
|
||||
in
|
||||
pkgs.mkShell rec {
|
||||
in pkgs.mkShell rec {
|
||||
buildInputs = with pkgs; [
|
||||
androidSdk
|
||||
jdk17
|
||||
|
Loading…
x
Reference in New Issue
Block a user