Skip to content
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

flake.nix (or; remove need for --impure flag on nixos install) #3029

Open
quinn-dougherty opened this issue Aug 23, 2022 · 6 comments
Open
Assignees
Labels

Comments

@quinn-dougherty
Copy link

I'm running nixos, and I can't install daedalus in pure mode. I need to run --impure flag on nixos-rebuild switch, or else I get the following bug

building the system configuration...
error: attribute 'currentSystem' missing

       at /nix/store/77yavamh2axnx8znz6dwbpjwmgg96bhw-iohk-nix-src/default.nix:2:12:

            1| { config ? {}
            2| , system ? builtins.currentSystem
             |            ^
            3| , crossSystem ? null

       … while evaluating the attribute 'system'

       at /nix/store/77yavamh2axnx8znz6dwbpjwmgg96bhw-iohk-nix-src/default.nix:47:20:

           46|             overlays = extraOverlays;
           47|             inherit system crossSystem;
             |                    ^
           48|           } // args);

       … while evaluating the attribute 'system'

       at /nix/store/d5hgy42a104xh2ajkrfy5i3gl9425v45-nixpkgs-src/pkgs/top-level/impure.nix:18:19:

           17|   # (build, in GNU Autotools parlance) platform.
           18|   localSystem ? { system = args.system or builtins.currentSystem; }
             |                   ^
           19|

       … while evaluating 'splitString'

       at /nix/store/d5hgy42a104xh2ajkrfy5i3gl9425v45-nixpkgs-src/lib/strings.nix:440:23:

          439|   */
          440|   splitString = _sep: _s:
             |                       ^
          441|     let

       … from call site

       at /nix/store/d5hgy42a104xh2ajkrfy5i3gl9425v45-nixpkgs-src/lib/systems/parse.nix:472:69:

          471|
          472|   mkSystemFromString = s: mkSystemFromSkeleton (mkSkeletonFromList (lib.splitString "-" s));
             |                                                                     ^
          473|

       … while evaluating 'mkSkeletonFromList'

....
.....
...

My install looks like this, with home-manager:

let 
  daedalus = (import (pkgs.fetchFromGitHub {
    owner = "input-output-hk";
    repo = "daedalus";
    rev = "478ec558705cebfc660b7b4ebba3aa20c6bfb6b6";
    sha256 = "+7t3nfe+J9iZZ1LiPP0m8c0lvl09HeTOgfQ/OcUWiog=";
  }) { }).daedalus; in
...
home.packages = [ ... daedalus ... ]
...

I think a flake would be a better way to install daedalus.

@danielmain
Copy link
Contributor

Hi @quinn-dougherty we only give official support by using the signed installers from www.daedaluswallet.io

But I am sure @michalrus could give you an answer here 🙏

@michalrus
Copy link
Member

Hey, @quinn-dougherty!

If you want flakes, you can try this in-progress PR → #3008

We use some impure evaluations for code signing of the Windows builds, so it may take some time, before this is merged into develop

If #3008 works for you, I can merge the current develop into it, so that you have more up-to-date code

@michalrus
Copy link
Member

Or you can also look at that diff, to see what I had to change to make it build purely.

Unfortunately, IIRC, I don’t think that passing target = "x86_64-linux"; when you import this repository would be enough…

@quinn-dougherty quinn-dougherty changed the title flake.nix flake.nix (or; remove need for --impure flag) Aug 29, 2022
@quinn-dougherty quinn-dougherty changed the title flake.nix (or; remove need for --impure flag) flake.nix (or; remove need for --impure flag on nixos install) Aug 29, 2022
@quinn-dougherty
Copy link
Author

quinn-dougherty commented Aug 29, 2022

So

nix build github:input-output-hk/daedalus/chore/ddw-1083-flakes

works great, and the reason I can't build my system is the package isn't interacting with fish completions

error: attribute 'name' missing

       at /nix/store/gyp5c9cp5v0xkmgc5xkcl4dxrmmrrgla-source/modules/programs/fish.nix:311:30:

          310|         generateCompletions = package:
          311|           pkgs.runCommand "${package.name}-fish-completions" {
             |                              ^
          312|             src = package;
(use '--show-trace' to show detailed location information)
~

Which isn't super important to you, but I figured it couldn't hurt to make you aware.

Thanks for the branch!

@michalrus
Copy link
Member

Oh, so there is no name for the defaultPackage on that branch?

Interesting 😮 Thanks! 🙇 I’ll add it 📝

@olmokramer
Copy link

FWIW this seems to work fine for me on Linux on the 5.1.1 tag

{
  inputs.daedalus.url = "github:input-output-hk/daedalus/5.1.1";

  outputs = { nixpkgs, daedalus, ... }: {
    # ...
    home.packages = [
      (import daedalus {
        target = "x86_64-linux";
        localLibSystem = "x86_64-linux";
      }).daedalus
    ];
    # ...
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@olmokramer @danielmain @michalrus @quinn-dougherty and others