diff --git a/cli/helix.nix b/cli/helix.nix deleted file mode 100644 index d2ebb18..0000000 --- a/cli/helix.nix +++ /dev/null @@ -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"; - }; -} diff --git a/cli/yt-dlp.nix b/cli/yt-dlp.nix deleted file mode 100644 index 90126db..0000000 --- a/cli/yt-dlp.nix +++ /dev/null @@ -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; - }; -} diff --git a/graphical/games/mangohud.nix b/graphical/games/mangohud.nix deleted file mode 100644 index 6457fd4..0000000 --- a/graphical/games/mangohud.nix +++ /dev/null @@ -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; - }; - }; -} diff --git a/graphical/games/steam.nix b/graphical/games/steam.nix deleted file mode 100644 index 35b4910..0000000 --- a/graphical/games/steam.nix +++ /dev/null @@ -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; - }; - }; -} diff --git a/graphical/mpv.nix b/graphical/mpv.nix deleted file mode 100644 index 4a67380..0000000 --- a/graphical/mpv.nix +++ /dev/null @@ -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; - }; - } - ) - ]; - }; -} diff --git a/graphical/virt.nix b/graphical/virt.nix deleted file mode 100644 index e8706c9..0000000 --- a/graphical/virt.nix +++ /dev/null @@ -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" ]; - }; -} diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index 6610aa3..0000000 --- a/lib/default.nix +++ /dev/null @@ -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 - ]; - }; -}