Format with Alejandra. Prepare for flakes.

This commit is contained in:
Jimbo 2024-08-22 23:27:34 -04:00
parent e402113111
commit 85f4107c82
3 changed files with 1461 additions and 1204 deletions

View file

@ -1,10 +1,14 @@
{ config, pkgs, options, lib, ... }:
let
{
config,
pkgs,
options,
lib,
...
}: let
# Set common boot paramaters
commonKernelParams = [
# Nvidia settings
"nvidia_drm.fbdev=1"
"nouveau.config=NvGspRm=1"
# VM/GPU passthrough
"amd_iommu=on"
@ -18,12 +22,11 @@ let
"pcie_acs_override=downstream,multifunction"
"pci=routeirq"
];
in
{
in {
# Import other nix files and firmware
imports = let
homeManager = fetchTarball
homeManager =
fetchTarball
"https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz";
in [
./hardware-configuration.nix
@ -36,10 +39,16 @@ in
config = {
allowUnfree = true;
packageOverrides = pkgs: {
unstable = import (fetchTarball
unstable =
import (
fetchTarball
"https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"
){ inherit pkgs; config.allowUnfree = true; };
nur = import (fetchTarball
) {
inherit pkgs;
config.allowUnfree = true;
};
nur = import (
fetchTarball
"https://github.com/nix-community/NUR/archive/master.tar.gz"
) {inherit pkgs;};
};
@ -50,8 +59,7 @@ in
# MPV scripts
(self: super: {
mpv = super.mpv.override {
scripts = with self.mpvScripts;
[ mpris sponsorblock thumbnail ];
scripts = with self.mpvScripts; [mpris sponsorblock thumbnail];
};
})
];
@ -120,7 +128,11 @@ in
enable = true;
extraRules = [
# Give wheel root access, allow persistant session
{ groups = [ "wheel" ]; keepEnv = true; persist = true; }
{
groups = ["wheel"];
keepEnv = true;
persist = true;
}
];
};
};
@ -138,17 +150,24 @@ in
users.users.jimbo = {
description = "Jimbo Awesome";
isNormalUser = true;
hashedPassword =
"$6$gYpE.pG/zPXgin06$2kydjDfd0K62Dhf9P0PFvJhRNz6xIC/bHYaf/XYqyKcLyZNzPQpy8uy9tCRcSYlj1wwBhzVtTRyItwajOHCEj0";
hashedPassword = "$6$gYpE.pG/zPXgin06$2kydjDfd0K62Dhf9P0PFvJhRNz6xIC/bHYaf/XYqyKcLyZNzPQpy8uy9tCRcSYlj1wwBhzVtTRyItwajOHCEj0";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIKC8Uqxb09V3msBgDv6lD/nETMYr/X0OgtpDo8ldcMK jimbo@JimDebianServer"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDLe/HioxCOkszFQdm1vb3ZwuzLzsOThqHNvEI4IXeXZ JimPhone"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPeqiMCRXtpoP+BvKBmzvkL7oLKKCmbfdaQIF3yk/S8I jimbo@DV-JHAMPTON-NIXOS"
];
extraGroups = [
"wheel" "audio" "video" "input" "disk"
"dialout" "networkmanager" "rtkit"
"kvm" "libvirtd" "qemu-libvirtd"
"wheel"
"audio"
"video"
"input"
"disk"
"dialout"
"networkmanager"
"rtkit"
"kvm"
"libvirtd"
"qemu-libvirtd"
];
uid = 1000;
shell = pkgs.zsh;
@ -157,14 +176,19 @@ in
# Install programs system-wide
environment.systemPackages = with pkgs; [
# Essential system tools
cifs-utils parted git
cifs-utils
parted
git
# Printer control
system-config-printer
# Virtual machines
virt-manager virtiofsd dnsmasq
spice-vdagent looking-glass-client
virt-manager
virtiofsd
dnsmasq
spice-vdagent
looking-glass-client
];
# Disable the HTML documentation link
@ -271,8 +295,13 @@ in
# Fonts
fonts = {
packages = with pkgs; [
liberation_ttf twitter-color-emoji ubuntu_font_family noto-fonts sarasa-gothic
orbitron (nerdfonts.override { fonts = [ "UbuntuMono" ]; })
liberation_ttf
twitter-color-emoji
ubuntu_font_family
noto-fonts
sarasa-gothic
orbitron
(nerdfonts.override {fonts = ["UbuntuMono"];})
];
fontconfig.defaultFonts.emoji = ["Twitter Color Emoji"];
};

View file

@ -1,8 +1,11 @@
# This file was generated by 'nixos-generate-config'
# and may be overwritten by future invocations.
{ config, lib, pkgs, modulesPath, ... }:
# This file was generated by 'nixos-generate-config', try not to modify too much
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];

View file

@ -1,5 +1,9 @@
{ config, pkgs, options, ... }:
let
{
config,
pkgs,
options,
...
}: let
# Global color palette
primeCol = ''3823C4''; #3823C4
accentCol = ''1B1F59''; #1B1F59
@ -47,10 +51,25 @@ let
};
# Define the workspace names
w0 = ''0:0''; w1 = ''1:1''; w2 = ''2:2''; w3 = ''3:3''; w4 = ''4:4'';
w5 = ''5:5''; w6 = ''6:6''; w7 = ''7:7''; w8 = ''8:8''; w9 = ''9:9'';
w1a = ''11:I''; w2a = ''22:II''; w3a = ''33:III''; w4a = ''44:IV'';
w5a = ''55:V''; w6a = ''66:VI''; w7a = ''77:VII''; w8a = ''88:VIII''; w9a = ''99:IX'';
w0 = ''0:0'';
w1 = ''1:1'';
w2 = ''2:2'';
w3 = ''3:3'';
w4 = ''4:4'';
w5 = ''5:5'';
w6 = ''6:6'';
w7 = ''7:7'';
w8 = ''8:8'';
w9 = ''9:9'';
w1a = ''11:I'';
w2a = ''22:II'';
w3a = ''33:III'';
w4a = ''44:IV'';
w5a = ''55:V'';
w6a = ''66:VI'';
w7a = ''77:VII'';
w8a = ''88:VIII'';
w9a = ''99:IX'';
# Define the primary monitor
display1 = ''DP-3'';
@ -771,7 +790,8 @@ let
]
}
'';
in pkgs.writeScriptBin "pfetch"
in
pkgs.writeScriptBin "pfetch"
''fastfetch --config ${smallConf}'';
# Ranger's bookmarks
@ -1083,42 +1103,82 @@ let
overflow: hidden !important;
}
'';
in
{
in {
# Define home manager programs and configs
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.jimbo = { config, pkgs, ... }: {
users.jimbo = {
config,
pkgs,
...
}: {
# Install user programs
home.packages = (with pkgs; [
home.packages = with pkgs; [
# Useful programs
rofi-bluetooth bemoji imv qbittorrent
libreoffice-fresh easyeffects vesktop
element-desktop ffmpegthumbnailer thunderbird
rofi-bluetooth
bemoji
imv
qbittorrent
libreoffice-fresh
easyeffects
vesktop
element-desktop
ffmpegthumbnailer
thunderbird
# Terminal programs
dua vimv p7zip fastfetch gotop pciutils usbutils
pulsemixer tcptrack mpc-cli protonvpn-cli_2
dua
vimv
p7zip
fastfetch
gotop
pciutils
usbutils
pulsemixer
tcptrack
mpc-cli
protonvpn-cli_2
# Scripts as global programs
rofiScripts makoToggle swayLock screenShot pFetch
rofiScripts
makoToggle
swayLock
screenShot
pFetch
# Production tools
krita inkscape audacity blender sunvox
krita
inkscape
audacity
blender
sunvox
# File manager
pcmanfm-qt gnome.file-roller imagemagick poppler_utils
pcmanfm-qt
gnome.file-roller
imagemagick
poppler_utils
# School tools
remmina freerdp globalprotect-openconnect python3 zoom-us
remmina
freerdp
globalprotect-openconnect
python3
zoom-us
# Audio/Video tools
yt-dlp spotdl ani-cli playerctl ffmpeg
yt-dlp
spotdl
ani-cli
playerctl
ffmpeg
# Unlimited games
steam steam-run heroic prismlauncher
steam
steam-run
heroic
prismlauncher
# Emulators
#dolphin-emu cemu ryujinx duckstation pcsx2 unstable.lime3ds
@ -1127,9 +1187,18 @@ in
#moonlight-qt
# Window manager apps
swaybg wdisplays wl-clipboard clipman
libnotify bc grim slurp swappy jq lm_sensors
]);
swaybg
wdisplays
wl-clipboard
clipman
libnotify
bc
grim
slurp
swappy
jq
lm_sensors
];
# Enable Sway and write some scripts
wayland.windowManager.sway = let
@ -1180,7 +1249,7 @@ in
'';
in {
enable = true;
#package = pkgs.swayfx
package = pkgs.unstable.sway;
wrapperFeatures.gtk = true;
checkConfig = false;
config = {
@ -1273,7 +1342,12 @@ in
workspaces1 = ["${w0}" "${w1}" "${w2}" "${w3}" "${w1a}" "${w2a}" "${w3a}"];
workspaces2 = ["${w4}" "${w5}" "${w6}" "${w4a}" "${w5a}" "${w6a}"];
workspaces3 = ["${w7}" "${w8}" "${w9}" "${w7a}" "${w8a}" "${w9a}"];
assign = output: workspaces: map (workspace: { inherit workspace; inherit output; }) workspaces;
assign = output: workspaces:
map (workspace: {
inherit workspace;
inherit output;
})
workspaces;
in
(assign "${display1}" workspaces1) ++ (assign "${display2}" workspaces2) ++ (assign "${display3}" workspaces3);
@ -1350,7 +1424,7 @@ in
"${primeMod}+${secMod}+Ctrl+r" = ''exec rofiscripts --resolutions'';
# Open NixOS configuration files
"${primeMod}+F12" = ''exec bash -c "foot nvim /etc/nixos/{configuration,jimbo,hardware-configuration}.nix" | ${sendNotif} "Nix Config"'';
"${primeMod}+F12" = ''exec foot ranger /etc/nixos | ${sendNotif} "Nix Config"'';
# Terminal, rofi, clipmenu, media script, power menu, show/hide waybar
"${primeMod}+Return" = ''exec foot'';
@ -1543,31 +1617,68 @@ in
titlebar = false;
commands = [
# Scratchpads
{ criteria = { con_mark = "scratchpad"; };
command = ''floating enable, sticky enable, move scratchpad, mark borderless''; }
{ criteria = { app_id = "gotop"; };
command = ''mark scratchpad''; }
{ criteria = { app_id = "music"; };
command = ''mark scratchpad''; }
{ criteria = { app_id = "sound"; };
command = ''mark scratchpad''; }
{ criteria = { app_id = "com.github.wwmm.easyeffects"; };
command = ''mark scratchpad, opacity 0.9''; }
{
criteria = {con_mark = "scratchpad";};
command = ''floating enable, sticky enable, move scratchpad, mark borderless'';
}
{
criteria = {app_id = "gotop";};
command = ''mark scratchpad'';
}
{
criteria = {app_id = "music";};
command = ''mark scratchpad'';
}
{
criteria = {app_id = "sound";};
command = ''mark scratchpad'';
}
{
criteria = {app_id = "com.github.wwmm.easyeffects";};
command = ''mark scratchpad, opacity 0.9'';
}
# Create a "Scratchpad" for apps I don't want to be seen when launched
{ criteria = { con_mark = "hiddenaway"; }; command = ''move scratchpad''; }
{
criteria = {con_mark = "hiddenaway";};
command = ''move scratchpad'';
}
# Give apps that don't have them borders
{ criteria = { con_mark = "borderless"; }; command = ''border pixel ${borderWeight}''; }
{ criteria = { app_id = "com.github.wwmm.easyeffects"; }; command = ''mark borderless''; }
{ criteria = { class = "steam"; }; command = ''mark borderless''; }
{ criteria = { app_id = "swappy"; }; command = ''mark borderless''; }
{ criteria = { app_id = "virt-manager"; }; command = ''mark borderless''; }
{ criteria = { window_role = "pop-up"; }; command = ''mark borderless''; }
{
criteria = {con_mark = "borderless";};
command = ''border pixel ${borderWeight}'';
}
{
criteria = {app_id = "com.github.wwmm.easyeffects";};
command = ''mark borderless'';
}
{
criteria = {class = "steam";};
command = ''mark borderless'';
}
{
criteria = {app_id = "swappy";};
command = ''mark borderless'';
}
{
criteria = {app_id = "virt-manager";};
command = ''mark borderless'';
}
{
criteria = {window_role = "pop-up";};
command = ''mark borderless'';
}
# Floating or fullscreen rules
{ criteria = { app_id = "float"; }; command = ''floating enable''; }
{ criteria = { title = "^GlobalShot"; }; command = ''floating enable, fullscreen enable global''; }
{
criteria = {app_id = "float";};
command = ''floating enable'';
}
{
criteria = {title = "^GlobalShot";};
command = ''floating enable, fullscreen enable global'';
}
];
};
assigns = {
@ -1876,8 +1987,16 @@ in
output = [display1 "VGA-1"];
modules-left = ["sway/workspaces" "sway/window"];
modules-right = [
"pulseaudio" "cpu" "memory" "custom/vram" "custom/clock-long"
"gamemode" "sway/scratchpad" "tray" "bluetooth" "network"
"pulseaudio"
"cpu"
"memory"
"custom/vram"
"custom/clock-long"
"gamemode"
"sway/scratchpad"
"tray"
"bluetooth"
"network"
];
"sway/workspaces" = swayWorkspacesModule;
"sway/window" = swayWindowsModule;
@ -1899,8 +2018,13 @@ in
output = [display2];
modules-left = ["sway/workspaces" "sway/window"];
modules-right = [
"pulseaudio" "custom/media" "custom/notifs" "cpu"
"memory" "custom/vram" "custom/clock-long"
"pulseaudio"
"custom/media"
"custom/notifs"
"cpu"
"memory"
"custom/vram"
"custom/clock-long"
];
"sway/workspaces" = swayWorkspacesModule;
"sway/window" = swayWindowsModule;
@ -1919,7 +2043,12 @@ in
output = [display3];
modules-left = ["sway/workspaces" "sway/window"];
modules-right = [
"pulseaudio" "custom/weather" "cpu" "memory" "custom/vram" "custom/clock-short"
"pulseaudio"
"custom/weather"
"cpu"
"memory"
"custom/vram"
"custom/clock-short"
];
"sway/workspaces" = swayWorkspacesModule;
"sway/window" = swayWindowsModule;
@ -1937,8 +2066,21 @@ in
output = ["eDP-1" "LVDS-1" "DSI-1" "HDMI-A-1"];
modules-left = ["sway/workspaces" "sway/window"];
modules-right = [
"pulseaudio" "custom/media" "custom/notifs" "custom/weather2" "cpu" "memory" "custom/vram" "backlight"
"battery" "custom/clock-long" "gamemode" "sway/scratchpad" "tray" "bluetooth" "network"
"pulseaudio"
"custom/media"
"custom/notifs"
"custom/weather2"
"cpu"
"memory"
"custom/vram"
"backlight"
"battery"
"custom/clock-long"
"gamemode"
"sway/scratchpad"
"tray"
"bluetooth"
"network"
];
"sway/workspaces" = swayWorkspacesModule;
"sway/window" = swayWindowsModule;
@ -2146,29 +2288,47 @@ in
# Enable Librewolf and extensions
programs.firefox = let
commonExtensions = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin bitwarden darkreader sponsorblock return-youtube-dislikes no-pdf-download
ublock-origin
bitwarden
darkreader
sponsorblock
return-youtube-dislikes
no-pdf-download
];
commonSearch = {
force = true;
default = "Google";
engines = {
"Google" = {
urls = [{
urls = [
{
template = "https://www.google.com/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
{
name = "q";
value = "{searchTerms}";
}
];
}
];
}];
definedAliases = ["@g"];
};
"NixPKGs" = {
urls = [{
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@pkgs"];
};
@ -2234,8 +2394,16 @@ in
settings = commonSettings;
containersForce = true;
containers = {
Google = { color = "green"; icon = "fingerprint"; id = 200; };
Seneca = { color = "red"; icon = "briefcase"; id = 201; };
Google = {
color = "green";
icon = "fingerprint";
id = 200;
};
Seneca = {
color = "red";
icon = "briefcase";
id = 201;
};
};
};
};
@ -2287,19 +2455,26 @@ in
vimAlias = true;
plugins = with pkgs.vimPlugins; [
# Vim theme
vim-airline vim-airline-themes
vim-airline
vim-airline-themes
# Internal clipboard
vim-vsnip cmp-vsnip
vim-vsnip
cmp-vsnip
# Autocomplete manager
lspkind-nvim
# Autocomplete plugins
cmp-nvim-lsp cmp-buffer cmp-path cmp-cmdline nvim-cmp
cmp-nvim-lsp
cmp-buffer
cmp-path
cmp-cmdline
nvim-cmp
# Hex color visualizer and color theme
nvim-colorizer-lua vim-monokai-pro
nvim-colorizer-lua
vim-monokai-pro
];
extraConfig = ''
lua <<EOF
@ -2409,28 +2584,76 @@ in
};
rifle = [
# Text editing
{ condition = ''ext xml|json|jsonc|m3u|m3u8|csv|tex|py|pl|rb|js|sh|php|md|nix''; command = ''vim -- "$@"''; }
{
condition = ''ext xml|json|jsonc|m3u|m3u8|csv|tex|py|pl|rb|js|sh|php|md|nix'';
command = ''vim -- "$@"'';
}
# Media
{ condition = ''mime ^image, has imv, X, flag f''; command = ''imv -- "$@"''; }
{ condition = ''mime ^video, terminal, has mpv''; command = ''mpv -- "$@"''; }
{ condition = ''mime ^video, terminal, has mpv''; command = ''mpv --video-rotate=270 -- "$@"''; }
{ condition = ''mime ^audio|ogg$, terminal, has mpv''; command = ''mpv --no-audio-display -- "$@"''; }
{ condition = ''mime ^audio|ogg$, terminal, has mpv''; command = ''mpv --shuffle --no-audio-display -- "$@"''; }
{ condition = ''ext x?html?|pdf, has librewolf, X, flag f''; command = ''librewolf -- "$@"''; }
{ condition = ''ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f''; command = ''libreoffice "$@"''; }
{
condition = ''mime ^image, has imv, X, flag f'';
command = ''imv -- "$@"'';
}
{
condition = ''mime ^video, terminal, has mpv'';
command = ''mpv -- "$@"'';
}
{
condition = ''mime ^video, terminal, has mpv'';
command = ''mpv --video-rotate=270 -- "$@"'';
}
{
condition = ''mime ^audio|ogg$, terminal, has mpv'';
command = ''mpv --no-audio-display -- "$@"'';
}
{
condition = ''mime ^audio|ogg$, terminal, has mpv'';
command = ''mpv --shuffle --no-audio-display -- "$@"'';
}
{
condition = ''ext x?html?|pdf, has librewolf, X, flag f'';
command = ''librewolf -- "$@"'';
}
{
condition = ''ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f'';
command = ''libreoffice "$@"'';
}
# Scripts
{ condition = ''sh''; command = ''sh -- "$1"''; }
{ condition = ''py''; command = ''python -- "$1"''; }
{ condition = ''pl''; command = ''perl -- "$1"''; }
{ condition = ''js''; command = ''node -- "$1"''; }
{ condition = ''php''; command = ''php -- "$1"''; }
{
condition = ''sh'';
command = ''sh -- "$1"'';
}
{
condition = ''py'';
command = ''python -- "$1"'';
}
{
condition = ''pl'';
command = ''perl -- "$1"'';
}
{
condition = ''js'';
command = ''node -- "$1"'';
}
{
condition = ''php'';
command = ''php -- "$1"'';
}
# Misc
{ condition = ''ext exe|msi''; command = ''wine "$1"''; }
{ condition = ''ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz|iso|jar|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has 7z''; command = ''7z x -- "$@"''; }
{ condition = ''label open, has xdg-open''; command = ''xdg-open -- "$@"''; }
{
condition = ''ext exe|msi'';
command = ''wine "$1"'';
}
{
condition = ''ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz|iso|jar|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has 7z'';
command = ''7z x -- "$@"'';
}
{
condition = ''label open, has xdg-open'';
command = ''xdg-open -- "$@"'';
}
];
plugins = [
{
@ -2585,8 +2808,11 @@ in
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-pipewire-audio-capture obs-webkitgtk
obs-multi-rtmp obs-vkcapture obs-tuna
obs-pipewire-audio-capture
obs-webkitgtk
obs-multi-rtmp
obs-vkcapture
obs-tuna
looking-glass-obs
];
};
@ -2736,8 +2962,7 @@ in
spotdl = "spotdl --m3u --format opus";
# Flakes
buildiso =
"${pkgs.nixos-generators}/bin/nixos-generate -f install-iso -c /home/jimbo/Downloads/NixISO/configuration.nix";
buildiso = "${pkgs.nixos-generators}/bin/nixos-generate -f install-iso -c /home/jimbo/Downloads/NixISO/configuration.nix";
};
};