refactor(nixos): inline module enable conditions #134

Merged
alexion merged 1 commits from refactor/inline-module-enable-options into main 2026-10-06 22:28:05 -04:00
33 changed files with 33 additions and 78 deletions
Showing only changes of commit f48bac5ec1 - Show all commits

View File

@@ -6,14 +6,13 @@
}: }:
# Alacritty as the desktop terminal. # Alacritty as the desktop terminal.
let let
cfg = config.modules.desktop.apps.alacritty; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.desktop.apps.alacritty.enable = options.modules.desktop.apps.alacritty.enable =
lib.mkEnableOption "Alacritty as the desktop terminal"; lib.mkEnableOption "Alacritty as the desktop terminal";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.apps.alacritty.enable {
home-manager.users.${user}.home.packages = [ pkgs.alacritty ]; home-manager.users.${user}.home.packages = [ pkgs.alacritty ];
}; };
} }

View File

@@ -6,13 +6,12 @@
}: }:
# Ghostty as the desktop terminal. # Ghostty as the desktop terminal.
let let
cfg = config.modules.desktop.apps.ghostty; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.desktop.apps.ghostty.enable = lib.mkEnableOption "Ghostty as the desktop terminal"; options.modules.desktop.apps.ghostty.enable = lib.mkEnableOption "Ghostty as the desktop terminal";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.apps.ghostty.enable {
home-manager.users.${user}.home.packages = [ pkgs.ghostty ]; home-manager.users.${user}.home.packages = [ pkgs.ghostty ];
}; };
} }

View File

@@ -6,14 +6,13 @@
}: }:
# Obsidian as the desktop note-taking vault. # Obsidian as the desktop note-taking vault.
let let
cfg = config.modules.desktop.apps.obsidian; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.desktop.apps.obsidian.enable = options.modules.desktop.apps.obsidian.enable =
lib.mkEnableOption "Obsidian as the desktop note-taking vault"; lib.mkEnableOption "Obsidian as the desktop note-taking vault";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.apps.obsidian.enable {
home-manager.users.${user}.home.packages = [ pkgs.obsidian ]; home-manager.users.${user}.home.packages = [ pkgs.obsidian ];
}; };
} }

View File

@@ -6,14 +6,13 @@
}: }:
# r2modman, a Thunderstore mod manager. # r2modman, a Thunderstore mod manager.
let let
cfg = config.modules.desktop.apps.r2modman; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.desktop.apps.r2modman.enable = options.modules.desktop.apps.r2modman.enable =
lib.mkEnableOption "r2modman, a Thunderstore mod manager"; lib.mkEnableOption "r2modman, a Thunderstore mod manager";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.apps.r2modman.enable {
home-manager.users.${user}.home.packages = [ pkgs.r2modman ]; home-manager.users.${user}.home.packages = [ pkgs.r2modman ];
}; };
} }

View File

@@ -6,13 +6,12 @@
}: }:
# Signal desktop messenger. # Signal desktop messenger.
let let
cfg = config.modules.desktop.apps.signal; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.desktop.apps.signal.enable = lib.mkEnableOption "Signal desktop messenger"; options.modules.desktop.apps.signal.enable = lib.mkEnableOption "Signal desktop messenger";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.apps.signal.enable {
home-manager.users.${user}.home.packages = [ pkgs.signal-desktop ]; home-manager.users.${user}.home.packages = [ pkgs.signal-desktop ];
}; };
} }

View File

@@ -6,14 +6,13 @@
}: }:
# Vesktop, a Discord client with Vencord built in. # Vesktop, a Discord client with Vencord built in.
let let
cfg = config.modules.desktop.apps.vencord; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.desktop.apps.vencord.enable = options.modules.desktop.apps.vencord.enable =
lib.mkEnableOption "Vesktop, a Discord client with Vencord built in"; lib.mkEnableOption "Vesktop, a Discord client with Vencord built in";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.apps.vencord.enable {
home-manager.users.${user}.home.packages = [ pkgs.vesktop ]; home-manager.users.${user}.home.packages = [ pkgs.vesktop ];
}; };
} }

View File

@@ -1,14 +1,11 @@
{ config, lib, ... }: { config, lib, ... }:
# The desktop aggregator: one flag brings up the whole graphical session. # The desktop aggregator: one flag brings up the whole graphical session.
let
cfg = config.modules.desktop; # NOLINT(let_order)
in
{ {
options.modules.desktop.enable = lib.mkEnableOption "the keyboard-driven Hyprland desktop"; options.modules.desktop.enable = lib.mkEnableOption "the keyboard-driven Hyprland desktop";
# Each piece is turned on at default priority, so a host can still override # Each piece is turned on at default priority, so a host can still override
# any one of them while the single flag above enables the whole desktop. # any one of them while the single flag above enables the whole desktop.
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.enable {
modules.desktop.apps.firefox.enable = lib.mkDefault true; modules.desktop.apps.firefox.enable = lib.mkDefault true;
modules.desktop.apps.ghostty.enable = lib.mkDefault true; modules.desktop.apps.ghostty.enable = lib.mkDefault true;
modules.desktop.session.hyprland.enable = lib.mkDefault true; modules.desktop.session.hyprland.enable = lib.mkDefault true;

View File

@@ -6,7 +6,6 @@
}: }:
# The lock screen: a hyprlock session-lock surface the compositor owns. # The lock screen: a hyprlock session-lock surface the compositor owns.
let let
cfg = config.modules.desktop.session.hyprland.hyprlock; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
# The hyprlock this module installs, used by the lock keybind below. # The hyprlock this module installs, used by the lock keybind below.
@@ -48,7 +47,7 @@ in
options.modules.desktop.session.hyprland.hyprlock.enable = options.modules.desktop.session.hyprland.hyprlock.enable =
lib.mkEnableOption "the hyprlock lock screen"; lib.mkEnableOption "the hyprlock lock screen";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.session.hyprland.hyprlock.enable {
home-manager.users.${user} = { home-manager.users.${user} = {
# Colors and the lock-screen background come from Stylix's hyprlock target, # Colors and the lock-screen background come from Stylix's hyprlock target,
# so only geometry and behaviour are set here. # so only geometry and behaviour are set here.

View File

@@ -6,14 +6,11 @@
}: }:
# Text login: greetd running the tuigreet greeter, which starts the session # Text login: greetd running the tuigreet greeter, which starts the session
# through the universal Wayland session manager. # through the universal Wayland session manager.
let
cfg = config.modules.desktop.session.login; # NOLINT(let_order)
in
{ {
options.modules.desktop.session.login.enable = options.modules.desktop.session.login.enable =
lib.mkEnableOption "greetd with the tuigreet text greeter"; lib.mkEnableOption "greetd with the tuigreet text greeter";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.session.login.enable {
services.greetd = { services.greetd = {
enable = true; enable = true;
settings.default_session.command = settings.default_session.command =

View File

@@ -6,7 +6,6 @@
}: }:
# mako as the notification daemon: toasts, a do-not-disturb mode, and history recall. # mako as the notification daemon: toasts, a do-not-disturb mode, and history recall.
let let
cfg = config.modules.desktop.session.mako; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
makoctl = "${pkgs.mako}/bin/makoctl"; makoctl = "${pkgs.mako}/bin/makoctl";
@@ -14,7 +13,7 @@ in
{ {
options.modules.desktop.session.mako.enable = lib.mkEnableOption "the mako notification daemon"; options.modules.desktop.session.mako.enable = lib.mkEnableOption "the mako notification daemon";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.session.mako.enable {
home-manager.users.${user} = { home-manager.users.${user} = {
# Colors and the popup font come from Stylix's mako target, so only # Colors and the popup font come from Stylix's mako target, so only
# behaviour is set here. # behaviour is set here.

View File

@@ -1,13 +1,10 @@
{ config, lib, ... }: { config, lib, ... }:
# XDG desktop portal routing for in-app screen sharing and file dialogs. # XDG desktop portal routing for in-app screen sharing and file dialogs.
let
cfg = config.modules.desktop.session.portals; # NOLINT(let_order)
in
{ {
options.modules.desktop.session.portals.enable = options.modules.desktop.session.portals.enable =
lib.mkEnableOption "XDG desktop portals for in-app screen sharing and file dialogs"; lib.mkEnableOption "XDG desktop portals for in-app screen sharing and file dialogs";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.session.portals.enable {
# The backend packages arrive with the compositor, so only the routing is set # The backend packages arrive with the compositor, so only the routing is set
# here. # here.
# Screen sharing, screenshots, and global shortcuts need the compositor's # Screen sharing, screenshots, and global shortcuts need the compositor's

View File

@@ -6,7 +6,6 @@
}: }:
# Waybar: a top status bar reading system state at a glance. # Waybar: a top status bar reading system state at a glance.
let let
cfg = config.modules.desktop.session.waybar; # NOLINT(let_order)
vpnClient = config.modules.network.vpn-client; vpnClient = config.modules.network.vpn-client;
# A Nerd Font Private-Use-Area codepoint as a literal character, decoded # A Nerd Font Private-Use-Area codepoint as a literal character, decoded
@@ -102,7 +101,7 @@ in
{ {
options.modules.desktop.session.waybar.enable = lib.mkEnableOption "the Waybar status bar"; options.modules.desktop.session.waybar.enable = lib.mkEnableOption "the Waybar status bar";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.session.waybar.enable {
# A symbols font backs the module glyphs, so pango falls back to it for the # A symbols font backs the module glyphs, so pango falls back to it for the
# codepoints Stylix's monospace font does not carry. # codepoints Stylix's monospace font does not carry.
fonts.packages = [ pkgs.nerd-fonts.symbols-only ]; fonts.packages = [ pkgs.nerd-fonts.symbols-only ];

View File

@@ -1,12 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
# PipeWire as the desktop audio server. # PipeWire as the desktop audio server.
let
cfg = config.modules.desktop.utilities.audio; # NOLINT(let_order)
in
{ {
options.modules.desktop.utilities.audio.enable = lib.mkEnableOption "the PipeWire audio server"; options.modules.desktop.utilities.audio.enable = lib.mkEnableOption "the PipeWire audio server";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.utilities.audio.enable {
# Realtime scheduling for the audio threads, so playback survives load. # Realtime scheduling for the audio threads, so playback survives load.
security.rtkit.enable = true; security.rtkit.enable = true;

View File

@@ -6,7 +6,6 @@
}: }:
# Clipboard history: cliphist records every copy, picked back through rofi. # Clipboard history: cliphist records every copy, picked back through rofi.
let let
cfg = config.modules.desktop.utilities.clipboard; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
cliphist = "${pkgs.cliphist}/bin/cliphist"; cliphist = "${pkgs.cliphist}/bin/cliphist";
@@ -28,7 +27,7 @@ in
options.modules.desktop.utilities.clipboard.enable = options.modules.desktop.utilities.clipboard.enable =
lib.mkEnableOption "cliphist clipboard history"; lib.mkEnableOption "cliphist clipboard history";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.utilities.clipboard.enable {
home-manager.users.${user} = { home-manager.users.${user} = {
# wl-copy and wl-paste on PATH, so the shell can pipe into and out of the # wl-copy and wl-paste on PATH, so the shell can pipe into and out of the
# clipboard. # clipboard.

View File

@@ -6,14 +6,13 @@
}: }:
# SwayOSD: a transient on-screen popup for volume and brightness changes. # SwayOSD: a transient on-screen popup for volume and brightness changes.
let let
cfg = config.modules.desktop.utilities.osd; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.desktop.utilities.osd.enable = options.modules.desktop.utilities.osd.enable =
lib.mkEnableOption "the SwayOSD volume and brightness popup"; lib.mkEnableOption "the SwayOSD volume and brightness popup";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.utilities.osd.enable {
environment.systemPackages = [ pkgs.swayosd ]; environment.systemPackages = [ pkgs.swayosd ];
# The udev rule chgrps each backlight's brightness node to `video` and adds # The udev rule chgrps each backlight's brightness node to `video` and adds

View File

@@ -6,7 +6,6 @@
}: }:
# Keybound screen recording: pick a region, then toggle a video-only capture. # Keybound screen recording: pick a region, then toggle a video-only capture.
let let
cfg = config.modules.desktop.utilities.recording; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
slurp = "${pkgs.slurp}/bin/slurp"; slurp = "${pkgs.slurp}/bin/slurp";
@@ -44,7 +43,7 @@ in
options.modules.desktop.utilities.recording.enable = options.modules.desktop.utilities.recording.enable =
lib.mkEnableOption "wf-recorder screen recording"; lib.mkEnableOption "wf-recorder screen recording";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.utilities.recording.enable {
home-manager.users.${user} = { home-manager.users.${user} = {
# $mod is defined by the compositor config these binds share. # $mod is defined by the compositor config these binds share.
wayland.windowManager.hyprland.settings.bind = [ wayland.windowManager.hyprland.settings.bind = [

View File

@@ -7,7 +7,6 @@
# Keyboard-driven screenshots copy to the clipboard before Satty opens for # Keyboard-driven screenshots copy to the clipboard before Satty opens for
# annotation. Satty copies annotated screenshots when it saves them. # annotation. Satty copies annotated screenshots when it saves them.
let let
cfg = config.modules.desktop.utilities.screenshot; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
grimblast = "${pkgs.grimblast}/bin/grimblast"; grimblast = "${pkgs.grimblast}/bin/grimblast";
@@ -37,7 +36,7 @@ in
options.modules.desktop.utilities.screenshot.enable = options.modules.desktop.utilities.screenshot.enable =
lib.mkEnableOption "screenshots via grimblast and satty"; lib.mkEnableOption "screenshots via grimblast and satty";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.utilities.screenshot.enable {
home-manager.users.${user} = { home-manager.users.${user} = {
# satty is a one-shot annotation surface, so float it rather than letting # satty is a one-shot annotation surface, so float it rather than letting
# it claim a tile in the layout. # it claim a tile in the layout.

View File

@@ -6,7 +6,6 @@
}: }:
# Nord theming for the graphical layer, driven from one base16 scheme by Stylix. # Nord theming for the graphical layer, driven from one base16 scheme by Stylix.
let let
cfg = config.modules.desktop.utilities.theming; # NOLINT(let_order)
# A single static Nord wallpaper, drawn as a vertical gradient across the # A single static Nord wallpaper, drawn as a vertical gradient across the
# Polar Night shades so it needs no committed binary and no network fetch. # Polar Night shades so it needs no committed binary and no network fetch.
@@ -21,7 +20,7 @@ in
options.modules.desktop.utilities.theming.enable = options.modules.desktop.utilities.theming.enable =
lib.mkEnableOption "Nord theming of the graphical layer via Stylix"; lib.mkEnableOption "Nord theming of the graphical layer via Stylix";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.utilities.theming.enable {
stylix = { stylix = {
enable = true; enable = true;

View File

@@ -2,13 +2,12 @@
# Declares the XDG user directories, so a tool that queries them lands in a # Declares the XDG user directories, so a tool that queries them lands in a
# well-known folder a host can relocate from one place. # well-known folder a host can relocate from one place.
let let
cfg = config.modules.desktop.utilities.userdirs; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.desktop.utilities.userdirs.enable = lib.mkEnableOption "XDG user directories"; options.modules.desktop.utilities.userdirs.enable = lib.mkEnableOption "XDG user directories";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.desktop.utilities.userdirs.enable {
# Write ~/.config/user-dirs.dirs from the option defaults. # Write ~/.config/user-dirs.dirs from the option defaults.
home-manager.users.${user}.xdg.userDirs.enable = true; home-manager.users.${user}.xdg.userDirs.enable = true;
}; };

View File

@@ -1,11 +1,8 @@
{ config, lib, ... }: { config, lib, ... }:
let
cfg = config.modules.guest; # NOLINT(let_order)
in
{ {
options.modules.guest.enable = lib.mkEnableOption "nested guest configuration"; options.modules.guest.enable = lib.mkEnableOption "nested guest configuration";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.guest.enable {
modules.network.ssh.enable = lib.mkDefault false; modules.network.ssh.enable = lib.mkDefault false;
modules.network.ssh.hostKeys.restore = lib.mkDefault false; modules.network.ssh.hostKeys.restore = lib.mkDefault false;
}; };

View File

@@ -4,13 +4,10 @@
... ...
}: }:
# Tools for developing this monorepo. # Tools for developing this monorepo.
let
cfg = config.modules.monorepo; # NOLINT(let_order)
in
{ {
options.modules.monorepo.enable = lib.mkEnableOption "tools for developing this monorepo"; options.modules.monorepo.enable = lib.mkEnableOption "tools for developing this monorepo";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.monorepo.enable {
modules.shell.bazel.enable = true; modules.shell.bazel.enable = true;
modules.shell.python.enable = true; modules.shell.python.enable = true;
modules.shell.rust.enable = true; modules.shell.rust.enable = true;

View File

@@ -5,7 +5,6 @@
... ...
}: }:
let let
cfg = config.modules.services.reverse-proxy; # NOLINT(let_order)
generatedUdpStreams = lib.concatLists ( generatedUdpStreams = lib.concatLists (
lib.mapAttrsToList ( lib.mapAttrsToList (
@@ -125,7 +124,7 @@ in
enable = lib.mkEnableOption "the public edge reverse proxy"; enable = lib.mkEnableOption "the public edge reverse proxy";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.services.reverse-proxy.enable {
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
80 80
443 443

View File

@@ -6,14 +6,13 @@
}: }:
# Bazel for the primary user's shell environment. # Bazel for the primary user's shell environment.
let let
cfg = config.modules.shell.bazel; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.shell.bazel.enable = options.modules.shell.bazel.enable =
lib.mkEnableOption "Bazel for the primary user's shell environment"; lib.mkEnableOption "Bazel for the primary user's shell environment";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.shell.bazel.enable {
home-manager.users.${user}.home.packages = [ pkgs.bazel ]; home-manager.users.${user}.home.packages = [ pkgs.bazel ];
}; };
} }

View File

@@ -5,14 +5,13 @@
}: }:
# direnv for the primary user, configured through home-manager. # direnv for the primary user, configured through home-manager.
let let
cfg = config.modules.shell.direnv; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.shell.direnv.enable = options.modules.shell.direnv.enable =
lib.mkEnableOption "direnv for the primary user, with nix-direnv shell caching"; lib.mkEnableOption "direnv for the primary user, with nix-direnv shell caching";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.shell.direnv.enable {
home-manager.users.${user}.programs.direnv = { home-manager.users.${user}.programs.direnv = {
enable = true; enable = true;
silent = true; silent = true;

View File

@@ -5,14 +5,13 @@
}: }:
# git for the primary user, configured through home-manager. # git for the primary user, configured through home-manager.
let let
cfg = config.modules.shell.git; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.shell.git.enable = options.modules.shell.git.enable =
lib.mkEnableOption "git for the primary user, carrying the operator's commit identity"; lib.mkEnableOption "git for the primary user, carrying the operator's commit identity";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.shell.git.enable {
home-manager.users.${user}.programs.git = { home-manager.users.${user}.programs.git = {
enable = true; enable = true;

View File

@@ -6,14 +6,13 @@
}: }:
# gitea-axi for the primary user, installed through its own home-manager module. # gitea-axi for the primary user, installed through its own home-manager module.
let let
cfg = config.modules.shell.gitea-axi; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.shell.gitea-axi.enable = options.modules.shell.gitea-axi.enable =
lib.mkEnableOption "gitea-axi, an agent-ergonomic CLI for Gitea issues and pull requests"; lib.mkEnableOption "gitea-axi, an agent-ergonomic CLI for Gitea issues and pull requests";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.shell.gitea-axi.enable {
home-manager.sharedModules = [ inputs.gitea-axi.homeModules.default ]; home-manager.sharedModules = [ inputs.gitea-axi.homeModules.default ];
home-manager.users.${user}.programs.gitea-axi.enable = true; home-manager.users.${user}.programs.gitea-axi.enable = true;
}; };

View File

@@ -6,14 +6,13 @@
}: }:
# Herdr, a terminal multiplexer for coding agents. # Herdr, a terminal multiplexer for coding agents.
let let
cfg = config.modules.shell.herdr; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.shell.herdr.enable = options.modules.shell.herdr.enable =
lib.mkEnableOption "Herdr, a terminal multiplexer for coding agents"; lib.mkEnableOption "Herdr, a terminal multiplexer for coding agents";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.shell.herdr.enable {
registry.shell-shortcut.${config.networking.hostName}.hs = "herdr --session"; registry.shell-shortcut.${config.networking.hostName}.hs = "herdr --session";
home-manager.users.${user} = lib.mkMerge [ home-manager.users.${user} = lib.mkMerge [

View File

@@ -7,14 +7,13 @@
}: }:
# Neovim for the primary user, configured declaratively through nixvim. # Neovim for the primary user, configured declaratively through nixvim.
let let
cfg = config.modules.shell.nvim; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.shell.nvim.enable = options.modules.shell.nvim.enable =
lib.mkEnableOption "Neovim, configured declaratively via nixvim"; lib.mkEnableOption "Neovim, configured declaratively via nixvim";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.shell.nvim.enable {
registry.shell-shortcut.${config.networking.hostName} = { registry.shell-shortcut.${config.networking.hostName} = {
vi = "nvim"; vi = "nvim";
vim = "nvim"; vim = "nvim";

View File

@@ -6,7 +6,6 @@
}: }:
# Oh My Pi, installed alongside upstream Pi as the `omp` command. # Oh My Pi, installed alongside upstream Pi as the `omp` command.
let let
cfg = config.modules.shell.omp; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
@@ -14,7 +13,7 @@ in
enable = lib.mkEnableOption "Oh My Pi, a batteries-included fork of Pi"; enable = lib.mkEnableOption "Oh My Pi, a batteries-included fork of Pi";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.shell.omp.enable {
home-manager.users.${user}.home.packages = [ pkgs.omp ]; home-manager.users.${user}.home.packages = [ pkgs.omp ];
}; };
} }

View File

@@ -6,14 +6,13 @@
}: }:
# Python tools for the primary user's shell environment. # Python tools for the primary user's shell environment.
let let
cfg = config.modules.shell.python; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.shell.python.enable = options.modules.shell.python.enable =
lib.mkEnableOption "Python tools for the primary user's shell environment"; lib.mkEnableOption "Python tools for the primary user's shell environment";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.shell.python.enable {
home-manager.users.${user}.home = { home-manager.users.${user}.home = {
sessionVariables.PYTHON_TOOLCHAIN_ROOT = "${pkgs.python3}"; sessionVariables.PYTHON_TOOLCHAIN_ROOT = "${pkgs.python3}";
packages = [ pkgs.python3 ]; packages = [ pkgs.python3 ];

View File

@@ -6,7 +6,6 @@
}: }:
# Rust tools for the primary user's shell environment. # Rust tools for the primary user's shell environment.
let let
cfg = config.modules.shell.rust; # NOLINT(let_order)
toolchain = pkgs.symlinkJoin { toolchain = pkgs.symlinkJoin {
name = "rust-toolchain"; name = "rust-toolchain";
paths = with pkgs; [ paths = with pkgs; [
@@ -23,7 +22,7 @@ in
options.modules.shell.rust.enable = options.modules.shell.rust.enable =
lib.mkEnableOption "Rust tools for the primary user's shell environment"; lib.mkEnableOption "Rust tools for the primary user's shell environment";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.shell.rust.enable {
home-manager.users.${user} = { home-manager.users.${user} = {
home.sessionVariables.RUST_TOOLCHAIN_ROOT = "${toolchain}"; home.sessionVariables.RUST_TOOLCHAIN_ROOT = "${toolchain}";

View File

@@ -6,13 +6,12 @@
# tmux for the primary user, configured through home-manager. # tmux for the primary user, configured through home-manager.
# Settings without a home-manager option are read from ./extra.conf. # Settings without a home-manager option are read from ./extra.conf.
let let
cfg = config.modules.shell.tmux; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.shell.tmux.enable = lib.mkEnableOption "tmux, configured via home-manager"; options.modules.shell.tmux.enable = lib.mkEnableOption "tmux, configured via home-manager";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.shell.tmux.enable {
registry.shell-shortcut.${config.networking.hostName}.tmx = "tmux new-session -A -s"; registry.shell-shortcut.${config.networking.hostName}.tmx = "tmux new-session -A -s";
home-manager.users.${user}.programs.tmux = { home-manager.users.${user}.programs.tmux = {

View File

@@ -6,13 +6,12 @@
}: }:
# Yazi, a terminal file manager. # Yazi, a terminal file manager.
let let
cfg = config.modules.shell.yazi; # NOLINT(let_order)
user = config.user.name; user = config.user.name;
in in
{ {
options.modules.shell.yazi.enable = lib.mkEnableOption "Yazi, a terminal file manager"; options.modules.shell.yazi.enable = lib.mkEnableOption "Yazi, a terminal file manager";
config = lib.mkIf cfg.enable { config = lib.mkIf config.modules.shell.yazi.enable {
home-manager.users.${user}.programs.yazi = { home-manager.users.${user}.programs.yazi = {
enable = true; enable = true;
enableFishIntegration = true; enableFishIntegration = true;