Finally switch to flakes.

This commit is contained in:
Jimbo 2024-08-24 22:16:51 -04:00
parent a90e09db74
commit 5e0b713756
116 changed files with 5443 additions and 3 deletions

View file

@ -0,0 +1,15 @@
{
# Enable Bluetooth
hardware.bluetooth = {
enable = true;
settings = {
General.Experimental = "true";
Policy.AutoEnable = "true";
};
};
# Enable lingering for Bluetooth
systemd.tmpfiles.rules = [
"f /var/lib/systemd/linger/jimbo"
];
}

View file

@ -0,0 +1,12 @@
{
# Networking settings
networking = {
# Enable firewall
firewall = {
allowPing = false;
extraInputRules = ''
ip saddr 10.0.0.2 accept comment "Accept Server Connections"
'';
};
};
}

15
nixos/desktop/fonts.nix Normal file
View file

@ -0,0 +1,15 @@
{pkgs, ...}: {
# Fonts
fonts = {
packages = with pkgs; [
liberation_ttf
twitter-color-emoji
ubuntu_font_family
noto-fonts
sarasa-gothic
orbitron
(nerdfonts.override {fonts = ["UbuntuMono"];})
];
fontconfig.defaultFonts.emoji = ["Twitter Color Emoji"];
};
}

23
nixos/desktop/gaming.nix Normal file
View file

@ -0,0 +1,23 @@
{pkgs, ...}: {
# Enable Gamemode to boost games
programs.gamemode = {
enable = true;
settings.general.renice = 10;
};
# Enable hardware like the Steam Controller
hardware.steam-hardware.enable = true;
# Enable the Steam client
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
extraPackages = with pkgs; [
steam-run heroic prismlauncher
];
extraCompatPackages = with pkgs; [
proton-ge-bin
];
};
}

25
nixos/desktop/misc.nix Normal file
View file

@ -0,0 +1,25 @@
{pkgs, ...}: {
# Enable AppImages
programs.appimage = {
enable = true;
binfmt = true;
};
# Network mounts, automounts, and battery saver
services = {
gvfs.enable = true;
udisks2.enable = true;
tlp.enable = true;
};
# Security that only makes sense with a GUI
security = {
polkit.enable = true;
rtkit.enable = true;
};
# Install programs system-wide
environment.systemPackages = with pkgs; [
cifs-utils
];
}

View file

@ -0,0 +1,26 @@
{pkgs, ...}: {
# Enabling sound
sound.enable = true;
# Enable Pipewire
services = {
pipewire = {
enable = true;
audio.enable = true;
wireplumber = {
enable = true;
configPackages = [
(pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf" ''
wireplumber.settings = { bluetooth.autoswitch-to-headset-profile = false }
'')
];
};
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
#jack.enable = true;
};
};
}

View file

@ -0,0 +1,20 @@
{pkgs, ...}: {
# Enable printing
services = {
printing = {
enable = true;
drivers = with pkgs; [hplip];
webInterface = false;
};
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
};
# Install programs system-wide
environment.systemPackages = with pkgs; [
system-config-printer
];
}

13
nixos/desktop/school.nix Normal file
View file

@ -0,0 +1,13 @@
{pkgs, ...}: {
# Install programs system-wide
environment.systemPackages = with pkgs; [
remmina
freerdp
globalprotect-openconnect
python3
zoom-us
];
# Enable Globalprotect VPN
services.globalprotect.enable = true;
}

32
nixos/desktop/sway.nix Normal file
View file

@ -0,0 +1,32 @@
{pkgs, ...}: {
imports = [
./wayland.nix
];
programs.sway = {
enable = true;
xwayland.enable = true;
extraPackages = with pkgs; [
swaylock
swaybg
];
};
# Allow swaylock to function
security.pam.services.swaylock = {};
# Enable desktop portals for screengrab
xdg.portal = {
wlr = {
enable = true;
settings.screencast = {
max_fps = 60;
chooser_type = "simple";
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or -B 00000066 -b 00000099";
};
};
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
};
}

63
nixos/desktop/wayland.nix Normal file
View file

@ -0,0 +1,63 @@
{pkgs, ...}: {
services = {
# Configure greetd for "auto" login (single user only)
greetd = let
startSway = pkgs.writeScript "startsway" ''
# Use NVIDIA variables if drivers are in use
if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null; then
# NVIDIA/AMD variables
export LIBVA_DRIVER_NAME=nvidia
export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export WLR_NO_HARDWARE_CURSORS=1
else
:
fi
# Sway/Wayland
export XDG_CURRENT_DESKTOP=sway
export QT_QPA_PLATFORM="wayland;xcb"
# Start Sway
sway --unsupported-gpu
'';
in {
enable = true;
restart = true;
settings = {
terminal = {
vt = 2;
switch = true;
};
default_session = {
command = "${startSway}";
user = "jimbo";
};
};
};
dbus.enable = true;
};
programs.xwayland = {
enable = true;
};
# Enable backlight and theme control
programs = {
dconf.enable = true;
light.enable = true;
};
# Packages needed for Wayland
environment.systemPackages = with pkgs; [
wl-clipboard
wdisplays
clipman
libnotify
grim
slurp
swappy
jq
lm_sensors
];
}