mirror of
https://github.com/NixOS/nix.git
synced 2025-12-16 22:11:05 +01:00
flake.nix: Add builds for nixos-unstable
This commit is contained in:
parent
0d26358bda
commit
85dfa808e5
1 changed files with 33 additions and 5 deletions
38
flake.nix
38
flake.nix
|
|
@ -4,16 +4,34 @@
|
|||
# TODO switch to nixos-23.11-small
|
||||
# https://nixpk.gs/pr-tracker.html?pr=291954
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
|
||||
inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2";
|
||||
inputs.flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
|
||||
inputs.libgit2 = { url = "github:libgit2/libgit2"; flake = false; };
|
||||
|
||||
outputs = { self, nixpkgs, nixpkgs-regression, libgit2, ... }:
|
||||
# dev
|
||||
inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2";
|
||||
inputs.nixpkgs-nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, nixpkgs-regression, libgit2, ... }:
|
||||
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
inherit (lib) fileset;
|
||||
|
||||
nixpkgsChannel = inputs.nixpkgsChannel or "nixos-23.11";
|
||||
# If nixpkgsChannel hasn't been set, its the default invocation of the
|
||||
# flake outputs, and we want to add attributes for the other variants.
|
||||
shouldAddVariants = ! inputs?nixpkgsChannel;
|
||||
|
||||
self_nixos-unstable =
|
||||
(import ./flake.nix).outputs
|
||||
(inputs // {
|
||||
nixpkgs = inputs.nixpkgs-nixos-unstable;
|
||||
nixpkgsChannel = "nixos-unstable";
|
||||
self = self_nixos-unstable;
|
||||
});
|
||||
|
||||
prefixAttrs = prefix: lib.concatMapAttrs (k: v: { "${prefix}${k}" = v; });
|
||||
|
||||
officialRelease = false;
|
||||
|
||||
version = lib.fileContents ./.version + versionSuffix;
|
||||
|
|
@ -336,7 +354,8 @@
|
|||
binaryTarballs = self.hydraJobs.binaryTarball;
|
||||
inherit nixpkgsFor;
|
||||
};
|
||||
|
||||
} // lib.optionalAttrs shouldAddVariants {
|
||||
nixos-unstable = self_nixos-unstable.hydraJobs;
|
||||
};
|
||||
|
||||
checks = forAllSystems (system: {
|
||||
|
|
@ -351,7 +370,9 @@
|
|||
'';
|
||||
} // (lib.optionalAttrs (builtins.elem system linux64BitSystems)) {
|
||||
dockerImage = self.hydraJobs.dockerImage.${system};
|
||||
});
|
||||
} // lib.optionalAttrs shouldAddVariants (
|
||||
prefixAttrs "nixos-unstable-" self_nixos-unstable.checks.${system}
|
||||
));
|
||||
|
||||
packages = forAllSystems (system: rec {
|
||||
inherit (nixpkgsFor.${system}.native) nix changelog-d-nix;
|
||||
|
|
@ -383,7 +404,11 @@
|
|||
name = "nix-${stdenvName}";
|
||||
value = nixpkgsFor.${system}.stdenvs."${stdenvName}Packages".nix;
|
||||
})
|
||||
stdenvs)));
|
||||
stdenvs))
|
||||
// lib.optionalAttrs shouldAddVariants (
|
||||
prefixAttrs "nixos-unstable-" self_nixos-unstable.packages.${system}
|
||||
)
|
||||
);
|
||||
|
||||
devShells = let
|
||||
makeShell = pkgs: stdenv: (pkgs.nix.override { inherit stdenv; forDevShell = true; }).overrideAttrs (attrs: {
|
||||
|
|
@ -418,6 +443,9 @@
|
|||
{
|
||||
default = self.devShells.${system}.native-stdenvPackages;
|
||||
}
|
||||
// lib.optionalAttrs shouldAddVariants (
|
||||
prefixAttrs "nixos-unstable-" self_nixos-unstable.devShells.${system}
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue