This commit is contained in:
mjallen18
2025-10-23 22:21:39 -05:00
parent b748aa86a0
commit 35733e1044
17 changed files with 750 additions and 460 deletions

View File

@@ -31,14 +31,24 @@ in
programs.hyprland = {
enable = true;
primaryDisplay = "eDP-1";
display1 = display;
wallpaper = [
"${display.input}, /run/wallpaper.jpg"
monitorv2 = [
{
name = display.input;
mode = "${display.resolution}@${display.refreshRate}";
position = "0x0";
scale = 1.25;
extra = [
"bitdepth"
"10"
"cm"
"hdr"
"sdrbrightness"
"1.2"
"sdrsaturation"
"0.98"
];
monitor = [
"${display.input},${display.resolution}@${display.refreshRate},0x0,1.25,bitdepth,10,cm,hdr,sdrbrightness,1.2,sdrsaturation,0.98"
}
];
workspace = [
@@ -50,6 +60,17 @@ in
windowRule = [
"size 2160 3356, tag:horizonrdp"
];
hyprpaper = {
wallpaperPath = "/run/wallpaper.jpg";
};
keybinds = {
bind = [
"$mod, A, exec, chromium --app=\"https://music.apple.com\""
];
};
defaultApps = {
browser = pkgs.firefox;
};

View File

@@ -33,14 +33,39 @@ in
enable = true;
primaryDisplay = "DP-1";
wallpaper = [
"${displayLeft.input}, /run/wallpaper.jpg"
"${displayRight.input}, /run/wallpaper.jpg"
monitorv2 = [
{
name = displayLeft.input;
mode = "${displayLeft.resolution}@${displayLeft.refreshRate}";
position = "0x0";
scale = 1.0;
extra = [
"bitdepth"
"10"
"cm"
"hdr"
"sdrbrightness"
"1.2"
"sdrsaturation"
"0.98"
];
monitor = [
"${displayLeft.input},${displayLeft.resolution}@${displayLeft.refreshRate},0x0,1,bitdepth,10,cm,hdr,sdrbrightness,1.2,sdrsaturation,0.98"
"${displayRight.input},${displayRight.resolution}@${displayRight.refreshRate},3840x0,1,bitdepth,10,cm,hdr,sdrbrightness,1.5,sdrsaturation,0.98"
}
{
name = displayRight.input;
mode = "${displayRight.resolution}@${displayRight.refreshRate}";
position = "3840x0";
scale = 1.0;
extra = [
"bitdepth"
"10"
"cm"
"hdr"
"sdrbrightness"
"1.5"
"sdrsaturation"
"0.98"
];
}
];
workspace = [
@@ -53,12 +78,24 @@ in
"size 2160 7680, tag:horizonrdp"
];
extraConfig = ''
exec-once = [silent] firefox
exec-once = [silent] vesktop
exec-once = [silent] chromium --app="https://music.apple.com"
exec-once = [silent] steam
'';
autostartCommands = [
"[silent] firefox"
"[silent] vesktop"
"[silent] chromium --app=\"https://music.apple.com\""
"[silent] steam"
];
hyprpaper = {
wallpaperPath = "/run/wallpaper.jpg";
};
keybinds = {
bind = [
"$mod, A, exec, chromium --app=\"https://music.apple.com\""
"$mod, C, exec, vesktop"
"$mod, G, exec, steam"
];
};
defaultApps = {
browser = pkgs.firefox;

View File

@@ -17,11 +17,13 @@ in
config = mkIf cfg.enable {
# Home packages
home.packages = with pkgs; [
home.packages =
with pkgs;
(
[
box64
brightnessctl
ddcutil
dunst
egl-wayland
file-roller
glib
@@ -44,7 +46,6 @@ in
kdePackages.qtmultimedia
libnotify
libz
mako
meson
nautilus
nomacs
@@ -53,11 +54,8 @@ in
pamixer
pavucontrol
playerctl
polkit
polkit_gnome
qt5.qtwayland
qt6.qtwayland
rofi
waybar
wayland-protocols
wayland-utils
@@ -66,15 +64,15 @@ in
wl-clipboard
wlogout
wlroots
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
xdg-desktop-portal-wlr
xorg.xhost
xsettingsd
xwayland
pkgs.mjallen.pipewire-python
];
]
++ (if cfg.notificationDaemon == "mako" then [ mako ] else [ dunst ])
++ (if cfg.launcher == "wofi" then [ wofi ] else [ rofi ])
);
# Session variables
home.sessionVariables = {
@@ -114,11 +112,23 @@ in
hyprpaper = {
enable = true;
settings = {
preload = [ "/run/wallpaper.jpg" ];
wallpaper = [
"${cfg.display1.input}, /run/wallpaper.jpg"
"${cfg.display2.input}, /run/wallpaper.jpg"
preload = [ cfg.hyprpaper.wallpaperPath ];
wallpaper =
let
useMonitorV2 = (lib.versionAtLeast pkgs.hyprland.version "0.40.0") && (cfg.monitorv2 != [ ]);
names =
if useMonitorV2 then
map (m: m.name) cfg.monitorv2
else
[
cfg.display1.input
cfg.display2.input
];
in
if cfg.hyprpaper.usePerMonitor then
map (n: "${n}, ${cfg.hyprpaper.wallpaperPath}") names
else
[ ", ${cfg.hyprpaper.wallpaperPath}" ];
splash = false;
};
};
@@ -139,16 +149,16 @@ in
# on-resume = "brightnessctl -r"; # monitor backlight restore.
# }
{
timeout = 900; # 15 min
timeout = cfg.hyprIdle.lockScreenTimer;
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
}
{
timeout = 930; # 15.5 min
timeout = cfg.hyprIdle.screenOffTimer;
on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed
on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired.
}
{
timeout = 3600; # 1hr
timeout = cfg.hyprIdle.suspendTimer;
on-timeout = "systemctl suspend"; # suspend pc
}
];
@@ -212,8 +222,22 @@ in
# hyprgrass
];
settings = {
"$mod" = "SUPER";
settings =
let
useMonitorV2 = (lib.versionAtLeast pkgs.hyprland.version "0.40.0") && (cfg.monitorv2 != [ ]);
names =
if useMonitorV2 then
map (m: m.name) cfg.monitorv2
else
[
cfg.display1.input
cfg.display2.input
];
firstMonitor = builtins.elemAt names 0;
secondMonitor = if builtins.length names > 1 then builtins.elemAt names 1 else firstMonitor;
in
{
"$mod" = cfg.modKey;
# Mouse
# mouse_[up|down] - scroll wheel
@@ -237,8 +261,8 @@ in
bind = [
"$mod, Return, exec, ${cfg.defaultApps.terminal.pname}"
"$mod, SPACE, exec, wofi --show drun"
", xf86Search, exec, wofi --show drun"
"$mod, SPACE, exec, ${if cfg.launcher == "wofi" then "wofi --show drun" else "rofi -show drun"}"
", xf86Search, exec, ${if cfg.launcher == "wofi" then "wofi --show drun" else "rofi -show drun"}"
"$mod, Q, killactive, "
"$mod, M, exec, wlogout --protocol layer-shell"
"$mod, E, exec, ${cfg.defaultApps.fileExplorer.pname}"
@@ -252,8 +276,8 @@ in
"$mod SHIFT, F, fullscreen, 0"
"$mod SHIFT, E, exec, smile"
"$mod, mouse:276, movecurrentworkspacetomonitor, ${cfg.display1.input}"
"$mod, mouse:275, movecurrentworkspacetomonitor, ${cfg.display2.input}"
"$mod, mouse:276, movecurrentworkspacetomonitor, ${firstMonitor}"
"$mod, mouse:275, movecurrentworkspacetomonitor, ${secondMonitor}"
# alt-tab between workspaces on active monitor
"$mod, Tab, workspace, m+1"
@@ -297,7 +321,8 @@ in
"$mod SHIFT, j, movewindow, d"
"$mod, b, exec, ${cfg.defaultApps.browser.pname}"
];
]
++ cfg.keybinds.bind;
bindm = [
# Move/resize windows with mod + LMB/RMB and dragging
@@ -305,12 +330,14 @@ in
"$mod, mouse:273, resizewindow"
# middle mouse will grab a window, mod + middle mouse will close it
"$mod SHIFT, mouse:274, movewindow"
];
]
++ cfg.keybinds.bindm;
bindel = [
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
]
++ cfg.keybinds.bindel;
bindl = [
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
@@ -324,17 +351,40 @@ in
"$mod, XF86MonBrightnessUp, exec, brightnessctl -d kbd_backlight set +10%"
"$mod, XF86MonBrightnessDown, exec, brightnessctl -d kbd_backlight set 10%-"
];
]
++ cfg.keybinds.bindl;
monitor = cfg.monitor;
monitorv2 = cfg.monitorv2 or { };
monitorv2 = map (
m:
if m.disabled then
"${m.name}, disable"
else if m.mirrorOf != null then
"${m.name}, mirror, ${m.mirrorOf}"
else
let
mode = if m.mode == null then "preferred" else m.mode;
position = if m.position == null then "auto" else m.position;
scale = if m.scale == null then "1" else (toString m.scale);
transform = if m.transform == null then "auto" else m.transform;
base = [
m.name
mode
position
scale
transform
];
line = builtins.concatStringsSep ", " (base ++ m.extra);
in
line
) cfg.monitorv2;
render = {
cm_fs_passthrough = 1;
};
misc = {
vrr = 1;
vrr = if cfg.enableVRR then 1 else 0;
force_default_wallpaper = 0;
};
@@ -345,7 +395,7 @@ in
"col.active_border" = "rgb(8aadf4) rgb(24273A) rgb(24273A) rgb(8aadf4) 45deg";
"col.inactive_border" = "rgb(24273A) rgb(24273A) rgb(24273A) rgb(24273A) 45deg";
layout = "dwindle";
allow_tearing = true;
allow_tearing = cfg.allowTearing;
};
decoration = {
@@ -558,21 +608,24 @@ in
};
debug = {
full_cm_proto = true;
disable_logs = true;
disable_scale_checks = true;
full_cm_proto = cfg.debug.fullCmProto;
disable_logs = cfg.debug.disableLogs;
disable_scale_checks = cfg.debug.disableScaleChecks;
};
};
extraConfig = ''
extraConfig =
let
autostarts = builtins.concatStringsSep "\n" (map (cmd: "exec-once = ${cmd}") cfg.autostartCommands);
in
''
exec-once = dbus-update-activation-environment --systemd --all
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = xhost +SI:localuser:root
exec-once = nwg-look -a
exec-once = nwg-dock-hyprland -d
''
+ cfg.extraConfig or '''';
+ autostarts
+ "\n"
+ (cfg.extraConfig or "");
};
};
}

View File

@@ -14,19 +14,19 @@ with lib;
input = mkOption {
type = types.str;
default = "DP-1";
description = "First display identifier";
description = "First display identifier (Deprecated: prefer monitorv2)";
};
resolution = mkOption {
type = types.str;
default = "3840x2160";
description = "First display resolution";
description = "First display resolution (Deprecated: prefer monitorv2)";
};
refreshRate = mkOption {
type = types.str;
default = "240.00000";
description = "First display refresh rate";
description = "First display refresh rate (Deprecated: prefer monitorv2)";
};
};
@@ -34,38 +34,104 @@ with lib;
input = mkOption {
type = types.str;
default = "DP-1";
description = "Second display identifier";
description = "Second display identifier (Deprecated: prefer monitorv2)";
};
resolution = mkOption {
type = types.str;
default = "3840x2160";
description = "Second display resolution";
description = "Second display resolution (Deprecated: prefer monitorv2)";
};
refreshRate = mkOption {
type = types.str;
default = "240.00000";
description = "Second display refresh rate";
description = "Second display refresh rate (Deprecated: prefer monitorv2)";
};
};
# Deprecated: prefer hyprpaper.* options
wallpaper = mkOption {
type = with types; listOf str;
default = [ ];
description = "List of hyprland wallpaper configs";
description = "Deprecated: no longer used; prefer hyprpaper.wallpaperPath and hyprpaper.usePerMonitor.";
};
hyprpaper = mkOption {
type = types.submodule {
options = {
wallpaperPath = mkOption {
type = types.str;
default = "/run/wallpaper.jpg";
description = "Path to the wallpaper used by hyprpaper.";
};
usePerMonitor = mkOption {
type = types.bool;
default = true;
description = "If true, generate one wallpaper entry per monitor (monitorv2 preferred, falls back to display1/display2).";
};
};
};
default = { };
description = "Hyprpaper configuration.";
};
monitor = mkOption {
type = with types; listOf str;
default = [ ];
description = "List of hyprland monitor configs";
description = "List of Hyprland monitor configs (legacy). Example: [ \"eDP-1, 1920x1080@60, 0x0, 1\" ]";
};
monitorv2 = mkOption {
type =
with types;
listOf (
types.submodule {
options = {
name = mkOption {
type = types.str;
description = "Monitor name (e.g., DP-1, eDP-1).";
};
mode = mkOption {
type = types.nullOr types.str;
default = null;
description = "Resolution@Hz or keyword (e.g., \"3840x2160@144\" or \"preferred\").";
};
position = mkOption {
type = types.nullOr types.str;
default = null;
description = "Position like \"0x0\" or \"auto\".";
};
scale = mkOption {
type = types.nullOr types.float;
default = null;
description = "Scale factor (e.g., 1.0).";
};
transform = mkOption {
type = types.nullOr types.str;
default = null;
description = "Rotation/transform (e.g., \"normal\", \"90\", \"180\", \"270\", \"flipped\").";
};
disabled = mkOption {
type = types.bool;
default = false;
description = "Disable this monitor.";
};
mirrorOf = mkOption {
type = types.nullOr types.str;
default = null;
description = "Mirror another monitor by name.";
};
extra = mkOption {
type = with types; listOf str;
default = [ ];
description = "List of hyprland monitorv2 configs";
description = "Additional monitorv2 flags appended as-is.";
};
};
}
);
default = [ ];
description = "Hyprland monitorv2 entries as structured options; rendered to lines like \"name, mode, position, scale, transform, ...\".";
};
workspace = mkOption {
@@ -146,6 +212,110 @@ with lib;
description = "Default applications used across the system";
};
autostartCommands = mkOption {
type = with types; listOf str;
default = [
"nwg-look -a"
"nwg-dock-hyprland -d"
];
description = "Commands to run via Hyprland exec-once";
};
launcher = mkOption {
type = types.enum [
"wofi"
"rofi"
];
default = "wofi";
description = "Application launcher to use in keybinds and packages.";
};
notificationDaemon = mkOption {
type = types.enum [
"mako"
"dunst"
];
default = "mako";
description = "Notification daemon to install.";
};
modKey = mkOption {
type = types.str;
default = "SUPER";
description = "Modifier key used for Hyprland binds (e.g., SUPER, ALT).";
};
enableVRR = mkOption {
type = types.bool;
default = true;
description = "Enable variable refresh rate (maps to Hyprland misc.vrr).";
};
allowTearing = mkOption {
type = types.bool;
default = true;
description = "Allow tearing (maps to Hyprland general.allow_tearing).";
};
debug = mkOption {
type = types.submodule {
options = {
disableLogs = mkOption {
type = types.bool;
default = false;
description = "Set Hyprland debug.disable_logs.";
};
fullCmProto = mkOption {
type = types.bool;
default = false;
description = "Set Hyprland debug.full_cm_proto.";
};
disableScaleChecks = mkOption {
type = types.bool;
default = false;
description = "Set Hyprland debug.disable_scale_checks.";
};
};
};
default = { };
description = "Hyprland debug flags.";
};
keybinds = mkOption {
type = types.submodule {
options = {
bind = mkOption {
type = with types; listOf str;
default = [ ];
description = "Hyprland bind entries.";
};
bindm = mkOption {
type = with types; listOf str;
default = [ ];
description = "Hyprland bindm entries.";
};
bindel = mkOption {
type = with types; listOf str;
default = [ ];
description = "Hyprland bindel entries.";
};
bindl = mkOption {
type = with types; listOf str;
default = [ ];
description = "Hyprland bindl entries.";
};
};
};
default = { };
description = "Keybinding lists for Hyprland; useful for host-level overrides.";
};
gestures = mkOption {
type = with types; listOf str;
default = [ ];
description = "Hyprland gesture entries.";
};
hyprIdle = {
lockScreenTimer = mkOption {
type = with types; int;

View File

@@ -119,12 +119,12 @@ in
enable = true;
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
# before = [ "display-manager.service" ];
# requiredBy = [
# "plymouth-quit-wait.service"
# "display-manager.service"
# ];
# wantedBy = [ "display-manager.service" ];
# before = [ "display-manager.service" ];
# requiredBy = [
# "plymouth-quit-wait.service"
# "display-manager.service"
# ];
# wantedBy = [ "display-manager.service" ];
path = [
pkgs.bash
pkgs.jq

View File

@@ -83,10 +83,5 @@ in
dns_enabled = true;
};
};
# Common development programs
programs = {
nix-ld.enable = lib.mkDefault true;
};
};
}

View File

@@ -9,7 +9,10 @@
}:
let
isArm = ("aarch64-linux" == system) || ("aarch64-darwin" == system);
hasDestopEnvironment = config.${namespace}.desktop.cosmic.enable || config.${namespace}.desktop.gnome.enable || config.${namespace}.desktop.hyprland.enable;
hasDestopEnvironment =
config.${namespace}.desktop.cosmic.enable
|| config.${namespace}.desktop.gnome.enable
|| config.${namespace}.desktop.hyprland.enable;
in
{

View File

@@ -61,6 +61,12 @@ in
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
"/var/lib/tailscale"
{
directory = "/var/lib/wallpapers";
user = "nobody";
group = "nobody";
mode = "u=rwx,g=rwx,o=rx";
}
{
directory = "/etc/nix";
user = "root";

View File

@@ -1,6 +1,15 @@
{ config, pkgs, lib, namespace, ... }:
{
config,
pkgs,
lib,
namespace,
...
}:
let
hasDestopEnvironment = config.${namespace}.desktop.cosmic.enable || config.${namespace}.desktop.gnome.enable || config.${namespace}.desktop.hyprland.enable;
hasDestopEnvironment =
config.${namespace}.desktop.cosmic.enable
|| config.${namespace}.desktop.gnome.enable
|| config.${namespace}.desktop.hyprland.enable;
in
{
programs = {

View File

@@ -40,7 +40,7 @@ let
group = "actual";
home = cfg.dataDir;
};
users.groups.actual = {};
users.groups.actual = { };
};
# Create reverse proxy configuration using mkReverseProxy

View File

@@ -1,6 +1,5 @@
{
config,
pkgs,
lib,
namespace,
...
@@ -18,7 +17,7 @@ let
settings = {
server_url = "https://headscale.mjallen.dev:443";
database.sqlite.path = "${cfg.dataDir}/db.sqlite";
dns ={
dns = {
nameservers.global = [
"1.1.1.1"
"8.8.8.8"

View File

@@ -6,10 +6,8 @@
}:
with lib;
let
inherit (lib.${namespace}) mkOpt mkReverseProxyOpt;
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.services.jellyseerr;
jellyseerrPort = 5055;
in
{
options.${namespace}.services.jellyseerr = {
@@ -46,6 +44,6 @@ in
group = "jellyseerr";
home = cfg.dataDir;
};
users.groups.jellyseerr = {};
users.groups.jellyseerr = { };
};
}

View File

@@ -8,8 +8,6 @@ let
inherit (lib.${namespace}) mkOpt mkReverseProxyOpt;
cfg = config.${namespace}.services.ntfy;
ntfyEnvFile = config.sops.secrets."jallen-nas/ntfy/auth-users".path;
ntfyConfig = {
services = {
ntfy-sh = {
@@ -48,7 +46,7 @@ let
group = "ntfy-sh";
home = cfg.dataDir;
};
users.groups.ntfy-sh = {};
users.groups.ntfy-sh = { };
};
# Create reverse proxy configuration using mkReverseProxy

View File

@@ -1,6 +1,5 @@
{
config,
pkgs,
lib,
namespace,
...

View File

@@ -1,5 +1,5 @@
{ inputs, ... }:
final: prev: {
_final: prev: {
rcon = inputs.nixpkgs-stable.legacyPackages.${prev.system}.rcon;
open-webui = inputs.nixpkgs-stable.legacyPackages.${prev.system}.open-webui;
nextcloud-client = inputs.nixpkgs-stable.legacyPackages.${prev.system}.nextcloud-client;

View File

@@ -2,7 +2,6 @@
buildHomeAssistantComponent,
python3Packages,
fetchFromGitHub,
lib,
...
}:
buildHomeAssistantComponent rec {

View File

@@ -25,7 +25,10 @@
package = pkgs.postgresql_16;
enableTCPIP = true;
dataDir = "/media/nas/main/nix-app-data/postgresql";
ensureDatabases = [ "authentik" "homeassistant" ];
ensureDatabases = [
"authentik"
"homeassistant"
];
ensureUsers = [
{
name = "authentik";