Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin nixpkgs to 24.11 #1891

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions flake.lock

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

116 changes: 60 additions & 56 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small";

treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
Expand All @@ -17,13 +17,13 @@
};

outputs =
{ self
, nixpkgs
, flake-utils
, nix-github-actions
, treefmt-nix
, systems
,
{
self,
nixpkgs,
flake-utils,
nix-github-actions,
treefmt-nix,
systems,
}:
let
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
Expand All @@ -35,7 +35,8 @@

githubActions =
let
mkPkgs = system:
mkPkgs =
system:
import nixpkgs {
config = {
allowAliases = false;
Expand Down Expand Up @@ -69,10 +70,11 @@
in
{
# Aggregate all tests into one derivation so that only one GHA runner is scheduled for all darwin jobs
aggregate = pkgs.runCommand "darwin-aggregate"
{
env.TEST_INPUTS = lib.concatStringsSep " " (lib.attrValues (lib.filterAttrs (_: v: lib.isDerivation v) tests));
} "touch $out";
aggregate = pkgs.runCommand "darwin-aggregate" {
env.TEST_INPUTS = lib.concatStringsSep " " (
lib.attrValues (lib.filterAttrs (_: v: lib.isDerivation v) tests)
);
} "touch $out";
};
aarch64-darwin =
let
Expand All @@ -82,11 +84,11 @@
in
{
# Aggregate all tests into one derivation so that only one GHA runner is scheduled for all darwin jobs
aggregate =
pkgs.runCommand "darwin-aggregate"
{
env.TEST_INPUTS = lib.concatStringsSep " " (lib.attrValues (lib.filterAttrs (_: v: lib.isDerivation v) tests));
} "touch $out";
aggregate = pkgs.runCommand "darwin-aggregate" {
env.TEST_INPUTS = lib.concatStringsSep " " (
lib.attrValues (lib.filterAttrs (_: v: lib.isDerivation v) tests)
);
} "touch $out";
};
};
};
Expand All @@ -99,48 +101,50 @@
default = self.templates.app;
};
}
// (flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowAliases = false;
};
// (flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowAliases = false;
};

poetry2nix = import ./default.nix { inherit pkgs; };
p2nix-tools = pkgs.callPackage ./tools { inherit poetry2nix; };
in
rec {
formatter = treefmtEval.${system}.config.build.wrapper;
poetry2nix = import ./default.nix { inherit pkgs; };
p2nix-tools = pkgs.callPackage ./tools { inherit poetry2nix; };
in
rec {
formatter = treefmtEval.${system}.config.build.wrapper;

packages = {
poetry2nix = poetry2nix.cli;
default = poetry2nix.cli;
};
packages = {
poetry2nix = poetry2nix.cli;
default = poetry2nix.cli;
};

devShells = {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
p2nix-tools.env
p2nix-tools.flamegraph
nixpkgs-fmt
poetry
niv
jq
nix-prefetch-git
nix-eval-jobs
nix-build-uncached
];
devShells = {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
p2nix-tools.env
p2nix-tools.flamegraph
nixpkgs-fmt
poetry
niv
jq
nix-prefetch-git
nix-eval-jobs
nix-build-uncached
];
};
};
};

apps = {
poetry = {
# https://wiki.nixos.org/wiki/Flakes
type = "app";
program = "${pkgs.poetry}/bin/poetry";
apps = {
poetry = {
# https://wiki.nixos.org/wiki/Flakes
type = "app";
program = "${pkgs.poetry}/bin/poetry";
};
poetry2nix = flake-utils.lib.mkApp { drv = packages.poetry2nix; };
default = apps.poetry2nix;
};
poetry2nix = flake-utils.lib.mkApp { drv = packages.poetry2nix; };
default = apps.poetry2nix;
};
}));
}
));
}
2 changes: 1 addition & 1 deletion templates/app/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down
38 changes: 33 additions & 5 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,42 @@ in
}
}:
let
python3 = pkgs.python311.override {
# Can be removed once https://nixpk.gs/pr-tracker.html?pr=362304 is through
self = python3;
packageOverrides = final: prev: {
wheel = prev.wheel.overridePythonAttrs (oA: rec {
version = "0.45.1";
src = oA.src.override (oA: {
rev = "refs/tags/${version}";
hash = "sha256-tgueGEWByS5owdA5rhXGn3qh1Vtf0HGYC6+BHfrnGAs=";
});
});
};
};
python = pkgs.python311.override {
# Can be removed once https://nixpk.gs/pr-tracker.html?pr=362304 is through
self = python;
packageOverrides = final: prev: {
wheel = prev.wheel.overridePythonAttrs (oA: rec {
version = "0.45.1";
src = oA.src.override (oA: {
rev = "refs/tags/${version}";
hash = "sha256-tgueGEWByS5owdA5rhXGn3qh1Vtf0HGYC6+BHfrnGAs=";
});
});
};
};
pkgs' = pkgs // {
inherit poetry2nix;

# At the time of writing 3.12 is causing issues.
python3 = pkgs.python311;
python = pkgs.python311;
inherit
poetry2nix
python
python3
;
};

# At the time of writing 3.12 is causing issues.

poetry2nix = import ./.. { pkgs = pkgs'; };
callTest = lib.callPackageWith pkgs';

Expand Down
Loading