treewide: remove overcomplicated and out-of-scope stuff

This commit is contained in:
Elec3137 2026-03-23 20:39:33 -07:00
commit a652c76523
7 changed files with 0 additions and 382 deletions

View file

@ -1,46 +0,0 @@
{
pkgs,
lib,
config,
owoLib,
...
}:
let
name = "helix";
cfg = config.nixowos.cli.${name};
in
{
options.nixowos.cli.${name} = {
enable = lib.mkEnableOption name;
package = lib.mkPackageOption pkgs name { };
extraConfig = lib.mkOption {
type = lib.types.lines;
default = /* toml */ ''
theme = "dark_high_contrast"
[editor]
soft-wrap.enable = true
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"
'';
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
(owoLib.mkConfWrapper "hx" cfg.package {
globalConfig = pkgs.writeText "${name}.toml" cfg.extraConfig;
userConfig = "$HOME/${name}/config.toml";
})
];
# nixos/modules/programs/environment.nix uses mkDefault "nano"
environment.variables.EDITOR = lib.mkOverride 900 "hx";
};
}

View file

@ -1,83 +0,0 @@
{
pkgs,
lib,
config,
...
}:
let
name = "yt-dlp";
cfg = config.nixowos.cli.${name};
serialize =
let
serializeValue =
value: prepend:
if builtins.isBool value then
""
else
prepend
+ (
if builtins.isString value then
value
else if builtins.isList value then
builtins.concatStringsSep "," value
else if builtins.isAttrs value then
lib.concatMapAttrsStringSep "," (key: value: "${key}:${value}") value
else
abort "invalid ${name} config value: ${value}"
);
in
set:
lib.strings.concatMapAttrsStringSep "\n" (
key: value:
if builtins.isBool value && !value then
""
else if builtins.stringLength key == 1 then
"-${key}${serializeValue value ""}"
else
"--${key}${serializeValue value "="}"
) set
+ "\n";
in
{
options.nixowos.cli.${name} = {
enable = lib.mkEnableOption name;
package = lib.mkPackageOption pkgs name { };
settings = lib.mkOption {
type =
with lib.types;
attrsOf (oneOf [
bool
str
(listOf str)
(attrsOf str)
]);
default = {
no-write-auto-subs = true;
sub-langs = [
"all"
"-live_chat"
];
embed-subs = true;
embed-metadata = true;
embed-chapters = true;
sponsorblock-mark = "all";
paths = {
"temp" = "/tmp";
};
};
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
environment.etc."${name}.conf".text = serialize cfg.settings;
};
}

View file

@ -1,75 +0,0 @@
{
pkgs,
lib,
config,
...
}:
let
name = "mangohud";
cfg = config.nixowos.graphical.games.${name};
in
{
options.nixowos.graphical.games.${name} = {
enable = lib.mkEnableOption "${name}, a performance overlay";
package = lib.mkPackageOption pkgs name { };
extraConfig = lib.mkOption {
type = lib.types.lines;
default = ''
legacy_layout=false
background_alpha=0.2
background_color=000000
font_size=24
text_color=FFFFFF
position=top-left
no_display
table_columns=3
gpu_stats
gpu_load_change
gpu_load_value=50,90
gpu_load_color=FFFFFF,FFAA7F,CC0000
cpu_stats
cpu_temp
cpu_load_change
cpu_load_value=50,90
cpu_load_color=FFFFFF,FFAA7F,CC0000
swap
ram
fps
frame_timing
frametime_color=22FF00
fps_limit_method=late
fps_limit=60,5
fps_color_change
fps_value=30,60
fps_color=B22222,FDFD09,39F900
'';
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
environment.variables = {
MANGOHUD = 1; # enables mangohud by default on all vulkan games
MANGOHUD_CONFIGFILE = pkgs.writeText "MangoHud.conf" cfg.extraConfig;
};
};
}

View file

@ -1,32 +0,0 @@
{
pkgs,
lib,
config,
...
}:
let
name = "steam";
cfg = config.nixowos.graphical.games.${name};
in
{
options.nixowos.graphical.games.${name} = {
enable = lib.mkEnableOption name;
};
config = lib.mkIf cfg.enable {
programs.steam = lib.mkDefault {
enable = true;
# open firewall to let these steam features work
localNetworkGameTransfers.openFirewall = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
# make GE-Proton avaliable
extraCompatPackages = [ pkgs.proton-ge-bin ];
# protontricks.enable = true;
};
};
}

View file

@ -1,79 +0,0 @@
{
pkgs,
lib,
config,
...
}:
let
name = "mpv";
cfg = config.nixowos.graphical.${name};
in
{
options.nixowos.graphical.${name} = {
enable = lib.mkEnableOption name;
package = lib.mkPackageOption pkgs name { };
useFullFFmpeg = lib.mkEnableOption "ffmpeg-full within mpv" // {
description = ''
Whether to use pkgs.ffmpeg-full within mpv, for more media support.
For instance, this makes jxl viewing and screenshots possible.
However, this will (almost certainly) require a local compilation of mpv
'';
};
extraConfig = lib.mkOption {
type = lib.types.lines;
default = /* ini */ ''
hwdec
use-filedir-conf
window-maximized
screenshot-format=webp
# 6 is maximum size efficency
screenshot-webp-compression=6
screenshot-webp-lossless=yes
# this allows using mpv as an image viewer
image-display-duration=inf
'';
};
extraInputConf = lib.mkOption {
type = lib.types.lines;
default = ''
RIGHT seek 2
LEFT seek -2
'';
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
(
cfg.package.override {
extraMakeWrapperArgs = [
"--add-flags"
"--config-dir=${
pkgs.symlinkJoin {
inherit name;
paths = [
(pkgs.writeTextDir "${name}.conf" cfg.extraConfig)
(pkgs.writeTextDir "input.conf" cfg.extraInputConf)
];
}
}"
];
}
// lib.optionalAttrs cfg.useFullFFmpeg {
mpv-unwrapped = pkgs.mpv-unwrapped.override {
ffmpeg = pkgs.ffmpeg-full;
};
}
)
];
};
}

View file

@ -1,33 +0,0 @@
{
lib,
config,
...
}:
let
name = "virt";
cfg = config.nixowos.graphical.${name};
in
{
options.nixowos.graphical.${name} = {
enable = lib.mkEnableOption name;
user = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
};
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = cfg.user != null;
message = "you must set nixowos.graphical.${name}.user";
}
];
programs.virt-manager.enable = true;
virtualisation.libvirtd.enable = true;
users.users.${cfg.user}.extraGroups = [ "libvirtd" ];
};
}

View file

@ -1,34 +0,0 @@
{
pkgs,
...
}:
{
mkConfWrapper =
name: package:
{
globalConfig,
userConfig ? "$HOME/${name}/${name}.conf",
configArg ? "-c ",
excecutable ? "${package}/bin/${name}",
}:
pkgs.symlinkJoin {
inherit name;
paths = [
(pkgs.writeShellApplication {
inherit name;
runtimeInputs = [ package ];
text = ''
if test -r "${userConfig}"; then
exec -a "$0" "${excecutable}" "$@"
else
exec -a "$0" "${excecutable}" ${configArg}"${globalConfig}" "$@"
fi
'';
})
package
];
};
}