Skip to content

Commit 3f02f1c

Browse files
Merge pull request #1893 from nix-community/test-nixpkgs-commit
Pin nixpkgs to working commit
2 parents 29b2641 + 81fba45 commit 3f02f1c

File tree

2 files changed

+63
-57
lines changed

2 files changed

+63
-57
lines changed

flake.nix

+61-56
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

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

89
treefmt-nix.url = "github:numtide/treefmt-nix";
910
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
@@ -17,13 +18,13 @@
1718
};
1819

1920
outputs =
20-
{ self
21-
, nixpkgs
22-
, flake-utils
23-
, nix-github-actions
24-
, treefmt-nix
25-
, systems
26-
,
21+
{
22+
self,
23+
nixpkgs,
24+
flake-utils,
25+
nix-github-actions,
26+
treefmt-nix,
27+
systems,
2728
}:
2829
let
2930
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
@@ -35,7 +36,8 @@
3536

3637
githubActions =
3738
let
38-
mkPkgs = system:
39+
mkPkgs =
40+
system:
3941
import nixpkgs {
4042
config = {
4143
allowAliases = false;
@@ -69,10 +71,11 @@
6971
in
7072
{
7173
# Aggregate all tests into one derivation so that only one GHA runner is scheduled for all darwin jobs
72-
aggregate = pkgs.runCommand "darwin-aggregate"
73-
{
74-
env.TEST_INPUTS = lib.concatStringsSep " " (lib.attrValues (lib.filterAttrs (_: v: lib.isDerivation v) tests));
75-
} "touch $out";
74+
aggregate = pkgs.runCommand "darwin-aggregate" {
75+
env.TEST_INPUTS = lib.concatStringsSep " " (
76+
lib.attrValues (lib.filterAttrs (_: v: lib.isDerivation v) tests)
77+
);
78+
} "touch $out";
7679
};
7780
aarch64-darwin =
7881
let
@@ -82,11 +85,11 @@
8285
in
8386
{
8487
# Aggregate all tests into one derivation so that only one GHA runner is scheduled for all darwin jobs
85-
aggregate =
86-
pkgs.runCommand "darwin-aggregate"
87-
{
88-
env.TEST_INPUTS = lib.concatStringsSep " " (lib.attrValues (lib.filterAttrs (_: v: lib.isDerivation v) tests));
89-
} "touch $out";
88+
aggregate = pkgs.runCommand "darwin-aggregate" {
89+
env.TEST_INPUTS = lib.concatStringsSep " " (
90+
lib.attrValues (lib.filterAttrs (_: v: lib.isDerivation v) tests)
91+
);
92+
} "touch $out";
9093
};
9194
};
9295
};
@@ -99,48 +102,50 @@
99102
default = self.templates.app;
100103
};
101104
}
102-
// (flake-utils.lib.eachDefaultSystem (system:
103-
let
104-
pkgs = import nixpkgs {
105-
inherit system;
106-
config.allowAliases = false;
107-
};
105+
// (flake-utils.lib.eachDefaultSystem (
106+
system:
107+
let
108+
pkgs = import nixpkgs {
109+
inherit system;
110+
config.allowAliases = false;
111+
};
108112

109-
poetry2nix = import ./default.nix { inherit pkgs; };
110-
p2nix-tools = pkgs.callPackage ./tools { inherit poetry2nix; };
111-
in
112-
rec {
113-
formatter = treefmtEval.${system}.config.build.wrapper;
113+
poetry2nix = import ./default.nix { inherit pkgs; };
114+
p2nix-tools = pkgs.callPackage ./tools { inherit poetry2nix; };
115+
in
116+
rec {
117+
formatter = treefmtEval.${system}.config.build.wrapper;
114118

115-
packages = {
116-
poetry2nix = poetry2nix.cli;
117-
default = poetry2nix.cli;
118-
};
119+
packages = {
120+
poetry2nix = poetry2nix.cli;
121+
default = poetry2nix.cli;
122+
};
119123

120-
devShells = {
121-
default = pkgs.mkShell {
122-
nativeBuildInputs = with pkgs; [
123-
p2nix-tools.env
124-
p2nix-tools.flamegraph
125-
nixpkgs-fmt
126-
poetry
127-
niv
128-
jq
129-
nix-prefetch-git
130-
nix-eval-jobs
131-
nix-build-uncached
132-
];
124+
devShells = {
125+
default = pkgs.mkShell {
126+
nativeBuildInputs = with pkgs; [
127+
p2nix-tools.env
128+
p2nix-tools.flamegraph
129+
nixpkgs-fmt
130+
poetry
131+
niv
132+
jq
133+
nix-prefetch-git
134+
nix-eval-jobs
135+
nix-build-uncached
136+
];
137+
};
133138
};
134-
};
135139

136-
apps = {
137-
poetry = {
138-
# https://wiki.nixos.org/wiki/Flakes
139-
type = "app";
140-
program = "${pkgs.poetry}/bin/poetry";
140+
apps = {
141+
poetry = {
142+
# https://wiki.nixos.org/wiki/Flakes
143+
type = "app";
144+
program = "${pkgs.poetry}/bin/poetry";
145+
};
146+
poetry2nix = flake-utils.lib.mkApp { drv = packages.poetry2nix; };
147+
default = apps.poetry2nix;
141148
};
142-
poetry2nix = flake-utils.lib.mkApp { drv = packages.poetry2nix; };
143-
default = apps.poetry2nix;
144-
};
145-
}));
149+
}
150+
));
146151
}

templates/app/flake.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
inputs = {
55
flake-utils.url = "github:numtide/flake-utils";
6-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
6+
# Last working commit from nixos-small-unstable
7+
nixpkgs.url = "github:NixOS/nixpkgs?rev=75e28c029ef2605f9841e0baa335d70065fe7ae2";
78
poetry2nix = {
89
url = "github:nix-community/poetry2nix";
910
inputs.nixpkgs.follows = "nixpkgs";

0 commit comments

Comments
 (0)