Move old config here

This commit is contained in:
Mateusz Słodkowicz 2023-05-18 12:07:07 +02:00
parent 97fd90c347
commit f728476449
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
48 changed files with 5844 additions and 49 deletions

View File

@ -0,0 +1,6 @@
{ inputs, materusFlake, ... }:
let
genHomes = import ./genHomes.nix { inherit inputs; inherit materusFlake; };
in
{ }
// genHomes "materus"

View File

@ -0,0 +1,44 @@
{ inputs, materusFlake, ... }:
let
profles = import ../profile;
hosts = builtins.attrNames materusFlake.nixosConfigurations;
genHomes = username:
let
#Make host specific user profile "username@host"
_list = builtins.map (host: username + "@" + host) hosts;
_for = i: (
let len = builtins.length hosts; in
([{
name = builtins.elemAt _list i;
value = let host = builtins.elemAt hosts i; in
inputs.home-manager.lib.homeManagerConfiguration {
pkgs = materusFlake.nixosConfigurations.${host}.pkgs;
extraSpecialArgs = { inherit inputs; inherit materusFlake; };
modules = [
./${username}
../host/${host}/extraHome.nix
profles.homeProfile
inputs.private.homeModule
];
};
}]
++ (if ((i + 1) < len) then _for (i + 1) else [ ]))
);
in
(builtins.listToAttrs (_for 0)) // {
#Make generic x86_64-linux user profile "username"
${username} = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; config = {allowUnfree = true;}; };
extraSpecialArgs = { inherit inputs; inherit materusFlake; };
modules = [
./${username}
profles.homeProfile
inputs.private.homeModule
];
};
};
in
genHomes

View File

@ -0,0 +1,22 @@
{ config, pkgs, lib, ... }:
{
materus.profile = {
fonts.enable = lib.mkDefault true;
nixpkgs.enable = lib.mkDefault true;
enableDesktop = lib.mkDefault true;
enableTerminal = lib.mkDefault true;
enableTerminalExtra = lib.mkDefault true;
enableNixDevel = lib.mkDefault true;
};
programs.git.signing.key = "28D140BCA60B4FD1";
programs.git.signing.signByDefault = true;
programs.git.userEmail = "materus@podkos.pl";
programs.git.userName = "materus";
home.username = "materus";
home.homeDirectory = "/home/materus";
home.stateVersion = "23.05";
home.packages = [pkgs.papirus-icon-theme];
}

View File

@ -0,0 +1,17 @@
{inputs, materusFlake}:
let
profles = import ../profile;
in
{
materusPC = inputs.nixpkgs.lib.nixosSystem rec {
specialArgs = {inherit inputs; inherit materusFlake;};
system = "x86_64-linux";
modules = [
./materusPC
inputs.private.systemModule
profles.osProfile
];
};
}

View File

@ -0,0 +1,20 @@
{ config, pkgs, lib, inputs, materusFlake, ... }:
{
imports =
[
./hardware
./tmp.nix
];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
system.copySystemConfiguration = false;
system.stateVersion = "23.05";
materus.profile.nix.enable = true;
materus.profile.nixpkgs.enable = true;
}

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1,33 @@
{ config, pkgs, lib, inputs, materusFlake, ... }:
{
#Kernel
boot.kernelPackages = pkgs.linuxPackages_zen;
boot.kernelParams = [ "nvme_core.default_ps_max_latency_us=0" "nvme_core.io_timeout=255" "nvme_core.max_retries=10" "nvme_core.shutdown_timeout=10" "amd_iommu=on" "iommu=pt" "pcie_acs_override=downstream,multifunction" ];
boot.kernelModules = [ "i2c_dev" "kvm-amd" "vfio-pci" "v4l2loopback" "kvmfr" ];
boot.kernel.sysctl = {"vm.max_map_count" = 1000000;};
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback kvmfr];
boot.supportedFilesystems = [ "ntfs" "btrfs" "vfat" "exfat" "ext4"];
boot.tmp.useTmpfs = true;
#bootloader
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.loader.grub = {
enable = true;
efiSupport = true;
device = "nodev";
gfxmodeEfi = pkgs.lib.mkDefault "1920x1080";
gfxmodeBios = pkgs.lib.mkDefault "1920x1080";
useOSProber = true;
memtest86.enable = true;
};
}

View File

@ -0,0 +1,52 @@
{ config, pkgs, lib, inputs, materusFlake, materusPkgs, ... }:
{
imports =
[
./filesystem.nix
./boot.nix
];
hardware.firmware = with pkgs; [
linux-firmware
alsa-firmware
sof-firmware
];
hardware.cpu.amd.updateMicrocode = lib.mkForce true;
#extra
hardware.wooting.enable = true;
hardware.bluetooth.enable = true;
#Graphics
hardware.opengl.enable = true;
hardware.opengl.driSupport32Bit = true;
hardware.opengl.extraPackages = with pkgs; [
vaapiVdpau
libvdpau-va-gl
amdvlk
rocm-opencl-icd
rocm-opencl-runtime
materusPkgs.amdgpu-pro-libs.vulkan
materusPkgs.amdgpu-pro-libs.amf
];
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [
vaapiVdpau
pkgs.driversi686Linux.amdvlk
materusPkgs.i686Linux.amdgpu-pro-libs.vulkan
libvdpau-va-gl
];
#GPU bar size
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x744c", ATTR{resource0_resize}="15"
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x744c", ATTR{resource2_resize}="8"
'';
#Trim
services.fstrim = {
enable = true;
interval = "weekly";
};
}

View File

@ -0,0 +1,69 @@
{ config, pkgs, lib, inputs, materusFlake, ... }:
{
zramSwap = {
enable = true;
memoryPercent = 25;
};
swapDevices = [
{
label = "NixOS_Swap";
}
];
fileSystems."/etc/nixos" =
{
device = "/materus/Nix/Nixerus";
fsType = "none";
options = [ "bind" ];
};
fileSystems."/materus" =
{
device = "/dev/disk/by-label/NixOS_Root";
fsType = "btrfs";
options = [ "subvol=@materus" "noatime" "compress=zstd" "ssd" "space_cache=v2" ];
};
fileSystems."/" =
{
device = "/dev/disk/by-label/NixOS_Root";
fsType = "btrfs";
options = [ "subvol=@" "noatime" "ssd" "space_cache=v2" "compress=zstd" ];
};
fileSystems."/nix" =
{
device = "/dev/disk/by-label/NixOS_Root";
fsType = "btrfs";
options = [ "subvol=@nix" "noatime" "compress=zstd" "ssd" "space_cache=v2" ];
};
fileSystems."/home" =
{
device = "/dev/disk/by-label/NixOS_Root";
fsType = "btrfs";
options = [ "subvol=@home" "noatime" "compress=zstd" "ssd" "space_cache=v2" ];
};
fileSystems."/boot" =
{
device = "/dev/disk/by-label/NixOS_Root";
fsType = "btrfs";
options = [ "subvol=@boot" "ssd" ];
};
fileSystems."/boot/efi" =
{
device = "/dev/disk/by-label/NixOS_EFI";
fsType = "vfat";
};
}

View File

@ -0,0 +1,619 @@
{ config, pkgs, lib, inputs, materusFlake, materusPkgs, ... }:
let
steam = pkgs.steam.override {
extraPkgs = pkgs: [
pkgs.nss_latest
pkgs.libstrangle
pkgs.libkrb5
pkgs.keyutils
pkgs.libGL
pkgs.libglvnd
pkgs.gamescope
pkgs.steamPackages.steam
pkgs.libxcrypt
pkgs.gnutls
pkgs.xorg.libXcursor
pkgs.xorg.libXi
pkgs.xorg.libXinerama
pkgs.xorg.libXScrnSaver
pkgs.openvdb
pkgs.tbb_2021_8
pkgs.gtk4
pkgs.gtk3
pkgs.glib
pkgs.gsettings-desktop-schemas
];
extraLibraries = pkgs: [
pkgs.libkrb5
pkgs.keyutils
pkgs.ncurses6
pkgs.fontconfig
pkgs.libxcrypt
pkgs.gnutls
pkgs.gsettings-desktop-schemas
];
extraEnv = { XDG_DATA_DIRS = "/usr/share:$XDG_DATA_DIRS"; };
};
grml-config = pkgs.fetchFromGitHub {
owner = "grml";
repo = "grml-etc-core";
rev = "a2cda85d3d56fd5f5a7b954a444fd151318c4680";
sha256 = "0ap8lmqi45yjyjazdm1v64fz1rfqhkhfpdp2z17ag6hs5wi6i67y";
};
in
{
virtualisation.lxc.enable = true;
virtualisation.lxc.lxcfs.enable = true;
virtualisation.lxd.enable = true;
#virtualisation.lxd.recommendedSysctlSettings = true;
programs.corectrl.enable = true;
programs.corectrl.gpuOverclock.enable = true;
programs.corectrl.gpuOverclock.ppfeaturemask = "0xffffffff";
programs.gamemode.enable = true;
services.xserver.displayManager.startx.enable = true;
services.teamviewer.enable = true;
services.xserver.windowManager.awesome.enable = true;
services.xserver.windowManager.awesome.luaModules = with pkgs.luaPackages; [
luarocks
luadbi-mysql #
];
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
];
services.flatpak.enable = true;
services.gvfs.enable = true;
networking.hostName = "materusPC";
networking.networkmanager.enable = true;
time.timeZone = "Europe/Warsaw";
i18n.defaultLocale = "pl_PL.UTF-8";
console = {
font = "lat2-16";
# keyMap = "pl";
useXkbConfig = true; # use xkbOptions in tty.
};
services.xserver.layout = "pl";
services.xserver.enable = true;
services.xserver.videoDrivers = [ "amdgpu" ];
services.dbus.enable = true;
services.dbus.packages = [ pkgs.gcr_4 ];
services.xserver.displayManager.lightdm.enable = true;
services.xserver.displayManager.lightdm.greeters.enso.enable = true;
services.xserver.displayManager.lightdm.greeters.enso.blur = true;
services.xserver.desktopManager.plasma5.enable = true;
services.xserver.desktopManager.plasma5.phononBackend = "gstreamer";
services.xserver.desktopManager.plasma5.useQtScaling = true;
services.xserver.desktopManager.plasma5.runUsingSystemd = true;
environment.plasma5.excludePackages = with pkgs; [libsForQt5.kwallet libsForQt5.kwalletmanager libsForQt5.kwallet-pam];
services.xserver.config = pkgs.lib.mkAfter ''
Section "OutputClass"
Identifier "amd-options"
Option "TearFree" "True"
Option "SWCursor" "True"
Option "VariableRefresh" "true"
Option "AsyncFlipSecondaries" "true"
MatchDriver "amdgpu
EndSection
'';
services.xserver.displayManager.defaultSession = "plasmawayland";
services.xserver.displayManager.autoLogin.user = "materus";
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 = true;
# If you want to use JACK applications, uncomment this
jack.enable = true;
};
hardware.pulseaudio.enable = false;
services.xserver.libinput.enable = true;
virtualisation.waydroid.enable = true;
virtualisation.podman = {
enable = true;
#enableNvidia = true;
dockerCompat = true;
dockerSocket.enable = true;
};
virtualisation.libvirtd = {
enable = true;
onBoot = "ignore";
onShutdown = "shutdown";
qemu.ovmf.enable = true;
qemu.ovmf.packages = [ pkgs.OVMFFull.fd ];
qemu.runAsRoot = true;
qemu.swtpm.enable = true;
};
virtualisation.libvirtd.qemu.package = pkgs.qemu_full;
systemd.services.libvirtd = {
path =
let
env = pkgs.buildEnv {
name = "qemu-hook-env";
paths = with pkgs; [
bash
libvirt
kmod
systemd
ripgrep
sd
coreutils
sudo
su
killall
procps
util-linux
bindfs
];
};
in
[ env ];
};
users.users.materus = {
isNormalUser = true;
extraGroups = [ "pipewire" "wheel" "networkmanager" "input" "kvm" "libvirt-qemu" "libvirt" "libvirtd" "podman" "lxd" ]; # Enable sudo for the user.
shell = pkgs.bashInteractive;
description = "Mateusz Słodkowicz";
# packages = with pkgs; [
# firefox
# thunderbird
# ];
};
environment.variables = {
KWIN_DRM_NO_AMS = "1";
DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1="1";
VK_ICD_FILENAMES="/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json:/run/opengl-driver-32/share/vulkan/icd.d/radeon_icd.i686.json";
AMD_VULKAN_ICD="RADV";
RADV_PERFTEST = "gpl,rt,sam";
};
environment.sessionVariables = rec {
XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_BIN_HOME = "\${HOME}/.local/bin";
XDG_DATA_HOME = "\${HOME}/.local/share";
#SSH_ASKPASS_REQUIRE = "prefer";
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d";
MOZ_USE_XINPUT2 = "1";
PATH = [
"\${XDG_BIN_HOME}"
];
};
environment.shellInit = ''
if ! [ -z "$DISPLAY" ]; then xhost +si:localuser:root &> /dev/null; fi;
if ! [ -z "$DISPLAY" ]; then xhost +si:localuser:$USER &> /dev/null; fi;
'';
i18n.inputMethod.enabled = "fcitx5";
i18n.inputMethod.fcitx5.addons = [ pkgs.fcitx5-configtool pkgs.fcitx5-lua pkgs.fcitx5-mozc 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;
networking.firewall.allowedTCPPorts = [ 24800 5900 5357 4656];
networking.firewall.allowedUDPPorts = [ 24800 5900 3702 4656];
networking.firewall.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = false;
enableBrowserSocket = true;
pinentryFlavor = "gtk2";
};
programs.ssh.startAgent = true;
services.openssh.enable = true;
environment.enableAllTerminfo = true;
environment.pathsToLink = [ "/share/zsh" "/share/bash-completion" "/share/fish" ];
environment.shells = with pkgs; [ zsh bashInteractive fish ];
programs = {
steam = {
enable = true;
dedicatedServer.openFirewall = true;
remotePlay.openFirewall = true;
};
fish.enable = true;
zsh = {
enable = true;
interactiveShellInit = ''
if [[ ''${__MATERUS_HM_ZSH:-0} == 0 ]]; then
source ${grml-config}/etc/zsh/zshrc
fi
'';
promptInit = ''
'';
};
java.enable = true;
command-not-found.enable = false;
dconf.enable = true;
};
fonts.fontDir.enable = true;
fonts.enableDefaultFonts = true;
fonts.fonts = with pkgs; [
dejavu_fonts
hack-font
noto-fonts
noto-fonts-extra
noto-fonts-emoji
noto-fonts-cjk-sans
noto-fonts-cjk-serif
ubuntu_font_family
wqy_zenhei
monocraft
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Meslo" "ProFont" ]; })
];
fonts.fontconfig.enable = true;
fonts.fontconfig.cache32Bit = true;
fonts.fontconfig.defaultFonts.sansSerif = [ "Noto Sans" "DejaVu Sans" "WenQuanYi Zen Hei" "Noto Color Emoji" ];
fonts.fontconfig.defaultFonts.serif = [ "Noto Serif" "DejaVu Serif" "WenQuanYi Zen Hei" "Noto Color Emoji"];
fonts.fontconfig.defaultFonts.emoji = [ "Noto Color Emoji" "OpenMoji Color" ];
fonts.fontconfig.defaultFonts.monospace = [ "FiraCode Nerd Font Mono" "Noto Sans Mono" "WenQuanYi Zen Hei Mono" ];
networking.networkmanager.extraConfig = lib.mkDefault ''
[connectivity]
uri=http://nmcheck.gnome.org/check_network_status.txt
'';
environment.systemPackages = with pkgs; [
firefox
steam
steam.run
gamescope
(pkgs.lutris.override { extraLibraries = pkgs: with pkgs; [ pkgs.libunwind pkgs.libusb1 pkgs.gnutls pkgs.gtk3 pkgs.pango ]; })
materusPkgs.amdgpu-pro-libs.prefixes
(pkgs.bottles.override {extraLibraries = pkgs: with pkgs; [pkgs.libunwind pkgs.libusb1 pkgs.gnutls pkgs.gtk3 pkgs.pango]; })
glibc
glib
gtk3
gtk4
gsettings-desktop-schemas
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
jdk
nss_latest
aspell
aspellDicts.pl
aspellDicts.en
aspellDicts.en-computers
distrobox
p7zip
unrar
bzip2
rar
unzip
zstd
xz
zip
gzip
virtiofsd
config.virtualisation.libvirtd.qemu.package
looking-glass-client
tree
mc
lf
htop
nmon
iftop
iptraf-ng
mprocs
tldr
bat
# pgcli
# litecli
#zenmonitor
nix-du
ark
kate
krusader
wineWowPackages.stagingFull
winetricks
protontricks
openal
gnupg
pinentry
pinentry-gnome
pinentry-curses
ncurses
monkeysphere
gparted
inkscape
gimp
virt-manager
libguestfs
bubblewrap
bindfs
pulseaudio
binutils
/*
gnome3.adwaita-icon-theme
gnome3.gnome-tweaks
gnome3.gnome-color-manager
gnome3.gnome-shell-extensions
gnomeExtensions.appindicator
gnomeExtensions.desktop-clock
gnomeExtensions.gtk4-desktop-icons-ng-ding
gnomeExtensions.compiz-windows-effect
gnomeExtensions.burn-my-windows
gnomeExtensions.user-themes
gnomeExtensions.gsconnect
gnomeExtensions.dash-to-panel
gnomeExtensions.dash-to-dock
*/
config.materus.profile.packages.home-manager
];
/*
system.activationScripts.libvirt-hooks.text =
''
ln -Tfs /etc/libvirt/hooks /var/lib/libvirt/hooks
'';
environment.etc = {
"libvirt/hooks/qemu" = {
text =
''
#!/usr/bin/env bash
#
# Author: Sebastiaan Meijer (sebastiaan@passthroughpo.st)
#
# Copy this file to /etc/libvirt/hooks, make sure it's called "qemu".
# After this file is installed, restart libvirt.
# From now on, you can easily add per-guest qemu hooks.
# Add your hooks in /etc/libvirt/hooks/qemu.d/vm_name/hook_name/state_name.
# For a list of available hooks, please refer to https://www.libvirt.org/hooks.html
#
GUEST_NAME="$1"
HOOK_NAME="$2"
STATE_NAME="$3"
MISC="''${@:4}"
BASEDIR="$(dirname $0)"
HOOKPATH="$BASEDIR/qemu.d/$GUEST_NAME/$HOOK_NAME/$STATE_NAME"
set -e # If a script exits with an error, we should as well.
# check if it's a non-empty executable file
if [ -f "$HOOKPATH" ] && [ -s "$HOOKPATH"] && [ -x "$HOOKPATH" ]; then
eval \"$HOOKPATH\" "$@"
elif [ -d "$HOOKPATH" ]; then
while read file; do
# check for null string
if [ ! -z "$file" ]; then
eval \"$file\" "$@"
fi
done <<< "$(find -L "$HOOKPATH" -maxdepth 1 -type f -executable -print;)"
fi
'';
mode = "0755";
};
"libvirt/hooks/kvm.conf" = {
text =
''
VIRSH_GPU_VIDEO=pci_0000_01_00_0
VIRSH_GPU_AUDIO=pci_0000_01_00_1
VIRSH_GPU_USB=pci_0000_01_00_2
VIRSH_GPU_SERIAL_BUS=pci_0000_01_00_3
'';
mode = "0755";
};
"libvirt/hooks/qemu.d/win11/prepare/begin/start.sh" = {
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 "/etc/libvirt/hooks/kvm.conf"
# 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 [ "$(grep -c "frame buffer" /sys/class/vtconsole/vtcon"''${i}"/name)" = 1 ]; then
echo 0 > /sys/class/vtconsole/vtcon"''${i}"/bind
echo "$DATE Unbinding Console ''${i}"
fi
fi
done
# Unbind EFI Framebuffer
echo "efi-framebuffer.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 = "0755";
};
"libvirt/hooks/qemu.d/win11/release/end/stop.sh" = {
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 "/etc/libvirt/hooks/kvm.conf"
# 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 "efi-framebuffer.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 = "0755";
};
"libvirt/vgabios/patched.rom".source = ./vbios.rom;
}; */
}

View File

@ -0,0 +1,10 @@
{ config, pkgs, lib, materusFlake, ... }:
{
imports = [
./nixpkgs.nix
./packages
];
config._module.args.materusPkgs = (import materusFlake { inherit pkgs; }) //
(if pkgs.system == "x86_64-linux" then { i686Linux = import materusFlake { pkgs = pkgs.pkgsi686Linux; }; } else { });
#config.nixpkgs.config.allowUnfree = builtins.trace config.nixpkgs.config.allowUnfree true;
}

View File

@ -0,0 +1,22 @@
{ config, pkgs, inputs, lib,... }:
let
mkBoolOpt = default: description: lib.mkOption {
inherit default;
inherit description;
type = lib.types.bool;
example = true;
};
cfg = config.materus.profile.nixpkgs;
in
{
options.materus.profile.nixpkgs.enable = mkBoolOpt false "Enable materus nixpkgs config";
options.materus.profile.nixpkgs.enableOverlays = mkBoolOpt (cfg.enable) "Enable materus overlays";
config.nixpkgs.config = lib.mkIf cfg.enable{
allowUnfree = lib.mkDefault true;
joypixels.acceptLicense = lib.mkDefault true;
firefox.enablePlasmaBrowserIntegration = lib.mkDefault true;
};
config.nixpkgs.overlays = lib.mkIf cfg.enableOverlays [inputs.emacs-overlay.overlay];
}

View File

@ -0,0 +1,49 @@
{ config, pkgs, lib, inputs, materusFlake, materusPkgs, ... }:
with materusPkgs.lib;
{
imports = [
./fonts.nix
];
#Single Packages
options.materus.profile.packages.home-manager = mkPrivateVar inputs.home-manager.packages.${pkgs.system}.home-manager;
options.materus.profile.packages.firefox = mkPrivateVar pkgs.firefox;
#Package Lists
options.materus.profile.packages.list.nixRelated = mkPrivateVar (with pkgs; [
nix-prefetch
nix-prefetch-scripts
nix-prefetch-github
nix-prefetch-docker
nixfmt
nix-top
nix-tree
nix-diff
nix-ld
rnix-hashes
rnix-lsp
nixpkgs-review
]);
options.materus.profile.packages.list.desktopApps = mkPrivateVar (with pkgs; [
barrier
(discord.override { nss = nss_latest; })
tdesktop
mpv
ani-cli
(pkgs.obsidian.override {electron = pkgs.electron;})
spotify
thunderbird
keepassxc
(aspellWithDicts (ds: with ds; [ en en-computers en-science pl ]))
libreoffice-qt
]);
options.materus.profile.packages.list.terminalApps = mkPrivateVar (with pkgs; [
neofetch
ripgrep
fd
]);
}

View File

@ -0,0 +1,24 @@
{ pkgs, lib, ... }:
let
fonts = [
pkgs.noto-fonts
pkgs.noto-fonts-extra
pkgs.noto-fonts-emoji
pkgs.noto-fonts-cjk-sans
pkgs.noto-fonts-cjk-serif
pkgs.wqy_zenhei
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Meslo" "ProFont" ]; })
];
moreFonts = [
pkgs.ubuntu_font_family
pkgs.monocraft
pkgs.dejavu_fonts
pkgs.hack-font
];
in
{
options.materus.profile.packages.list.fonts = lib.mkOption { default = fonts; readOnly = true; visible = false; };
options.materus.profile.packages.list.moreFonts = lib.mkOption { default = moreFonts; readOnly = true; visible = false; };
}

View File

@ -0,0 +1,16 @@
{
osProfile = {
imports = [
./os
./common
];
};
homeProfile = {
imports = [
./common
./home
];
};
}

View File

@ -0,0 +1,19 @@
{ config, lib, pkgs, materusPkgs, ... }:
let
cfg = config.materus.profile.browser;
in
{
options= let mkBoolOpt = materusPkgs.lib.mkBoolOpt; in{
materus.profile.browser.firefox.enable = mkBoolOpt config.materus.profile.enableDesktop "Enable Firefox with materus cfg";
materus.profile.browser.vivaldi.enable = mkBoolOpt false "Enable Vivaldi with materus cfg";
};
#TODO: Make some config
config.home.packages = [
(lib.mkIf cfg.firefox.enable config.materus.profile.packages.firefox)
(lib.mkIf cfg.vivaldi.enable pkgs.vivaldi)
];
}

View File

@ -0,0 +1,71 @@
{ config, lib, pkgs, materusPkgs, ... }:
let
packages = cfg.packages;
cfg = config.materus.profile;
in
{
imports = [
./fonts.nix
./browser.nix
./shell
./editor
];
options.materus.profile.enableDesktop = materusPkgs.lib.mkBoolOpt false "Enable settings for desktop";
options.materus.profile.enableTerminal = materusPkgs.lib.mkBoolOpt true "Enable settings for terminal";
options.materus.profile.enableTerminalExtra = materusPkgs.lib.mkBoolOpt false "Enable extra settings for terminal";
options.materus.profile.enableNixDevel = materusPkgs.lib.mkBoolOpt false "Enable settings for nix devel";
config =
{
home.packages = (if cfg.enableDesktop then packages.list.desktopApps else []) ++
(if cfg.enableNixDevel then packages.list.nixRelated else []) ++
(if cfg.enableTerminal then packages.list.terminalApps else []);
#Desktop
programs.feh.enable = lib.mkDefault cfg.enableDesktop;
#Terminal
programs.git = {
enable = lib.mkDefault cfg.enableTerminal;
package = lib.mkDefault pkgs.gitFull;
delta.enable = lib.mkDefault cfg.enableTerminal;
lfs.enable = lib.mkDefault cfg.enableTerminal;
};
programs.gitui.enable = cfg.enableTerminal;
programs.nix-index = {
enable = lib.mkDefault cfg.enableTerminal;
enableBashIntegration = lib.mkDefault config.programs.bash.enable;
enableFishIntegration = lib.mkDefault config.programs.fish.enable;
enableZshIntegration = lib.mkDefault config.programs.zsh.enable;
};
programs.direnv = {
enable = lib.mkDefault (cfg.enableTerminalExtra || cfg.enableNixDevel);
nix-direnv.enable = lib.mkDefault (cfg.enableNixDevel && (config.programs.direnv.enable == true));
enableBashIntegration = lib.mkDefault config.programs.bash.enable;
#enableFishIntegration = lib.mkDefault config.programs.fish.enable;
enableZshIntegration = lib.mkDefault config.programs.zsh.enable;
};
programs.tmux.enable = lib.mkDefault cfg.enableTerminal;
programs.tmux.clock24 = lib.mkDefault config.programs.tmux.enable;
programs.fzf = {
enable = lib.mkDefault cfg.enableTerminalExtra;
enableBashIntegration = lib.mkDefault config.programs.bash.enable;
enableFishIntegration = lib.mkDefault config.programs.fish.enable;
enableZshIntegration = lib.mkDefault config.programs.zsh.enable;
};
programs.exa.enable = lib.mkDefault cfg.enableTerminalExtra;
programs.exa.enableAliases = lib.mkDefault config.programs.exa.enable;
programs.yt-dlp.enable = lib.mkDefault cfg.enableTerminalExtra;
};
}

View File

@ -0,0 +1,16 @@
{ config, lib, pkgs, materusPkgs, ... }:
let
cfg = config.materus.profile.editor.code;
in
{
options.materus.profile.editor.code.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable VSCodium with materus cfg";
config = lib.mkIf cfg.enable {
programs.vscode = {
enable = lib.mkDefault true;
package = lib.mkDefault (pkgs.vscodium.fhsWithPackages (ps: with ps; [ gcc clang llvm lld lldb gdb rnix-hashes rnix-lsp nixfmt]));
mutableExtensionsDir = lib.mkDefault true;
};
materus.profile.fonts.enable = lib.mkDefault true;
};
}

View File

@ -0,0 +1,8 @@
{ config, lib, pkgs, ... }:
{
imports = [
./code.nix
./neovim.nix
./emacs.nix
];
}

View File

@ -0,0 +1,25 @@
{ config, lib, pkgs, materusPkgs, ... }:
let
cfg = config.materus.profile.editor.emacs;
in
{
options.materus.profile.editor.emacs.enable = materusPkgs.lib.mkBoolOpt false "Enable emacs with materus cfg";
config = lib.mkIf cfg.enable {
#TODO: Make config
/*home.activation.doomEmacs = lib.hm.dag.entryBetween [ "onFilesChange" ] [ "writeBoundry" ] ''
if [ ! -d ~/.emacs.d ] ;
then ${pkgs.git}/bin/git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.emacs.d
fi
PATH="${config.programs.git.package}/bin:${config.programs.emacs.package}/bin:$PATH"
~/.emacs.d/bin/doom sync
'';
home.file.doomEmacs.source = "${materusArg.flakeData.extraFiles}/config/emacs/doom";
home.file.doomEmacs.target = "${config.xdg.configHome}/doom";*/
programs.emacs.enable = true;
programs.emacs.package = with pkgs; lib.mkDefault (if pkgs ? emacsUnstablePgtk then emacsUnstablePgtk else emacs-gtk);
};
}

View File

@ -0,0 +1,20 @@
{ config, lib, pkgs, materusPkgs, ... }:
let
cfg = config.materus.profile.editor.neovim;
in
{
options.materus.profile.editor.neovim.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableTerminal "Enable neovim with materus cfg";
config = lib.mkIf cfg.enable {
programs.neovim = {
enable = true;
coc.enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withPython3 = true;
withRuby = true;
};
};
}

View File

@ -0,0 +1,13 @@
{ config, pkgs, lib, materusPkgs, ... }:
let
packages = config.materus.profile.packages;
cfg = config.materus.profile.fonts;
in
{
options.materus.profile.fonts.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable materus font settings";
config = lib.mkIf cfg.enable {
fonts.fontconfig.enable = lib.mkDefault true;
home.packages = packages.list.fonts;
};
}

View File

@ -0,0 +1,20 @@
{ config, pkgs, lib, materusFlake, materusPkgs, ... }:
let
cfg = config.materus.profile.bash;
in
{
options.materus.profile.bash.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableTerminal "Enable materus bash config";
config = lib.mkIf cfg.enable {
programs.bash = {
enable = lib.mkDefault true;
enableCompletion = lib.mkDefault true;
enableVteIntegration = lib.mkDefault true;
historyControl = lib.mkDefault ["erasedups" "ignorespace"];
shellOptions = lib.mkDefault [ "autocd" "checkwinsize" "cmdhist" "expand_aliases" "extglob" "globstar" "checkjobs" "nocaseglob" ];
};
};
}

View File

@ -0,0 +1,9 @@
{
imports = [
./zsh.nix
./bash.nix
./fish.nix
./starship.nix
];
}

View File

@ -0,0 +1,12 @@
{ config, pkgs, lib, materusFlake, materusPkgs, ... }:
let
cfg = config.materus.profile.fish;
in
{
options.materus.profile.fish.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableTerminalExtra "Enable materus fish config";
config = lib.mkIf cfg.enable {
programs.fish = {
enable = lib.mkDefault true;
};
};
}

View File

@ -0,0 +1,15 @@
{ config, pkgs, lib, materusFlake, materusPkgs, ... }:
let
profile = config.materus.profile;
cfg = config.materus.profile.starship;
in
{
options.materus.profile.starship.enable = materusPkgs.lib.mkBoolOpt (profile.zsh.enable || profile.bash.enable || profile.fish.enable) "Enable materus fish config";
config = lib.mkIf cfg.enable {
programs.starship.enable = lib.mkDefault cfg.enable;
programs.starship.settings = lib.mkDefault { };
};
}

View File

@ -0,0 +1,95 @@
{ config, pkgs, lib, materusFlake, materusPkgs, ... }:
let
p10kcfg = "${zshcfg}/p10kcfg";
zshcfg = "${materusFlake.path}/extraFiles/config/zsh";
cfg = config.materus.profile.zsh;
enableStarship = config.materus.starship.enable;
in
{
options.materus.profile.zsh.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableTerminalExtra "Enable materus zsh config";
options.materus.profile.zsh.prompt = lib.mkOption {
type = lib.types.enum ["p10k" "starship"];
example = "p10k";
default = "p10k";
};
config = lib.mkIf cfg.enable {
home.packages = [
pkgs.ripgrep
];
programs.zsh = {
enable = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;
enableVteIntegration = true;
historySubstringSearch.enable = true;
historySubstringSearch.searchUpKey = ";5A";
historySubstringSearch.searchDownKey = ";5B";
envExtra = ''
if [[ -z "$__MATERUS_HM_ZSH" ]]; then
__MATERUS_HM_ZSH=1
fi
if [[ -z "$__MATERUS_HM_ZSH_PROMPT" ]]; then
__MATERUS_HM_ZSH_PROMPT=${cfg.prompt}
fi
'';
initExtraFirst = lib.mkIf (cfg.prompt == "p10k" ) ''
if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh"
fi
'';
plugins = [
(lib.mkIf (cfg.prompt == "p10k" ) {
name = "powerlevel10k";
src = pkgs.fetchFromGitHub {
owner = "romkatv";
repo = "powerlevel10k";
rev = "bc5983543a10cff2eac30cced9208bbfd91428b8";
sha256 = "0s8ndbpmlqakg7s7hryyi1pqij1h5dv0xv9xvr2qwwyhyj6zrx2i";
};
file = "powerlevel10k.zsh-theme";
})
];
history = {
extended = true;
save = 100000;
size = 100000;
share = false;
ignoreDups = true;
ignoreSpace = true;
};
initExtra = ''
. ${zshcfg}/zinputrc
source ${zshcfg}/zshcompletion.zsh
bindkey ";5C" forward-word
bindkey ";5D" backward-word
'' +
(if (cfg.prompt == "p10k" ) then
''
if zmodload zsh/terminfo && (( terminfo[colors] >= 256 )); then
[[ ! -f ${p10kcfg}/fullcolor.zsh ]] || source ${p10kcfg}/fullcolor.zsh
else
[[ ! -f ${p10kcfg}/compatibility.zsh ]] || source ${p10kcfg}/compatibility.zsh
fi
'' else "");
};
programs.starship.enableZshIntegration = lib.mkForce false;
};
}

View File

@ -0,0 +1,6 @@
{ config, pkgs, ... }:
{
imports = [
./nix.nix
];
}

View File

@ -0,0 +1,23 @@
{ config, pkgs, lib, inputs, materusPkgs, ... }:
let
cfg = config.materus.profile.nix;
in
{
options.materus.profile.nix.enable = materusPkgs.lib.mkBoolOpt false "Enable materus nix settings";
config.nix = lib.mkIf cfg.enable {
package = pkgs.nixVersions.unstable;
settings = {
experimental-features = [ "nix-command" "flakes" "repl-flake" "no-url-literals" ];
auto-optimise-store = true;
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ];
};
};
}

View File

@ -7,14 +7,23 @@
# nix-build -A mypackage
{ pkgs ? import <nixpkgs> { } }:
let
materusPkgs = packages // utils //
(if pkgs.system == "x86_64-linux" then { i686Linux = import ./. { pkgs = pkgs.pkgsi686Linux; }; } else { });
callPackage = pkgs.lib.callPackageWith (pkgs // packages // { inherit materusPkgs; } //
(if pkgs.system == "x86_64-linux" then { pkgsi686Linux = pkgs.pkgsi686Linux // materusPkgs.i686Linux; } else { }));
{
packages = import ./pkgs { inherit pkgs; inherit callPackage; };
utils = {
# The `lib`, `modules`, and `overlay` names are special
lib = import ./lib { inherit pkgs; }; # functions
modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays
lib = import ./lib { inherit pkgs; };
modules = import ./modules;
overlays = import ./overlays;
};
in
packages // utils
example-package = pkgs.callPackage ./pkgs/example-package { };
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
# ...
}

View File

@ -0,0 +1,76 @@
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets. It is optional.
(setq user-full-name "John Doe"
user-mail-address "john@doe.com")
;; Doom exposes five (optional) variables for controlling fonts in Doom:
;;
;; - `doom-font' -- the primary font to use
;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable)
;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;; - `doom-unicode-font' -- for unicode glyphs
;; - `doom-serif-font' -- for the `fixed-pitch-serif' face
;;
;; See 'C-h v doom-font' for documentation and more examples of what they
;; accept. For example:
;;
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
;;
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
;; refresh your font settings. If Emacs still can't find your font, it likely
;; wasn't installed correctly. Font issues are rarely Doom issues!
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'doom-one)
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type t)
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/org/")
;; Whenever you reconfigure a package, make sure to wrap your config in an
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
;;
;; (after! PACKAGE
;; (setq x y))
;;
;; The exceptions to this rule:
;;
;; - Setting file/directory variables (like `org-directory')
;; - Setting variables which explicitly tell you to set them before their
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
;; - Setting doom variables (which start with 'doom-' or '+').
;;
;; Here are some additional functions/macros that will help you configure Doom.
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
;; etc).
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.

View File

@ -0,0 +1,194 @@
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a link to Doom's Module Index where all
;; of our modules are listed, including what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
;; flags as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
company ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
vertico ; the search engine of the future
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
;;(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;;indent-guides ; highlighted indent columns
ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
tabs ; a tab bar for Emacs
treemacs ; a project drawer, like neotree but cooler
unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing
:editor
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
;;(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
;;word-wrap ; soft wrapping with language-aware indent
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;ibuffer ; interactive buffer management
undo ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
;;eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
;;(spell +flyspell) ; tasing you for misspelling mispelling
;;grammar ; tasing grammar mistake every you make
:tools
;;ansible
;;biblio ; Writes a PhD for you (citation needed)
debugger ; FIXME stepping through code, to help you add bugs
direnv
;;docker
;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
lookup ; navigate your code and its documentation
;;lsp ; M-x vscode
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
;;pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
;;tree-sitter ; syntax and parsing, sitting in a tree...
;;upload ; map local to remote projects via ssh/ftp
:os
(:if IS-MAC macos) ; improve compatibility with macOS
;;tty ; improve the terminal Emacs experience
:lang
;;agda ; types of types of types of types...
;;beancount ; mind the GAAP
(cc +lsp) ; C > C++ == 1
;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
;;gdscript ; the language you waited for
;;(go +lsp) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST
;;(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on
;;json ; At least it ain't XML
;;(java +lsp) ; the poster child for carpal tunnel syndrome
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
org ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
;;python ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
;;web ; the tubes
;;yaml ; JSON, but readable
;;zig ; C, but simpler
:email
;;(mu4e +org +gmail)
;;notmuch
;;(wanderlust +gmail)
:app
;;calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
;;(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
:config
;;literate
(default +bindings +smartparens))

View File

@ -0,0 +1,50 @@
;; -*- no-byte-compile: t; -*-
;;; $DOOMDIR/packages.el
;; To install a package with Doom you must declare them here and run 'doom sync'
;; on the command line, then restart Emacs for the changes to take effect -- or
;; use 'M-x doom/reload'.
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;(package! some-package)
;; To install a package directly from a remote git repo, you must specify a
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
;; https://github.com/radian-software/straight.el#the-recipe-format
;(package! another-package
; :recipe (:host github :repo "username/repo"))
;; If the package you are trying to install does not contain a PACKAGENAME.el
;; file, or is located in a subdirectory of the repo, you'll need to specify
;; `:files' in the `:recipe':
;(package! this-package
; :recipe (:host github :repo "username/repo"
; :files ("some-file.el" "src/lisp/*.el")))
;; If you'd like to disable a package included with Doom, you can do so here
;; with the `:disable' property:
;(package! builtin-package :disable t)
;; You can override the recipe of a built in package without having to specify
;; all the properties for `:recipe'. These will inherit the rest of its recipe
;; from Doom or MELPA/ELPA/Emacsmirror:
;(package! builtin-package :recipe (:nonrecursive t))
;(package! builtin-package-2 :recipe (:repo "myfork/package"))
;; Specify a `:branch' to install a package from a particular branch or tag.
;; This is required for some packages whose default branch isn't 'master' (which
;; our package manager can't deal with; see radian-software/straight.el#279)
;(package! builtin-package :recipe (:branch "develop"))
;; Use `:pin' to specify a particular commit to install.
;(package! builtin-package :pin "1a2b3c4d5e")
;; Doom's packages are pinned to a specific commit and updated from release to
;; release. The `unpin!' macro allows you to unpin single packages...
;(unpin! pinned-package)
;; ...or multiple packages
;(unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;(unpin! t)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,45 @@
# Stolen from ArchWiki
# create a zkbd compatible hash;
# to add other keys to this hash, see: man 5 terminfo
typeset -A key
key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history
# Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init () {
printf '%s' "${terminfo[smkx]}"
}
function zle-line-finish () {
printf '%s' "${terminfo[rmkx]}"
}
zle -N zle-line-init
zle -N zle-line-finish
fi

View File

@ -0,0 +1,190 @@
#Stolen from grml zsh config
function __zsh_compl () {
# TODO: This could use some additional information
# Make sure the completion system is initialised
(( ${+_comps} )) || return 1
# allow one error for every three characters typed in approximate completer
zstyle ':completion:*:approximate:' max-errors 'reply=( $((($#PREFIX+$#SUFFIX)/3 )) numeric )'
# don't complete backup files as executables
zstyle ':completion:*:complete:-command-::commands' ignored-patterns '(aptitude-*|*\~)'
# start menu completion only if it could find no unambiguous initial string
zstyle ':completion:*:correct:*' insert-unambiguous true
zstyle ':completion:*:corrections' format $'%{\e[0;31m%}%d (errors: %e)%{\e[0m%}'
zstyle ':completion:*:correct:*' original true
# activate color-completion
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
# format on completion
zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}'
# automatically complete 'cd -<tab>' and 'cd -<ctrl-d>' with menu
# zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
# insert all expansions for expand completer
zstyle ':completion:*:expand:*' tag-order all-expansions
zstyle ':completion:*:history-words' list false
# activate menu
zstyle ':completion:*:history-words' menu yes
# ignore duplicate entries
zstyle ':completion:*:history-words' remove-all-dups yes
zstyle ':completion:*:history-words' stop yes
# match uppercase from lowercase
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# separate matches into groups
zstyle ':completion:*:matches' group 'yes'
zstyle ':completion:*' group-name ''
if [[ "$NOMENU" -eq 0 ]] ; then
# if there are more than 5 options allow selecting from a menu
zstyle ':completion:*' menu select=5
else
# don't use any menus at all
setopt no_auto_menu
fi
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:options' auto-description '%d'
# describe options in full
zstyle ':completion:*:options' description 'yes'
# on processes completion complete all user processes
zstyle ':completion:*:processes' command 'ps -au$USER'
# offer indexes before parameters in subscripts
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
# provide verbose completion information
zstyle ':completion:*' verbose true
# recent (as of Dec 2007) zsh versions are able to provide descriptions
# for commands (read: 1st word in the line) that it will list for the user
# to choose from. The following disables that, because it's not exactly fast.
zstyle ':completion:*:-command-:*:' verbose false
# set format for warnings
zstyle ':completion:*:warnings' format $'%{\e[0;31m%}No matches for:%{\e[0m%} %d'
# define files to ignore for zcompile
zstyle ':completion:*:*:zcompile:*' ignored-patterns '(*~|*.zwc)'
zstyle ':completion:correct:' prompt 'correct to: %e'
# Ignore completion functions for commands you don't have:
zstyle ':completion::(^approximate*):*:functions' ignored-patterns '_*'
# Provide more processes in completion of programs like killall:
zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq'
# complete manual by their section
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.*' insert-sections true
zstyle ':completion:*:man:*' menu yes select
# Search path for sudo completion
zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \
/usr/local/bin \
/usr/sbin \
/usr/bin \
/sbin \
/bin \
/usr/X11R6/bin \
/run/current-system/sw/bin \
/run/current-system/sw/sbin
# provide .. as a completion
zstyle ':completion:*' special-dirs ..
# run rehash on completion so new installed program are found automatically:
function _force_rehash () {
(( CURRENT == 1 )) && rehash
return 1
}
## correction
# some people don't like the automatic correction - so run 'NOCOR=1 zsh' to deactivate it
if [[ "$NOCOR" -gt 0 ]] ; then
zstyle ':completion:*' completer _oldlist _expand _force_rehash _complete _files _ignored
setopt nocorrect
else
# try to be smart about when to use what completer...
setopt correct
zstyle -e ':completion:*' completer '
if [[ $_last_try != "$HISTNO$BUFFER$CURSOR" ]] ; then
_last_try="$HISTNO$BUFFER$CURSOR"
reply=(_complete _match _ignored _prefix _files)
else
if [[ $words[1] == (rm|mv) ]] ; then
reply=(_complete _files)
else
reply=(_oldlist _expand _force_rehash _complete _ignored _correct _approximate _files)
fi
fi'
fi
# command for process lists, the local web server details and host completion
zstyle ':completion:*:urls' local 'www' '/var/www/' 'public_html'
# Some functions, like _apt and _dpkg, are very slow. We can use a cache in
# order to speed things up
if [[ ${__COMP_CACHING:-yes} == yes ]]; then
__COMP_CACHE_DIR=${__COMP_CACHE_DIR:-${ZDOTDIR:-$HOME}/.cache}
if [[ ! -d ${__COMP_CACHE_DIR} ]]; then
command mkdir -p "${__COMP_CACHE_DIR}"
fi
zstyle ':completion:*' use-cache yes
zstyle ':completion:*:complete:*' cache-path "${__COMP_CACHE_DIR}"
fi
# host completion
_etc_hosts=()
_ssh_config_hosts=()
_ssh_hosts=()
if [[ -r ~/.ssh/config ]] ; then
_ssh_config_hosts=(${${(s: :)${(ps:\t:)${${(@M)${(f)"$(<$HOME/.ssh/config)"}:#Host *}#Host }}}:#*[*?]*})
fi
if [[ -r ~/.ssh/known_hosts ]] ; then
_ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*})
fi
if [[ -r /etc/hosts ]] && [[ "$NOETCHOSTS" -eq 0 ]] ; then
: ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(grep -v '^0\.0\.0\.0\|^127\.0\.0\.1\|^::1 ' /etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}}
fi
local localname
localname="$(uname -n)"
hosts=(
"${localname}"
"$_ssh_config_hosts[@]"
"$_ssh_hosts[@]"
"$_etc_hosts[@]"
localhost
)
zstyle ':completion:*:hosts' hosts $hosts
# TODO: so, why is this here?
# zstyle '*' hosts $hosts
# use generic completion system for programs not yet defined; (_gnu_generic works
# with commands that provide a --help option with "standard" gnu-like output.)
for compcom in cp deborphan df feh fetchipac gpasswd head hnb ipacsum mv \
pal stow uname ; do
[[ -z ${_comps[$compcom]} ]] && compdef _gnu_generic ${compcom}
done; unset compcom
# see upgrade function in this file
compdef _hosts upgrade
}
__zsh_compl

View File

@ -1,24 +1,132 @@
{
"nodes": {
"emacs-overlay": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1684348799,
"narHash": "sha256-K/2G+BnHK3JdGnT/qkYWGljgy5kUeCZDSnBz4cLqb+c=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "95c844b1985808df780acc1835a354fe3ff27282",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "emacs-overlay",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1684321175,
"narHash": "sha256-V4EbM+jK7pvjKBaj0dgAiW9ultzDE27Nz5fRyu/ceMk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "59659243cd4ababda605e79b4a9c2e6d83e24c86",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1624561540,
"narHash": "sha256-izJ2PYZMGMsSkg+e7c9A1x3t/yOLT+qzUM6WQsc2tqo=",
"lastModified": 1673540789,
"narHash": "sha256-xqnxBOK3qctIeUVxecydrEDbEXjsvHCPGPbvsl63M/U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c6a049a3d32293b24c0f894a840872cf67fd7c11",
"rev": "0f213d0fee84280d8c3a97f7469b988d6fe5fcdf",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1684215771,
"narHash": "sha256-fsum28z+g18yreNa1Y7MPo9dtps5h1VkHfZbYQ+YPbk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "963006aab35e3e8ebbf6052b6bf4ea712fdd3c28",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1684360268,
"narHash": "sha256-fvQWCYVaoy46/dz5FEMV7/A4QFra3DQbUpo6A7YXhFU=",
"owner": "nix-community",
"repo": "NUR",
"rev": "ca68452b8a9e9ca328e60308d87cd62aa0541c4b",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "NUR",
"type": "github"
}
},
"private": {
"locked": {
"lastModified": 1684365475,
"narHash": "sha256-xmkgtNtpDSlWrHHe7HYkqStEWB7tkHFgiKoJnTawsfo=",
"owner": "materusPL",
"repo": "Nixerus",
"rev": "025b07afd8e09eef1f6388e0e5f2d7a7ca1e2061",
"type": "github"
},
"original": {
"owner": "materusPL",
"ref": "mock",
"repo": "Nixerus",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
"emacs-overlay": "emacs-overlay",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_2",
"nur": "nur",
"private": "private"
}
}
},

View File

@ -1,21 +1,63 @@
{
description = "My personal NUR repository";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }:
description = "Nixerus - System config and repo";
inputs = {
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable";
};
home-manager = {
type = "github";
owner = "nix-community";
repo = "home-manager";
ref = "master";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
nur = {
type = "github";
owner = "nix-community";
repo = "NUR";
ref = "master";
};
emacs-overlay = {
type = "github";
owner = "nix-community";
repo = "emacs-overlay";
ref = "master";
};
private = {
type = "github";
owner = "materusPL";
repo = "Nixerus";
ref = "mock";
};
};
outputs = inputs @ { self, nixpkgs, home-manager, nur, ... }:
let
systems = [
"x86_64-linux"
"i686-linux"
"x86_64-darwin"
"aarch64-linux"
"armv6l-linux"
"armv7l-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
in
{
rec {
extraFiles = ./extraFiles;
packages = forAllSystems (system: import ./default.nix {
pkgs = import nixpkgs { inherit system; };
});
nixosConfigurations = import ./configurations/host { inherit inputs; materusFlake = self; };
homeConfigurations = import ./configurations/home { inherit inputs; materusFlake = self; };
path = ./.;
};
}

View File

@ -1,7 +1,16 @@
{ pkgs }:
with pkgs.lib; {
# Add your library functions here
#
# hexint = x: hexvals.${toLower x};
with pkgs; {
mkBoolOpt = default: description: lib.mkOption {
inherit default;
inherit description;
type = lib.types.bool;
example = true;
};
mkPrivateVar = default: lib.mkOption {
inherit default;
readOnly = true;
visible = false;
};
}

View File

@ -1,15 +0,0 @@
# You can use this file as a nixpkgs overlay. This is useful in the
# case where you don't want to add the whole NUR namespace to your
# configuration.
self: super:
let
isReserved = n: n == "lib" || n == "overlays" || n == "modules";
nameValuePair = n: v: { name = n; value = v; };
nurAttrs = import ./default.nix { pkgs = super; };
in
builtins.listToAttrs
(map (n: nameValuePair n nurAttrs.${n})
(builtins.filter (n: !isReserved n)
(builtins.attrNames nurAttrs)))

9
pkgs/default.nix Normal file
View File

@ -0,0 +1,9 @@
{pkgs, callPackage}:
{
amdgpu-pro-libs = pkgs.lib.recurseIntoAttrs {
vulkan = callPackage ./libs/amdgpu-pro-libs { };
amf = callPackage ./libs/amdgpu-pro-libs/amf.nix { };
opengl = callPackage ./libs/amdgpu-pro-libs/opengl.nix { };
prefixes = callPackage ./libs/amdgpu-pro-libs/prefixes.nix { };
};
}

View File

@ -1,9 +0,0 @@
{ stdenv }:
stdenv.mkDerivation rec {
name = "example-package-${version}";
version = "1.0";
src = ./.;
buildPhase = "echo echo Hello World > example";
installPhase = "install -Dm755 example $out";
}

View File

@ -0,0 +1,57 @@
{ pkgs, lib, stdenv, libdrm, dpkg, vulkan-loader, patchelf, fetchurl }:
let
ver = import ./version.nix { inherit pkgs; };
suffix = ver.suffix;
amdbit = ver.amdbit;
in
stdenv.mkDerivation rec {
pname = "amdgpu-pro-amf";
version = ver.repo_folder_ver;
src = [
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/a/amf-amdgpu-pro/amf-amdgpu-pro_${ver.amf}-${ver.minor}.${ver.ubuntu_ver}_amd64.deb";
sha256 = "sha256:038d39lji5n85lg22mbxr7fq3nldwyrslkr5z94hp94g2l8ar5x5";
name = "amf";
})
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/liba/libamdenc-amdgpu-pro/libamdenc-amdgpu-pro_1.0-${ver.minor}.${ver.ubuntu_ver}_amd64.deb";
sha256 = "sha256:0l0bfd2ayfhn15jk8cf8xnl2lgrcwpmc3c70qw3gf53jxrp5h0zs";
name = "libamdenc";
})
];
dontPatchELF = true;
sourceRoot = ".";
nativeBuildInputs = [
dpkg
patchelf
];
buildInputs = [
vulkan-loader
stdenv.cc.cc.lib
libdrm
];
rpath = lib.makeLibraryPath buildInputs;
unpackPhase = ''
for file in $src; do dpkg -x $file .; done
'';
installPhase = ''
mkdir -p $out
mv opt/amdgpu-pro/lib/x86_64-linux-gnu $out/lib
patchelf --set-rpath "$rpath" $out/lib/libamdenc64.so
patchelf --set-rpath "$rpath" $out/lib/libamfrt64.so
'';
meta = with lib; {
description = "AMD Advanced Multimedia Framework";
homepage = "https://www.amd.com";
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
};
}

View File

@ -0,0 +1,62 @@
{ pkgs, lib, xorg, stdenv, openssl, libdrm, zlib, dpkg, patchelf, fetchurl }:
let
ver = import ./version.nix { inherit pkgs; };
suffix = ver.suffix;
amdbit = ver.amdbit;
in
stdenv.mkDerivation rec {
pname = "amdgpu-pro-vulkan${suffix}";
version = ver.repo_folder_ver;
pkg64 = fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/v/vulkan-amdgpu-pro/vulkan-amdgpu-pro_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_amd64.deb";
sha256 = "sha256:02kavnxcccdrqz09v1628l005p1kzgv17wpqgb75nllyfr5103l9";
name = "vulkan64";
};
pkg32 = fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/v/vulkan-amdgpu-pro/vulkan-amdgpu-pro_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_i386.deb";
sha256 = "sha256:143r5vcqbh6s699w3y9wg87lnyl77h2g8kmdikcbl44y3q06xm6r";
name = "vulkan32";
};
src = if stdenv.system == "x86_64-linux" then pkg64 else pkg32;
dontPatchELF = true;
sourceRoot = ".";
nativeBuildInputs = [
dpkg
patchelf
];
buildInputs = [
libdrm
openssl
stdenv.cc.cc.lib
xorg.libX11
xorg.libxcb
xorg.libxshmfence
zlib
];
rpath = lib.makeLibraryPath buildInputs;
unpackPhase = ''
dpkg -x $src .
'';
installPhase = ''
mkdir -p $out/lib
mkdir -p $out/share/vulkan/icd.d
install -Dm644 opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd${suffix}.json $out/share/vulkan/icd.d/amd_pro_icd${suffix}.json
install -Dm755 opt/amdgpu-pro/lib/${amdbit}/amdvlk${suffix}.so $out/lib/amdvlkpro${suffix}.so
sed -i "s#/opt/amdgpu-pro/lib/${amdbit}/amdvlk${suffix}.so#$out/lib/amdvlkpro${suffix}.so#" $out/share/vulkan/icd.d/amd_pro_icd${suffix}.json
patchelf --set-rpath "$rpath" $out/lib/amdvlkpro${suffix}.so
'';
meta = with lib; {
description = "AMD Proprietary Driver For Vulkan";
homepage = "https://www.amd.com";
license = licenses.unfree;
platforms = [ "x86_64-linux" "i686-linux" ];
};
}

View File

@ -0,0 +1,125 @@
{ pkgs, lib, systemd, xorg, mesa, stdenv, expat, openssl, libdrm, zlib, wayland, dpkg, patchelf, fetchurl }:
let
ver = import ./version.nix { inherit pkgs; };
suffix = ver.suffix;
amdbit = ver.amdbit;
in
stdenv.mkDerivation rec {
pname = "amdgpu-pro-opengl${suffix}";
version = ver.repo_folder_ver;
src64 = [
#libgl
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-dri_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_amd64.deb";
sha256 = "sha256:05ywwnscbfjd4jg76vfgq18zjymxph69hz58i2jn8gw6aqcpi36j";
name = "libgl-dri64";
})
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-glx_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_amd64.deb";
sha256 = "sha256:0spad30ifhycll3jm5da4skxmv42v5kjkxc5cv0j719zqrnqrlj4";
name = "libgl-glx64";
})
#egl
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libegl1-amdgpu-pro-oglp_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_amd64.deb";
sha256 = "sha256:1m4scayyw0w3cixpl3qb494bc7p0djby32g305r49g8zxp047msw";
name = "libegl64";
})
#gles1
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles1-amdgpu-pro-oglp_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_amd64.deb";
sha256 = "sha256:0rkr6r7mx2zrp327wzg8jc41x0vgrhqsrlj51a78gqcxzyarfngk";
name = "libgles1-64";
})
#gles2
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles2-amdgpu-pro-oglp_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_amd64.deb";
sha256 = "sha256:1rcc7xsag3gfszyz426bkk0ipbxazf6c2ws5zw2x8br2wdi2wq4x";
name = "libgles2-64";
})
];
src32 = [
#libgl
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-dri_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_i386.deb";
sha256 = "sha256:1iak5yr2l3i5pvb2936xfknpm07zlqldjb4rnx7xy6n8w6aw1dhg";
name = "libgl-dri32";
})
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-glx_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_i386.deb";
sha256 = "sha256:06iqjnw782fdc16j621k0cmhbnc7x6hn00qky3llz7p5ybnpk9vp";
name = "libgl-glx32";
})
#egl
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libegl1-amdgpu-pro-oglp_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_i386.deb";
sha256 = "sha256:16574pgrm8946jfnyyfa9n6sjdjvvbp11kqjkfib3gjh9y3kmmw6";
name = "libegl32";
})
#gles1
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles1-amdgpu-pro-oglp_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_i386.deb";
sha256 = "sha256:09pjxxgg7zjn5b61109va8w7xv5i3zdk627z92lpb4f48fy2i325";
name = "libgles1-32";
})
#gles2
(fetchurl {
url = "https://repo.radeon.com/amdgpu/${ver.repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles2-amdgpu-pro-oglp_${ver.major_short}-${ver.minor}.${ver.ubuntu_ver}_i386.deb";
sha256 = "sha256:02w7lfl38xnw7gx90gpic6pf4xfm413k9ixp8qimsvn8irk8y45g";
name = "libgles2-32";
})
];
src = if stdenv.system == "x86_64-linux" then src64 else src32;
dontPatchELF = true;
dontStrip = true;
sourceRoot = ".";
nativeBuildInputs = [
dpkg
patchelf
];
buildInputs = [
libdrm
openssl
expat
stdenv.cc.cc.lib
xorg.libX11
xorg.libxcb
xorg.libXext
xorg.libXfixes
xorg.libXxf86vm
xorg.libxshmfence
zlib
wayland
systemd
mesa
];
rpath = lib.makeLibraryPath buildInputs;
unpackPhase = ''
for file in $src; do dpkg -x $file .; done
'';
installPhase = ''
mkdir $out
mv opt/amdgpu/lib/${amdbit} $out/lib
mv opt/amdgpu/share $out/share
mv opt/amdgpu-pro/lib/${amdbit}/* $out/lib
patchelf --set-rpath "$rpath" $out/lib/dri/amdgpu_dri.so
for file in "$out/lib/*.so*"; do patchelf --set-rpath "$rpath" $file; done
'';
meta = with lib; {
description = "AMD Proprietary Driver For OpenGL";
homepage = "https://www.amd.com";
license = licenses.unfree;
platforms = [ "x86_64-linux" "i686-linux" ];
};
}

View File

@ -0,0 +1,91 @@
{ pkgs
, pkgsi686Linux
, driversi686Linux
, stdenv
, amdgpu-pro-libs
, amdvlk
, mesa
, libGL
, with32bit ? true
}:
let
amf-amd-pro = amdgpu-pro-libs.amf;
vulkan-amd-pro = amdgpu-pro-libs.vulkan;
oglp-amd-pro = amdgpu-pro-libs.opengl;
vulkan-amd-pro32 = pkgsi686Linux.amdgpu-pro-libs.vulkan;
oglp-amd-pro32 = pkgsi686Linux.amdgpu-pro-libs.opengl;
in
pkgs.buildEnv {
name = "amdgpu-pro-prefixes";
paths = with pkgs; [
(writeShellScriptBin "vk_pro"
''
export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1
export VK_ICD_FILENAMES="${vulkan-amd-pro}/share/vulkan/icd.d/amd_pro_icd64.json"
export LD_LIBRARY_PATH="${amf-amd-pro}/lib:$LD_LIBRARY_PATH"
${(if with32bit then ''export VK_ICD_FILENAMES=$VK_ICD_FILENAMES:${vulkan-amd-pro32}/share/vulkan/icd.d/amd_pro_icd32.json'' else "")}
"$@"
''
)
(writeShellScriptBin "vk_amdvlk"
''
export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1
export VK_ICD_FILENAMES="${amdvlk}/share/vulkan/icd.d/amd_icd64.json"
${(if with32bit then ''export VK_ICD_FILENAMES=$VK_ICD_FILENAMES:${driversi686Linux.amdvlk}/share/vulkan/icd.d/amd_icd32.json'' else "")}
"$@"
''
)
(writeShellScriptBin "vk_radv"
''
export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1
export VK_ICD_FILENAMES="${mesa.drivers}/share/vulkan/icd.d/radeon_icd.x86_64.json"
${(if with32bit then ''export VK_ICD_FILENAMES=$VK_ICD_FILENAMES:${driversi686Linux.mesa.drivers}/share/vulkan/icd.d/radeon_icd.i686.json'' else "")}
"$@"
''
)
(writeShellScriptBin "gl_pro"
''
export __GLX_VENDOR_LIBRARY_NAME=amd
export LIBGL_DRIVERS_PATH="${oglp-amd-pro}/lib/dri"
${(if with32bit then ''
export LD_LIBRARY_PATH="${oglp-amd-pro32}/lib:$LD_LIBRARY_PATH"
export LIBGL_DRIVERS_PATH="$LIBGL_DRIVERS_PATH:${oglp-amd-pro32}/lib/dri"
'' else "")}
export LD_LIBRARY_PATH="${oglp-amd-pro}/lib:$LD_LIBRARY_PATH"
"$@"
''
)
(writeShellScriptBin "gl_zink"
''
${(if with32bit then ''export LD_LIBRARY_PATH="${pkgsi686Linux.libGL}/lib:$LD_LIBRARY_PATH"'' else "")}
export LD_LIBRARY_PATH="${libGL}/lib:$LD_LIBRARY_PATH"
export __GLX_VENDOR_LIBRARY_NAME=mesa
export MESA_LOADER_DRIVER_OVERRIDE=zink
export GALLIUM_DRIVER=zink
"$@"
''
)
(writeShellScriptBin "gl_radeonsi"
''
${(if with32bit then ''export LD_LIBRARY_PATH="${pkgsi686Linux.libGL}/lib:$LD_LIBRARY_PATH"'' else "")}
export LD_LIBRARY_PATH="${libGL}/lib:$LD_LIBRARY_PATH"
export __GLX_VENDOR_LIBRARY_NAME=mesa
export MESA_LOADER_DRIVER_OVERRIDE=radeonsi
export GALLIUM_DRIVER=radeonsi
"$@"
''
)
];
meta = with pkgs.lib; {
description = "AMDGPU Pro helper prefixes";
license = licenses.mit;
platforms = [ "x86_64-linux" ];
};
}

View File

@ -0,0 +1,11 @@
{ pkgs }:
{
suffix = if pkgs.stdenv.system == "x86_64-linux" then "64" else "32";
amdbit = if pkgs.stdenv.system == "x86_64-linux" then "x86_64-linux-gnu" else "i386-linux-gnu";
major = "22.40";
major_short = "22.40";
minor = "1577631";
ubuntu_ver = "22.04";
repo_folder_ver = "5.4.5";
amf = "1.4.29";
}