diff --git a/README.org b/README.org index 26124a0..d9ecc39 100644 --- a/README.org +++ b/README.org @@ -96,6 +96,16 @@ You can then install your configuration into TF2's =tf= directory: Rebuild your system, and rejoice! +** Example Flake + +Try out the example flake: + +#+begin_example +$ nix build 'gitlab:msyds/tf2-nix?dir=example' +#+end_example + +The resulting config can then be explored in =./result/=. + ** Library TODO! diff --git a/example/flake.nix b/example/flake.nix new file mode 100644 index 0000000..fb1cdb6 --- /dev/null +++ b/example/flake.nix @@ -0,0 +1,39 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + tf2-nix.url = "path:///home/crumb/src/tf2-nix"; + }; + + outputs = { self, ... }@inputs: { + # TF2 config built as a package. + packages.x86_64-linux.default = + let + pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; + tf2pkgs = inputs.tf2-nix.packages.x86_64-linux; + in tf2pkgs.mergeTf2Configs (with tf2pkgs; [ + mastercomfig.presets.medium-low + mastercomfig.addons.flat-mouse + mastercomfig.addons.no-tutorial + mastercomfig.addons.null-canceling-movement + maps.jump_beef + improved-crosshairs + loadouts-script + # Packages are overridable. + (huds.deerhud.overrideAttrs (final: prev: { + patches = [ ./raise-uber-meter.patch ]; + })) + # Existing configs on your file system may be referenced by path: + ./my-config + ]); + + # TF2 config installed using Home-manager. + homeConfigurations.default = + let gameDir = ".local/share/Steam/steamapps/common/Team Fortress 2/tf"; + in { + home.file.${gameDir} = { + recursive = true; + source = self.packages.x86_64-linux.default; + }; + }; + }; +} diff --git a/example/my-config/cfg/overrides/autoexec.cfg b/example/my-config/cfg/overrides/autoexec.cfg new file mode 100644 index 0000000..a6bd7d6 --- /dev/null +++ b/example/my-config/cfg/overrides/autoexec.cfg @@ -0,0 +1 @@ +echo "Hello!!!!!!!!!!!!!!!!!!!" \ No newline at end of file diff --git a/example/raise-uber-meter.patch b/example/raise-uber-meter.patch new file mode 100644 index 0000000..538ff5c --- /dev/null +++ b/example/raise-uber-meter.patch @@ -0,0 +1,49 @@ +diff --git a/resource/ui/hudmediccharge.res b/resource/ui/hudmediccharge.res +index afbf45a..5b0cd3c 100644 +--- a/resource/ui/hudmediccharge.res ++++ b/resource/ui/hudmediccharge.res +@@ -5,7 +5,7 @@ + "ControlName" "ImagePanel" + "fieldName" "MeterBrackets" + "xpos" "cs-0.5" +- "ypos" "47" ++ "ypos" "3" + "zpos" "-5" + "wide" "156" + "tall" "20" +@@ -21,7 +21,7 @@ + "ControlName" "CExLabel" + "fieldName" "ChargeLabel" + "xpos" "cs-0.5" +- "ypos" "50" ++ "ypos" "6" + "zpos" "3" + "wide" "90" + "tall" "15" +@@ -65,7 +65,7 @@ + "ControlName" "CExLabel" + "fieldName" "IndividualChargesLabel" + "xpos" "c92" +- "ypos" "44" ++ "ypos" "0" + "zpos" "2" + "wide" "90" + "tall" "30" +@@ -87,7 +87,7 @@ + "fieldName" "ChargeMeter" + "font" "Default" + "xpos" "cs-0.5" +- "ypos" "50" ++ "ypos" "6" + "zpos" "2" + "wide" "150" + "tall" "14" +@@ -107,7 +107,7 @@ + "fieldName" "ChargeMeter1" + "font" "Default" + "xpos" "c-75" +- "ypos" "52" ++ "ypos" "8" + "zpos" "2" + "wide" "36" + "tall" "10"