Skip to content

Commit

Permalink
Merge pull request #1893 from nix-community/test-nixpkgs-commit
Browse files Browse the repository at this point in the history
Pin nixpkgs to working commit
  • Loading branch information
Nebucatnetzer authored Jan 13, 2025
2 parents 29b2641 + 81fba45 commit 3f02f1c
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 57 deletions.
117 changes: 61 additions & 56 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
# Last working commit from nixos-small-unstable
nixpkgs.url = "github:NixOS/nixpkgs?rev=75e28c029ef2605f9841e0baa335d70065fe7ae2";

treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
Expand All @@ -17,13 +18,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 +36,8 @@

githubActions =
let
mkPkgs = system:
mkPkgs =
system:
import nixpkgs {
config = {
allowAliases = false;
Expand Down Expand Up @@ -69,10 +71,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 +85,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 +102,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;
};
}));
}
));
}
3 changes: 2 additions & 1 deletion templates/app/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
# Last working commit from nixos-small-unstable
nixpkgs.url = "github:NixOS/nixpkgs?rev=75e28c029ef2605f9841e0baa335d70065fe7ae2";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down

0 comments on commit 3f02f1c

Please sign in to comment.