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": { diff --git a/flake.nix b/flake.nix index e54186ea..5f75fceb 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 ''; @@ -14,28 +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: { - 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 ""); + 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 ""); }); }; - 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 { }; @@ -43,6 +45,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/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/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/nix/typescript/shims.nix b/nix/typescript/shims.nix index 803d68da..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-LofHepVz6CjbAXkUwwNFVzlbmPq+g/gJvkBka9I/gHo="; + hash = "sha256-Je0nigOKUklS+7iE1R0vwIMe+cDeOZccIXQ7nLeD9Ao="; fetcherVersion = 2; }; 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 +'' 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 +}