mirror of
https://github.com/materusPL/Nixerus.git
synced 2026-07-09 16:41:58 +00:00
Move old config here
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
{ inputs, materusFlake, ... }:
|
||||
let
|
||||
genHomes = import ./genHomes.nix { inherit inputs; inherit materusFlake; };
|
||||
in
|
||||
{ }
|
||||
// genHomes "materus"
|
||||
@@ -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
|
||||
@@ -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];
|
||||
}
|
||||
@@ -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
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -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";
|
||||
};
|
||||
|
||||
}
|
||||
@@ -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";
|
||||
};
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}; */
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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];
|
||||
}
|
||||
@@ -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
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
@@ -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; };
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
osProfile = {
|
||||
imports = [
|
||||
./os
|
||||
./common
|
||||
];
|
||||
};
|
||||
|
||||
homeProfile = {
|
||||
imports = [
|
||||
./common
|
||||
./home
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./code.nix
|
||||
./neovim.nix
|
||||
./emacs.nix
|
||||
];
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -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" ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
|
||||
imports = [
|
||||
./zsh.nix
|
||||
./bash.nix
|
||||
./fish.nix
|
||||
./starship.nix
|
||||
];
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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 { };
|
||||
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./nix.nix
|
||||
];
|
||||
}
|
||||
@@ -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=" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user