!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

899 Members
183 Servers

Load older messages


SenderMessageTime
11 Jun 2024
@aos1:matrix.orgaos joined the room.15:17:28
@camzer:matrix.orgcamzer joined the room.23:50:52
12 Jun 2024
@lorenzleutgeb:matrix.orgLorenz Leutgeb removed their display name Lorenz Leutgeb.00:31:04
@lorenzleutgeb:matrix.orgLorenz Leutgeb set their display name to Lorenz Leutgeb.00:32:37
18 Jun 2024
@hive:the-apothecary.club👉@crystallinefire:chat.solarpunk.moe joined the room.18:13:26
19 Jun 2024
@gas.station.sushi:matrix.orggas.station.sushi joined the room.00:14:50
@qu4pk4:matrix.orgqu4pk4 joined the room.12:10:17
@qu4pk4:matrix.orgqu4pk4 Hi guys, I am trying to create a Flake that builds older version of OpenSSL. However, I am getting infinite recursion - I suspect it is because I use fetchurl which depends on OpenSSL (I infer this from this comment: https://github.com/NixOS/nixpkgs/blob/nixos-24.05/pkgs/development/libraries/openssl/default.nix#L15). I can send the bare flake.nix if that would help. 12:23:07
@qu4pk4:matrix.orgqu4pk4I am still quite new to flakes and also to overlays in particular.12:23:29
@qu4pk4:matrix.orgqu4pk4
{
  description = "OpenSSL version";
  inputs = {
    nixpkgs.url      = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url  = "github:numtide/flake-utils";
  };
  outputs = { self, nixpkgs, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        overlays = [ (final: prev: {
            openssl = prev.openssl.overrideAttrs (old: rec{
              version = "0.1";
              src = prev.pkgs.fetchurl {
                url = "https://www.openssl.org/source/openssl-${version}.tar.gz";
                hash = "";
              };
            });
          }) ];
        pkgs = import nixpkgs {
          inherit system overlays;
        };
      in
      with pkgs;
      {
        devShells.default = mkShell { buildInputs = [ openssl ]; };
      }
    );
}
12:24:30
@qu4pk4:matrix.orgqu4pk4 *
{
  description = "OpenSSL version";
  inputs = {
    nixpkgs.url      = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url  = "github:numtide/flake-utils";
  };
  outputs = { self, nixpkgs, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        overlays = [ (final: prev: {
            openssl = prev.openssl.overrideAttrs (old: rec{
              version = "0.1";
              src = prev.pkgs.fetchurl {
                url = "https://www.openssl.org/source/openssl-${version}.tar.gz";
                hash = "";
              };
            });
          }) ];
        pkgs = import nixpkgs {
          inherit system overlays;
        };
      in
      with pkgs;
      {
        devShells.default = mkShell { buildInputs = [ openssl ]; };
      }
    );
}
12:24:39
@gsaurel:laas.frnim65sdo you really need an overlay ? ie. do you want a whole nixpkgs where each and every instance of openssl is "updated" ?t12:35:35
@gsaurel:laas.frnim65s

otherwise, I would just go for:

        packages.default = pkgs.openssl.overrideAttrs (_old: rec {
          version = "0.1";
          src = pkgs.fetchurl { url = "https://www.openssl.org/source/openssl-${version}.tar.gz"; };
        });
12:36:28
@gsaurel:laas.frnim65s or packages.old-openssl if you prefer 12:36:44
@qu4pk4:matrix.orgqu4pk4Hmm, good point. 12:40:56
@flameopathic:matrix.orgflameopathic joined the room.18:03:55
@zachcoyle:matrix.orgZach joined the room.21:24:02
20 Jun 2024
@niko:puppygock.gaynyanbinary 🏳️‍⚧️ joined the room.00:09:39
@vengmark2:matrix.org@vengmark2:matrix.org left the room.01:26:07
21 Jun 2024
@linus:schreibt.jetzt@linus:schreibt.jetzt left the room.14:06:08
@qu4pk4:matrix.orgqu4pk4Thanks, this worked out for me in the end!14:44:13
@qu4pk4:matrix.orgqu4pk4

I have read various threads on command line arguments for Flake builds, runs - is it still the case, that one cannot do like:

$ nix run -dOpenSSLVerion=3.1.5
$ nix run -dOpenSSLVerion=3.2.2

And dynamically different package/app would be built?

14:45:56
@qu4pk4:matrix.orgqu4pk4 It might not work also because the version is then put into fetchUrl, which also needs the hash, but maybe that could be worked around as well somehow. 14:46:30
@antifuchs:asf.computer@antifuchs:asf.computer left the room.14:56:29
@mtxyz:the-apothecary.club@mtxyz:the-apothecary.club left the room.22:51:40
22 Jun 2024
@ramtechbytes:matrix.orgRam joined the room.02:07:17
@ramtechbytes:matrix.orgRamWould anyone mind helping me with a flake I am trying to make?02:07:56
@tomberek:matrix.orgtomberekSure... what's up?02:18:28
@ramtechbytes:matrix.orgRamI am trying to make a flake for a simple python flask app02:19:17
@ramtechbytes:matrix.orgRam{ description = "LIMS Dashboard Flake"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { nixpkgs, flake-utils, ... }: flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ] (system: let pkgs = nixpkgs.legacyPackages.${system}; in { devShell.${system} = pkgs.mkShell { buildInputs = with pkgs; [ python3Packages.flask ]; }; } ); } 02:19:36

Show newer messages


Back to Room ListRoom Version: 6