desktop building?

This commit is contained in:
mjallen18
2025-07-20 18:35:14 -05:00
parent 91be65bc39
commit 608a6ce9b8
51 changed files with 535 additions and 299 deletions

View File

@@ -1,105 +0,0 @@
{ lib, config, ... }:
with lib;
let
cfg = config.mjallen.desktop.extra.kitty;
in
{
imports = [ ./options.nix ];
config = mkIf cfg.enable {
programs.kitty = {
enable = true;
shellIntegration.enableZshIntegration = true;
font = {
name = settings.fontName;
package = settings.fontPackage;
size = settings.fontSize;
};
settings = {
bold_font = "auto";
italic_font = "auto";
bold_italic_font = "auto";
mouse_hide_wait = "2.0";
cursor_shape = "block";
url_style = "dotted";
confirm_os_window_close = "0";
background_opacity = "0.85";
# The basic colors
foreground = settings.theme.snowStorm.nord6;
background = settings.theme.polarNight.nord0;
selection_foreground = settings.theme.polarNight.nord0;
selection_background = settings.theme.aurora.nord15;
# Cursor colors
cursor = settings.theme.aurora.nord15;
cursor_text_color = settings.theme.polarNight.nord0;
# URL underline color when hovering with mouse
url_color = settings.theme.aurora.nord15;
# Kitty window border colors
active_border_color = settings.theme.frost.nord10;
inactive_border_color = settings.theme.polarNight.nord1;
bell_border_color = settings.theme.aurora.nord13;
# OS Window titlebar colors
wayland_titlebar_color = settings.theme.polarNight.nord0;
macos_titlebar_color = settings.theme.polarNight.nord0;
# Tab bar colors
active_tab_foreground = settings.theme.polarNight.nord3;
active_tab_background = settings.theme.aurora.nord15;
inactive_tab_foreground = settings.theme.snowStorm.nord6;
inactive_tab_background = settings.theme.polarNight.nord1;
tab_bar_background = settings.theme.polarNight.nord3;
# Colors for marks (marked text in the terminal)
mark1_foreground = settings.theme.polarNight.nord0;
mark1_background = settings.theme.frost.nord10;
mark2_foreground = settings.theme.polarNight.nord0;
mark2_background = settings.theme.aurora.nord15;
mark3_foreground = settings.theme.polarNight.nord0;
mark3_background = settings.theme.frost.nord8;
# The 16 terminal colors
# black
color0 = settings.theme.polarNight.nord0;
# Autosuggestion
color8 = settings.theme.frost.nord10;
# red
color1 = settings.theme.aurora.nord11;
color9 = settings.theme.aurora.nord11;
# green
color2 = settings.theme.aurora.nord14;
color10 = settings.theme.aurora.nord14;
# yellow
color3 = settings.theme.aurora.nord13;
color11 = settings.theme.aurora.nord13;
# blue
color4 = settings.theme.frost.nord10;
color12 = settings.theme.frost.nord10;
# magenta
color5 = settings.theme.aurora.nord15;
color13 = settings.theme.aurora.nord15;
# cyan
color6 = settings.theme.frost.nord8;
color14 = settings.theme.frost.nord8;
# white
color7 = settings.theme.snowStorm.nord5;
color15 = settings.theme.snowStorm.nord4;
};
};
};
}

View File

@@ -1,12 +0,0 @@
{ lib, ... }:
with lib;
{
options.mjallen.desktop.extra.nwg-panel = {
enable = mkEnableOption "enable nwg-panel";
defaultApps = mkOption {
type = attrs;
default = { };
};
};
}

View File

@@ -2,7 +2,7 @@
with lib;
let
cfg = config.mjallen.desktop.hyprland;
drawer = "nwg-drawer -fm nautilus -term kitty -mb 10 -mt 10 -ml 10 -mr 10 -pbuseicontheme -i ${config.home-manager.users.matt.gtk.iconTheme.name}";
drawer = "nwg-drawer -fm nautilus -term kitty -mb 10 -mt 10 -ml 10 -mr 10 -pbuseicontheme -i ${cfg.iconThemeName}";
in
{
imports = [
@@ -71,8 +71,8 @@ in
"$mod SHIFT, F, fullscreen, 0"
"$mod SHIFT, E, exec, smile"
"$mod, mouse:276, movecurrentworkspacetomonitor, ${cfg.displayLeft.input}"
"$mod, mouse:275, movecurrentworkspacetomonitor, ${cfg.displayRight.input}"
"$mod, mouse:276, movecurrentworkspacetomonitor, ${cfg.display1.input}"
"$mod, mouse:275, movecurrentworkspacetomonitor, ${cfg.display2.input}"
# alt-tab between workspaces on active monitor
"$mod, Tab, workspace, m+1"

View File

@@ -5,13 +5,48 @@ with lib;
enable = mkEnableOption "enable hyprland desktop";
primaryDisplay = mkOption {
type = types.string;
type = types.str;
default = "DP-1";
};
display1 = {
input = mkOption {
type = types.str;
default = "DP-1";
};
resolution = mkOption {
type = types.str;
default = "3840x2160";
};
refreshRate = mkOptions {
type = types.str;
default = "240.00000";
};
};
display2 = {
input = mkOption {
type = types.str;
default = "DP-1";
};
resolution = mkOption {
type = types.str;
default = "3840x2160";
};
refreshRate = mkOptions {
type = types.str;
default = "240.00000";
};
};
wallpaper = mkOption {
type = types.string;
default = "/run/wallpaper.jpeg";
type = with types; listOf str;
default = [];
description = "list of hyprland wallpaper configs";
};
monitor = mkOption {
@@ -44,6 +79,16 @@ with lib;
description = "any extra options";
};
iconThemeName = mkOption {
type = types.str;
default = "Colloid-Dark";
};
gtkThemeName = mkOption {
type = types.str;
default = "Colloid-Dark";
};
defaultApps = mkOption {
type = types.submodule {
options = {
@@ -62,15 +107,15 @@ with lib;
hyprIdle = {
lockScreenTimer = mkOption {
type = with types; null || signed integer || floating point number;
type = with types; int;
default = 5;
};
screenOffTimer = mkOption {
type = with types; null || signed integer || floating point number;
type = with types; int;
default = 15;
};
suspendTimer = mkOption {
type = with types; null || signed integer || floating point number;
type = with types; int;
default = 30;
};
};

View File

@@ -22,16 +22,16 @@ in
# on-resume = "brightnessctl -r"; # monitor backlight restore.
# }
{
timeout = cfg.hypridle.lockScreenTimer;
timeout = cfg.hyprIdle.lockScreenTimer;
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
}
{
timeout = cfg.hypridle.screenOffTimer;
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 = cfg.hypridle.suspendTimer;
timeout = cfg.hyprIdle.suspendTimer;
on-timeout = "systemctl suspend"; # suspend pc
}
];

View File

@@ -16,10 +16,10 @@ let
cursorSize = 24;
# GTK
gtkThemeSize = themeSize;
gtkThemeAccent = themeAccent;
gtkThemeVariant = themeVariant;
gtkThemeColor = themeColor;
# gtkThemeSize = themeSize;
# gtkThemeAccent = themeAccent;
# gtkThemeVariant = themeVariant;
# gtkThemeColor = themeColor;
gtkTheme = "Colloid-Dark-Compact-Nord";
gtkThemePkg = pkgs.colloid-gtk-theme.override {
sizeVariants = [ themeSize ];
@@ -29,7 +29,7 @@ let
};
# Icons
iconThemeScheme = iconScheme;
# iconThemeScheme = iconScheme;
iconTheme = "Colloid-Nord-Dark";
iconThemePkg = pkgs.colloid-icon-theme.override {
schemeVariants = [ iconScheme ];

View File

@@ -10,12 +10,12 @@ in
CLUTTER_BACKEND = "wayland";
EDITOR = "${cfg.defaultApps.editor.pname}";
VISUAL = "${cfg.defaultApps.visual.pname}";
ICON_THEME = settings.iconTheme;
ICON_THEME = cfg.iconThemeName;
GTK_CSD = "0";
GTK_THEME = settings.gtkTheme;
GTK_THEME = cfg.gtkThemeName;
GTK_USE_PORTAL = "1";
HYPRCURSOR_THEME = config.home-manager.users.matt.pointerCursor.name;
HYPRCURSOR_SIZE = config.home-manager.users.matt.pointerCursor.size;
HYPRCURSOR_THEME = config.home.pointerCursor.name;
HYPRCURSOR_SIZE = config.home.pointerCursor.size;
MOZ_ENABLE_WAYLAND = "1";
NIXOS_OZONE_WL = "1";
NIXOS_XDG_OPEN_USE_PORTAL = "1";
@@ -26,8 +26,8 @@ in
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
SDL_VIDEODRIVER = "wayland";
TERMINAL = "${cfg.defaultApps.terminal.pname}";
XCURSOR_THEME = config.home-manager.users.matt.pointerCursor.name;
XCURSOR_SIZE = config.home-manager.users.matt.pointerCursor.size;
XCURSOR_THEME = config.home.pointerCursor.name;
XCURSOR_SIZE = config.home.pointerCursor.size;
XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_CURRENT_DESKTOP = "Hyprland";

View File

@@ -31,4 +31,32 @@
nord14 = "#a3be8c";
nord15 = "#b48ead";
};
defaultOpacity = "opacity: 0.85;";
defaultBorderRadius = "border-radius: 1rem;";
defaultCenterOptions = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
'';
borderRight = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
border-radius: 0rem 1rem 1rem 0rem;
margin-right: 0.5rem;
'';
borderLeft = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
border-radius: 1rem 0rem 0rem 1rem;
margin-left: 0.5rem;
'';
}

View File

@@ -39,7 +39,10 @@
btop.enable = lib.mkDefault true;
fastfetch.enable = lib.mkDefault true;
home-manager.enable = lib.mkDefault true;
java.enable = lib.mkDefault true;
java = {
enable = lib.mkDefault true;
package = pkgs.jdk17;
};
mangohud.enable = lib.mkDefault true;
password-store.enable = true;
nh = {

View File

@@ -1,8 +1,8 @@
{ config, lib, ... }:
with lib;
let
cfg = config.mjallen.desktop.extra.btop;
nord = import ../../theme/nord.nix;
cfg = config.mjallen.programs.btop;
nord = import ../../desktop/theme/nord.nix;
in
{
imports = [ ./options.nix ];

View File

@@ -1,7 +1,7 @@
{ lib, ... }:
with lib;
{
options.mjallen.desktop.extra.btop = {
options.mjallen.programs.btop = {
enable = mkEnableOption "enable btop";
};
}

View File

@@ -0,0 +1,106 @@
{ lib, config, ... }:
with lib;
let
cfg = config.mjallen.programs.kitty;
nord = import ../../desktop/theme/nord.nix;
in
{
imports = [ ./options.nix ];
config = mkIf cfg.enable {
programs.kitty = {
enable = true;
shellIntegration.enableZshIntegration = true;
font = {
name = cfg.font.name;
package = cfg.font.package;
size = cfg.font.size;
};
settings = {
bold_font = "auto";
italic_font = "auto";
bold_italic_font = "auto";
mouse_hide_wait = "2.0";
cursor_shape = "block";
url_style = "dotted";
confirm_os_window_close = "0";
background_opacity = "0.85";
# The basic colors
foreground = nord.snowStorm.nord6;
background = nord.polarNight.nord0;
selection_foreground = nord.polarNight.nord0;
selection_background = nord.aurora.nord15;
# Cursor colors
cursor = nord.aurora.nord15;
cursor_text_color = nord.polarNight.nord0;
# URL underline color when hovering with mouse
url_color = nord.aurora.nord15;
# Kitty window border colors
active_border_color = nord.frost.nord10;
inactive_border_color = nord.polarNight.nord1;
bell_border_color = nord.aurora.nord13;
# OS Window titlebar colors
wayland_titlebar_color = nord.polarNight.nord0;
macos_titlebar_color = nord.polarNight.nord0;
# Tab bar colors
active_tab_foreground = nord.polarNight.nord3;
active_tab_background = nord.aurora.nord15;
inactive_tab_foreground = nord.snowStorm.nord6;
inactive_tab_background = nord.polarNight.nord1;
tab_bar_background = nord.polarNight.nord3;
# Colors for marks (marked text in the terminal)
mark1_foreground = nord.polarNight.nord0;
mark1_background = nord.frost.nord10;
mark2_foreground = nord.polarNight.nord0;
mark2_background = nord.aurora.nord15;
mark3_foreground = nord.polarNight.nord0;
mark3_background = nord.frost.nord8;
# The 16 terminal colors
# black
color0 = nord.polarNight.nord0;
# Autosuggestion
color8 = nord.frost.nord10;
# red
color1 = nord.aurora.nord11;
color9 = nord.aurora.nord11;
# green
color2 = nord.aurora.nord14;
color10 = nord.aurora.nord14;
# yellow
color3 = nord.aurora.nord13;
color11 = nord.aurora.nord13;
# blue
color4 = nord.frost.nord10;
color12 = nord.frost.nord10;
# magenta
color5 = nord.aurora.nord15;
color13 = nord.aurora.nord15;
# cyan
color6 = nord.frost.nord8;
color14 = nord.frost.nord8;
# white
color7 = nord.snowStorm.nord5;
color15 = nord.snowStorm.nord4;
};
};
};
}

View File

@@ -1,7 +1,7 @@
{ lib, ... }:
with lib;
{
options.mjallen.desktop.extra.kitty = {
options.mjallen.programs.kitty = {
enable = mkEnableOption "enable kitty terminal";
font = {
@@ -14,14 +14,14 @@ with lib;
default = pkgs.dejavu_fonts;
};
size = mkOption {
type = with types; null || signed integer || floating point number;
type = with types; int;
default = 8;
};
};
theme = mkOption {
type = types.attrs;
default = import ../../theme/nord.nix;
default = import ../../desktop/theme/nord.nix;
};
};
}

View File

@@ -1,8 +1,8 @@
{ config, lib, ... }:
with lib;
let
cfg = config.mjallen.desktop.extra.mako;
nord = import ../../theme/nord.nix;
cfg = config.mjallen.programs.mako;
nord = import ../../desktop/theme/nord.nix;
in
{
imports = [ ./options.nix ];

View File

@@ -1,7 +1,7 @@
{ lib, ... }:
with lib;
{
options.mjallen.desktop.extra.mako = {
options.mjallen.programs.mako = {
enable = mkEnableOption "enable mako";
fontName = mkOption {

View File

@@ -1,8 +1,8 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.mjallen.desktop.extra.nwg-dock;
nord = import ../../theme/nord.nix;
cfg = config.mjallen.programs.nwg-dock;
nord = import ../../desktop/theme/nord.nix;
in
{
imports = [ ./options.nix ];

View File

@@ -1,7 +1,7 @@
{ lib, ... }:
with lib;
{
options.mjallen.desktop.extra.nwg-dock = {
options.mjallen.programs.nwg-dock = {
enable = mkEnableOption "enable nwg-dock";
};
}

View File

@@ -1,8 +1,8 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.mjallen.desktop.extra.nwg-drawer;
nord = import ../../theme/nord.nix;
cfg = config.mjallen.programs.nwg-drawer;
nord = import ../../desktop/theme/nord.nix;
in
{
imports = [ ./options.nix ];

View File

@@ -1,7 +1,7 @@
{ lib, ... }:
with lib;
{
options.mjallen.desktop.extra.nwg-drawer = {
options.mjallen.programs.nwg-drawer = {
enable = mkEnableOption "enable nwg-drawer";
};
}

View File

@@ -1,7 +1,7 @@
{ config, lib, ... }:
with lib;
let
cfg = config.mjallen.desktop.extra.nwg-dock;
cfg = config.mjallen.programs.nwg-panel;
in
{
imports = [ ./options.nix ];

View File

@@ -0,0 +1,23 @@
{ lib, pkgs, ... }:
with lib;
{
options.mjallen.programs.nwg-panel = {
enable = mkEnableOption "enable nwg-panel";
defaultApps = mkOption {
type = types.submodule {
options = {
browser = mkOption { type = types.package; default = pkgs.firefox; };
editor = mkOption { type = types.package; default = pkgs.micro; };
fileExplorer = mkOption { type = types.package; default = pkgs.nemo; };
visual = mkOption { type = types.package; default = pkgs.vscodium; };
terminal = mkOption { type = types.package; default = pkgs.kitty; };
office = mkOption { type = types.package; default = pkgs.onlyoffice-bin_latest; };
video = mkOption { type = types.package; default = pkgs.vlc; };
imageViewer = mkOption { type = types.package; default = pkgs.gnome-photos; };
};
};
description = "Default applications used across the system.";
};
};
}

View File

@@ -1,8 +1,8 @@
{ config, lib, ... }:
with lib;
let
cfg = config.mjallen.desktop.extra.waybar;
nord = import ../../theme/nord.nix;
cfg = config.mjallen.programs.waybar;
nord = import ../../desktop/theme/nord.nix;
defaultOpacity = "opacity: 0.85;";
defaultBorderRadius = "border-radius: 1rem;";
@@ -371,8 +371,8 @@ in
${defaultOpacity}
${defaultBorderRadius}
${defaultCenterOptions}
margin-left: ${hyprlandSettings.waybar.moduleStyle.window.margin-left or "4rem"};
margin-right: ${hyprlandSettings.waybar.moduleStyle.window.margin-right or "4rem"};
margin-left: 4rem
margin-right: 4rem
}
/* make window module transparent when no windows present */
@@ -513,8 +513,8 @@ in
color: ${nord.frost.nord9};
background-color: ${nord.polarNight.nord0};
${defaultOpacity}
${hyprlandSettings.waybar.moduleStyle.temperature.location or defaultCenterOptions}
border-radius: ${hyprlandSettings.waybar.moduleStyle.temperature.border-radius or "0"}
${defaultCenterOptions}
border-radius: 0
}
/* ------------- */
@@ -528,7 +528,7 @@ in
}
/* ------------- */
'' + hyprlandSettings.waybar.extraModulesStyle or '''';
'' + cfg.extraModulesStyle or '''';
};
};
}

View File

@@ -1,7 +1,7 @@
{ lib, ... }:
with lib;
{
options.mjallen.desktop.extra.waybar = {
options.mjallen.programs.waybar = {
enable = mkEnableOption "enable waybar";
layer = mkOption {
@@ -10,7 +10,7 @@ with lib;
};
modules-right = mkOption {
type = with types; listOf string;
type = with types; listOf str;
default = [];
};
@@ -23,5 +23,10 @@ with lib;
type = types.attrs;
default = { };
};
extraModulesStyle = mkOption {
type = types.str;
default = "";
};
};
}

View File

@@ -1,7 +1,6 @@
{ config, lib, namespace, ... }:
with lib;
{ config, lib, namespace, pkgs, ... }:
let
cfg = config.mjallen.desktop.extra.waybar;
cfg = config.mjallen.programs.waybar;
pythonEnv = pkgs.python3.withPackages (ps: [
pkgs.${namespace}.homeassistant-api

View File

@@ -1,7 +1,6 @@
{ config, lib, namespace, ... }:
with lib;
{ config, lib, pkgs, ... }:
let
cfg = config.mjallen.desktop.extra.waybar;
cfg = config.mjallen.programs.waybar;
waybar-weather = pkgs.writeScriptBin "waybar-weather" ''
#!/usr/bin/env nix-shell

View File

@@ -1,14 +1,14 @@
{ config, lib, ... }:
with lib;
let
cfg = config.mjallen.desktop.extra.wlogout;
nord = import ../../theme/nord.nix;
cfg = config.mjallen.programs.wlogout;
nord = import ../../desktop/theme/nord.nix;
in
{
imports = [ ./options.nix ];
config = mkIf cfg.enable {
programs.wlogout = {
enable = true;
enable = false;
layout = {
lock = {
label = "lock";

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,7 +1,7 @@
{ lib, ... }:
with lib;
{
options.mjallen.desktop.extra.wlogout = {
options.mjallen.programs.wlogout = {
enable = mkEnableOption "enable wlogout";
fontName = mkOption {

View File

@@ -1,8 +1,8 @@
{ config, lib, ... }:
with lib;
let
cfg = config.mjallen.desktop.extra.wofi;
nord = import ../../theme/nord.nix;
cfg = config.mjallen.programs.wofi;
nord = import ../../desktop/theme/nord.nix;
in
{
imports = [ ./options.nix ];

View File

@@ -1,7 +1,7 @@
{ lib, ... }:
with lib;
{
options.mjallen.desktop.extra.wofi = {
options.mjallen.programs.wofi = {
enable = mkEnableOption "enable wofi";
fontName = mkOption {

View File

@@ -0,0 +1,18 @@
{ config, ... }:
{
# sops = {
# age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
# defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
# validateSopsFiles = false;
# secrets = {
# "ssh-keys-public/desktop-nixos" = {
# path = "/home/matt/.ssh/id_ed25519.pub";
# mode = "0644";
# };
# "ssh-keys-private/desktop-nixos" = {
# path = "/home/matt/.ssh/id_ed25519";
# mode = "0600";
# };
# };
# };
}