djanatyn / ssbm-nix

Nix expressions for Super Smash Bros. Melee players.
34 stars 21 forks source link

Cannot build #44

Open zDEFz opened 1 year ago

zDEFz commented 1 year ago

Tried:

nix build github:djanatyn/ssbm-nix

error: flake 'github:djanatyn/ssbm-nix' does not provide attribute 'packages.x86_64-linux.default' or 'defaultPackage.x86_64-linux'

flake.nix

{
  description = "Home Manager configuration of blu";

  inputs = {
    # Specify the source of Home Manager and Nixpkgs.
    nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
    home-manager = {
      url = "github:nix-community/home-manager/release-23.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    ssbm-nix = { # nix need to know where to look for ssbm-nix
      url = "github:djanatyn/ssbm-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { nixpkgs, home-manager, ssbm-nix, ... }:
    let
      system = "x86_64-linux";
      pkgs=import nixpkgs{
  inherit system;
  overlays = [ssbm-nix.overlay];
};
    in {
      homeConfigurations."blu" = home-manager.lib.homeManagerConfiguration {
        inherit pkgs;

        # Specify your home configuration modules here, for example,
        # the path to your home.nix.
        modules = [ 
          ./home.nix
          ssbm-nix.homeManagerModule #and you also need tell it to include the module
        ];

        # Optionally use extraSpecialArgs
        # to pass through arguments to home.nix
      };
    };
}

home.nix

{ config, pkgs, ... }:

{
  # Home Manager needs a bit of information about you and the paths it should
  # manage.
  home.username = "blu";
  home.homeDirectory = "/home/blu";

  # This value determines the Home Manager release that your configuration is
  # compatible with. This helps avoid breakage when a new Home Manager release
  # introduces backwards incompatible changes.
  #
  # You should not change this value, even if you update Home Manager. If you do
  # want to update the value, then make sure to first check the Home Manager
  # release notes.
  home.stateVersion = "23.05"; # Please read the comment before changing.

  # The home.packages option allows you to install Nix packages into your
  # environment.
  home.packages = [
    # # Adds the 'hello' command to your environment. It prints a friendly
    # # "Hello, world!" when run.
    # pkgs.hello

    # # It is sometimes useful to fine-tune packages, for example, by applying
    # # overrides. You can do that directly here, just don't forget the
    # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
    # # fonts?
    # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })

    # # You can also create simple shell scripts directly inside your
    # # configuration. For example, this adds a command 'my-hello' to your
    # # environment:
    # (pkgs.writeShellScriptBin "my-hello" ''
    #   echo "Hello, ${config.home.username}!"
    # '')
  ];

  # Home Manager is pretty good at managing dotfiles. The primary way to manage
  # plain files is through 'home.file'.
  home.file = {
    # # Building this configuration will create a copy of 'dotfiles/screenrc' in
    # # the Nix store. Activating the configuration will then make '~/.screenrc' a
    # # symlink to the Nix store copy.
    # ".screenrc".source = dotfiles/screenrc;

    # # You can also set the file content immediately.
    # ".gradle/gradle.properties".text = ''
    #   org.gradle.console=verbose
    #   org.gradle.daemon.idletimeout=3600000
    # '';
  };

  # You can also manage environment variables but you will have to manually
  # source
  #
  #  ~/.nix-profile/etc/profile.d/hm-session-vars.sh
  #
  # or
  #
  #  /etc/profiles/per-user/blu/etc/profile.d/hm-session-vars.sh
  #
  # if you don't want to manage your shell through Home Manager.
  home.sessionVariables = {
    # EDITOR = "emacs";
  };

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;

# ssbm.slippi-launcher= {
#   enable = true;
#   # Replace with the path to your Melee ISO
#   isoPath = "Path/To/SSBM.ciso";
# };

}
lytedev commented 1 year ago
    ssbm-nix = { # nix need to know where to look for ssbm-nix
      url = "github:djanatyn/ssbm-nix";
      inputs.nixpkgs.follows = "nixpkgs";

I believe this could force ssbm-nix to use nixpkgs it is not compatible with which is likely the cause of your compilation errors. If you get rid of inputs.nixpkgs.follows = "nixpkgs"; does it work?

zDEFz commented 1 year ago

edit nix run github:lytedev/ssbm-nix#slippi-netplay works but url = "github:lytedev/ssbm-nix#slippi-netplay"; seems invalid syntax! I think I have to edit the URL to that?

    ssbm-nix = { # nix need to know where to look for ssbm-nix
      url = "github:djanatyn/ssbm-nix";
      inputs.nixpkgs.follows = "nixpkgs";

I believe this could force ssbm-nix to use nixpkgs it is not compatible with which is likely the cause of your compilation errors. If you get rid of inputs.nixpkgs.follows = "nixpkgs"; does it work?

No its the exact same - and this is a fresh install... first time nixos...

       > gcc-ranlib libglslang.a
       > [ 34%] Linking CXX static library libcommon.a
       > [ 34%] Built target glslang
       > gcc-ar qc libcommon.a CMakeFiles/common.dir/Analytics.cpp.o CMakeFiles/common.dir/BreakPoints.cpp.o CMakeFiles/common.dir/CDUtils.cpp.o CMakeFiles/common.dir/ColorUtil.cpp.o CMakeFiles/common.dir/ENetUtil.cpp.o CMakeFiles/common.dir/FileSearch.cpp.o CMakeFiles/common.dir/FileUtil.cpp.o CMakeFiles/common.dir/GekkoDisassembler.cpp.o CMakeFiles/common.dir/Hash.cpp.o CMakeFiles/common.dir/IniFile.cpp.o CMakeFiles/common.dir/JitRegister.cpp.o CMakeFiles/common.dir/MathUtil.cpp.o CMakeFiles/common.dir/MemArena.cpp.o CMakeFiles/common.dir/MemoryUtil.cpp.o CMakeFiles/common.dir/Misc.cpp.o CMakeFiles/common.dir/MsgHandler.cpp.o CMakeFiles/common.dir/NandPaths.cpp.o CMakeFiles/common.dir/Network.cpp.o CMakeFiles/common.dir/PcapFile.cpp.o CMakeFiles/common.dir/PerformanceCounter.cpp.o CMakeFiles/common.dir/Profiler.cpp.o CMakeFiles/common.dir/SettingsHandler.cpp.o CMakeFiles/common.dir/SDCardUtil.cpp.o CMakeFiles/common.dir/StringUtil.cpp.o CMakeFiles/common.dir/SymbolDB.cpp.o CMakeFiles/common.dir/SysConf.cpp.o CMakeFiles/common.dir/Thread.cpp.o CMakeFiles/common.dir/Timer.cpp.o CMakeFiles/common.dir/TraversalClient.cpp.o CMakeFiles/common.dir/Version.cpp.o CMakeFiles/common.dir/x64ABI.cpp.o CMakeFiles/common.dir/x64Analyzer.cpp.o CMakeFiles/common.dir/x64Emitter.cpp.o CMakeFiles/common.dir/MD5.cpp.o CMakeFiles/common.dir/Crypto/bn.cpp.o CMakeFiles/common.dir/Crypto/ec.cpp.o CMakeFiles/common.dir/Logging/LogManager.cpp.o CMakeFiles/common.dir/Logging/ConsoleListenerNix.cpp.o CMakeFiles/common.dir/x64FPURoundMode.cpp.o CMakeFiles/common.dir/x64CPUDetect.cpp.o CMakeFiles/common.dir/GL/GLUtil.cpp.o CMakeFiles/common.dir/GL/GLExtensions/GLExtensions.cpp.o CMakeFiles/common.dir/GL/GLInterface/GLInterface.cpp.o CMakeFiles/common.dir/GL/GLInterface/GLX.cpp.o CMakeFiles/common.dir/GL/GLInterface/X11_Util.cpp.o
       > gcc-ranlib libcommon.a
       > [ 34%] Built target common
       > make: *** [Makefile:166: all] Error 2
       For full logs, run 'nix log /nix/store/icz61fnfpwgnss871ybjxip3v21ibakn-slippi-ishiiruka-3.3.1-netplay.drv'.
error: 1 dependencies of derivation '/nix/store/gdnrv32ail0ywgq43n58025ydfr4mkxl-slippi-config.drv' failed to build
error: 1 dependencies of derivation '/nix/store/i27lcg9nilhbqw90qqrabc4ag4j9zinw-home-manager-files.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mh2sxfsav18rz67c9xvscfs4148lnrvj-home-manager-generation.drv' failed to build
blu@mainrig-MS-7D51:~ $                                                                                                           
lytedev commented 1 year ago

From within a flake you can only reference another flake, not a flake attribute.

Also, I'm not sure it works without the nixpkgs overlay, which it looks like you are missing?

zDEFz commented 1 year ago

From within a flake you can only reference another flake, not a flake attribute.

Also, I'm not sure it works without the nixpkgs overlay, which it looks like you are missing?

I am new to NixOS - it would be nice to have a installation guide in this project for NixOS - I am not understanding what I'm doing.

zDEFz commented 1 year ago

@lytedev could it be I am lacking dependencies? If so, which could they be? I mean I can partially build, just not fully.

lytedev commented 1 year ago

I'm still new, too. This flake.nix seems to work. All I really changed was that nixpkgs and home-manager are using the nixos-unstable and master branches respectively. I would expect the ssbm-nix flake to use its own nixpkgs, so I'm guessing something is wrong with the way the flake is put together.

{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  inputs.home-manager.url = "github:nix-community/home-manager/master";
  inputs.ssbm-nix.url = "github:lytedev/ssbm-nix";
  outputs = {home-manager, ssbm-nix, nixpkgs, ...}: {
    homeConfigurations."blu" = home-manager.lib.homeManagerConfiguration {
      pkgs = import nixpkgs {
        system = "x86_64-linux";
        overlays = [ssbm-nix.overlay];
      };
      modules = [
        ./home.nix
        ssbm-nix.homeManagerModule
      ];
    };
  };
}

You can always run the application using nix run as above as well.

lytedev commented 1 year ago

Ah I'm silly! I realize that since we're using the ssbm-nix homeManagerModule, the pkgs we define in the homeManagerConfiguration will of course propagate to the module, and so it will not use the right packages. There's probably a way to force the module to use its own nixpkgs like so, but I'm not sure what that would be off the top of my head.

But ultimately we should probably have the NixOS and homeManager modules use their own nixpkgs since we know that's what they should build with. I'm not sure what the standard expectation is here for modules here, though.

For now, I'll update my fork to do this and then folks using stable nixpkgs should be able to use the flake just fine. Stay tuned!