fixed refreshrate on desktop

switch to neovim as a pager
added parrot and mining modules
deleted amd module
moved the rest of vfio configuration to vfio.nix
moved git from home-manager to system configuration
This commit is contained in:
ISnortPennies 2023-01-23 21:10:16 -05:00
parent 67b3e39735
commit 6b7ce7d133
25 changed files with 152 additions and 165 deletions

View file

@ -1,7 +0,0 @@
{pkgs, ...}: {
boot.initrd.kernelModules = ["amdgpu"];
hardware.opengl = {
driSupport = true;
driSupport32Bit = true;
};
}

View file

@ -1,5 +1,4 @@
{
hardware.enableRedistributableFirmware = true;
boot = {
blacklistedKernelModules = ["nouveau" "lbm-nouveau" "pcspkr"];
kernelParams = ["fbcon=nodefer" "bgrt_disable" "quiet" "splash"];

15
modules/git.nix Normal file
View file

@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.git = {
enable = true;
package = pkgs.gitMinimal;
config = {
user = {
name = "ISnortPennies";
email = "ISnortPennies@protonmail.com";
};
init = {
defaultBranch = "master";
};
};
};
}

27
modules/mining.nix Normal file
View file

@ -0,0 +1,27 @@
{
pkgs,
settings,
...
}: {
boot = {
kernelModules = ["msr"];
kernelParams = ["iomem=relaxed" "msr.allow_writes=on"];
};
systemd.services.mining = {
enable = true;
path = with pkgs; [t-rex-miner afk-cmds st zsh dbus xmrig];
wantedBy = ["multi-user.target"];
wants = ["graphical.target"];
script = ''
afk-cmds -c /home/${settings.username}/afk-cmds.json
'';
environment = {
# PATH="/run/current-system/sw/bin"; missing something with dbus
XAUTHORITY = "/home/${settings.username}/.Xauthority";
DISPLAY = ":0";
XDG_DATA_DIRS = "/nix/var/nix/profiles/default/share:/run/current-system/sw/share";
DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/1000/bus";
NO_AT_BRIDGE = "1";
};
};
}

View file

@ -1,14 +0,0 @@
{config, ...}: {
hardware = {
nvidia = {
nvidiaPersistenced = false;
nvidiaSettings = false;
modesetting.enable = true;
};
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
};
}

View file

@ -1,7 +1,6 @@
{
config,
pkgs,
inputs,
...
}: {
environment.systemPackages = with pkgs; [
@ -13,7 +12,6 @@
btrfs-progs #for external harddrive
vlc #play stuff
bitwarden #store stuff
gimp #edit stuff
qbittorrent #steal stuff
discord # talk to people (gross)
feh #for wallpaper
@ -32,5 +30,6 @@
pcmanfm #file manager
nix-tree #view packages
bc #terminal calculator
page #use nvim as a pager
];
}

19
modules/parrot.nix Normal file
View file

@ -0,0 +1,19 @@
{
pkgs,
settings,
...
}: {
#discord bot stuff
virtualisation.docker.enable = false;
systemd.services.parrot = {
enable = true;
path = with pkgs; [parrot yt-dlp ffmpeg];
wantedBy = ["multi-user.target"];
wants = ["NetworkManager-wait-online.service"];
after = ["NetworkManager-wait-online.service"];
script = "parrot";
serviceConfig = {
EnvironmentFile = "/home/${settings.username}/parrot/.env";
};
};
}

View file

@ -1,7 +1,15 @@
{config, ...}: {
{
hardware.nvidia.prime = {
sync.enable = true;
amdgpuBusId = "PCI:5:0:0";
nvidiaBusId = "PCI:1:0:0";
nvidia = {
nvidiaPersistenced = false;
nvidiaSettings = false;
modesetting.enable = true;
};
};
services.xserver = {
videoDrivers = ["modesetting" "nvidia"];
};
}

View file

@ -1,26 +1,26 @@
{
services.xserver = {
xrandrHeads = [
{
output = "HDMI-0";
primary = true;
monitorConfig = ''
Option "DPMS" "false"
'';
}
];
#set drivers for igpu
videoDrivers = ["amdgpu"];
#fix nasty screen tearing
screenSection = ''
Option "metamodes" "1920x1080_144 +0+0"
Option "TearFree" "true"
'';
#set monitor as primary
#set refreshrate to 144 instead of default(60)
#disable DPMS(screen turning off)
monitorSection = ''
Option "Primary" "true"
Modeline "1920x1080_144" 332.75 1920 1952 2016 2080 1080 1084 1089 1111 +HSync +VSync
Option "PreferredMode" "1920x1080_144"
Option "DPMS" "false"
'';
#disable screen blanking in total
serverFlagsSection = ''
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
Option "DPMS" "false"
Option "BlankTime" "0"
'';
};
}

View file

@ -1,8 +1,4 @@
{
pkgs,
config,
...
}: let
{pkgs, ...}: let
update-system = pkgs.writeShellScriptBin "update-system" ''
if ! [ $(id -u) = 0 ]; then
echo "RUN AS ROOT"

View file

@ -1,4 +1,4 @@
{username, ...}: {
{settings, ...}: {
services.samba-wsdd.enable = true; # make shares visible for windows 10 clients
networking.firewall = {
allowedTCPPorts = [139 445];
@ -10,11 +10,11 @@
openFirewall = true;
shares = {
Share = {
path = "/home/${username}/Share";
path = "/home/${settings.username}/Share";
browseable = "no";
"read only" = "no";
"guest ok" = "no";
"force user" = "${username}";
"force user" = "${settings.username}";
"force group" = "users";
};
};

View file

@ -1,11 +1,11 @@
{
pkgs,
username,
settings,
...
}: {
boot = {
kernelParams = ["amd_iommu=on" "iommu=pt" "vfio_iommu_type1.allow_unsafe_interrupts=1" "kvm.ignore_msrs=1"];
kernelModules = ["vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio"];
kernelModules = ["amd-kvm" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio"];
initrd.kernelModules = ["vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio"];
extraModprobeConfig = ''
options vfio-pci ids=10de:228e,10de:2504
@ -18,7 +18,7 @@
runAsRoot = true;
ovmf.enable = true;
verbatimConfig = ''
user = "${username}"
user = "${settings.username}"
group = "kvm"
namespaces = []
'';

View file

@ -1,16 +1,11 @@
{
config,
pkgs,
username,
inputs,
settings,
...
}: {
services.xserver = {
enable = true;
videoDrivers =
if (config.networking.hostName == "gerg-laptop")
then ["modesetting" "nvidia"]
else ["amdgpu"];
exportConfiguration = true; #make config debuggable
layout = "us";
libinput.enable = true;
xautolock.enable = false;
@ -25,7 +20,7 @@
enable = true;
extraConfig = ''
[greeter]
user = ${username}
user = ${settings.username}
show-password-label = false
password-label-text =
invalid-password-text =
@ -62,7 +57,6 @@
password-border-color = "#000000"
password-border-width = 2px
password-border-radius = 0.341125em
'';
};
};