Skip to content

Commit

Permalink
Merge master into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 4, 2022
2 parents 4f6caef + 20e059f commit 33b3f97
Show file tree
Hide file tree
Showing 35 changed files with 512 additions and 159 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/no-channel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ on:
- 'nixos-**'
- 'nixpkgs-**'

permissions:
contents: read

jobs:
fail:
permissions:
contents: none
name: "This PR is is targeting a channel branch"
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/update-terraform-providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ on:
- cron: "14 3 * * 1"
workflow_dispatch:

permissions:
contents: read

jobs:
tf-providers:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
issues: write # for peter-evans/create-or-update-comment to create or update comment
pull-requests: write # for peter-evans/create-pull-request to create a PR
if: github.repository_owner == 'NixOS' && github.ref == 'refs/heads/master' # ensure workflow_dispatch only runs on master
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/installer/netboot/netboot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ with lib;


# Create the initrd
system.build.netbootRamdisk = pkgs.makeInitrd {
system.build.netbootRamdisk = pkgs.makeInitrdNG {
inherit (config.boot.initrd) compressor;
prepend = [ "${config.system.build.initialRamdisk}/initrd" ];

Expand Down
84 changes: 51 additions & 33 deletions nixos/modules/virtualisation/qemu-vm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,21 @@ in
'';
};

virtualisation.useDefaultFilesystems =
mkOption {
type = types.bool;
default = true;
description =
''
If enabled, the boot disk of the virtual machine will be
formatted and mounted with the default filesystems for
testing. Swap devices and LUKS will be disabled.
If disabled, a root filesystem has to be specified and
formatted (for example in the initial ramdisk).
'';
};

virtualisation.efiVars =
mkOption {
type = types.str;
Expand Down Expand Up @@ -754,13 +769,13 @@ in
);
boot.loader.grub.gfxmodeBios = with cfg.resolution; "${toString x}x${toString y}";

boot.initrd.extraUtilsCommands = lib.mkIf (!config.boot.initrd.systemd.enable)
boot.initrd.extraUtilsCommands = lib.mkIf (cfg.useDefaultFilesystems && !config.boot.initrd.systemd.enable)
''
# We need mke2fs in the initrd.
copy_bin_and_libs ${pkgs.e2fsprogs}/bin/mke2fs
'';

boot.initrd.postDeviceCommands = lib.mkIf (!config.boot.initrd.systemd.enable)
boot.initrd.postDeviceCommands = lib.mkIf (cfg.useDefaultFilesystems && !config.boot.initrd.systemd.enable)
''
# If the disk image appears to be empty, run mke2fs to
# initialise.
Expand Down Expand Up @@ -930,38 +945,41 @@ in
};
in
mkVMOverride (cfg.fileSystems //
{
optionalAttrs cfg.useDefaultFilesystems {
"/".device = cfg.bootDevice;
"/".fsType = "ext4";
"/".autoFormat = true;

"/tmp" = mkIf config.boot.tmpOnTmpfs
{ device = "tmpfs";
fsType = "tmpfs";
neededForBoot = true;
# Sync with systemd's tmp.mount;
options = [ "mode=1777" "strictatime" "nosuid" "nodev" "size=${toString config.boot.tmpOnTmpfsSize}" ];
};

"/nix/${if cfg.writableStore then ".ro-store" else "store"}" =
mkIf cfg.useNixStoreImage
{ device = "${lookupDriveDeviceName "nix-store" cfg.qemu.drives}";
neededForBoot = true;
options = [ "ro" ];
};

"/nix/.rw-store" = mkIf (cfg.writableStore && cfg.writableStoreUseTmpfs)
{ fsType = "tmpfs";
options = [ "mode=0755" ];
neededForBoot = true;
};

"/boot" = mkIf cfg.useBootLoader
# see note [Disk layout with `useBootLoader`]
{ device = "${lookupDriveDeviceName "boot" cfg.qemu.drives}2"; # 2 for e.g. `vdb2`, as created in `bootDisk`
fsType = "vfat";
noCheck = true; # fsck fails on a r/o filesystem
};
} //
optionalAttrs config.boot.tmpOnTmpfs {
"/tmp" = {
device = "tmpfs";
fsType = "tmpfs";
neededForBoot = true;
# Sync with systemd's tmp.mount;
options = [ "mode=1777" "strictatime" "nosuid" "nodev" "size=${toString config.boot.tmpOnTmpfsSize}" ];
};
} //
optionalAttrs cfg.useNixStoreImage {
"/nix/${if cfg.writableStore then ".ro-store" else "store"}" = {
device = "${lookupDriveDeviceName "nix-store" cfg.qemu.drives}";
neededForBoot = true;
options = [ "ro" ];
};
} //
optionalAttrs (cfg.writableStore && cfg.writableStoreUseTmpfs) {
"/nix/.rw-store" = {
fsType = "tmpfs";
options = [ "mode=0755" ];
neededForBoot = true;
};
} //
optionalAttrs cfg.useBootLoader {
# see note [Disk layout with `useBootLoader`]
"/boot" = {
device = "${lookupDriveDeviceName "boot" cfg.qemu.drives}2"; # 2 for e.g. `vdb2`, as created in `bootDisk`
fsType = "vfat";
noCheck = true; # fsck fails on a r/o filesystem
};
} // lib.mapAttrs' mkSharedDir cfg.sharedDirectories);

boot.initrd.systemd = lib.mkIf (config.boot.initrd.systemd.enable && cfg.writableStore) {
Expand All @@ -986,8 +1004,8 @@ in
};
};

swapDevices = mkVMOverride [ ];
boot.initrd.luks.devices = mkVMOverride {};
swapDevices = (if cfg.useDefaultFilesystems then mkVMOverride else mkDefault) [ ];
boot.initrd.luks.devices = (if cfg.useDefaultFilesystems then mkVMOverride else mkDefault) {};

# Don't run ntpd in the guest. It should get the correct time from KVM.
services.timesyncd.enable = false;
Expand Down
2 changes: 2 additions & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ in {
nixpkgs = pkgs.callPackage ../modules/misc/nixpkgs/test.nix { inherit evalMinimalConfig; };
node-red = handleTest ./node-red.nix {};
nomad = handleTest ./nomad.nix {};
non-default-filesystems = handleTest ./non-default-filesystems.nix {};
noto-fonts = handleTest ./noto-fonts.nix {};
novacomd = handleTestOn ["x86_64-linux"] ./novacomd.nix {};
nsd = handleTest ./nsd.nix {};
Expand Down Expand Up @@ -519,6 +520,7 @@ in {
step-ca = handleTestOn ["x86_64-linux"] ./step-ca.nix {};
strongswan-swanctl = handleTest ./strongswan-swanctl.nix {};
sudo = handleTest ./sudo.nix {};
swap-partition = handleTest ./swap-partition.nix {};
sway = handleTest ./sway.nix {};
switchTest = handleTest ./switch-test.nix {};
sympa = handleTest ./sympa.nix {};
Expand Down
54 changes: 54 additions & 0 deletions nixos/tests/non-default-filesystems.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import ./make-test-python.nix ({ lib, pkgs, ... }:
{
name = "non-default-filesystems";

nodes.machine =
{ config, pkgs, lib, ... }:
let
disk = config.virtualisation.bootDevice;
in
{
virtualisation.useDefaultFilesystems = false;

boot.initrd.availableKernelModules = [ "btrfs" ];
boot.supportedFilesystems = [ "btrfs" ];

boot.initrd.postDeviceCommands = ''
FSTYPE=$(blkid -o value -s TYPE ${disk} || true)
if test -z "$FSTYPE"; then
modprobe btrfs
${pkgs.btrfs-progs}/bin/mkfs.btrfs ${disk}
mkdir /nixos
mount -t btrfs ${disk} /nixos
${pkgs.btrfs-progs}/bin/btrfs subvolume create /nixos/root
${pkgs.btrfs-progs}/bin/btrfs subvolume create /nixos/home
umount /nixos
fi
'';

virtualisation.fileSystems = {
"/" = {
device = disk;
fsType = "btrfs";
options = [ "subvol=/root" ];
};

"/home" = {
device = disk;
fsType = "btrfs";
options = [ "subvol=/home" ];
};
};
};

testScript = ''
machine.wait_for_unit("multi-user.target")
with subtest("BTRFS filesystems are mounted correctly"):
machine.succeed("grep -E '/dev/vda / btrfs rw,relatime,space_cache=v2,subvolid=[0-9]+,subvol=/root 0 0' /proc/mounts")
machine.succeed("grep -E '/dev/vda /home btrfs rw,relatime,space_cache=v2,subvolid=[0-9]+,subvol=/home 0 0' /proc/mounts")
'';
})
48 changes: 48 additions & 0 deletions nixos/tests/swap-partition.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import ./make-test-python.nix ({ lib, pkgs, ... }:
{
name = "swap-partition";

nodes.machine =
{ config, pkgs, lib, ... }:
{
virtualisation.useDefaultFilesystems = false;

virtualisation.bootDevice = "/dev/vda1";

boot.initrd.postDeviceCommands = ''
if ! test -b /dev/vda1; then
${pkgs.parted}/bin/parted --script /dev/vda -- mklabel msdos
${pkgs.parted}/bin/parted --script /dev/vda -- mkpart primary 1MiB -250MiB
${pkgs.parted}/bin/parted --script /dev/vda -- mkpart primary -250MiB 100%
sync
fi
FSTYPE=$(blkid -o value -s TYPE /dev/vda1 || true)
if test -z "$FSTYPE"; then
${pkgs.e2fsprogs}/bin/mke2fs -t ext4 -L root /dev/vda1
${pkgs.util-linux}/bin/mkswap --label swap /dev/vda2
fi
'';

virtualisation.fileSystems = {
"/" = {
device = "/dev/disk/by-label/root";
fsType = "ext4";
};
};

swapDevices = [
{
device = "/dev/disk/by-label/swap";
}
];
};

testScript = ''
machine.wait_for_unit("multi-user.target")
with subtest("Swap is active"):
# Doesn't matter if the numbers reported by `free` are slightly off due to unit conversions.
machine.succeed("free -h | grep -E 'Swap:\s+2[45][0-9]Mi'")
'';
})
4 changes: 2 additions & 2 deletions pkgs/applications/editors/neovim/neovim-qt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

mkDerivation rec {
pname = "neovim-qt-unwrapped";
version = "0.2.16.1";
version = "0.2.17";

src = fetchFromGitHub {
owner = "equalsraf";
repo = "neovim-qt";
rev = "v${version}";
sha256 = "0x5brrim3f21bzdmh6wyrhrislwpx1248wbx56csvic6v78hzqny";
sha256 = "sha256-UJXaHENqau5EEe5c94pJuNxZU5rutJs642w9Cof8Sa4=";
};

cmakeFlags = [
Expand Down
12 changes: 11 additions & 1 deletion pkgs/applications/science/electronics/archimedes/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl }:
{ lib, stdenv, fetchurl, fetchpatch }:

stdenv.mkDerivation rec {
pname = "archimedes";
Expand All @@ -9,6 +9,16 @@ stdenv.mkDerivation rec {
sha256 = "0jfpnd3pns5wxcxbiw49v5sgpmm5b4v8s4q1a5292hxxk2hzmb3z";
};

patches = [
# Pull patch pending upstream inclusion to support c99 toolchains:
# https://savannah.gnu.org/bugs/index.php?62703
(fetchpatch {
name = "c99.patch";
url = "https://savannah.gnu.org/bugs/download.php?file_id=53393";
sha256 = "1xmy1w4ln1gynldk3srdi2h0fxpx465dsa1yxc3rzrrjpxh6087f";
})
];

meta = {
description = "GNU package for semiconductor device simulations";
homepage = "https://www.gnu.org/software/archimedes";
Expand Down
58 changes: 50 additions & 8 deletions pkgs/applications/version-management/gitqlient/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,46 @@

mkDerivation rec {
pname = "gitqlient";
version = "1.4.3";
version = "1.5.0";

src = fetchFromGitHub {
owner = "francescmm";
repo = pname;
rev = "v${version}";
sha256 = "018jz6b28zwr205jmgw13ddlfvlhxqf0cw1pfjiwsi6i8gay7w6s";
};
srcs = [
(fetchFromGitHub {
owner = "francescmm";
repo = pname;
rev = "v${version}";
sha256 = "sha256-Mq29HbmPABrRIJjWC5AAKIOKbGngeJdkZkWeJw8BFuw=";
})
(fetchFromGitHub rec {
owner = "francescmm";
repo = "AuxiliarCustomWidgets";
rev = "835f538b4a79e4d6bb70eef37a32103e7b2a1fd1";
sha256 = "sha256-b1gb/7UcLS6lI92dBfTenGXA064t4dZufs3S9lu/lQA=";
name = repo;
})
(fetchFromGitHub rec {
owner = "francescmm";
repo = "QLogger";
rev = "d1ed24e080521a239d5d5e2c2347fe211f0f3e4f";
sha256 = "sha256-NVlFYmm7IIkf8LhQrAYXil9kH6DFq1XjOEHQiIWmER4=";
name = repo;
})
(fetchFromGitHub rec {
owner = "francescmm";
repo = "QPinnableTabWidget";
rev = "cc937794e910d0452f0c07b4961c6014a7358831";
sha256 = "sha256-2KzzBv/s2t665axeBxWrn8aCMQQArQLlUBOAlVhU+wE=";
name = repo;
})
(fetchFromGitHub rec {
owner = "francescmm";
repo = "git";
rev = "b62750f4da4b133faff49e6f53950d659b18c948";
sha256 = "sha256-4FqA+kkHd0TqD6ZuB4CbJ+IhOtQG9uWN+qhSAT0dXGs=";
name = repo;
})
];

sourceRoot = "source";

nativeBuildInputs = [
qmake
Expand All @@ -25,11 +57,21 @@ mkDerivation rec {
qtwebengine
];

postUnpack = ''
for dep in AuxiliarCustomWidgets QPinnableTabWidget QLogger git; do
rmdir "source/src/$dep"
ln -sf "../../$dep" "source/src/$dep"
done
'';

qmakeFlags = [
"GitQlient.pro"
];

passthru.updateScript = gitUpdater { inherit pname version; };
passthru.updateScript = gitUpdater {
inherit pname version;
rev-prefix = "v";
};

meta = with lib; {
homepage = "https://github.com/francescmm/GitQlient";
Expand Down
Loading

0 comments on commit 33b3f97

Please sign in to comment.