diff --git a/flake.nix b/flake.nix index 2920576..8b59a58 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,16 @@ # deprecated in Nix 2.8 nixosModule = self.nixosModules.default; + homeManagerModules = + let + protontweaks = import ./nix/home-manager.nix; + in + { + protontweaks = protontweaks; + default = protontweaks; + }; + homeManagerModule = self.homeManagerModules.default; + overlay = final: prev: { protontweaks = prev.callPackage ./nix/pkgs/protontweaks.nix { }; }; diff --git a/nix/home-manager.nix b/nix/home-manager.nix new file mode 100644 index 0000000..19e48b9 --- /dev/null +++ b/nix/home-manager.nix @@ -0,0 +1,26 @@ +{ lib, config, pkgs, ... }: +let + cfg = config.services.protontweaks; + + inherit (lib) mkIf mkEnableOption; +in +{ + options.services.protontweaks = { + enable = mkEnableOption "protontweaks"; + + gamemode = mkEnableOption "automatic gamemode initialization" // { + default = true; + }; + + mangohud = mkEnableOption "automatic mangohud initialization" // { + default = false; + }; + }; + + config = mkIf (cfg.enable) { + home.file.".config/protontweaks.json".text = builtins.toJSON ({ + gamemode = cfg.gamemode; + mangohud = cfg.mangohud; + }); + }; +}