mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 08:53:56 -05:00
rename modules folder to imports
This commit is contained in:
parent
ad16fd69f5
commit
ad704d807c
21 changed files with 12 additions and 12 deletions
28
imports/boot.nix
Normal file
28
imports/boot.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{pkgs, ...}: {
|
||||
environment.etc = {
|
||||
"issue" = {
|
||||
text = "[?12l[?25h";
|
||||
mode = "0444";
|
||||
};
|
||||
};
|
||||
boot = {
|
||||
blacklistedKernelModules = ["nouveau" "lbm-nouveau" "pcspkr"];
|
||||
kernelParams = ["fbcon=nodefer" "bgrt_disable" "quiet" "systemd.show_status=false" "rd.udev.log_level=3" "vt.global_cursor_default=0"];
|
||||
consoleLogLevel = 0;
|
||||
initrd.verbose = false;
|
||||
plymouth = {
|
||||
enable = true;
|
||||
theme = "breeze";
|
||||
logo = ../images/nixos.png;
|
||||
};
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
consoleMode = "max";
|
||||
editor = false;
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 0;
|
||||
};
|
||||
};
|
||||
}
|
||||
55
imports/dwm.nix
Normal file
55
imports/dwm.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
pkgs,
|
||||
settings,
|
||||
...
|
||||
}: {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
exportConfiguration = true; #make config debuggable
|
||||
layout = "us";
|
||||
libinput.enable = true;
|
||||
xautolock.enable = false;
|
||||
desktopManager.xterm.enable = false;
|
||||
excludePackages = [pkgs.xterm];
|
||||
windowManager.dwm.enable = true;
|
||||
displayManager = {
|
||||
sessionCommands = ''
|
||||
feh --bg-scale ${../images/recursion.png}
|
||||
'';
|
||||
defaultSession = "none+dwm";
|
||||
lightdm = {
|
||||
enable = true;
|
||||
background = ../images/recursion.png;
|
||||
greeters.mini = {
|
||||
enable = true;
|
||||
user = settings.username;
|
||||
extraConfig = ''
|
||||
[greeter]
|
||||
show-password-label = false
|
||||
password-label-text =
|
||||
invalid-password-text =
|
||||
show-input-cursor = false
|
||||
password-alignment = center
|
||||
password-input-width = 19
|
||||
show-image-on-all-monitors = true
|
||||
|
||||
|
||||
[greeter-theme]
|
||||
font = "OverpassMono Nerd Font"
|
||||
font-size = 1.1em
|
||||
text-color = "#7AA2F7"
|
||||
error-color = "#DB4B4B"
|
||||
background-color = "#000000"
|
||||
window-color = "#000000"
|
||||
border-color = "#000000"
|
||||
password-character = -1
|
||||
password-color = "#7AA2F7"
|
||||
password-background-color = "#24283B"
|
||||
password-border-color = "#000000"
|
||||
password-border-radius = 0.341125em
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
49
imports/fonts.nix
Normal file
49
imports/fonts.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{pkgs, ...}: {
|
||||
services.kmscon = {
|
||||
enable = true;
|
||||
hwRender = true;
|
||||
extraConfig = ''
|
||||
font-size=10
|
||||
'';
|
||||
fonts = [
|
||||
{
|
||||
name = "Overpass Mono";
|
||||
package = pkgs.overpass;
|
||||
}
|
||||
{
|
||||
name = "OverpassMono Nerd Font";
|
||||
package =
|
||||
pkgs.nerdfonts.override
|
||||
{
|
||||
fonts = ["Overpass"];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "Material Design Icons";
|
||||
package = pkgs.material-design-icons;
|
||||
}
|
||||
];
|
||||
};
|
||||
fonts = {
|
||||
fonts = with pkgs; [
|
||||
overpass
|
||||
material-design-icons
|
||||
(nerdfonts.override
|
||||
{
|
||||
fonts = ["Overpass"];
|
||||
})
|
||||
];
|
||||
enableDefaultFonts = false;
|
||||
fontDir.enable = true;
|
||||
fontconfig = {
|
||||
enable = true;
|
||||
defaultFonts = {
|
||||
serif = ["Overpass" "Overpass Nerd Font" "Material Design Icons"];
|
||||
sansSerif = ["Overpass" "Overpass Nerd Font" "Material Design Icons"];
|
||||
monospace = ["Overpass Mono" "OverpassMono Nerd Font" "Material Design Icons"];
|
||||
};
|
||||
hinting.enable = true;
|
||||
antialias = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
16
imports/gaming.nix
Normal file
16
imports/gaming.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
heroic
|
||||
legendary-gl
|
||||
prismlauncher
|
||||
];
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||
};
|
||||
}
|
||||
15
imports/git.nix
Normal file
15
imports/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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
56
imports/gnome.nix
Normal file
56
imports/gnome.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
pkgs,
|
||||
settings,
|
||||
...
|
||||
}: {
|
||||
environment.gnome.excludePackages =
|
||||
(with pkgs; [
|
||||
gnome-photos
|
||||
gnome-tour
|
||||
gnome-console
|
||||
gnome-text-editor
|
||||
gnome-online-accounts
|
||||
])
|
||||
++ (with pkgs.gnome; [
|
||||
gnome-terminal
|
||||
gnome-weather
|
||||
gnome-shell
|
||||
gnome-calculator
|
||||
gnome-disk-utility
|
||||
gnome-maps
|
||||
gnome-clocks
|
||||
gnome-remote-desktop
|
||||
gnome-calendar
|
||||
gnome-music
|
||||
simple-scan
|
||||
cheese # webcam tool
|
||||
gedit # text editor
|
||||
epiphany # web browser
|
||||
geary # email reader
|
||||
evince # document viewer
|
||||
gnome-characters
|
||||
totem # video player
|
||||
tali # poker game
|
||||
iagno # go game
|
||||
hitori # sudoku game
|
||||
atomix # puzzle game
|
||||
]);
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
exportConfiguration = true; #make config debuggable
|
||||
layout = "us";
|
||||
libinput.enable = true;
|
||||
xautolock.enable = false;
|
||||
desktopManager.xterm.enable = false;
|
||||
excludePackages = [pkgs.xterm];
|
||||
desktopManager.gnome.enable = true;
|
||||
displayManager = {
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = settings.username;
|
||||
};
|
||||
gdm.enable = true;
|
||||
defaultSession = "gnome";
|
||||
};
|
||||
};
|
||||
}
|
||||
27
imports/mining.nix
Normal file
27
imports/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";
|
||||
};
|
||||
};
|
||||
}
|
||||
27
imports/packages.nix
Normal file
27
imports/packages.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{pkgs, ...}: {
|
||||
environment = {
|
||||
defaultPackages = []; #don't install anything by default
|
||||
systemPackages = with pkgs; [
|
||||
efibootmgr #efi editor
|
||||
pciutils #lspci
|
||||
alsa-utils #volume control
|
||||
xclip #commandline clipboard access
|
||||
btrfs-progs #for external harddrive
|
||||
feh #for wallpaper
|
||||
|
||||
#directly used tui apps
|
||||
bottom #view tasks
|
||||
bc #terminal calculator
|
||||
nix-tree #view packages
|
||||
#pointless stuff
|
||||
cava #pretty audio
|
||||
pipes-rs # more fun things
|
||||
|
||||
#gui apps
|
||||
pavucontrol #gui volume control
|
||||
pcmanfm #file manager
|
||||
#big gui apps
|
||||
librewolf #best browser
|
||||
];
|
||||
};
|
||||
}
|
||||
18
imports/parrot.nix
Normal file
18
imports/parrot.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
pkgs,
|
||||
settings,
|
||||
...
|
||||
}: {
|
||||
#discord bot stuff
|
||||
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";
|
||||
};
|
||||
};
|
||||
}
|
||||
41
imports/picom.nix
Normal file
41
imports/picom.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
services.picom = {
|
||||
enable = true;
|
||||
backend = "glx";
|
||||
shadow = false;
|
||||
shadowOpacity = 0.5;
|
||||
vSync = false;
|
||||
settings = {
|
||||
blur = false;
|
||||
|
||||
shadow-radius = 12;
|
||||
frame-opacity = 1.0;
|
||||
inactive-opacity-override = false;
|
||||
corner-radius = 12;
|
||||
rounded-corners-exclude = [
|
||||
"window_type = 'desktop'"
|
||||
"window_type = 'tooltip'"
|
||||
];
|
||||
mark-wmwin-focused = true;
|
||||
mark-ovredir-focused = true;
|
||||
detect-rounded-corners = true;
|
||||
detect-client-opacity = true;
|
||||
detect-transient = true;
|
||||
use-damage = true;
|
||||
log-level = "warn";
|
||||
wintypes = {
|
||||
tooltip = {
|
||||
fade = true;
|
||||
shadow = false;
|
||||
opacity = 1.0;
|
||||
focus = true;
|
||||
full-shadow = false;
|
||||
};
|
||||
dock = {shadow = true;};
|
||||
dnd = {shadow = true;};
|
||||
popup_menu = {opacity = 1.0;};
|
||||
dropdown_menu = {opacity = 1.0;};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
30
imports/prime.nix
Normal file
30
imports/prime.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{pkgs, ...}: {
|
||||
hardware.nvidia = {
|
||||
prime = {
|
||||
offload.enable = true;
|
||||
amdgpuBusId = "PCI:5:0:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
powerManagement = {
|
||||
enable = true;
|
||||
finegrained = true;
|
||||
};
|
||||
nvidiaPersistenced = true;
|
||||
nvidiaSettings = false;
|
||||
modesetting.enable = true;
|
||||
};
|
||||
services.xserver = {
|
||||
videoDrivers = ["nvidia"];
|
||||
#disable DPMS
|
||||
monitorSection = ''
|
||||
Option "DPMS" "false"
|
||||
'';
|
||||
#disable screen blanking in total
|
||||
serverFlagsSection = ''
|
||||
Option "StandbyTime" "0"
|
||||
Option "SuspendTime" "0"
|
||||
Option "OffTime" "0"
|
||||
Option "BlankTime" "0"
|
||||
'';
|
||||
};
|
||||
}
|
||||
26
imports/refreshrate.nix
Normal file
26
imports/refreshrate.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
services.xserver = {
|
||||
#set drivers for igpu
|
||||
videoDrivers = ["amdgpu"];
|
||||
#fix nasty screen tearing
|
||||
screenSection = ''
|
||||
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 "StandbyTime" "0"
|
||||
Option "SuspendTime" "0"
|
||||
Option "OffTime" "0"
|
||||
Option "BlankTime" "0"
|
||||
'';
|
||||
};
|
||||
}
|
||||
101
imports/shells.nix
Normal file
101
imports/shells.nix
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: rec {
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
dash
|
||||
neovim
|
||||
page
|
||||
zsh
|
||||
st
|
||||
exa
|
||||
fetch-rs
|
||||
];
|
||||
binsh = "${pkgs.dash}/bin/dash"; #use dash for speed
|
||||
variables = {
|
||||
EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
PAGER = "page";
|
||||
SYSTEMD_PAGERSECURE = "true";
|
||||
TERMINAL = "st";
|
||||
NIX_BUILD_SHELL = "zsh";
|
||||
};
|
||||
shellAliases = {
|
||||
#make sudo use aliases
|
||||
sudo = "sudo ";
|
||||
#paste link trick
|
||||
pastebin = "curl -F 'clbin=<-' https://clbin.com";
|
||||
#nix stuff
|
||||
update = "nix flake update /etc/nixos/#";
|
||||
switch = "nixos-rebuild switch";
|
||||
boot = "nixos-rebuild boot";
|
||||
clean = "nix-collect-garbage -d";
|
||||
gc-force = "rm /nix/var/gcroots/auto/*";
|
||||
gc-check = "find -H /nix/var/nix/gcroots/auto -type l | xargs -I {} sh -c 'readlink {}; realpath {}; echo' | page";
|
||||
#vim stuff
|
||||
vi = "nvim";
|
||||
vim = "nvim";
|
||||
vimdiff = "nvim -d";
|
||||
#exa is 1 too many letters
|
||||
ls = "exa";
|
||||
l = "exa -lbF --git";
|
||||
ll = "exa -lbGF --git";
|
||||
llm = "exa -lbGd --git --sort=modified";
|
||||
la = "exa -lbhHigUmuSa --time-style=long-iso --git --color-scale";
|
||||
lx = "exa -lbhHigUmuSa@ --time-style=long-iso --git --color-scale";
|
||||
lS = "exa -1";
|
||||
lt = "exa --tree --level=2";
|
||||
};
|
||||
interactiveShellInit = "fetch-rs";
|
||||
};
|
||||
security.sudo = {
|
||||
enable = true;
|
||||
execWheelOnly = true;
|
||||
extraConfig = ''
|
||||
Defaults env_keep += "${builtins.concatStringsSep " " (builtins.attrNames environment.variables)}"
|
||||
'';
|
||||
};
|
||||
|
||||
#zsh stuff
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
environment.shells = [pkgs.zsh];
|
||||
programs = {
|
||||
zsh = {
|
||||
enable = true;
|
||||
autosuggestions = {
|
||||
enable = true;
|
||||
};
|
||||
syntaxHighlighting = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
#starship
|
||||
starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
add_newline = false;
|
||||
format = "$sudo$cmd_duration \n $directory$git_branch$character";
|
||||
character = {
|
||||
success_symbol = "[ ](#9ece6a bold)";
|
||||
error_symbol = "[ ](#db4b4b bold)";
|
||||
};
|
||||
directory = {
|
||||
read_only = " ";
|
||||
};
|
||||
git_branch = {
|
||||
style = "bold red";
|
||||
};
|
||||
sudo = {
|
||||
format = "[ ](#7aa2f7)";
|
||||
disabled = false;
|
||||
};
|
||||
cmd_duration = {
|
||||
min_time = 5000;
|
||||
style = "bold #9ece6a";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
40
imports/spicetify.nix
Normal file
40
imports/spicetify.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
sp-nix = inputs.spicetify-nix;
|
||||
spicePkgs = sp-nix.packages.${pkgs.system}.default;
|
||||
in {
|
||||
imports = [sp-nix.nixosModule];
|
||||
programs.spicetify = {
|
||||
spotifyPackage = pkgs.spotify-unwrapped;
|
||||
spicetifyPackage = pkgs.spicetify-cli;
|
||||
enable = true;
|
||||
enabledExtensions = with spicePkgs.extensions; [
|
||||
adblock
|
||||
hidePodcasts
|
||||
shuffle
|
||||
];
|
||||
theme = spicePkgs.themes.Dribbblish;
|
||||
colorScheme = "custom";
|
||||
customColorScheme = {
|
||||
text = "f8f8f8";
|
||||
subtext = "f8f8f8";
|
||||
sidebar-text = "79dac8";
|
||||
main = "000000";
|
||||
sidebar = "323437";
|
||||
player = "000000";
|
||||
card = "000000";
|
||||
shadow = "000000";
|
||||
selected-row = "7c8f8f";
|
||||
button = "74b2ff";
|
||||
button-active = "74b2ff";
|
||||
button-disabled = "555169";
|
||||
tab-active = "80a0ff";
|
||||
notification = "80a0ff";
|
||||
notification-error = "e2637f";
|
||||
misc = "282a36";
|
||||
};
|
||||
};
|
||||
}
|
||||
28
imports/sxhkd.nix
Normal file
28
imports/sxhkd.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
maim #screenshooter
|
||||
brightnessctl #brightness control for laptop
|
||||
playerctl #music control
|
||||
];
|
||||
services.sxhkd = {
|
||||
enable = true;
|
||||
keybindings = {
|
||||
#media keybindings
|
||||
"XF86AudioPlay" = "playerctl play-pause";
|
||||
"XF86AudioPause" = "playerctl play-pause";
|
||||
"XF86AudioStop" = "playerctl stop";
|
||||
"XF86AudioNext" = "playerctl next";
|
||||
"XF86AudioPrev" = "playerctl previous";
|
||||
"XF86AudioRaiseVolume" = "amixer sset Master +40";
|
||||
"XF86AudioLowerVolume" = "amixer sset Master -40";
|
||||
"XF86AudioMute" = "amixer sset Master toggle ";
|
||||
"XF86MonBrightnessUp" = "brightnessctl s 20+";
|
||||
"XF86MonBrightnessDown" = "brightnessctl s 20-";
|
||||
#screenshot stuff
|
||||
"Print" = "maim $HOME/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg";
|
||||
"Print + shift" = "maim | xclip -selection clipboard -t image/png";
|
||||
"super + Print" = "maim -s $HOME/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg";
|
||||
"super + Print + shift" = "maim -s | xclip -selection clipboard -t image/png";
|
||||
};
|
||||
};
|
||||
}
|
||||
46
imports/theme.nix
Normal file
46
imports/theme.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{pkgs, ...}: {
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
flat-remix-gtk
|
||||
flat-remix-icon-theme
|
||||
quintom-cursor-theme
|
||||
];
|
||||
etc = {
|
||||
"xdg/gtk-4.0/settings.ini".text = ''
|
||||
[Settings]
|
||||
gtk-cursor-theme-name=Quintom_Ink
|
||||
gtk-cursor-theme-size=16
|
||||
gtk-font-name=Overpass 10
|
||||
gtk-icon-theme-name=Flat-Remix-Blue-Dark
|
||||
gtk-theme-name=Flat-Remix-GTK-Blue-Darkest
|
||||
'';
|
||||
"xdg/gtk-3.0/settings.ini".text = ''
|
||||
[Settings]
|
||||
gtk-cursor-theme-name=Quintom_Ink
|
||||
gtk-cursor-theme-size=16
|
||||
gtk-font-name=Overpass 10
|
||||
gtk-icon-theme-name=Flat-Remix-Blue-Dark
|
||||
gtk-theme-name=Flat-Remix-GTK-Blue-Darkest
|
||||
'';
|
||||
"xdg/gtk-2.0/gtkrc".text = ''
|
||||
gtk-cursor-theme-name = "Quintom_Ink"
|
||||
gtk-cursor-theme-size = 16
|
||||
gtk-font-name = "Overpass 10"
|
||||
gtk-icon-theme-name = "Flat-Remix-Blue-Dark"
|
||||
gtk-theme-name = "Flat-Remix-GTK-Blue-Darkest"
|
||||
'';
|
||||
"xdg/Xresources".text = ''
|
||||
Xcursor.size: 16
|
||||
Xcursor.theme: Quintom_Ink
|
||||
'';
|
||||
};
|
||||
};
|
||||
qt = {
|
||||
enable = true;
|
||||
style = "gtk2";
|
||||
platformTheme = "gtk2";
|
||||
};
|
||||
services.xserver.displayManager.sessionCommands = ''
|
||||
xrdb -load /etc/xdg/Xresources
|
||||
'';
|
||||
}
|
||||
64
imports/vfio.nix
Normal file
64
imports/vfio.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
pkgs,
|
||||
settings,
|
||||
...
|
||||
}: {
|
||||
boot = {
|
||||
kernelParams = ["amd_iommu=on" "iommu=pt" "vfio_iommu_type1.allow_unsafe_interrupts=1" "kvm.ignore_msrs=1"];
|
||||
kernelModules = ["kvm-amd" "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
|
||||
'';
|
||||
};
|
||||
virtualisation = {
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
qemu = {
|
||||
runAsRoot = true;
|
||||
ovmf.enable = true;
|
||||
verbatimConfig = ''
|
||||
user = "${settings.username}"
|
||||
group = "kvm"
|
||||
namespaces = []
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
environment = {
|
||||
systemPackages = with pkgs; [virt-manager];
|
||||
shellAliases = {
|
||||
vm-start = "virsh start Windows";
|
||||
vm-stop = "virsh shutdown Windows";
|
||||
};
|
||||
};
|
||||
systemd.services.libvirtd.preStart = let
|
||||
qemuHook = pkgs.writeScript "qemu-hook" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
|
||||
GUEST_NAME="$1"
|
||||
OPERATION="$2"
|
||||
SUB_OPERATION="$3"
|
||||
|
||||
if [ "$GUEST_NAME" == "Windows" ]; then
|
||||
if [ "$OPERATION" == "start" ]; then
|
||||
systemctl set-property --runtime -- user.slice AllowedCPUs=8-15,24-31
|
||||
systemctl set-property --runtime -- system.slice AllowedCPUs=8-15,24-31
|
||||
systemctl set-property --runtime -- init.scope AllowedCPUs=8-15,24-31
|
||||
fi
|
||||
|
||||
if [ "$OPERATION" == "stopped" ]; then
|
||||
systemctl set-property --runtime -- user.slice AllowedCPUs=0-31
|
||||
systemctl set-property --runtime -- system.slice AllowedCPUs=0-31
|
||||
systemctl set-property --runtime -- init.scope AllowedCPUs=0-31
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
in ''
|
||||
mkdir -p /var/lib/libvirt/hooks
|
||||
chmod 755 /var/lib/libvirt/hooks
|
||||
|
||||
# Copy hook files
|
||||
ln -sf ${qemuHook} /var/lib/libvirt/hooks/qemu
|
||||
'';
|
||||
}
|
||||
60
imports/xfce.nix
Normal file
60
imports/xfce.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
pkgs,
|
||||
settings,
|
||||
...
|
||||
}: {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
exportConfiguration = true; #make config debuggable
|
||||
layout = "us";
|
||||
libinput.enable = true;
|
||||
xautolock.enable = false;
|
||||
desktopManager.xterm.enable = false;
|
||||
excludePackages = [pkgs.xterm];
|
||||
desktopManager.gnome.enable = true;
|
||||
displayManager = {
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = settings.username;
|
||||
};
|
||||
defaultSession = "xfce";
|
||||
lightdm = {
|
||||
enable = true;
|
||||
background = ../images/recursion.png;
|
||||
greeters.mini = {
|
||||
enable = true;
|
||||
user = settings.username;
|
||||
extraConfig = ''
|
||||
[greeter]
|
||||
show-password-label = false
|
||||
password-label-text =
|
||||
invalid-password-text =
|
||||
show-input-cursor = false
|
||||
password-alignment = center
|
||||
password-input-width = 19
|
||||
show-image-on-all-monitors = true
|
||||
|
||||
|
||||
[greeter-theme]
|
||||
font = "OverpassMono Nerd Font"
|
||||
font-size = 1.1em
|
||||
text-color = "#7AA2F7"
|
||||
error-color = "#DB4B4B"
|
||||
background-color = "#000000"
|
||||
window-color = "#000000"
|
||||
border-color = "#000000"
|
||||
password-character = -1
|
||||
password-color = "#7AA2F7"
|
||||
password-background-color = "#24283B"
|
||||
password-border-color = "#000000"
|
||||
password-border-radius = 0.341125em
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
desktopManager.xfce = {
|
||||
enable = true;
|
||||
enableScreensaver = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue