commit fb0fc3a37f4cc073503d6cd822086b12d4005e39 Author: Evar Date: Sat Feb 22 20:21:32 2025 -0500 feat: initial commit diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b01a4f8 --- /dev/null +++ b/flake.lock @@ -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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..32e7605 --- /dev/null +++ b/flake.nix @@ -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; }; + }; + }); +} diff --git a/godot-withmodules.nix b/godot-withmodules.nix new file mode 100644 index 0000000..e9257ad --- /dev/null +++ b/godot-withmodules.nix @@ -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 + )); + }); + }; +})