Rebase to flake parts #9
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
# HM side of the flake; option tree is `chiasson.home.*` (docs/module-conventions.md).
|
||||
{ self, inputs, ... }: {
|
||||
imports = [
|
||||
./apps/discord.nix
|
||||
./apps/localsend.nix
|
||||
./apps/pokeclicker
|
||||
./apps/spotify.nix
|
||||
./browsers/orion.nix
|
||||
./desktop/screenshot.nix
|
||||
./hardware/uconsole-gamepad.nix
|
||||
];
|
||||
|
||||
# Root module: chiasson.home.enable + bash. Everything else is separate `wisdom*` exports —
|
||||
# pull those into `home.users.<name>.extraModules` on each host as needed.
|
||||
flake.homeManagerModules.wisdom =
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.chiasson.home;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
self.homeManagerModules.wisdomShellBash
|
||||
];
|
||||
|
||||
options.chiasson.home = {
|
||||
enable = lib.mkEnableOption ''
|
||||
HM profile root for this flake (bash on by default). Wire other `wisdom*` modules in
|
||||
`home.users.<name>.extraModules` and flip their `chiasson.home.*.enable` options on the host.
|
||||
'' // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
extraPackages = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.package;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Extra `home.packages` (e.g. `pkgs.parsec-bin`) when you do not want a separate wisdom module.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable { home.packages = cfg.extraPackages; };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{ ... }: {
|
||||
flake.homeManagerModules.wisdomEditorsKate =
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
root = config.chiasson.home;
|
||||
cfg = config.chiasson.home.editors.kate;
|
||||
in
|
||||
{
|
||||
options.chiasson.home.editors.kate.enable = lib.mkEnableOption "Kate.";
|
||||
|
||||
config = lib.mkIf (root.enable && cfg.enable) {
|
||||
home.packages = lib.optional (
|
||||
lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.kdePackages.kate
|
||||
) pkgs.kdePackages.kate;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{ ... }: {
|
||||
flake.homeManagerModules.wisdomEditorsObsidian =
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
root = config.chiasson.home;
|
||||
cfg = config.chiasson.home.editors.obsidian;
|
||||
in
|
||||
{
|
||||
options.chiasson.home.editors.obsidian.enable = lib.mkEnableOption ''
|
||||
Obsidian (unfree); skipped if unavailable here.
|
||||
'';
|
||||
|
||||
config = lib.mkIf (root.enable && cfg.enable) {
|
||||
home.packages = lib.optional (
|
||||
lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.obsidian
|
||||
) pkgs.obsidian;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{ ... }: {
|
||||
flake.homeManagerModules.wisdomShellBash =
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
root = config.chiasson.home;
|
||||
cfg = config.chiasson.home.shell.bash;
|
||||
in
|
||||
{
|
||||
options.chiasson.home.shell.bash.enable = lib.mkEnableOption "Bash + rbw SSH socket env in profile/init." // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
config = lib.mkIf (root.enable && cfg.enable) {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
profileExtra = ''
|
||||
if [ -z "''${SSH_AUTH_SOCK:-}" ]; then
|
||||
if [ -n "''${XDG_RUNTIME_DIR:-}" ]; then
|
||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/rbw/ssh-agent-socket"
|
||||
else
|
||||
export SSH_AUTH_SOCK="/run/user/$(id -u)/rbw/ssh-agent-socket"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
initExtra = ''
|
||||
if [ -z "''${SSH_AUTH_SOCK:-}" ]; then
|
||||
if [ -n "''${XDG_RUNTIME_DIR:-}" ]; then
|
||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/rbw/ssh-agent-socket"
|
||||
else
|
||||
export SSH_AUTH_SOCK="/run/user/$(id -u)/rbw/ssh-agent-socket"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{ ... }: {
|
||||
flake.homeManagerModules.wisdomShellFish =
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
root = config.chiasson.home;
|
||||
cfg = config.chiasson.home.shell.fish;
|
||||
in
|
||||
{
|
||||
options.chiasson.home.shell.fish.enable = lib.mkEnableOption "Fish + grc, quiet greeting, rbw SSH socket defaults.";
|
||||
|
||||
config = lib.mkIf (root.enable && cfg.enable) {
|
||||
# `fishPlugins.grc` only installs the plugin; the wrapper invokes the `grc` binary.
|
||||
home.packages = [ pkgs.grc ];
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set fish_greeting ""
|
||||
if test -z "$SSH_AUTH_SOCK"
|
||||
if test -n "$XDG_RUNTIME_DIR"
|
||||
set -gx SSH_AUTH_SOCK "$XDG_RUNTIME_DIR/rbw/ssh-agent-socket"
|
||||
else
|
||||
set -l _hm_uid (${pkgs.coreutils}/bin/id -u)
|
||||
set -gx SSH_AUTH_SOCK "/run/user/$_hm_uid/rbw/ssh-agent-socket"
|
||||
end
|
||||
end
|
||||
'';
|
||||
plugins = [
|
||||
{
|
||||
name = "grc";
|
||||
src = pkgs.fishPlugins.grc.src;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{ ... }: {
|
||||
flake.homeManagerModules.wisdomShellOhMyPosh =
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
root = config.chiasson.home;
|
||||
cfg = config.chiasson.home.shell.ohMyPosh;
|
||||
in
|
||||
{
|
||||
options.chiasson.home.shell.ohMyPosh = {
|
||||
enable = lib.mkEnableOption "[Oh My Posh](https://ohmyposh.dev/) prompt.";
|
||||
|
||||
builtinTheme = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "jandedobbeleer";
|
||||
description = ''
|
||||
Stock theme when DMS is not overriding `configFile` (DMS replaces this with matugen output).
|
||||
'';
|
||||
};
|
||||
|
||||
enableFishIntegration = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Run `oh-my-posh init fish` in Fish `shellInit` (Home Manager).";
|
||||
};
|
||||
|
||||
enableBashIntegration = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Run `oh-my-posh init bash` in bash `initExtra`.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (root.enable && cfg.enable) {
|
||||
programs.oh-my-posh = {
|
||||
enable = true;
|
||||
inherit (cfg) enableFishIntegration enableBashIntegration;
|
||||
useTheme = lib.mkDefault cfg.builtinTheme;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
{ ... }: {
|
||||
# Optional fragment: import from `home.users.<name>.extraModules` only on hosts that need Yazi so this
|
||||
# module (and its `pkgs.yazi` wiring) is not evaluated when omitted.
|
||||
flake.homeManagerModules.wisdomShellYazi =
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
root = config.chiasson.home;
|
||||
cfg = config.chiasson.home.shell.yazi;
|
||||
in
|
||||
{
|
||||
options.chiasson.home.shell.yazi.enable = lib.mkEnableOption "Yazi as `y` + 7zz with rar.";
|
||||
|
||||
config = lib.mkIf (root.enable && cfg.enable) {
|
||||
programs.yazi = {
|
||||
enable = true;
|
||||
package = pkgs.yazi.override {
|
||||
_7zz = pkgs._7zz-rar;
|
||||
};
|
||||
shellWrapperName = "y";
|
||||
settings = {
|
||||
manager = {
|
||||
ratio = [
|
||||
1
|
||||
4
|
||||
3
|
||||
];
|
||||
sort_by = "natural";
|
||||
sort_sensitive = true;
|
||||
sort_reverse = false;
|
||||
sort_dir_first = true;
|
||||
linemode = "none";
|
||||
show_hidden = true;
|
||||
show_symlink = true;
|
||||
};
|
||||
preview = {
|
||||
image_filter = "lanczos3";
|
||||
image_quality = 90;
|
||||
tab_size = 1;
|
||||
max_width = 600;
|
||||
max_height = 900;
|
||||
cache_dir = "";
|
||||
ueberzug_scale = 1;
|
||||
ueberzug_offset = [
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
];
|
||||
};
|
||||
tasks = {
|
||||
micro_workers = 5;
|
||||
macro_workers = 10;
|
||||
bizarre_retry = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{ ... }: {
|
||||
flake.homeManagerModules.wisdomTerminalsKitty =
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
root = config.chiasson.home;
|
||||
cfg = config.chiasson.home.terminals.kitty;
|
||||
in
|
||||
{
|
||||
options.chiasson.home.terminals.kitty.enable = lib.mkEnableOption ''
|
||||
Kitty + DMS includes; activation strips `*-theme.auto.conf` so matugen colors stick.
|
||||
'';
|
||||
|
||||
config = lib.mkIf (root.enable && cfg.enable) {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
include dank-tabs.conf
|
||||
include dank-theme.conf
|
||||
allow_remote_control yes
|
||||
listen_on unix:@kitty
|
||||
'';
|
||||
};
|
||||
|
||||
home.activation.kittyRemoveAutoThemes = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
rm -f "$HOME/.config/kitty/dark-theme.auto.conf" \
|
||||
"$HOME/.config/kitty/light-theme.auto.conf" \
|
||||
"$HOME/.config/kitty/no-preference-theme.auto.conf"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user