From 1bbfdb48abe387da4acc0641b747c0dc4322e9bc Mon Sep 17 00:00:00 2001 From: DrymarchonShaun Date: Fri, 29 Aug 2025 17:58:02 -0700 Subject: [PATCH 1/7] fix(nix): ensure git exists in the steam fhsenv --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index e54186ea..1a0c753e 100755 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,7 @@ overlays.default = final: prev: rec { inherit (self.packages."x86_64-linux") millennium; steam-millennium = final.steam.override (prev: { + extraPkgs = pkgs: [ pkgs.git ]; extraProfile = '' export LD_LIBRARY_PATH="${millennium}/lib/millenium/''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" From 546ec1000397c96611387d7ee59964e91d757140 Mon Sep 17 00:00:00 2001 From: DrymarchonShaun Date: Fri, 29 Aug 2025 20:21:43 -0700 Subject: [PATCH 2/7] feat: add a basic script to simplify updating pnpmDeps hashes After bumping the submodule version of assets/ or sdk/, running `nix run .#update-pnpm-hashes` should automatically update the hashes in `nix/assets.nix` and `nix/typescript/shims.nix` --- flake.nix | 3 +++ nix/update.nix | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 nix/update.nix diff --git a/flake.nix b/flake.nix index 1a0c753e..db488e68 100755 --- a/flake.nix +++ b/flake.nix @@ -44,6 +44,9 @@ millennium = pkgs.callPackage ./nix/python/millennium.nix { }; core-utils = pkgs.callPackage ./nix/python/core-utils.nix { }; }; + # basic script to update pnpm hashes in the shims and assets package definitions + # usage: nix run .#update-pnpm-hashes + update-pnpm-hashes = pkgs.callPackage ./nix/update.nix { }; }; }; } diff --git a/nix/update.nix b/nix/update.nix new file mode 100644 index 00000000..fb038bf6 --- /dev/null +++ b/nix/update.nix @@ -0,0 +1,9 @@ +{ + lib, + writeShellScriptBin, + nix-update, +}: +writeShellScriptBin "update-pnpm-hashes" '' + ${lib.getExe nix-update} --version skip --flake assets + ${lib.getExe nix-update} --version skip --flake shims +'' From 2866808a691d7124f1644712ee157904c4b4e7ca Mon Sep 17 00:00:00 2001 From: DrymarchonShaun Date: Fri, 29 Aug 2025 19:40:46 -0700 Subject: [PATCH 3/7] chore: update sdk pnpmDeps hash --- nix/typescript/shims.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/typescript/shims.nix b/nix/typescript/shims.nix index 803d68da..3fde9851 100644 --- a/nix/typescript/shims.nix +++ b/nix/typescript/shims.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { pnpmDeps = pnpm.fetchDeps { inherit src version pname; #TODO: automatic hash update - hash = "sha256-LofHepVz6CjbAXkUwwNFVzlbmPq+g/gJvkBka9I/gHo="; + hash = "sha256-1cqsNIQnrVAe18FC8D6mnptH+gp4B5+hyGF9lGn0OE0="; fetcherVersion = 2; }; From 77e837d306fbf79ec20e46497b4c6214183534d8 Mon Sep 17 00:00:00 2001 From: DrymarchonShaun Date: Fri, 29 Aug 2025 20:29:07 -0700 Subject: [PATCH 4/7] chore: run nixfmt on all nix files --- flake.nix | 2 +- nix/millennium.nix | 2 +- nix/python/core-utils.nix | 4 ++-- nix/python/millennium.nix | 4 ++-- shell.nix | 6 ++++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index db488e68..31e5ec62 100755 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ # Special thanks to @Sk7Str1p3, @mourogurt, @kaeeraa, @mctrxw for help with this flake and packages { description = '' - Millennium - an open-source low-code modding framework to create, + Millennium - an open-source low-code modding framework to create, manage and use themes/plugins for the desktop Steam Client ''; diff --git a/nix/millennium.nix b/nix/millennium.nix index 1c4a2734..d321e24e 100755 --- a/nix/millennium.nix +++ b/nix/millennium.nix @@ -86,7 +86,7 @@ pkgsi686Linux.stdenv.mkDerivation { mkdir -p $out/lib/millennium cp libmillennium_x86.so $out/lib/millennium - + runHook postInstall ''; NIX_CFLAGS_COMPILE = [ diff --git a/nix/python/core-utils.nix b/nix/python/core-utils.nix index 1ca7a19b..4102f7d2 100644 --- a/nix/python/core-utils.nix +++ b/nix/python/core-utils.nix @@ -1,4 +1,4 @@ -{pkgs}: +{ pkgs }: pkgs.python311Packages.buildPythonPackage { pname = "millennium-core-utils"; version = "git"; @@ -11,4 +11,4 @@ pkgs.python311Packages.buildPythonPackage { cp ${../../sdk/package.json} ./millennium/package.json cp ${../../sdk/README.md} ./millennium/README.md ''; -} \ No newline at end of file +} diff --git a/nix/python/millennium.nix b/nix/python/millennium.nix index f9ffb5bd..06195d45 100644 --- a/nix/python/millennium.nix +++ b/nix/python/millennium.nix @@ -1,4 +1,4 @@ -{pkgs}: +{ pkgs }: pkgs.python311Packages.buildPythonPackage { pname = "millennium"; version = "git"; @@ -11,4 +11,4 @@ pkgs.python311Packages.buildPythonPackage { cp ${../../sdk/package.json} ./millennium/package.json cp ${../../sdk/README.md} ./millennium/README.md ''; -} \ No newline at end of file +} diff --git a/shell.nix b/shell.nix index e051df8a..855b9a14 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,6 @@ -{pkgs ? import }: +{ + pkgs ? import , +}: with pkgs; mkShell { @@ -9,4 +11,4 @@ mkShell { nixfmt-rfc-style mypy ]; -} \ No newline at end of file +} From 41d1a48d54af163a6feb1e94b13df5cf1db27874 Mon Sep 17 00:00:00 2001 From: trivaris Date: Mon, 1 Sep 2025 00:37:17 +0200 Subject: [PATCH 5/7] chore: factor out system variable for maintainability --- flake.nix | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 31e5ec62..5f75fceb 100755 --- a/flake.nix +++ b/flake.nix @@ -14,29 +14,30 @@ outputs = { nixpkgs, self, ... }: let + inherit (self.packages.${system}) millennium; + system = "x86_64-linux"; pkgs = import nixpkgs { - system = "x86_64-linux"; + inherit system; config.allowUnfree = true; }; in { - overlays.default = final: prev: rec { - inherit (self.packages."x86_64-linux") millennium; + overlays.default = final: prev: { + inherit system; steam-millennium = final.steam.override (prev: { extraPkgs = pkgs: [ pkgs.git ]; - extraProfile = - '' - export LD_LIBRARY_PATH="${millennium}/lib/millenium/''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" - export LD_PRELOAD="${millennium}/lib/millennium/libmillennium_x86.so''${LD_PRELOAD:+:$LD_PRELOAD}" - '' - + (prev.extraProfile or ""); + extraProfile = '' + export LD_LIBRARY_PATH="${millennium}/lib/millenium/''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + export LD_PRELOAD="${millennium}/lib/millennium/libmillennium_x86.so''${LD_PRELOAD:+:$LD_PRELOAD}" + '' + + (prev.extraProfile or ""); }); }; - devShells."x86_64-linux".default = import ./shell.nix { inherit pkgs; }; + devShells.${system}.default = import ./shell.nix { inherit pkgs; }; - packages."x86_64-linux" = { - default = self.packages."x86_64-linux".millennium; + packages.${system} = { + default = self.packages.${system}.millennium; millennium = pkgs.callPackage ./nix/millennium.nix { }; shims = pkgs.callPackage ./nix/typescript/shims.nix { }; assets = pkgs.callPackage ./nix/assets.nix { }; From afb2d3d6ebdd30a18c33dd2e04ebe32ff7a3fb51 Mon Sep 17 00:00:00 2001 From: DrymarchonShaun Date: Sat, 6 Sep 2025 14:21:39 -0700 Subject: [PATCH 6/7] chore: update nix flake --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index e5cf64ef..3aa04281 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1749398372, - "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", + "lastModified": 1756770412, + "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", + "rev": "4524271976b625a4a605beefd893f270620fd751", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1750506804, - "narHash": "sha256-VLFNc4egNjovYVxDGyBYTrvVCgDYgENp5bVi9fPTDYc=", + "lastModified": 1756787288, + "narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4206c4cb56751df534751b058295ea61357bbbaa", + "rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1748740939, - "narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=", + "lastModified": 1754788789, + "narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "656a64127e9d791a334452c6b6606d17539476e2", + "rev": "a73b9c743612e4244d865a2fdee11865283c04e6", "type": "github" }, "original": { From 4b9f334084345bc23d7560c5702d5526d02ca539 Mon Sep 17 00:00:00 2001 From: DrymarchonShaun Date: Sat, 6 Sep 2025 14:32:52 -0700 Subject: [PATCH 7/7] chore: update sdk pnpmDeps hash --- nix/assets.nix | 2 +- nix/typescript/shims.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/assets.nix b/nix/assets.nix index b689ea20..9196657c 100644 --- a/nix/assets.nix +++ b/nix/assets.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { src = ../assets; pnpmDeps = pnpm.fetchDeps { inherit src version pname; - hash = "sha256-nDSltpFQRM9loVuDour4OrRdN22/A7MkZTGAtL0x7rU="; + hash = "sha256-/H3Np/FjxEdU/TwqPPJlpNti2vfyNqUQ2CNIvzlSemA="; fetcherVersion = 2; }; nativeBuildInputs = [ diff --git a/nix/typescript/shims.nix b/nix/typescript/shims.nix index 3fde9851..ac0e2848 100644 --- a/nix/typescript/shims.nix +++ b/nix/typescript/shims.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { pnpmDeps = pnpm.fetchDeps { inherit src version pname; #TODO: automatic hash update - hash = "sha256-1cqsNIQnrVAe18FC8D6mnptH+gp4B5+hyGF9lGn0OE0="; + hash = "sha256-Je0nigOKUklS+7iE1R0vwIMe+cDeOZccIXQ7nLeD9Ao="; fetcherVersion = 2; };