mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 00:53:57 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
65 lines
1.4 KiB
Nix
65 lines
1.4 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
let
|
|
inherit (pkgs) writeScript;
|
|
|
|
pkgs2storeContents = map (x: {
|
|
object = x;
|
|
symlink = "none";
|
|
});
|
|
in
|
|
|
|
{
|
|
# Docker image config.
|
|
imports = [
|
|
../installer/cd-dvd/channel.nix
|
|
./minimal.nix
|
|
./clone-config.nix
|
|
];
|
|
|
|
# Create the tarball
|
|
system.build.tarball = pkgs.callPackage ../../lib/make-system-tarball.nix {
|
|
contents = [
|
|
{
|
|
source = "${config.system.build.toplevel}/.";
|
|
target = "./";
|
|
}
|
|
];
|
|
extraArgs = "--owner=0";
|
|
|
|
# Add init script to image
|
|
storeContents = pkgs2storeContents [
|
|
config.system.build.toplevel
|
|
pkgs.stdenv
|
|
];
|
|
|
|
# Some container managers like lxc need these
|
|
extraCommands =
|
|
let
|
|
script = writeScript "extra-commands.sh" ''
|
|
rm etc
|
|
mkdir -p proc sys dev etc
|
|
'';
|
|
in
|
|
script;
|
|
};
|
|
|
|
boot.isContainer = true;
|
|
boot.postBootCommands = ''
|
|
# After booting, register the contents of the Nix store in the Nix
|
|
# database.
|
|
if [ -f /nix-path-registration ]; then
|
|
${config.nix.package.out}/bin/nix-store --load-db < /nix-path-registration &&
|
|
rm /nix-path-registration
|
|
fi
|
|
|
|
# nixos-rebuild also requires a "system" profile
|
|
${config.nix.package.out}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system
|
|
'';
|
|
|
|
# Install new init script
|
|
system.activationScripts.installInitScript = ''
|
|
ln -fs $systemConfig/init /init
|
|
'';
|
|
}
|