!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

891 Members
179 Servers

Load older messages


SenderMessageTime
2 Jun 2023
@emilazy:matrix.orgemily is using file+https inputs for "evergreen" URLs that change over time not a supported use case? when doing nix flake archive or even just rebuilding my system it seems to always re-request even if they were already downloaded into the store and thus regularly run into "error: NAR hash mismatch in input ..." errors. I guess there's no way to reproducibly download the locked version on another system but it's surprising to me that it doesn't work even when you have it cached already. The example in the manual for the similar tarball input type is https://github.com/NixOS/patchelf/archive/master.tar.gz which would seem to have the same issue... 19:54:24
@rick:matrix.ciphernetics.nl@rick:matrix.ciphernetics.nlYou can use archive.org for a stable url20:10:47
@adam:valkor.net@adam:valkor.net If you want a stable GitHub tarball URL, you will need to use a commit or tags 20:31:01
@adam:valkor.net@adam:valkor.net * If you want a stable GitHub tarball URL, you will need to use a commit or tag in the url 20:31:11
@emilazy:matrix.orgemilyah, it's not a github tarball URL, that's just me giving an example of a URL the manual suggests as an example of an input but that seems like it would run into the same problems I'm getting here20:53:54
@emilazy:matrix.orgemily I don't mind having to update to be able to reproduce a lock on another machine, it's just confusing to me that it seems like you're forced to update as soon as the URL changes on your own machine, even if you haven't run nix flake update and the URL is cached in the store locally 20:54:31
3 Jun 2023
@theophane:hufschmitt.net@theophane:hufschmitt.net emily: I think it should work as you describe it. The lockfile has the expected nar hash, and it shouldn't try re-fetching it if it's already in the store 12:27:41
@theophane:hufschmitt.net@theophane:hufschmitt.net(the contrary would be utterly inefficient any way)12:27:58
@emilazy:matrix.orgemilyyeah, it doesn't make much sense to me either - it seemed like maybe it was doing a HEAD request and then a full GET based on the last-modified/expires headers? I'll try and come up with a minimal reproduction though20:12:16
@emilazy:matrix.orgemily

Okay, here's a way to reproduce:

{
  inputs.cask.url = "https://formulae.brew.sh/api/cask.jws.json";
  inputs.cask.flake = false;

  outputs = {self, nixpkgs, cask}: {
    packages = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system: {
      test = nixpkgs.legacyPackages.${system}.runCommand "test" {} ''
        cp ${cask} $out
      '';
    });
  };
}

Do nix build .#test, wait a while for the URL to get updated (you can check the Last-Modified/Expires headers and https://github.com/Homebrew/formulae.brew.sh/actions, might be good to give it some extra time for things to propagate), then:

emily@yuyuko ~/D/url-weirdness-test> nix flake archive
error: NAR hash mismatch in input 'https://formulae.brew.sh/api/cask.jws.json?narHash=sha256-UBfAYZ9000fvnJCC4xXMWWpeSDbexDTqoG97RlHXgGc=' (/nix/store/1r9vipfw5gp2imjbwkxzhszrciw6lbvc-source), expected 'sha256-UBfAYZ9000fvnJCC4xXMWWpeSDbexDTqoG97RlHXgGc=', got 'sha256-MgLlVZ5GaSiFlFZbbtRW3dYqA786GtdtKBIiOntj5AY='
22:16:40
@emilazy:matrix.orgemily Maybe this is a nix flake archive-specific bug? Not sure, would have to play around more to narrow it down further than this 22:17:25
@emilazy:matrix.orgemily after you do that nix build .#test again will adjust the lock. it seems like nix flake archive shouldn't redownload everything if it's already cached locally and there was no lock update 22:18:19
4 Jun 2023
@joepie91:pixie.townjoepie91 🏳️‍🌈 what is currently the most comprehensive document of the current design of flakes? 13:08:34
@joepie91:pixie.townjoepie91 🏳️‍🌈(assuming the original RFC is not perfectly accurate anymore)13:09:13
@federicodschonborn:matrix.org@federicodschonborn:matrix.org changed their profile picture.17:40:32
@ruination:matrix.orgPhobos joined the room.21:22:04
5 Jun 2023
@benjamin:computer.surgeryoliviahahaha there is none afaik17:22:29
@benjamin:computer.surgeryoliviathe RFC is your best bet17:22:43
@nowaaay:matrix.orgnowaaay

i'd like to add a neovim plugin for use in a devShell for a specific project. below is my current flake. i'm using flake-parts, and the general sentiment is that flakes should not be relying on overlays. i've read on a discourse thread that i should "build on top on nixpkgs" instead. i have no idea what that phrase means, or what it would look like. any tips?

{
  description = "Basic dotnet7 dev environment";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    flake-parts.url = "github:hercules-ci/flake-parts";
    flake-root.url = "github:srid/flake-root";
    mission-control.url = "github:Platonic-Systems/mission-control";
  };

  outputs = inputs@{ self, nixpkgs, flake-parts, ...}:
    flake-parts.lib.mkFlake { inherit inputs; } {
      systems = nixpkgs.lib.systems.flakeExposed;
      imports = [
        inputs.flake-root.flakeModule
        inputs.mission-control.flakeModule
      ];
      perSystem = { pkgs, lib, config, ... }:
        let
          omnisharp = pkgs.omnisharp-roslyn;

          nvimrc = ''...'';
        in
        {
          # Executed by 'nix build'
            #empty...
          # Used by `nix develop`
          mission-control.scripts = {
            dnbuild = {
              description = "dotnet build";
              exec = "boxxy -d -l warn dotnet build";
            };
          };
          devShells.default = pkgs.mkShell {
            inputsFrom = [ config.mission-control.devShell ];
            buildInputs = with pkgs; [
              # Sandboxing
              boxxy
              #basics
              dotnet-sdk_7
              dotnet-runtime

              #packages
              dotnetPackages.Nuget #install nuget declaratively

              #unit testing
              dotnetPackages.NUnit
              dotnetPackages.NUnitRunners

              #language server of choice
              omnisharp-roslyn
            ];

            DOTNET_CLI_TELEMETRY_OPTOUT = 1;
            DOTNET_SKIP_FIRST_TIME_EXPERIENCE = "true";

            shellHook = ''
              echo '${nvimrc}' > .nvimrc.lua
            '';
          };
        };
      };
}
18:29:37
@nowaaay:matrix.orgnowaaay btw i have an already existing neovim configuration i use system-wide, so i'd like to not get rid of that. i've tried an override and got just that 😭 18:31:03
@nowaaay:matrix.orgnowaaay * btw i have an already existing neovim configuration i use system-wide, so i'd like to not get rid of that. i've tried an override and ended up with just that 😭 18:33:25
@pajarove:matrix.orgpajarove joined the room.21:41:56
6 Jun 2023
@ylliu:matrix.scnu.run@ylliu:matrix.scnu.run removed their profile picture.01:34:06
@ylliu:matrix.scnu.run@ylliu:matrix.scnu.run removed their display name Yilong Liu.01:35:42
@ylliu:matrix.scnu.run@ylliu:matrix.scnu.run left the room.01:36:49
@winston:milli.ng@winston:milli.ng joined the room.15:49:54
@vcunat:matrix.orgvcunat changed their display name from Vladimír Čunát to @vcunat.17:20:44
@klaymore:klaymore.meKlaymore joined the room.18:32:40
7 Jun 2023
@switch3flip:matrix.orggluonix Is there a "special" trick to install xargo in a nix flake. Trying to build a rust package which is built with xargo. (Using oxalica overlay.) 06:54:38
@switch3flip:matrix.orggluonix
In reply to @switch3flip:matrix.org
Is there a "special" trick to install xargo in a nix flake. Trying to build a rust package which is built with xargo. (Using oxalica overlay.)
https://discourse.nixos.org/t/how-to-install-xargo-in-a-nix-flake/28856
10:22:09

Show newer messages


Back to Room ListRoom Version: 6