-
-
Notifications
You must be signed in to change notification settings - Fork 103
Init nix flakes #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Init nix flakes #208
Conversation
f72a60b
to
b374fbb
Compare
I made a mistake. For now this PR should be draft |
Commit hash: 3c58c0c I build Simula with below diff and diff --git a/.gitmodules b/.gitmodules
index 2cb9882..271bbcd 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -4,8 +4,8 @@
shallow = true
[submodule "submodules/wlroots"]
path = submodules/wlroots
- url = https://github.com/SimulaVR/wlroots
- branch = simula
+ url = https://github.com/haruki7049/wlroots-simula
+ branch = edit-nix-files
shallow = true
[submodule "submodules/godot"]
path = submodules/godot
@@ -41,4 +41,4 @@
[submodule "submodules/monado"]
path = submodules/monado
url = https://github.com/SimulaVR/monado-xv.git
- branch = xr50
\ No newline at end of file
+ branch = xr50
diff --git a/Simula.nix b/Simula.nix
index 5166a0f..b62b1c0 100644
--- a/Simula.nix
+++ b/Simula.nix
@@ -23,7 +23,7 @@ let
wayland-protocols-dev = wayland-protocols.overrideAttrs (oldAttrs: {
stdenv = stdenvRes;
});
- wlroots-dev = callPackage ./submodules/wlroots/wlroots.nix { stdenv = stdenvRes; };
+ wlroots-dev = callPackage ./submodules/wlroots { stdenv = stdenvRes; };
vulkan-loader-custom = if onNixOS then vulkan-loader else (callPackage ./nix/vulkan-loader.nix { });
glibc-locales = glibcLocales;
godot = callPackage ./submodules/godot/godot.nix { devBuild = devBuild; onNixOS = onNixOS; };
diff --git a/submodules/wlroots b/submodules/wlroots
index 017c7ca..7a3d488 160000
--- a/submodules/wlroots
+++ b/submodules/wlroots
@@ -1 +1 @@
-Subproject commit 017c7ca435e2198fab6fde16db918b64aa0d6232
+Subproject commit 7a3d48833ad58a19fed81f87744a0e69f505f3f5 |
This means that SimulaVR can be built with Nix flakes if SimulaVR/wlroots#1 merged into SimulaVR/wlroots |
Commit hash: b539685 I am so sad, because I understand that we cannot use Git submodules in nix build .?submodules=1#devBuild-onNixOS |
I can do these things but I cannot judge whether I should do in this PR or not:
I also can do these things but I don't think that I should do in this PR:
|
TODO:
|
I'll do some more work... |
…'s building result
- This avoids installation conflicts in case the user already has some of these programs installed. - Removes SIMULA_APP_DIR support since we no longer use it. - Involves flake.nix + Haskell sources edits - Add back simula-monado-service
These nix fields can lead to potential package collisions: - propagatedBuildInputs - propagatedUserEnvPkgs - propagatedNativeBuildInputs `getPropagatedPackages()` takes Simula's ./flake.nix and returns a list of all propagated packages for inspection.
`getNixDependenciesWhichInvolve` shows you a tree of dependencies of a flake (`$1`) which somehow involve the pattern `$2`.
nix-profile
support #169This PR creates
/flake.nix
and/flake.lock
files.Changes
/flake.nix
and/flake.lock
nix build .#simula nix build
nix profile
command supportnix profile install github:haruki7049/Simula/init-flakes -L
/pinned-nixpkgs.nix
externalSrc
attribute andlocalSrc
declaration. Useoverride
function to overridesrc
attribute.godot_headers
wlroots
andgodot
submodule.#devShells.default
/.envrc
to usenix-direnv
nix-checker
CI to check Nix derivation/addons/godot-haskell-plugin/justfile
My environment
$ nix-shell -p nix-info --run "nix-info -m" - system: `"x86_64-linux"` - host os: `Linux 6.6.62, NixOS, 25.05 (Warbler), 25.05beta710087.23e89b7da85c` - multi-user?: `yes` - sandbox: `yes` - version: `nix-env (Nix) 2.24.10` - channels(root): `"nixos"` - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`