mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
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:
parent
67b3e39735
commit
6b7ce7d133
25 changed files with 152 additions and 165 deletions
|
|
@ -1,27 +1,27 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
settings,
|
||||
...
|
||||
}: {
|
||||
system.stateVersion = "23.05";
|
||||
system.stateVersion = settings.version;
|
||||
environment = {
|
||||
defaultPackages = []; #don't install anything by default
|
||||
binsh = "${pkgs.dash}/bin/dash"; #use dash for speed
|
||||
variables = {
|
||||
EDITOR = "vi";
|
||||
VISUAL = "vi";
|
||||
PAGER = "page";
|
||||
SYSTEMD_PAGERSECURE = "true";
|
||||
TERMINAL = "st";
|
||||
};
|
||||
};
|
||||
#nix stuff
|
||||
nix = {
|
||||
settings = {
|
||||
auto-optimise-store = true; #save space
|
||||
cores = 0; # use all cores
|
||||
keep-outputs = false; #don't make ./results files
|
||||
keep-derivations = false; #^
|
||||
experimental-features = "nix-command flakes";
|
||||
#hardware stuff
|
||||
hardware = {
|
||||
enableRedistributableFirmware = true;
|
||||
opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
};
|
||||
#sound settings
|
||||
|
|
|
|||
30
flake.nix
30
flake.nix
|
|
@ -25,25 +25,22 @@
|
|||
suckless,
|
||||
...
|
||||
} @ inputs: let
|
||||
username = "gerg";
|
||||
settings = {
|
||||
username = "gerg";
|
||||
version = "23.05";
|
||||
};
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
packageOverrides = super: let
|
||||
self = super.pkgs;
|
||||
in {
|
||||
nerdfonts-overpass = self.nerdfonts.override {
|
||||
fonts = ["Overpass"];
|
||||
};
|
||||
};
|
||||
};
|
||||
config.allowUnfree = true;
|
||||
overlays = [
|
||||
(final: prev: rec {
|
||||
t-rex-miner = final.callPackage ./pkgs/t-rex-miner {};
|
||||
afk-cmds = final.callPackage ./pkgs/afk-cmds {};
|
||||
parrot = final.callPackage ./pkgs/parrot {};
|
||||
nerdfonts-overpass = prev.nerdfonts.override {
|
||||
fonts = ["Overpass"];
|
||||
};
|
||||
discord = prev.discord.override {
|
||||
withOpenASAR = true;
|
||||
nss = prev.nss_latest;
|
||||
|
|
@ -59,7 +56,7 @@
|
|||
nixosConfigurations = {
|
||||
gerg-desktop = lib.nixosSystem {
|
||||
inherit system pkgs;
|
||||
specialArgs = {inherit inputs username;};
|
||||
specialArgs = {inherit inputs settings;};
|
||||
modules = [
|
||||
./configuration.nix
|
||||
./systems/desktop.nix
|
||||
|
|
@ -77,6 +74,11 @@
|
|||
nixpkgs.flake = nixpkgs;
|
||||
suckless.flake = suckless;
|
||||
};
|
||||
settings = {
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
auto-optimise-store = true;
|
||||
warn-dirty = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
home-manager.nixosModules.home-manager
|
||||
|
|
@ -84,9 +86,9 @@
|
|||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = false;
|
||||
extraSpecialArgs = {inherit spicetify-nix username;};
|
||||
extraSpecialArgs = {inherit spicetify-nix settings;};
|
||||
users = {
|
||||
${username} = import ./home-manager/home.nix;
|
||||
${settings.username} = import ./home-manager/home.nix;
|
||||
root = import ./home-manager/root.nix;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,5 +11,6 @@
|
|||
"MIN_WIDTH": 0,
|
||||
"MIN_HEIGHT": 0,
|
||||
"OPEN_ON_STARTUP": false,
|
||||
"MINIMIZE_TO_TRAY": false
|
||||
"MINIMIZE_TO_TRAY": false,
|
||||
"SKIP_HOST_UPDATE": true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitMinimal;
|
||||
userName = "ISnortPennies";
|
||||
userEmail = "ISnortPennies@protonmail.com";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
username,
|
||||
settings,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
|
|
@ -9,14 +8,13 @@
|
|||
./sxhkd.nix
|
||||
./theme.nix
|
||||
./picom.nix
|
||||
./git.nix
|
||||
./spicetify.nix
|
||||
./neovim
|
||||
];
|
||||
xsession.numlock.enable = true;
|
||||
home = {
|
||||
homeDirectory = "/home/${username}";
|
||||
stateVersion = "23.05";
|
||||
homeDirectory = "/home/${settings.username}";
|
||||
stateVersion = settings.version;
|
||||
file = {
|
||||
".background-image".source = ../images/nix-stars.png;
|
||||
".config" = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
programs = {
|
||||
librewolf = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ vim.g.indentLine_setConceal = 0
|
|||
vim.g.loaded = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
require("nvim-tree").setup {
|
||||
open_on_setup = true,
|
||||
open_on_setup = false,
|
||||
sort_by = "case_sensitive",
|
||||
view = {
|
||||
adaptive_size = true,
|
||||
|
|
@ -63,7 +63,9 @@ vim.cmd[[colorscheme moonfly]]
|
|||
-- pretty colors
|
||||
require("colorizer").setup()
|
||||
require("telescope").load_extension("fzy_native")
|
||||
require("gitsigns").setup()
|
||||
require("gitsigns").setup {
|
||||
current_line_blame = true,
|
||||
}
|
||||
require("nvim-autopairs").setup()
|
||||
|
||||
-- telescope keybinds
|
||||
|
|
|
|||
|
|
@ -1,17 +1,12 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
{settings, ...}: {
|
||||
imports = [
|
||||
./theme.nix
|
||||
./git.nix
|
||||
./neovim
|
||||
];
|
||||
home = {
|
||||
username = "root";
|
||||
homeDirectory = "/root";
|
||||
stateVersion = "23.05";
|
||||
stateVersion = settings.version;
|
||||
file = {
|
||||
".config/neofetch/config.conf" = {
|
||||
source = ./config/neofetch/config.conf;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
spicetify-nix,
|
||||
...
|
||||
}: let
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
{
|
||||
pkgs,
|
||||
home-manager,
|
||||
...
|
||||
}: {
|
||||
{pkgs, ...}: {
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
boot.initrd.kernelModules = ["amdgpu"];
|
||||
hardware.opengl = {
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -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
15
modules/git.nix
Normal 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
27
modules/mining.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
{config, ...}: {
|
||||
hardware = {
|
||||
nvidia = {
|
||||
nvidiaPersistenced = false;
|
||||
nvidiaSettings = false;
|
||||
modesetting.enable = true;
|
||||
};
|
||||
opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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
19
modules/parrot.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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"];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
{pkgs, ...}: let
|
||||
update-system = pkgs.writeShellScriptBin "update-system" ''
|
||||
if ! [ $(id -u) = 0 ]; then
|
||||
echo "RUN AS ROOT"
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 = []
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
callPackage,
|
||||
lib,
|
||||
username,
|
||||
settings,
|
||||
...
|
||||
}: {
|
||||
#important stuff first
|
||||
imports = [
|
||||
../modules/amd.nix
|
||||
../modules/packages.nix
|
||||
../modules/boot.nix
|
||||
../modules/fonts.nix
|
||||
|
|
@ -18,29 +14,31 @@
|
|||
../modules/xserver.nix
|
||||
../modules/smb.nix
|
||||
../modules/zsh.nix
|
||||
../modules/git.nix
|
||||
#../modules/mining.nix
|
||||
../modules/parrot.nix
|
||||
];
|
||||
networking.hostName = "gerg-desktop";
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
#end important stuff
|
||||
environment.systemPackages = with pkgs; [
|
||||
#afk-cmds
|
||||
xmrig
|
||||
t-rex-miner
|
||||
vscodium
|
||||
gimp
|
||||
];
|
||||
#user managment
|
||||
users = {
|
||||
defaultUserShell = pkgs.zsh;
|
||||
users."${username}" = {
|
||||
users."${settings.username}" = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel" "audio" "networkmanager" "kvm" "libvirtd"];
|
||||
};
|
||||
};
|
||||
boot = {
|
||||
initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "uas" "sd_mod"];
|
||||
kernelModules = ["kvm-amd" "msr"];
|
||||
kernelParams = ["iomem=relaxed" "msr.allow_writes=on"];
|
||||
initrd = {
|
||||
kernelModules = ["amdgpu"];
|
||||
availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "uas" "sd_mod"];
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
|
|
@ -53,34 +51,4 @@
|
|||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
#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/${username}/parrot/.env";
|
||||
};
|
||||
};
|
||||
#mining stuff
|
||||
systemd.services.mining = {
|
||||
enable = false;
|
||||
path = with pkgs; [t-rex-miner afk-cmds st zsh dbus xmrig];
|
||||
wants = ["graphical.target"];
|
||||
script = ''
|
||||
afk-cmds -c /home/${username}/afk-cmds.json
|
||||
'';
|
||||
environment = {
|
||||
# PATH="/run/current-system/sw/bin"; missing something with dbus
|
||||
XAUTHORITY = "/home/${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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,15 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
callPackage,
|
||||
lib,
|
||||
username,
|
||||
settings,
|
||||
...
|
||||
}: {
|
||||
#important stuff first
|
||||
imports = [
|
||||
../modules/boot.nix
|
||||
../modules/prime.nix
|
||||
../modules/nvidia.nix
|
||||
../modules/packages.nix
|
||||
../modules/fonts.nix
|
||||
../modules/git.nix
|
||||
../modules/packages.nix
|
||||
../modules/prime.nix
|
||||
../modules/scripts.nix
|
||||
../modules/xserver.nix
|
||||
../modules/zsh.nix
|
||||
|
|
@ -22,13 +19,14 @@
|
|||
hardware.cpu.amd.updateMicrocode = true;
|
||||
|
||||
# end important stuff
|
||||
environment.systemPackages = with pkgs; [
|
||||
xorg.xf86videoamdgpu
|
||||
];
|
||||
#environment.systemPackages = with pkgs; [
|
||||
# xorg.xf86videoamdgpu
|
||||
#];
|
||||
#don't think i need this^
|
||||
# user managment
|
||||
users = {
|
||||
defaultUserShell = pkgs.zsh;
|
||||
users."${username}" = {
|
||||
users."${settings.username}" = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel" "audio" "networkmanager"];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue