desktop-2024-07-15-15-27-03
This commit is contained in:
@ -1,223 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
let
|
|
||||||
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
|
|
||||||
export __NV_PRIME_RENDER_OFFLOAD=1
|
|
||||||
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
|
|
||||||
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
|
||||||
export __VK_LAYER_NV_optimus=NVIDIA_only
|
|
||||||
exec -a "$0" "$@"
|
|
||||||
'';
|
|
||||||
secrets-thinkpad = import ../configs/secrets-thinkpad.nix;
|
|
||||||
be = import ../configs/borg-exclude.nix;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[
|
|
||||||
<nixos-hardware/lenovo/thinkpad/x1-extreme>
|
|
||||||
/etc/nixos/hardware-configuration.nix
|
|
||||||
../configs/docker.nix
|
|
||||||
../configs/libvirt.nix
|
|
||||||
../configs/common.nix
|
|
||||||
../configs/user.nix
|
|
||||||
../configs/user-gui.nix
|
|
||||||
../configs/user-gui-applications.nix
|
|
||||||
../configs/bspwm.nix
|
|
||||||
# ../configs/pantheon.nix
|
|
||||||
<home-manager/nixos>
|
|
||||||
];
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
loader = {
|
|
||||||
grub = {
|
|
||||||
enable = true;
|
|
||||||
device = "nodev";
|
|
||||||
version = 2;
|
|
||||||
efiSupport = true;
|
|
||||||
enableCryptodisk = true;
|
|
||||||
gfxmodeEfi = "1024x768";
|
|
||||||
};
|
|
||||||
efi = {
|
|
||||||
canTouchEfiVariables = true;
|
|
||||||
efiSysMountPoint = "/boot/efi";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
kernelPackages = pkgs.linuxPackages_lqx;
|
|
||||||
plymouth.enable = true;
|
|
||||||
initrd = {
|
|
||||||
luks.devices."root" = {
|
|
||||||
device = "/dev/disk/by-uuid/9e93feb7-8134-4b62-a05b-1aeade759880";
|
|
||||||
keyFile = "/keyfile0.bin";
|
|
||||||
allowDiscards = true;
|
|
||||||
};
|
|
||||||
secrets = {
|
|
||||||
"keyfile0.bin" = "/etc/secrets/initrd/keyfile0.bin";
|
|
||||||
"keyfile1.bin" = "/etc/secrets/initrd/keyfile1.bin";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Data mount
|
|
||||||
fileSystems."/data" = {
|
|
||||||
device = "/dev/disk/by-uuid/33693f43-076d-41fc-a612-f49ab6870ccb"; # UUID for /dev/mapper/crypted-data
|
|
||||||
encrypted = {
|
|
||||||
enable = true;
|
|
||||||
label = "crypted-data";
|
|
||||||
blkDev = "/dev/disk/by-uuid/9bf1d00e-1edc-4de3-9d5e-71a6722ef193"; # UUID for /dev/sda1
|
|
||||||
keyFile = "/keyfile1.bin";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.hostName = "thinkpad"; # Define your hostname.
|
|
||||||
time.timeZone = "Europe/Berlin";
|
|
||||||
|
|
||||||
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
|
||||||
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
|
||||||
# replicates the default behaviour.
|
|
||||||
networking.useDHCP = false;
|
|
||||||
|
|
||||||
# Select internationalisation properties.
|
|
||||||
# i18n.defaultLocale = "en_US.UTF-8";
|
|
||||||
console = {
|
|
||||||
font = "latarcyrheb-sun32";
|
|
||||||
keyMap = "us";
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware.nvidia.prime = {
|
|
||||||
offload.enable = true;
|
|
||||||
|
|
||||||
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
|
|
||||||
intelBusId = "PCI:0:2:0";
|
|
||||||
|
|
||||||
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
|
|
||||||
nvidiaBusId = "PCI:1:0:0";
|
|
||||||
};
|
|
||||||
|
|
||||||
# hardware.bumblebee = {
|
|
||||||
# enable = true;
|
|
||||||
# connectDisplay = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
hardware.opengl = {
|
|
||||||
enable = true;
|
|
||||||
driSupport32Bit = true;
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
intel-media-driver # LIBVA_DRIVER_NAME=iHD
|
|
||||||
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
|
|
||||||
vaapiVdpau
|
|
||||||
libvdpau-va-gl
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs.config.packageOverrides = pkgs: rec {
|
|
||||||
# bumblebee = pkgs.bumblebee.override {
|
|
||||||
# extraNvidiaDeviceOptions = ''
|
|
||||||
# Option "ProbeAllGpus" "false"
|
|
||||||
# Option "AllowEmptyInitialConfiguration"
|
|
||||||
# EndSection#
|
|
||||||
|
|
||||||
# Section "ServerLayout"
|
|
||||||
# Identifier "Layout0"
|
|
||||||
# Option "AutoAddDevices" "true" # Bumblebee defaults to false
|
|
||||||
# Option "AutoAddGPU" "false"
|
|
||||||
# EndSection
|
|
||||||
|
|
||||||
# Section "Screen" # Add this section
|
|
||||||
# Identifier "Screen0"
|
|
||||||
# Device "DiscreteNvidia"
|
|
||||||
# '';
|
|
||||||
# };
|
|
||||||
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable sound.
|
|
||||||
sound.enable = true;
|
|
||||||
hardware.pulseaudio = {
|
|
||||||
enable = true;
|
|
||||||
support32Bit = true;
|
|
||||||
daemon = {
|
|
||||||
config = {
|
|
||||||
avoid-resampling = "yes";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
configFile = pkgs.runCommand "default.pa" { } ''
|
|
||||||
sed 's/module-udev-detect$/module-udev-detect tsched=0/' \
|
|
||||||
${pkgs.pulseaudio}/etc/pulse/default.pa > $out
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
hardware.sane.enable = true;
|
|
||||||
|
|
||||||
services = {
|
|
||||||
thinkfan = {
|
|
||||||
enable = true;
|
|
||||||
levels = [
|
|
||||||
[ 0 0 67 ]
|
|
||||||
[ 1 65 75 ]
|
|
||||||
[ 2 73 80 ]
|
|
||||||
[ 3 78 85 ]
|
|
||||||
[ 4 83 90 ]
|
|
||||||
[ 6 88 95 ]
|
|
||||||
[ 7 93 32767 ]
|
|
||||||
];
|
|
||||||
};
|
|
||||||
xserver = {
|
|
||||||
videoDrivers = [ "nvidia" ];
|
|
||||||
# deviceSection = ''BusID "PCI:0:2:0"'';
|
|
||||||
# deviceSection = ''
|
|
||||||
# Option "TearFree" "true"
|
|
||||||
# '';
|
|
||||||
};
|
|
||||||
power-profiles-daemon.enable = false;
|
|
||||||
auto-cpufreq.enable = true;
|
|
||||||
tlp.enable = false;
|
|
||||||
# tlp = {
|
|
||||||
# enable = true;
|
|
||||||
# settings = {
|
|
||||||
# START_CHARGE_THRESH_BAT0 = 80;
|
|
||||||
# STOP_CHARGE_THRESH_BAT0 = 90;
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
borgbackup.jobs.home = rec {
|
|
||||||
compression = "auto,zstd";
|
|
||||||
encryption = {
|
|
||||||
mode = "repokey-blake2";
|
|
||||||
passphrase = secrets-thinkpad.borg-key;
|
|
||||||
};
|
|
||||||
extraCreateArgs = "--list --stats --verbose --checkpoint-interval 600 --exclude-caches";
|
|
||||||
environment.BORG_RSH = "ssh -i ~/.ssh/id_borg_rsa";
|
|
||||||
paths = "/home/alex";
|
|
||||||
repo = secrets-thinkpad.borg-repo;
|
|
||||||
startAt = "daily";
|
|
||||||
user = "alex";
|
|
||||||
prune.keep = {
|
|
||||||
daily = 7;
|
|
||||||
weekly = 4;
|
|
||||||
monthly = 6;
|
|
||||||
};
|
|
||||||
extraPruneArgs = "--save-space --list --stats";
|
|
||||||
exclude = map (x: paths + "/" + x) be.borg-exclude;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# home-manager.users.alex.services.barrier.client = {
|
|
||||||
# enable = true;
|
|
||||||
# enableCrypto = false;
|
|
||||||
# name = "thinkpad";
|
|
||||||
# server = "192.168.0.150:24800";
|
|
||||||
# };
|
|
||||||
|
|
||||||
systemd.extraConfig = ''
|
|
||||||
DefaultTimeoutStopSec=10s
|
|
||||||
'';
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
nvidia-offload
|
|
||||||
# xorg.xf86videointel
|
|
||||||
intel-gpu-tools
|
|
||||||
];
|
|
||||||
|
|
||||||
networking.firewall.enable = false;
|
|
||||||
|
|
||||||
powerManagement.powertop.enable = true;
|
|
||||||
|
|
||||||
system.stateVersion = "21.05";
|
|
||||||
}
|
|
@ -5,7 +5,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
environment.plasma6.excludePackages = with pkgs.kdePackages; [
|
environment.plasma6.excludePackages = with pkgs.kdePackages; [
|
||||||
# plasma-browser-integration
|
plasma-browser-integration
|
||||||
konsole
|
konsole
|
||||||
oxygen
|
oxygen
|
||||||
kate
|
kate
|
||||||
@ -17,7 +17,10 @@
|
|||||||
desktopManager.plasma6.enable = true;
|
desktopManager.plasma6.enable = true;
|
||||||
displayManager = {
|
displayManager = {
|
||||||
defaultSession = "plasmax11";
|
defaultSession = "plasmax11";
|
||||||
sddm = { enable = true; };
|
sddm = {
|
||||||
|
enable = true;
|
||||||
|
# wayland.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
xserver = {
|
xserver = {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
secrets = import ../configs/secrets.nix;
|
secrets = import ../configs/secrets.nix;
|
||||||
|
be = import ../configs/borg-exclude.nix;
|
||||||
wireguard = import ../configs/wireguard.nix;
|
wireguard = import ../configs/wireguard.nix;
|
||||||
unstable = import <nixos-unstable> { config.allowUnfree = true; };
|
unstable = import <nixos-unstable> { config.allowUnfree = true; };
|
||||||
in
|
in
|
||||||
@ -35,13 +36,14 @@ in
|
|||||||
efi = { canTouchEfiVariables = true; };
|
efi = { canTouchEfiVariables = true; };
|
||||||
};
|
};
|
||||||
|
|
||||||
initrd.kernelModules = [ "amdgpu" ];
|
# initrd.kernelModules = [ "amdgpu" ];
|
||||||
plymouth.enable = true;
|
plymouth.enable = true;
|
||||||
|
|
||||||
extraModulePackages = with pkgs.linuxPackages; [ it87 zenpower ];
|
extraModulePackages = with pkgs.linuxPackages; [ it87 zenpower ];
|
||||||
kernelModules = [ "it87" ];
|
kernelModules = [ "it87" "zenpower" ];
|
||||||
kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ];
|
kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ];
|
||||||
supportedFilesystems = [ "ntfs" ];
|
supportedFilesystems = [ "ntfs" ];
|
||||||
|
blacklistedKernelModules = [ "k10temp" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services = {
|
systemd.services = {
|
||||||
@ -56,19 +58,19 @@ in
|
|||||||
networking = {
|
networking = {
|
||||||
hostName = "desktop";
|
hostName = "desktop";
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
wireguard.interfaces = {
|
# wireguard.interfaces = {
|
||||||
wg0 = {
|
# wg0 = {
|
||||||
ips = [ "10.100.0.2/24" ];
|
# ips = [ "10.100.0.2/24" ];
|
||||||
privateKey = secrets.wireguard-desktop-private;
|
# privateKey = secrets.wireguard-desktop-private;
|
||||||
peers = [{
|
# peers = [{
|
||||||
publicKey = wireguard.wireguard-vps-public;
|
# publicKey = wireguard.wireguard-vps-public;
|
||||||
presharedKey = secrets.wireguard-preshared;
|
# presharedKey = secrets.wireguard-preshared;
|
||||||
allowedIPs = [ "10.100.0.0/24" ];
|
# allowedIPs = [ "10.100.0.0/24" ];
|
||||||
endpoint = "old.szczepan.ski:51820";
|
# endpoint = "old.szczepan.ski:51820";
|
||||||
persistentKeepalive = 25;
|
# persistentKeepalive = 25;
|
||||||
}];
|
# }];
|
||||||
};
|
# };
|
||||||
};
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
time.timeZone = "Europe/Berlin";
|
time.timeZone = "Europe/Berlin";
|
||||||
@ -83,6 +85,8 @@ in
|
|||||||
unigine-superposition
|
unigine-superposition
|
||||||
lact
|
lact
|
||||||
amdgpu_top
|
amdgpu_top
|
||||||
|
python3
|
||||||
|
python311Packages.tkinter
|
||||||
];
|
];
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
@ -109,16 +113,16 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
config = ''
|
config = ''
|
||||||
INTERVAL=10
|
INTERVAL=10
|
||||||
DEVPATH=hwmon3=devices/platform/it87.656
|
DEVPATH=hwmon2=devices/platform/it87.656
|
||||||
DEVNAME=hwmon3=it8665
|
DEVNAME=hwmon2=it8665
|
||||||
FCTEMPS=hwmon3/pwm3=hwmon3/temp1_input hwmon3/pwm2=hwmon3/temp1_input hwmon3/pwm1=hwmon3/temp1_input
|
FCTEMPS=hwmon2/pwm3=hwmon2/temp1_input hwmon2/pwm2=hwmon2/temp1_input hwmon2/pwm1=hwmon2/temp1_input
|
||||||
FCFANS=hwmon3/pwm3=hwmon3/fan2_input hwmon3/pwm2=hwmon3/fan1_input hwmon3/pwm1=
|
FCFANS=hwmon2/pwm3=hwmon2/fan2_input hwmon2/pwm2=hwmon2/fan1_input hwmon2/pwm1=
|
||||||
MINTEMP=hwmon3/pwm3=60 hwmon3/pwm2=60 hwmon3/pwm1=60
|
MINTEMP=hwmon2/pwm3=60 hwmon2/pwm2=60 hwmon2/pwm1=60
|
||||||
MAXTEMP=hwmon3/pwm3=75 hwmon3/pwm2=75 hwmon3/pwm1=75
|
MAXTEMP=hwmon2/pwm3=75 hwmon2/pwm2=75 hwmon2/pwm1=75
|
||||||
MINSTART=hwmon3/pwm3=51 hwmon3/pwm2=51 hwmon3/pwm1=51
|
MINSTART=hwmon2/pwm3=51 hwmon2/pwm2=51 hwmon2/pwm1=51
|
||||||
MINSTOP=hwmon3/pwm3=51 hwmon3/pwm2=51 hwmon3/pwm1=51
|
MINSTOP=hwmon2/pwm3=51 hwmon2/pwm2=51 hwmon2/pwm1=51
|
||||||
MINPWM=hwmon3/pwm1=51 hwmon3/pwm2=51 hwmon3/pwm3=51
|
MINPWM=hwmon2/pwm1=51 hwmon2/pwm2=51 hwmon2/pwm3=51
|
||||||
MAXPWM=hwmon3/pwm3=127 hwmon3/pwm2=204
|
MAXPWM=hwmon2/pwm3=127 hwmon2/pwm2=204
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -128,9 +132,10 @@ in
|
|||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
power-profiles-daemon.enable = true;
|
||||||
netdata.enable = true;
|
netdata.enable = true;
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
xserver.videoDrivers = [ "amdgpu" ];
|
# xserver.videoDrivers = [ "amdgpu" ];
|
||||||
|
|
||||||
displayManager.autoLogin = {
|
displayManager.autoLogin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -144,26 +149,28 @@ in
|
|||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# borgbackup.jobs.home = rec {
|
tailscale.enable = true;
|
||||||
# compression = "auto,zstd";
|
|
||||||
# encryption = {
|
borgbackup.jobs.home = rec {
|
||||||
# mode = "repokey-blake2";
|
compression = "auto,zstd";
|
||||||
# passphrase = secrets.borg-key;
|
encryption = {
|
||||||
# };
|
mode = "repokey-blake2";
|
||||||
# extraCreateArgs = "--checkpoint-interval 600 --exclude-caches";
|
passphrase = secrets.borg-key;
|
||||||
# environment.BORG_RSH = "ssh -i ~/.ssh/id_borg_rsa";
|
};
|
||||||
# paths = "/home/alex";
|
extraCreateArgs = "--checkpoint-interval 600 --exclude-caches";
|
||||||
# repo = secrets.borg-repo;
|
environment.BORG_RSH = "ssh -i ~/.ssh/id_borg_ed25519";
|
||||||
# startAt = "daily";
|
paths = "/home/alex";
|
||||||
# user = "alex";
|
repo = secrets.borg-repo;
|
||||||
# prune.keep = {
|
startAt = "daily";
|
||||||
# daily = 7;
|
user = "alex";
|
||||||
# weekly = 4;
|
prune.keep = {
|
||||||
# monthly = 6;
|
daily = 7;
|
||||||
# };
|
weekly = 4;
|
||||||
# extraPruneArgs = "--save-space --list --stats";
|
monthly = 6;
|
||||||
# exclude = map (x: paths + "/" + x) be.borg-exclude;
|
};
|
||||||
# };
|
extraPruneArgs = "--save-space --list --stats";
|
||||||
|
exclude = map (x: paths + "/" + x) be.borg-exclude;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.alex.services.barrier.client = {
|
home-manager.users.alex.services.barrier.client = {
|
||||||
|
Reference in New Issue
Block a user