2023-10-27 14:01:54 +02:00
{ config , pkgs , lib , materusArg , . . . }:
2023-10-08 11:42:08 +02:00
{
2023-10-31 14:40:57 +01:00
virtualisation . lxc . enable = true ;
virtualisation . lxc . lxcfs . enable = true ;
virtualisation . lxd . enable = true ;
2023-10-08 11:42:08 +02:00
#virtualisation.lxd.recommendedSysctlSettings = true;
programs . corectrl . enable = true ;
programs . corectrl . gpuOverclock . enable = true ;
programs . corectrl . gpuOverclock . ppfeaturemask = " 0 x f f f f f f f f " ;
programs . gamemode . enable = true ;
services . teamviewer . enable = true ;
systemd . tmpfiles . rules = [
2023-10-14 14:40:37 +02:00
" L + / o p t / r o c m / h i p - - - - ${ pkgs . rocmPackages . clr } "
2023-10-08 11:42:08 +02:00
] ;
services . flatpak . enable = true ;
services . gvfs . enable = true ;
time . timeZone = " E u r o p e / W a r s a w " ;
i18n . defaultLocale = " p l _ P L . U T F - 8 " ;
console = {
font = " l a t 2 - 1 6 " ;
# keyMap = "pl";
useXkbConfig = true ; # use xkbOptions in tty.
} ;
2023-11-13 00:44:03 +01:00
services . xserver . extraLayouts . hyper-pl = {
description = " P L , h y p e r m o d 3 " ;
languages = [ " p o l " ] ;
symbolsFile = pkgs . writeText " h y p e r - p l " ''
xkb_symbols " h y p e r - p l "
{
include " p l ( b a s i c ) "
name [ Group1 ] = " P o l i s h H Y P R " ;
modifier_map Mod3 { <HYPR> } ;
} ; '' ;
} ;
2023-10-08 11:42:08 +02:00
2023-11-13 00:44:03 +01:00
services . xserver . layout = " h y p e r - p l " ;
services . xserver . xkbOptions = " c a p s : h y p e r " ;
2023-10-08 11:42:08 +02:00
services . xserver . enable = true ;
services . xserver . videoDrivers = [ " a m d g p u " ] ;
services . dbus . enable = true ;
services . dbus . packages = [ pkgs . gcr_4 ] ;
#services.xserver.displayManager.autoLogin.user = "materus";
services . xserver . displayManager . startx . enable = false ;
/*
services . xserver . displayManager . lightdm . enable = true ;
services . xserver . displayManager . lightdm . greeters . enso . enable = true ;
services . xserver . displayManager . lightdm . greeters . enso . blur = true ;
* /
2023-10-14 14:40:37 +02:00
xdg . portal . enable = true ;
xdg . portal . wlr . enable = true ;
xdg . portal . xdgOpenUsePortal = true ;
2023-11-13 00:44:03 +01:00
services . xserver . exportConfiguration = false ;
2023-10-14 14:40:37 +02:00
services . xserver . extraConfig = pkgs . lib . mkDefault ''
2023-10-08 11:42:08 +02:00
Section " O u t p u t C l a s s "
Identifier " a m d - o p t i o n s "
Option " T e a r F r e e " " T r u e "
Option " S W C u r s o r " " T r u e "
Option " V a r i a b l e R e f r e s h " " t r u e "
Option " A s y n c F l i p S e c o n d a r i e s " " t r u e "
MatchDriver " a m d g p u "
EndSection
'' ;
services . printing . enable = true ;
sound . enable = true ;
security . rtkit . enable = true ;
services . pipewire = {
enable = true ;
audio . enable = true ;
alsa . enable = true ;
alsa . support32Bit = true ;
pulse . enable = true ;
systemWide = false ;
# If you want to use JACK applications, uncomment this
jack . enable = true ;
} ;
hardware . pulseaudio . enable = false ;
services . xserver . libinput . enable = true ;
virtualisation . waydroid . enable = false ;
virtualisation . podman = {
enable = true ;
#enableNvidia = true;
dockerCompat = true ;
dockerSocket . enable = true ;
} ;
users . users . materus = {
isNormalUser = true ;
extraGroups = [ " a u d i o " " v i d e o " " r e n d e r " " p i p e w i r e " " w h e e l " " n e t w o r k m a n a g e r " " i n p u t " " k v m " " l i b v i r t - q e m u " " l i b v i r t " " l i b v i r t d " " p o d m a n " " l x d " ] ; # Enable ‘ sudo’ for the user.
shell = pkgs . bashInteractive ;
description = " M a t e u s z S ł o d k o w i c z " ;
# packages = with pkgs; [
# firefox
# thunderbird
# ];
} ;
environment . variables = {
ALSOFT_DRIVERS = " p u l s e " ;
} ;
environment . sessionVariables = rec {
XDG_CACHE_HOME = " \$ { H O M E } / . c a c h e " ;
XDG_CONFIG_HOME = " \$ { H O M E } / . c o n f i g " ;
XDG_BIN_HOME = " \$ { H O M E } / . l o c a l / b i n " ;
XDG_DATA_HOME = " \$ { H O M E } / . l o c a l / s h a r e " ;
2023-11-13 00:44:03 +01:00
QT_XKB_CONFIG_ROOT = " \$ { X K B _ C O N F I G _ R O O T } " ;
2023-10-31 14:40:57 +01:00
GTK_IM_MODULE = " f c i t x " ;
QT_IM_MODULE = " f c i t x " ;
XMODIFIERS = " @ i m = f c i t x " ;
SDL_IM_MODULE = " f c i t x " ;
2023-10-08 11:42:08 +02:00
SDL_AUDIODRIVER = " p i p e w i r e " ;
#SSH_ASKPASS_REQUIRE = "prefer";
MOZ_USE_XINPUT2 = " 1 " ;
PATH = [
" \$ { X D G _ B I N _ H O M E } "
] ;
} ;
environment . shellInit = ''
if ! [ - z " $ D I S P L A Y " ] ; then xhost + si:localuser:root & > /dev/null ; fi ;
if ! [ - z " $ D I S P L A Y " ] ; then xhost + si:localuser:$USER & > /dev/null ; fi ;
'' ;
i18n . inputMethod . enabled = " f c i t x 5 " ;
i18n . inputMethod . fcitx5 . addons = [ pkgs . fcitx5-configtool pkgs . fcitx5-lua pkgs . fcitx5-mozc pkgs . fcitx5-gtk pkgs . libsForQt5 . fcitx5-qt ] ;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
services . pcscd . enable = true ;
services . samba-wsdd . enable = true ;
services . samba = {
enable = true ;
package = pkgs . sambaFull ;
} ;
programs . gnupg . agent = {
enable = true ;
enableSSHSupport = false ;
enableBrowserSocket = true ;
2023-10-14 14:40:37 +02:00
2023-10-08 11:42:08 +02:00
} ;
programs . ssh . startAgent = true ;
services . openssh . enable = true ;
environment . enableAllTerminfo = true ;
environment . pathsToLink = [ " / s h a r e / z s h " " / s h a r e / b a s h - c o m p l e t i o n " " / s h a r e / f i s h " ] ;
environment . shells = with pkgs ; [ zsh bashInteractive fish ] ;
programs = {
fish . enable = true ;
zsh = {
enable = true ;
interactiveShellInit = ''
if [ [ '' ${ __MATERUS_HM_ZSH : -0 } = = 0 ] ] ; t h e n
source $ { pkgs . grml-zsh-config } /etc/zsh/zshrc
fi
'' ;
promptInit = ''
'' ;
} ;
java . enable = true ;
java . package = pkgs . graalvm-ce ;
java . binfmt = true ;
command-not-found . enable = false ;
dconf . enable = true ;
} ;
/* c o n t a i n e r s . t e s t = {
config = { config , pkgs , . . . }: { environment . systemPackages = with pkgs ; [ wayfire ] ; } ;
autoStart = false ;
} ; * /
environment . systemPackages = with pkgs ; [
2023-11-13 00:44:03 +01:00
2023-10-08 11:42:08 +02:00
firefox
gamescope
#(pkgs.lutris.override { extraLibraries = pkgs: with pkgs; [ pkgs.samba pkgs.jansson pkgs.tdb pkgs.libunwind pkgs.libusb1 pkgs.gnutls pkgs.gtk3 pkgs.pango ]; })
2023-10-27 14:01:54 +02:00
materusArg . pkgs . amdgpu-pro-libs . prefixes
2023-10-08 11:42:08 +02:00
( pkgs . bottles . override { extraPkgs = pkgs : with pkgs ; [ pkgs . libsForQt5 . breeze-qt5 pkgs . libsForQt5 . breeze-gtk pkgs . nss_latest ] ; extraLibraries = pkgs : with pkgs ; [ pkgs . samba pkgs . jansson pkgs . tdb pkgs . libunwind pkgs . libusb1 pkgs . gnutls pkgs . gtk3 pkgs . pango ] ; } )
glibc
glib
gtk3
gtk4
gsettings-desktop-schemas
libsForQt5 . dolphin
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
patchelf
killall
util-linux
xorg . xhost
nix-top
gitFull
curl
wget
config . programs . java . package
nss_latest
2023-10-27 17:00:26 +02:00
2023-10-25 00:06:20 +02:00
pciutils
2023-10-08 11:42:08 +02:00
aspell
aspellDicts . pl
aspellDicts . en
aspellDicts . en-computers
steamtinkerlaunch
distrobox
p7zip
unrar
bzip2
rar
unzip
zstd
xz
zip
gzip
tree
mc
lf
htop
nmon
iftop
iptraf-ng
mprocs
tldr
bat
##config.materus.profile.packages.home-manager
# pgcli
# litecli
2023-10-27 14:01:54 +02:00
materusArg . pkgs . alvr
2023-10-08 11:42:08 +02:00
#zenmonitor
nix-du
ark
kate
krusader
wineWowPackages . stagingFull
winetricks
protontricks
openal
gnupg
pinentry
pinentry-gnome
pinentry-curses
ncurses
monkeysphere
gparted
virt-viewer
inkscape
gimp
bubblewrap
bindfs
pulseaudio
binutils
config . materus . profile . packages . firefox
] ;
environment . etc = {
/*
" l i b v i r t / h o o k s / q e m u . d / w i n 1 1 / p r e p a r e / b e g i n / s t a r t . s h " = {
text =
''
#!/usr/bin/env bash
# Debugging
exec 19 > /home/materus/startlogfile
BASH_XTRACEFD = 19
set - x
exec 3 > & 1 4 > & 2
trap ' exec 2 > & 4 1 > & 3 ' 0 1 2 3
exec 1 > /home/materus/startlogfile.out 2 > & 1
# Stop display manager
killall - u materus
systemctl stop display-manager . service
killall gdm-x-session
#systemctl isolate multi-user.target
sleep 1
# Load variables we defined
source " / e t c / l i b v i r t / h o o k s / k v m . c o n f "
# Isolate host to core 0
systemctl set-property - - runtime - - user . slice AllowedCPUs = 0
systemctl set-property - - runtime - - system . slice AllowedCPUs = 0
systemctl set-property - - runtime - - init . scope AllowedCPUs = 0
# Unbind VTconsoles
for ( ( i = 0 ; i < 16 ; i ++ ) )
do
if test - x /sys/class/vtconsole/vtcon " ' ' ${ i } " ; then
if [ " $ ( g r e p - c " frame buffer " / s y s / c l a s s / v t c o n s o l e / v t c o n " '' ${ i } " / n a m e ) " = 1 ] ; t h e n
echo 0 > /sys/class/vtconsole/vtcon " ' ' ${ i } " /bind
echo " $ D A T E U n b i n d i n g C o n s o l e ' ' ${ i } "
fi
fi
done
# Unbind EFI Framebuffer
echo " e f i - f r a m e b u f f e r . 0 " > /sys/bus/platform/drivers/efi-framebuffer/unbind
# Avoid race condition
sleep 1
# Unload NVIDIA kernel modules
modprobe - r nvidia_uvm
modprobe - r nvidia_drm
modprobe - r nvidia_modeset
modprobe - r nvidia
modprobe - r i2c_nvidia_gpu
modprobe - r drm_kms_helper
modprobe - r drm
# Detach GPU devices from host
#virsh nodedev-detach $VIRSH_GPU_VIDEO
#virsh nodedev-detach $VIRSH_GPU_AUDIO
#virsh nodedev-detach $VIRSH_GPU_USB
#virsh nodedev-detach $VIRSH_GPU_SERIAL_BUS
# Load vfio module
modprobe vfio
modprobe vfio_pci
modprobe vfio_iommu_type1
'' ;
mode = " 0 7 5 5 " ;
} ;
" l i b v i r t / h o o k s / q e m u . d / w i n 1 1 / r e l e a s e / e n d / s t o p . s h " = {
text =
''
#!/usr/bin/env bash
# Debugging
exec 19 > /home/materus/stoplogfile
BASH_XTRACEFD = 19
set - x
exec 3 > & 1 4 > & 2
trap ' exec 2 > & 4 1 > & 3 ' 0 1 2 3
exec 1 > /home/materus/stoplogfile.out 2 > & 1
# Load variables we defined
source " / e t c / l i b v i r t / h o o k s / k v m . c o n f "
# Unload vfio module
modprobe - r vfio-pci
modprobe - r vfio_iommu_type1
modprobe - r vfio
modprobe drm
modprobe drm_kms_helper
modprobe i2c_nvidia_gpu
modprobe nvidia
modprobe nvidia_modeset
modprobe nvidia_drm
modprobe nvidia_uvm
# Attach GPU devices from host
#virsh nodedev-reattach $VIRSH_GPU_VIDEO
#virsh nodedev-reattach $VIRSH_GPU_AUDIO
#virsh nodedev-reattach $VIRSH_GPU_USB
#virsh nodedev-reattach $VIRSH_GPU_SERIAL_BUS
#echo "0000:01:00.0" > /sys/bus/pci/drivers/nvidia/bind
# Bind EFI Framebuffer
echo " e f i - f r a m e b u f f e r . 0 " > /sys/bus/platform/drivers/efi-framebuffer/bind
# Bind VTconsoles
echo 1 > /sys/class/vtconsole/vtcon0/bind
#echo 1 > /sys/class/vtconsole/vtcon1/bind
# Start display manager
sleep 1
systemctl start display-manager . service
# Return host to all cores
systemctl set-property - - runtime - - user . slice AllowedCPUs = 0 -3
systemctl set-property - - runtime - - system . slice AllowedCPUs = 0 -3
systemctl set-property - - runtime - - init . scope AllowedCPUs = 0 -3
'' ;
text = ''
#!/usr/bin/env bash
reboot
'' ; * - /
mode = " 0 7 5 5 " ;
} ;
" l i b v i r t / v g a b i o s / p a t c h e d . r o m " . source = ./vbios.rom ;
} ;
} ;
* /
} ;
}