Skip to content

Conversation

@OmnipotentEntity
Copy link

@OmnipotentEntity OmnipotentEntity commented Feb 17, 2023

Updated the nix files so that they build in a sandboxed environment, such as a nix flake. An example of such a flake (that you may use to test this) is as follows:

{
  inputs = {
    flakeUtils.url = "github:numtide/flake-utils";
    nixpkgs.url = "github:nixos/nixpkgs/release-22.05";
    bizhawk.url = "github:OmnipotentEntity/BizHawk/master"; 
    bizhawk.flake = false;
  };
  outputs = { self, ... } @ inputs:
    inputs.flakeUtils.lib.eachSystem [ "x86_64-linux" ] (system:
      let
        pkgs = import inputs.nixpkgs {
          inherit system;
          config.allowUnfree = true;
        };
        bizhawk = import inputs.bizhawk {
          forNixOS = true;
          pkgs = pkgs;
          mono = pkgs.mono;
          lua = pkgs.lua5_4;
        };

      in rec {
        devShells = {
          # The activation script can be used as dev-shell
          default = pkgs.mkShell {
            buildInputs = with pkgs; [
              bizhawk.emuhawk
              bizhawk.discohawk
              gradle
              jdk11
              gtk2-x11
            ];
          };
        };

        devShell = devShells.default;
      }
    );
}

Tested as functional under NixOS. In order to do this I had to:

  1. Add a few packages to the main Nix file (such as speexdsp)
  2. Change how nuget files were referenced (name was depreciated)
  3. Update a handful of packages that had become stale (specifically OpenTK)
  4. Remove references to nixpkgs's lib by simply porting the functions over into the file.

Check if completed:

@OmnipotentEntity
Copy link
Author

Updated flake.nix because lol lol lol I'm a dumbass and I left a reference to my local filesystem in the flake. It should now pull from my fork on github and be accessible to anyone.

@OmnipotentEntity OmnipotentEntity force-pushed the master branch 2 times, most recently from a42b094 to e8fbc33 Compare February 24, 2023 22:04
@OmnipotentEntity OmnipotentEntity marked this pull request as draft February 24, 2023 22:10
@OmnipotentEntity
Copy link
Author

Converting to a draft due to an issue with a lua dependency not being fulfilled, will attempt to fix later on in the week.

@OmnipotentEntity OmnipotentEntity force-pushed the master branch 2 times, most recently from 4660c2d to c0df35e Compare February 25, 2023 03:49
@OmnipotentEntity OmnipotentEntity marked this pull request as ready for review February 25, 2023 03:51
@OmnipotentEntity
Copy link
Author

Fixes the problem with lua not being included on build. Also fixes the problem with the pkg versions being overridden by the default package inherit (pkgs), moved those to a normal inherit statement to prevent this surprising behavior.

@YoshiRulz
Copy link
Member

YoshiRulz commented Nov 19, 2023

I rewrote most of the Nix expression. I didn't add a flake yet, but it seems you didn't end up making any flake-specific changes? If anything comes up you can re-use this PR.

edit: I'll assume the last issues were resolved with #3890 and close this.

@YoshiRulz YoshiRulz closed this May 15, 2024
@YoshiRulz YoshiRulz mentioned this pull request May 25, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants