diff options
-rw-r--r-- | Biz/Bild/Nixpkgs.nix | 43 | ||||
-rw-r--r-- | Biz/Bild/Sources.json | 32 |
2 files changed, 48 insertions, 27 deletions
diff --git a/Biz/Bild/Nixpkgs.nix b/Biz/Bild/Nixpkgs.nix index ecf50b9..8cb3448 100644 --- a/Biz/Bild/Nixpkgs.nix +++ b/Biz/Bild/Nixpkgs.nix @@ -9,36 +9,45 @@ let system = __currentSystem; -in import sources.nixpkgs-stable { +in import sources.nixos-23_05 { inherit system config; overlays = [ (_: _: { inherit sources; }) - (_: _: { - unstable = import sources.nixpkgs-unstable { inherit system config; }; - }) - (_: pkgs: { + + # add some functions + (_: old: { # Given a generic `builder`, will generate an attrset for all the packages # pinned by `deps` with `builder` applied to the package. This attrset can # then be merged with the rest of the packages in the set as part of an # overlay or overrides. overridePinnedDeps = builder: - pkgs.lib.genAttrs (builtins.attrNames pkgs.sources) builder; - }) - (_: pkgs: { + old.lib.genAttrs (builtins.attrNames sources) builder; + # Modifies a derivation with our source and version, keeping old build # rules. This will fail if build steps have changed, or if no build # rules are available upstream. overrideSource = depName: - pkgs.${depName}.overrideAttrs (old: - old // rec { - version = - pkgs.sources.${depName}.version or pkgs.sources.${depName}.rev; - src = pkgs.sources.${depName}; - }); + if old ? "${depName}" && old.${depName} ? overrideAttrs then + old.${depName}.overrideAttrs (attrs: + attrs // rec { + version = sources.${depName}.version or sources.${depName}.rev; + src = sources.${depName}; + }) + else + null; }) - (_: pkgs: - # override pinned deps with our sources - pkgs.overridePinnedDeps pkgs.overrideSource) + + # override pinned deps with our sources, this must come before other + # package overlays, because of the 'null' above + (_: pkgs: pkgs.overridePinnedDeps pkgs.overrideSource) + + # add other nixpkgs distributions + (_: _: { + unstable = import sources.nixpkgs-unstable { inherit system config; }; + nixos-23_11 = import sources.nixos-23_11 { inherit system config; }; + }) + + # add our hand-written derivations (import ./Deps.nix) (_: pkgs: { niv = import pkgs.sources.niv { }; }) ]; diff --git a/Biz/Bild/Sources.json b/Biz/Bild/Sources.json index d3ec79a..7cdb418 100644 --- a/Biz/Bild/Sources.json +++ b/Biz/Bild/Sources.json @@ -100,16 +100,7 @@ "url": "https://github.com/nmattia/niv/archive/82e5cd1ad3c387863f0545d7591512e76ab0fc41.tar.gz", "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" }, - "nixos-mailserver": { - "repo": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver", - "rev": "f535d8123c4761b2ed8138f3d202ea710a334a1d", - "sha256": "0csx2i8p7gbis0n5aqpm57z5f9cd8n9yabq04bg1h4mkfcf7mpl6", - "type": "tarball", - "url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/f535d8123c4761b2ed8138f3d202ea710a334a1d/nixos-mailserver-f535d8123c4761b2ed8138f3d202ea710a334a1d.tar.gz", - "url_template": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/<rev>/nixos-mailserver-<rev>.tar.gz", - "version": "master" - }, - "nixpkgs-stable": { + "nixos-23_05": { "branch": "nixos-23.05", "description": "Nix Packages collection & NixOS", "homepage": "", @@ -121,6 +112,27 @@ "url": "https://github.com/nixos/nixpkgs/archive/70bdadeb94ffc8806c0570eb5c2695ad29f0e421.tar.gz", "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" }, + "nixos-23_11": { + "branch": "nixos-23.11", + "description": "Nix Packages collection & NixOS", + "homepage": "", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659", + "sha256": "065jy7qivlbdqmbvd7r9h97b23f21axmc4r7sqmq2h0j82rmymxv", + "type": "tarball", + "url": "https://github.com/nixos/nixpkgs/archive/219951b495fc2eac67b1456824cc1ec1fd2ee659.tar.gz", + "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" + }, + "nixos-mailserver": { + "repo": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver", + "rev": "f535d8123c4761b2ed8138f3d202ea710a334a1d", + "sha256": "0csx2i8p7gbis0n5aqpm57z5f9cd8n9yabq04bg1h4mkfcf7mpl6", + "type": "tarball", + "url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/f535d8123c4761b2ed8138f3d202ea710a334a1d/nixos-mailserver-f535d8123c4761b2ed8138f3d202ea710a334a1d.tar.gz", + "url_template": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/<rev>/nixos-mailserver-<rev>.tar.gz", + "version": "master" + }, "nixpkgs-unstable": { "branch": "master", "description": "Nix Packages collection", |