Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 18 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -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
'';

Expand All @@ -14,35 +14,40 @@
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 { };
python = {
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 { };
};
};
}
2 changes: 1 addition & 1 deletion nix/assets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion nix/millennium.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pkgsi686Linux.stdenv.mkDerivation {

mkdir -p $out/lib/millennium
cp libmillennium_x86.so $out/lib/millennium

runHook postInstall
'';
NIX_CFLAGS_COMPILE = [
Expand Down
4 changes: 2 additions & 2 deletions nix/python/core-utils.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs}:
{ pkgs }:
pkgs.python311Packages.buildPythonPackage {
pname = "millennium-core-utils";
version = "git";
Expand All @@ -11,4 +11,4 @@ pkgs.python311Packages.buildPythonPackage {
cp ${../../sdk/package.json} ./millennium/package.json
cp ${../../sdk/README.md} ./millennium/README.md
'';
}
}
4 changes: 2 additions & 2 deletions nix/python/millennium.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs}:
{ pkgs }:
pkgs.python311Packages.buildPythonPackage {
pname = "millennium";
version = "git";
Expand All @@ -11,4 +11,4 @@ pkgs.python311Packages.buildPythonPackage {
cp ${../../sdk/package.json} ./millennium/package.json
cp ${../../sdk/README.md} ./millennium/README.md
'';
}
}
2 changes: 1 addition & 1 deletion nix/typescript/shims.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
9 changes: 9 additions & 0 deletions nix/update.nix
Original file line number Diff line number Diff line change
@@ -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
''
6 changes: 4 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{pkgs ? import <nixpkgs>}:
{
pkgs ? import <nixpkgs>,
}:
with pkgs;

mkShell {
Expand All @@ -9,4 +11,4 @@ mkShell {
nixfmt-rfc-style
mypy
];
}
}