mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
Merge release.nix, shell.nix and release-common.nix into flake.nix
Also provide a Nixpkgs overlay, memoize Nixpkgs evaluation and fit the githubFlakes test.
This commit is contained in:
parent
90d6018509
commit
204291f059
9 changed files with 476 additions and 540 deletions
|
@ -1,6 +1,9 @@
|
|||
{ nixpkgs, system, nix }:
|
||||
{ nixpkgs, system, overlay }:
|
||||
|
||||
with import (nixpkgs + "/nixos/lib/testing.nix") { inherit system; };
|
||||
with import (nixpkgs + "/nixos/lib/testing.nix") {
|
||||
inherit system;
|
||||
extraConfigurations = [ { nixpkgs.overlays = [ overlay ]; } ];
|
||||
};
|
||||
|
||||
let
|
||||
|
||||
|
@ -101,7 +104,6 @@ makeTest (
|
|||
{ config, pkgs, nodes, ... }:
|
||||
{ virtualisation.writableStore = true;
|
||||
virtualisation.pathsInNixDB = [ pkgs.hello pkgs.fuse ];
|
||||
nix.package = nix;
|
||||
nix.binaryCaches = [ ];
|
||||
environment.systemPackages = [ pkgs.jq ];
|
||||
networking.hosts.${(builtins.head nodes.github.config.networking.interfaces.eth1.ipv4.addresses).address} =
|
||||
|
@ -135,11 +137,11 @@ makeTest (
|
|||
my $date = $client->succeed("nix flake info nixpkgs --json | jq -M .lastModified");
|
||||
strftime("%Y%m%d%H%M%S", gmtime($date)) eq "${nixpkgs.lastModified}" or die "time mismatch";
|
||||
|
||||
$client->succeed("nix build nixpkgs:hello");
|
||||
$client->succeed("nix build nixpkgs#hello");
|
||||
|
||||
# The build shouldn't fail even with --tarball-ttl 0 (the server
|
||||
# being down should not be a fatal error).
|
||||
$client->succeed("nix build nixpkgs:fuse --tarball-ttl 0");
|
||||
$client->succeed("nix build nixpkgs#fuse --tarball-ttl 0");
|
||||
'';
|
||||
|
||||
})
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
# Test ‘nix-copy-closure’.
|
||||
|
||||
{ nixpkgs, system, nix }:
|
||||
{ nixpkgs, system, overlay }:
|
||||
|
||||
with import (nixpkgs + "/nixos/lib/testing.nix") { inherit system; };
|
||||
with import (nixpkgs + "/nixos/lib/testing.nix") {
|
||||
inherit system;
|
||||
extraConfigurations = [ { nixpkgs.overlays = [ overlay ]; } ];
|
||||
};
|
||||
|
||||
makeTest (let pkgA = pkgs.cowsay; pkgB = pkgs.wget; pkgC = pkgs.hello; in {
|
||||
|
||||
|
@ -11,7 +14,6 @@ makeTest (let pkgA = pkgs.cowsay; pkgB = pkgs.wget; pkgC = pkgs.hello; in {
|
|||
{ config, pkgs, ... }:
|
||||
{ virtualisation.writableStore = true;
|
||||
virtualisation.pathsInNixDB = [ pkgA ];
|
||||
nix.package = nix;
|
||||
nix.binaryCaches = [ ];
|
||||
};
|
||||
|
||||
|
@ -20,7 +22,6 @@ makeTest (let pkgA = pkgs.cowsay; pkgB = pkgs.wget; pkgC = pkgs.hello; in {
|
|||
{ services.openssh.enable = true;
|
||||
virtualisation.writableStore = true;
|
||||
virtualisation.pathsInNixDB = [ pkgB pkgC ];
|
||||
nix.package = nix;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
# Test Nix's remote build feature.
|
||||
|
||||
{ nixpkgs, system, nix }:
|
||||
{ nixpkgs, system, overlay }:
|
||||
|
||||
with import (nixpkgs + "/nixos/lib/testing.nix") { inherit system; };
|
||||
with import (nixpkgs + "/nixos/lib/testing.nix") {
|
||||
inherit system;
|
||||
extraConfigurations = [ { nixpkgs.overlays = [ overlay ]; } ];
|
||||
};
|
||||
|
||||
makeTest (
|
||||
|
||||
|
@ -13,7 +16,6 @@ let
|
|||
{ config, pkgs, ... }:
|
||||
{ services.openssh.enable = true;
|
||||
virtualisation.writableStore = true;
|
||||
nix.package = nix;
|
||||
nix.useSandbox = true;
|
||||
};
|
||||
|
||||
|
@ -59,7 +61,6 @@ in
|
|||
];
|
||||
virtualisation.writableStore = true;
|
||||
virtualisation.pathsInNixDB = [ config.system.build.extraUtils ];
|
||||
nix.package = nix;
|
||||
nix.binaryCaches = [ ];
|
||||
programs.ssh.extraConfig = "ConnectTimeout 30";
|
||||
};
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
# Verify that Linux builds cannot create setuid or setgid binaries.
|
||||
|
||||
{ nixpkgs, system, nix }:
|
||||
{ nixpkgs, system, overlay }:
|
||||
|
||||
with import (nixpkgs + "/nixos/lib/testing.nix") { inherit system; };
|
||||
with import (nixpkgs + "/nixos/lib/testing.nix") {
|
||||
inherit system;
|
||||
extraConfigurations = [ { nixpkgs.overlays = [ overlay ]; } ];
|
||||
};
|
||||
|
||||
makeTest {
|
||||
|
||||
machine =
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ virtualisation.writableStore = true;
|
||||
nix.package = nix;
|
||||
nix.binaryCaches = [ ];
|
||||
nix.nixPath = [ "nixpkgs=${lib.cleanSource pkgs.path}" ];
|
||||
virtualisation.pathsInNixDB = [ pkgs.stdenv pkgs.pkgsi686Linux.stdenv ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue