From 79390d4eea20ca15fd8e088345528f31ed5fad1e Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 21 Dec 2024 10:40:06 -0400 Subject: Upgrade to nixos-24.05 I think this is the only "supported" nixos version now. But in any case scipy seemed to be broken on the older version, and I couldn't build my code that uses llm. Also, this allows me to get rid of the bild.os-unstable thing for Beryllium, which was just a sitting timebomb of breaking stuff. There are a lot of changes here because ruff updated to the very latest, and it changed some minor lint things. Also with the new nixos I get a proper cgit module, and some other breaking changes needed fixing. --- Biz/Bild/Deps.hs | 27 ++++++----- Biz/Bild/Deps.nix | 19 +++++--- Biz/Bild/Deps/autogen.nix | 107 ----------------------------------------- Biz/Bild/Deps/guile-opengl.nix | 4 +- Biz/Bild/Deps/inspekt3d.nix | 5 +- Biz/Bild/Example.py | 3 ++ Biz/Bild/Nixpkgs.nix | 38 ++++++--------- Biz/Bild/Sources.json | 44 ++++++++--------- 8 files changed, 70 insertions(+), 177 deletions(-) delete mode 100644 Biz/Bild/Deps/autogen.nix (limited to 'Biz/Bild') diff --git a/Biz/Bild/Deps.hs b/Biz/Bild/Deps.hs index 2b2a72a..e268a74 100644 --- a/Biz/Bild/Deps.hs +++ b/Biz/Bild/Deps.hs @@ -416,10 +416,9 @@ parseCmdUpdate = Opts.headerDoc <| Just <| Opts.nest 2 - <| "Examples:" - Opts.<$$> "" - Opts.<$$> Opts.vcat - [ Opts.fill 30 "deps update" Opts.<+> "# update all packages", + <| Opts.vcat + [ "Examples:", + Opts.fill 30 "deps update" Opts.<+> "# update all packages", Opts.fill 30 "deps update nixpkgs" Opts.<+> "# update nixpkgs", Opts.fill 30 "deps update my-package -v beta-0.2" Opts.<+> "# update my-package to version \"beta-0.2\"" ] @@ -507,10 +506,12 @@ parseCmdModify = Opts.progDesc "Modify dependency attributes without performing an update", Opts.headerDoc <| Just - <| "Examples:" - Opts.<$$> "" - Opts.<$$> " niv modify nixpkgs -v beta-0.2" - Opts.<$$> " niv modify nixpkgs -a branch=nixpkgs-unstable" + <| Opts.vcat + [ "Examples:", + "", + " niv modify nixpkgs -v beta-0.2", + " niv modify nixpkgs -a branch=nixpkgs-unstable" + ] ] optName = Opts.optional @@ -556,10 +557,12 @@ parseCmdDrop = Opts.progDesc "Drop dependency", Opts.headerDoc <| Just - <| "Examples:" - Opts.<$$> "" - Opts.<$$> " niv drop jq" - Opts.<$$> " niv drop my-package version" + <| Opts.vcat + [ "Examples:", + "", + " niv drop jq", + " niv drop my-package version" + ] ] parseDropAttributes :: Opts.Parser [T.Text] parseDropAttributes = diff --git a/Biz/Bild/Deps.nix b/Biz/Bild/Deps.nix index 46fa00f..23b096d 100644 --- a/Biz/Bild/Deps.nix +++ b/Biz/Bild/Deps.nix @@ -1,13 +1,9 @@ _self: super: { - autogen = super.callPackage ./Deps/autogen.nix { }; + # Needs upgrading for guile 3 + # inspekt3d = super.callPackage ./Deps/inspekt3d.nix {}; - guile = super.guile_3_0; - - guile-opengl = super.callPackage ./Deps/guile-opengl.nix { }; - # The libfive build is broken... - #inspekt3d = super.callPackage ./Deps/inspekt3d.nix {}; guix = super.pkgs.stdenv.mkDerivation rec { pname = "guix"; name = "${pname}-${version}"; @@ -35,4 +31,15 @@ _self: super: nostr-rs-relay = super.callPackage ./Deps/nostr-rs-relay.nix { }; ollama = super.callPackage ./Deps/ollama.nix { acceleration = "cuda"; }; + + # https://github.com/NixOS/nixpkgs/issues/317147#issuecomment-2147343125 + radicale = super.radicale.overrideAttrs (_old: rec { + version = "3.2.0"; + src = super.fetchFromGitHub { + owner = "Kozea"; + repo = "Radicale"; + rev = "v${version}"; + hash = "sha256-RxC8VOfdTXJZiAroDHTKjJqGWu65Z5uyb4WK1LOqubQ="; + }; + }); } diff --git a/Biz/Bild/Deps/autogen.nix b/Biz/Bild/Deps/autogen.nix deleted file mode 100644 index fc95b14..0000000 --- a/Biz/Bild/Deps/autogen.nix +++ /dev/null @@ -1,107 +0,0 @@ -# From: https://github.com/NixOS/nixpkgs/pull/139361 -{ lib, stdenv, buildPackages, fetchurl, fetchpatch, autoreconfHook, which -, pkg-config, perl, guile, libxml2 }: - -stdenv.mkDerivation rec { - pname = "autogen"; - version = "5.18.16"; - - src = fetchurl { - url = "mirror://gnu/autogen/rel${version}/autogen-${version}.tar.xz"; - sha256 = "16mlbdys8q4ckxlvxyhwkdnh1ay9f6g0cyp1kylkpalgnik398gq"; - }; - - patches = let - dp = { ver ? "1%255.18.16-4", pname, name ? (pname + ".diff"), sha256 }: - fetchurl { - url = "https://salsa.debian.org/debian/autogen/-/raw/debian/${ver}" - + "/debian/patches/${pname}.diff?inline=false"; - inherit name sha256; - }; - in [ - (dp { - pname = "20_no_Werror"; - sha256 = "08z4s2ifiqyaacjpd9pzr59w8m4j3548kkaq1bwvp2gjn29m680x"; - }) - (dp { - pname = "30_ag_macros.m4_syntax_error"; - sha256 = "1z8vmbwbkz3505wd33i2xx91mlf8rwsa7klndq37nw821skxwyh3"; - }) - (dp { - pname = "31_allow_overriding_AGexe_for_crossbuild"; - sha256 = "0h9wkc9bqb509knh8mymi43hg6n6sxg2lixvjlchcx7z0j7p8xkf"; - }) - # Next upstream release will contain guile-3 support. We apply non-invasive - # patch meanwhile. - (fetchpatch { - name = "guile-3.patch"; - url = - "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/autogen/files/autogen-5.18.16-guile-3.patch?id=43bcc61c56a5a7de0eaf806efec7d8c0e4c01ae7"; - sha256 = "18d7y1f6164dm1wlh7rzbacfygiwrmbc35a7qqsbdawpkhydm5lr"; - }) - ]; - - outputs = [ "bin" "dev" "lib" "out" "man" "info" ]; - - nativeBuildInputs = [ - which - pkg-config - perl - autoreconfHook # patches applied - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - # autogen needs a build autogen when cross-compiling - buildPackages.buildPackages.autogen - buildPackages.texinfo - ]; - buildInputs = [ guile libxml2 ]; - - preConfigure = '' - export MAN_PAGE_DATE=$(date '+%Y-%m-%d' -d "@$SOURCE_DATE_EPOCH") - ''; - - configureFlags = [ - # Make sure to use a static value for the timeout. If we do not set a value - # here autogen will select one based on the execution time of the configure - # phase which is not really reproducible. - # - # If you are curious about the number 78, it has been cargo-culted from - # Debian: https://salsa.debian.org/debian/autogen/-/blob/master/debian/rules#L21 - "--enable-timeout=78" - ] ++ (lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--with-libxml2=${libxml2.dev}" - "--with-libxml2-cflags=-I${libxml2.dev}/include/libxml2" - # the configure check for regcomp wants to run a host program - "libopts_cv_with_libregex=yes" - #"MAKEINFO=${buildPackages.texinfo}/bin/makeinfo" - ]) - # See: https://sourceforge.net/p/autogen/bugs/187/ - ++ lib.optionals stdenv.isDarwin [ "ac_cv_func_utimensat=no" ]; - - #doCheck = true; # not reliable - - postInstall = '' - mkdir -p $dev/bin - mv $bin/bin/autoopts-config $dev/bin - - for f in $lib/lib/autogen/tpl-config.tlib $out/share/autogen/tpl-config.tlib; do - sed -e "s|$dev/include|/no-such-autogen-include-path|" -i $f - sed -e "s|$bin/bin|/no-such-autogen-bin-path|" -i $f - sed -e "s|$lib/lib|/no-such-autogen-lib-path|" -i $f - done - - '' + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - # remove /build/** from RPATHs - for f in "$bin"/bin/*; do - local nrp="$(patchelf --print-rpath "$f" | sed -E 's@(:|^)/build/[^:]*:@\1@g')" - patchelf --set-rpath "$nrp" "$f" - done - ''; - - meta = with lib; { - description = "Automated text and program generation tool"; - license = with licenses; [ gpl3Plus lgpl3Plus ]; - homepage = "https://www.gnu.org/software/autogen/"; - platforms = platforms.all; - maintainers = [ ]; - }; -} diff --git a/Biz/Bild/Deps/guile-opengl.nix b/Biz/Bild/Deps/guile-opengl.nix index d547042..af01082 100644 --- a/Biz/Bild/Deps/guile-opengl.nix +++ b/Biz/Bild/Deps/guile-opengl.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, pkgconfig, guile, libGL, libGLU, freeglut }: +{ stdenv, lib, fetchurl, pkg-config, guile, libGL, libGLU, freeglut }: let name = "guile-opengl-${version}"; @@ -20,7 +20,7 @@ in stdenv.mkDerivation { --replace '(dynamic-link "libglut")' '(dynamic-link "${freeglut}/lib/libglut.so")' ''; - nativeBuildInputs = [ pkgconfig guile libGL libGLU freeglut ]; + nativeBuildInputs = [ pkg-config guile libGL libGLU freeglut ]; meta = with lib; { description = "Guile bindings for the OpenGL graphics API"; diff --git a/Biz/Bild/Deps/inspekt3d.nix b/Biz/Bild/Deps/inspekt3d.nix index d1cf60e..a9dac3d 100644 --- a/Biz/Bild/Deps/inspekt3d.nix +++ b/Biz/Bild/Deps/inspekt3d.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, autoreconfHook, pkgconfig, guile, guile-opengl, mesa +{ stdenv, lib, autoreconfHook, pkg-config, guile, guile-opengl, mesa , glibcLocales, libfive, sources }: stdenv.mkDerivation { @@ -7,7 +7,7 @@ stdenv.mkDerivation { src = sources.inspekt3d; version = "unstable-2018-10-17"; - nativeBuildInputs = [ pkgconfig autoreconfHook ]; + nativeBuildInputs = [ pkg-config autoreconfHook ]; buildInputs = [ guile glibcLocales mesa ]; propagatedBuildInputs = [ guile-opengl libfive ]; @@ -28,4 +28,3 @@ stdenv.mkDerivation { platforms = platforms.all; }; } - diff --git a/Biz/Bild/Example.py b/Biz/Bild/Example.py index dd9a6ef..e5766ba 100644 --- a/Biz/Bild/Example.py +++ b/Biz/Bild/Example.py @@ -15,6 +15,9 @@ def cryptic_hello(name: str) -> str: Encrypt and decrypt `name`. Example taken from `cryptography` docs. + + Raises: + ValueError: if decryption fails """ key = cryptography.fernet.Fernet.generate_key() f = cryptography.fernet.Fernet(key) diff --git a/Biz/Bild/Nixpkgs.nix b/Biz/Bild/Nixpkgs.nix index 8bc9cad..d53a125 100644 --- a/Biz/Bild/Nixpkgs.nix +++ b/Biz/Bild/Nixpkgs.nix @@ -15,32 +15,22 @@ let # package overlays, because of the 'null' from 'overrideSource' depsOverlay = _: pkgs: pkgs.overridePinnedDeps pkgs.overrideSource; + overlays = [ + (_: _: { inherit sources; }) + (import ./CcacheWrapper.nix) + (import ./Functions.nix) + depsOverlay + (import ./Deps.nix) + (import ./Python.nix) + (import ./Haskell.nix) + ]; in { - nixos-23_11 = import sources.nixos-23_11 { - inherit system config; - overlays = [ - (_: _: { inherit sources; }) - (import ./CcacheWrapper.nix) - (import ./Functions.nix) - depsOverlay - (import ./Deps.nix) - (import ./Python.nix) - (import ./Haskell.nix) - ]; - }; + nixos-24_05 = import sources.nixos-24_05 { + inherit system config overlays; - nixos-unstable-small = import sources.nixos-unstable-small { - inherit system config; - overlays = [ - (_: _: { inherit sources; }) - (import ./CcacheWrapper.nix) - (import ./Functions.nix) - depsOverlay - (import ./Deps.nix) - (import ./Python.nix) - (import ./Haskell.nix) - ]; }; -} + nixos-unstable-small = + import sources.nixos-unstable-small { inherit system config overlays; }; +} diff --git a/Biz/Bild/Sources.json b/Biz/Bild/Sources.json index c12b6ce..53ac29f 100644 --- a/Biz/Bild/Sources.json +++ b/Biz/Bild/Sources.json @@ -47,11 +47,9 @@ }, "inspekt3d": { "branch": "master", - "sha256": "0lan6930g5a9z4ack9jj0zdd0mb2s6q2xzpiwcjdc3pvl9b1nbw4", - "type": "tarball", - "url": "https://gitlab.com/kavalogic-inc/inspekt3d/-/archive/703f52ccbfedad2bf5240bf8183d1b573c9d54ef/inspekt3d-703f52ccbfedad2bf5240bf8183d1b573c9d54ef.tar.gz", - "url_template": "https://gitlab.com/kavalogic-inc/inspekt3d/-/archive//inspekt3d-.tar.gz", - "version": "703f52ccbfedad2bf5240bf8183d1b573c9d54ef" + "repo": "https://git.sr.ht/~morgansmith/inspekt3d", + "rev": "703f52ccbfedad2bf5240bf8183d1b573c9d54ef", + "type": "git" }, "interegular": { "branch": "master", @@ -84,10 +82,10 @@ "homepage": "https://github.com/nmattia/niv", "owner": "nmattia", "repo": "niv", - "rev": "82e5cd1ad3c387863f0545d7591512e76ab0fc41", - "sha256": "090l219mzc0gi33i3psgph6s2pwsc8qy4lyrqjdj4qzkvmaj65a7", + "rev": "e80fc8fae87cc91f449533fca6b9cadf8be69e6c", + "sha256": "024hnxvqk8z5n2n54rj05l91q38g9y8nwvrj46xml13kjmg4shb3", "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/82e5cd1ad3c387863f0545d7591512e76ab0fc41.tar.gz", + "url": "https://github.com/nmattia/niv/archive/e80fc8fae87cc91f449533fca6b9cadf8be69e6c.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixos-23_05": { @@ -114,6 +112,18 @@ "url": "https://github.com/nixos/nixpkgs/archive/219951b495fc2eac67b1456824cc1ec1fd2ee659.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, + "nixos-24_05": { + "branch": "nixos-24.05", + "description": "Nix Packages collection & NixOS", + "homepage": "", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a9b86fc2290b69375c5542b622088eb6eca2a7c3", + "sha256": "1mssfzy1nsansjmp5ckyl8vbk32va3abchpg19ljyak0xblxnjs1", + "type": "tarball", + "url": "https://github.com/nixos/nixpkgs/archive/a9b86fc2290b69375c5542b622088eb6eca2a7c3.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "nixos-mailserver": { "repo": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver", "rev": "f535d8123c4761b2ed8138f3d202ea710a334a1d", @@ -123,28 +133,16 @@ "url_template": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive//nixos-mailserver-.tar.gz", "version": "master" }, - "nixos-unstable": { - "branch": "nixos-unstable", - "description": "Nix Packages collection & NixOS", - "homepage": "", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", - "sha256": "1hy81yj2dcg6kfsm63xcqf8kvigxglim1rcg1xpmy2rb6a8vqvsj", - "type": "tarball", - "url": "https://github.com/nixos/nixpkgs/archive/fd281bd6b7d3e32ddfa399853946f782553163b5.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, "nixos-unstable-small": { "branch": "nixos-unstable-small", "description": "Nix Packages collection & NixOS", "homepage": "", "owner": "nixos", "repo": "nixpkgs", - "rev": "6cc8dbb00974248cdd1b7ebd05cbc7c0799ce974", - "sha256": "09lyljxmzvwc71j5s2k0ya3y04ya3lxy8bgcm36gi8vmrn42dgv0", + "rev": "a5e6a9e979367ee14f65d9c38119c30272f8455f", + "sha256": "08yfk81kpsizdzlbi8whpaarb0w0rw9aynlrvhn5gr5dfpv9hbsf", "type": "tarball", - "url": "https://github.com/nixos/nixpkgs/archive/6cc8dbb00974248cdd1b7ebd05cbc7c0799ce974.tar.gz", + "url": "https://github.com/nixos/nixpkgs/archive/a5e6a9e979367ee14f65d9c38119c30272f8455f.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "outlines": { -- cgit v1.2.3