refactor: consolidate app configurations and utility scripts
- Move 32+ app-specific scripts from features/apps/scripts/ to features/scripts/utils/ for centralized packaging. - Create individual Nix modules for orphaned app configurations (btop, kitty, tmux, etc.) in features/apps/ using xdg.configFile. - Fix broken paths in core/system/makima.nix and features/apps/vscode.nix. - Update VSCode configuration to use the modern 'profiles.default.userSettings' API, resolving deprecation warnings. - Merge duplicate 'nomarchy-launch-walker' scripts into a single robust utility. - Remove stale root 'config/' directory. - Update README.md and docs/creating-themes.md to reflect the new architecture and keybindings. - Ensure all modules are correctly imported and verified via nix flake check.
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
nomarchyLib = import ../../lib { inherit lib; };
|
||||
activeThemeName = config.nomarchy.system.theme;
|
||||
currentPalette = nomarchyLib.getPalette activeThemeName;
|
||||
|
||||
# Hex color for browser theme (base00 is background)
|
||||
themeColor = "#${currentPalette.base00}";
|
||||
|
||||
# Detect light mode from theme name or palette
|
||||
isLightTheme = nomarchyLib.isThemeLightMode {
|
||||
themeName = activeThemeName;
|
||||
assetsPath = ../../themes/palettes;
|
||||
};
|
||||
|
||||
browserPolicy = {
|
||||
BrowserThemeColor = themeColor;
|
||||
BrowserColorScheme = if isLightTheme then "light" else "dark";
|
||||
};
|
||||
in
|
||||
{
|
||||
# Chromium policies
|
||||
programs.chromium.extraOpts = lib.mkDefault browserPolicy;
|
||||
|
||||
# Brave browser policies via managed policy file
|
||||
environment.etc."brave/policies/managed/nomarchy.json".text = lib.mkDefault (
|
||||
builtins.toJSON browserPolicy
|
||||
);
|
||||
}
|
||||
5
features/apps/btop/default.nix
Normal file
5
features/apps/btop/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."btop".source = ./config;
|
||||
}
|
||||
5
features/apps/chromium/default.nix
Normal file
5
features/apps/chromium/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."chromium".source = ./config;
|
||||
}
|
||||
5
features/apps/elephant/default.nix
Normal file
5
features/apps/elephant/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."elephant".source = ./config;
|
||||
}
|
||||
5
features/apps/ghostty/default.nix
Normal file
5
features/apps/ghostty/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."ghostty".source = ./config;
|
||||
}
|
||||
5
features/apps/kitty/default.nix
Normal file
5
features/apps/kitty/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."kitty".source = ./config;
|
||||
}
|
||||
5
features/apps/lazygit/default.nix
Normal file
5
features/apps/lazygit/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."lazygit".source = ./config;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.nomarchy.system.features.makima;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg {
|
||||
# If the user has makima-bin available in their overlays (as they originally used a custom package),
|
||||
# this will install it. Otherwise, it will fail evaluation if not available in nixpkgs.
|
||||
environment.systemPackages = [ pkgs.makima-bin ];
|
||||
|
||||
environment.etc."makima/AT Translated Set 2 keyboard.toml".source = ../../assets/makima + "/AT Translated Set 2 keyboard.toml";
|
||||
|
||||
systemd.services.makima = {
|
||||
description = "Makima key remapping service";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
User = config.services.displayManager.autoLogin.user;
|
||||
Environment = "MAKIMA_CONFIG=/etc/makima";
|
||||
ExecStart = "${pkgs.makima-bin}/bin/makima";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
5
features/apps/opencode/default.nix
Normal file
5
features/apps/opencode/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."opencode".source = ./config;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Launch the Walker application launcher while ensuring that it's data provider (called elephant) is running first.
|
||||
|
||||
# Ensure elephant is running before launching walker
|
||||
if ! pgrep -x elephant > /dev/null; then
|
||||
setsid uwsm-app -- elephant &
|
||||
fi
|
||||
|
||||
# Ensure walker service is running
|
||||
if ! pgrep -f "walker --gapplication-service" > /dev/null; then
|
||||
setsid uwsm-app -- walker --gapplication-service &
|
||||
fi
|
||||
|
||||
exec walker --width 644 --maxheight 300 --minheight 300 "$@"
|
||||
5
features/apps/tmux/default.nix
Normal file
5
features/apps/tmux/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."tmux".source = ./config;
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
themeConfig = builtins.fromJSON (builtins.readFile (../../themes/palettes + "/${config.nomarchy.theme}/vscode.json"));
|
||||
themePath = ../../themes/palettes + "/${config.nomarchy.theme}/apps/vscode.json";
|
||||
themeConfig = if builtins.pathExists themePath then
|
||||
builtins.fromJSON (builtins.readFile themePath)
|
||||
else
|
||||
{ name = "Default Dark Modern"; };
|
||||
|
||||
# Development extensions that match the system theme
|
||||
devExtensions = with pkgs.vscode-extensions; [
|
||||
@@ -40,7 +44,7 @@ in
|
||||
programs.vscode = {
|
||||
enable = lib.mkDefault true;
|
||||
package = lib.mkDefault pkgs.vscode;
|
||||
userSettings = lib.mkDefault {
|
||||
profiles.default.userSettings = lib.mkDefault {
|
||||
"update.mode" = "none";
|
||||
"workbench.colorTheme" = themeConfig.name;
|
||||
"window.titleBarStyle" = "custom";
|
||||
|
||||
@@ -15,28 +15,30 @@ in
|
||||
imports = [
|
||||
inputs.nix-colors.homeManagerModules.default
|
||||
inputs.walker.homeManagerModules.default
|
||||
../core/home
|
||||
../themes/engine/stylix-compat.nix
|
||||
../core/home/options.nix
|
||||
../core/home/state.nix
|
||||
../core/home/overrides.nix
|
||||
../core/home/behavior.nix
|
||||
../themes/engine/loader.nix
|
||||
../themes/engine/files.nix
|
||||
../core/home/fonts.nix
|
||||
../themes/engine/stylix.nix
|
||||
../themes/engine/switcher.nix
|
||||
./apps/alacritty/default.nix
|
||||
./apps/btop/default.nix
|
||||
./apps/chromium/default.nix
|
||||
./apps/elephant/default.nix
|
||||
./apps/ghostty/default.nix
|
||||
./apps/kitty/default.nix
|
||||
./apps/lazygit/default.nix
|
||||
./apps/opencode/default.nix
|
||||
./apps/tmux/default.nix
|
||||
./apps/vscode.nix
|
||||
./apps/walker.nix
|
||||
./apps/swayosd.nix
|
||||
./desktop/nightlight.nix
|
||||
./desktop/idle.nix
|
||||
../themes/engine/stylix.nix
|
||||
./desktop/hyprland/default.nix
|
||||
./desktop/waybar/default.nix
|
||||
./apps/walker.nix
|
||||
../themes/engine/switcher.nix
|
||||
./scripts/default.nix
|
||||
../core/home/configs.nix
|
||||
./apps/swayosd.nix
|
||||
../core/home/security.nix
|
||||
./scripts/battery-monitor.nix
|
||||
../core/home/bash.nix
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,6 @@ bindd = SUPER SHIFT ALT, X, X Post, exec, nomarchy-launch-webapp "https://x.com/
|
||||
# Add extra bindings
|
||||
# bind = SUPER SHIFT, R, exec, alacritty -e ssh your-server
|
||||
|
||||
# Overwrite existing bindings, like putting Nomarchy Menu on Super + Space
|
||||
# Overwrite existing bindings, like putting Nomarchy Menu back on Super + Space
|
||||
# unbind = SUPER, SPACE
|
||||
# bindd = SUPER, SPACE, Nomarchy menu, exec, nomarchy-menu
|
||||
|
||||
@@ -3,10 +3,17 @@
|
||||
# Wrapper to launch walker with elephant provider, or fallback to rofi if walker is missing.
|
||||
|
||||
if command -v walker >/dev/null 2>&1; then
|
||||
# Ensure elephant is running before launching walker
|
||||
if ! pgrep -x elephant > /dev/null; then
|
||||
setsid uwsm-app -- elephant &
|
||||
fi
|
||||
exec uwsm-app -- walker "$@"
|
||||
|
||||
# Ensure walker service is running
|
||||
if ! pgrep -f "walker --gapplication-service" > /dev/null; then
|
||||
setsid uwsm-app -- walker --gapplication-service &
|
||||
fi
|
||||
|
||||
exec uwsm-app -- walker --width 644 --maxheight 300 --minheight 300 "$@"
|
||||
elif command -v rofi >/dev/null 2>&1; then
|
||||
# Convert walker arguments to rofi arguments if possible
|
||||
# This is a very basic mapping for --dmenu
|
||||
|
||||
@@ -348,8 +348,9 @@ show_main_menu() {
|
||||
|
||||
go_to_menu() {
|
||||
case "${1,,}" in
|
||||
*apps*) walker -p "Launch…" ;;
|
||||
*apps*) nomarchy-launch-walker ;;
|
||||
*learn*) show_learn_menu ;;
|
||||
*symbols*) nomarchy-launch-walker -m symbols ;;
|
||||
*trigger*) show_trigger_menu ;;
|
||||
*toggle*) show_toggle_menu ;;
|
||||
*share*) show_share_menu ;;
|
||||
|
||||
Reference in New Issue
Block a user