feat: initial commit

This commit is contained in:
Evar 2025-02-22 20:21:32 -05:00
commit fb0fc3a37f
3 changed files with 105 additions and 0 deletions

61
flake.lock generated Normal file
View file

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1739866667,
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

22
flake.nix Normal file
View file

@ -0,0 +1,22 @@
{
description = "A collection of godot";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { flake-utils, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages = rec {
default = godot;
godot = godot_4;
godot_4 = pkgs.callPackage ./godot-withmodules.nix { godot = pkgs.godot_4; };
godot_4-mono = pkgs.callPackage ./godot-withmodules.nix { godot = pkgs.godot_4-mono; };
};
});
}

22
godot-withmodules.nix Normal file
View file

@ -0,0 +1,22 @@
pkgs@{
lib,
godot ? pkgs.godot_4,
...
}:
godot.overrideAttrs (prev: {
passthru = prev.passthru // {
withModules =
modules:
godot.overrideAttrs (prev: {
postPatch =
if prev ? "postPatch" then prev.postPatch else ""
+ (lib.strings.concatLines (
builtins.map (module:
''
cp -ar ${module.path} modules/${module.name}
chmod -R u+w -- "modules/${module.name}"
'') modules
));
});
};
})