Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
build: overlay versioningit from NixOS 23.11
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsgruk committed Mar 11, 2024
1 parent 7c9b5c9 commit fb56348
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 24 deletions.
29 changes: 23 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 14 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
description = "⭐craft applications and libraries flake";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-2311.url = "github:nixos/nixpkgs/nixos-23.11";
};

outputs =
{ self
, nixpkgs
, nixos-2311
, unstable
, ...
}:
let
Expand All @@ -16,11 +18,14 @@
# "aarch64-linux"
];

forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
forAllSystems = unstable.lib.genAttrs supportedSystems;

pkgsForSystem = system: (import nixpkgs {
pkgsForSystem = system: (import unstable {
inherit system;
overlays = [ self.overlay ];
overlays = [
self.overlay
(final: _prev: { nixos2311pkgs = import nixos-2311 { inherit (final) system; }; })
];
});
in
{
Expand All @@ -45,19 +50,10 @@
types-deprecated = final.callPackage ./deps/types-deprecated.nix { };

pydantic = python_prev.pydantic_1;

# versioningit 2.2.1 migrated to pydantic 2, which is incompatible with the
# craft applications and libraries.
versioningit = python_prev.versioningit.overridePythonAttrs (_oldAttrs: rec {
version = "2.2.0";
src = prev.fetchFromGitHub {
owner = "jwodder";
repo = "versioningit";
rev = "refs/tags/v${version}";
hash = "sha256-sM5n02ewzysYNctXLamZHxJa+61D+xnYennprXjoiYc=";
};
doCheck = false;
});
# craft applications and libraries. NixOS 23.11 carries the correct version,
# so overlay it here.
inherit (final.nixos2311pkgs.python3Packages) versioningit;
})
];

Expand Down Expand Up @@ -92,7 +88,7 @@

# A minimal NixOS virtual machine which used for testing craft applications.
nixosConfigurations = {
testvm = nixpkgs.lib.nixosSystem {
testvm = unstable.lib.nixosSystem {
specialArgs = { flake = self; };
modules = [ ./test/vm.nix ];
};
Expand Down

0 comments on commit fb56348

Please sign in to comment.