forked from Bun/nixos-config
Move more things to Nixlang, remove bemenu and Pavucontrol
This commit is contained in:
parent
5c1ec4d677
commit
bdd47c9572
4 changed files with 280 additions and 517 deletions
|
@ -1,10 +1,9 @@
|
|||
{ config, pkgs, options, lib, ... }:
|
||||
let
|
||||
# Import home manager, set common boot paramaters
|
||||
homeManager = fetchTarball
|
||||
"https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz";
|
||||
# Set common boot paramaters
|
||||
commonKernelParams = [
|
||||
# Nvidia GSP firmware
|
||||
# Nvidia settings
|
||||
"nvidia_drm.fbdev=1"
|
||||
"nouveau.config=NvGspRm=1"
|
||||
|
||||
# VM/GPU passthrough
|
||||
|
@ -18,12 +17,18 @@ let
|
|||
# Isolate devices into IOMMU groups
|
||||
"pcie_acs_override=downstream,multifunction"
|
||||
"pci=routeirq"
|
||||
|
||||
# Provide less context messages
|
||||
"quiet"
|
||||
];
|
||||
in
|
||||
|
||||
{
|
||||
# Import other nix files and firmware
|
||||
imports = [
|
||||
imports = let
|
||||
homeManager = fetchTarball
|
||||
"https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz";
|
||||
in [
|
||||
./hardware-configuration.nix
|
||||
./jimbo.nix
|
||||
"${homeManager}/nixos"
|
||||
|
@ -34,15 +39,12 @@ in
|
|||
config = {
|
||||
allowUnfree = true;
|
||||
packageOverrides = pkgs: {
|
||||
unstable = import (builtins.fetchTarball
|
||||
"https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz") {
|
||||
inherit pkgs;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
nur = import (builtins.fetchTarball
|
||||
"https://github.com/nix-community/NUR/archive/master.tar.gz") {
|
||||
inherit pkgs;
|
||||
};
|
||||
unstable = import (fetchTarball
|
||||
"https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"
|
||||
){ inherit pkgs; config.allowUnfree = true; };
|
||||
nur = import (fetchTarball
|
||||
"https://github.com/nix-community/NUR/archive/master.tar.gz"
|
||||
){ inherit pkgs; };
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -105,12 +107,13 @@ in
|
|||
# Allow binary firmware
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
# Enable the Nouveau drivers
|
||||
# Enable video drivers
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
nvidiaSettings = false;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
open = true;
|
||||
};
|
||||
|
||||
# Enable a permissioning system
|
||||
|
@ -154,7 +157,7 @@ in
|
|||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
# Installed programs to the system profile.
|
||||
# Install programs system-wide
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Essential system tools
|
||||
cifs-utils parted git
|
||||
|
@ -173,10 +176,9 @@ in
|
|||
info.enable = false;
|
||||
};
|
||||
|
||||
# Enable OpenGL
|
||||
# Enable graphics
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
extraPackages = with pkgs; [
|
||||
vulkan-loader
|
||||
|
@ -298,11 +300,31 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
|
||||
};
|
||||
|
||||
# Configure greetd for remote login
|
||||
services.greetd = {
|
||||
services.greetd = let
|
||||
startSway = pkgs.writeScript "startsway" ''
|
||||
# Use NVIDIA variables if drivers are in use
|
||||
if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null; then
|
||||
# NVIDIA/AMD variables
|
||||
export LIBVA_DRIVER_NAME=nvidia
|
||||
export GBM_BACKEND=nvidia-drm
|
||||
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||
export WLR_NO_HARDWARE_CURSORS=1
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
# Sway/Wayland
|
||||
export XDG_CURRENT_DESKTOP=sway
|
||||
export QT_QPA_PLATFORM="wayland;xcb"
|
||||
|
||||
# Start Sway
|
||||
sway --unsupported-gpu
|
||||
'';
|
||||
in {
|
||||
enable = true;
|
||||
restart = true;
|
||||
settings = {
|
||||
|
@ -311,7 +333,7 @@ in
|
|||
switch = true;
|
||||
};
|
||||
default_session = {
|
||||
command = "/home/jimbo/.config/sway/start.sh";
|
||||
command = "${startSway}";
|
||||
user = "jimbo";
|
||||
};
|
||||
};
|
||||
|
@ -365,7 +387,6 @@ in
|
|||
PrintLastLog = "no";
|
||||
PasswordAuthentication = false;
|
||||
};
|
||||
ports = [ 2211 ];
|
||||
};
|
||||
|
||||
# Block SSH connections after numerous attempts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue