Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions nixos/modules/misc/version.nix
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ in
"/etc/os-release".source = initrdRelease;
"/etc/initrd-release".source = initrdRelease;
};

# We have to use `warnings` because when warning in the default of the option
# the warning would also be shown when building the manual since the manual
# has to evaluate the default.
#
# TODO Remove this and drop the default of the option so people are forced to set it.
# Doing this also means fixing the comment in nixos/modules/testing/test-instrumentation.nix
warnings = lib.optional (options.system.stateVersion.highestPrio == (lib.mkOptionDefault { }).priority)
"system.stateVersion is not set, defaulting to ${config.system.stateVersion}. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.";
};

# uses version info nixpkgs, which requires a full nixpkgs path
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/matrix/matrix-synapse.nix
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ in {
default = if lib.versionAtLeast config.system.stateVersion "22.05"
then "${cfg.dataDir}/media_store"
else "${cfg.dataDir}/media";
defaultText = "${cfg.dataDir}/media_store for when system.stateVersion is at least 22.05, ${cfg.dataDir}/media when lower than 22.05";
description = ''
Directory where uploaded images and attachments are stored.
'';
Expand Down
3 changes: 3 additions & 0 deletions nixos/modules/testing/test-instrumentation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ in
# Make sure we use the Guest Agent from the QEMU package for testing
# to reduce the closure size required for the tests.
services.qemuGuest.package = pkgs.qemu_test.ga;

# Squelch warning about unset system.stateVersion
system.stateVersion = lib.mkDefault lib.trivial.release;
};

}
2 changes: 2 additions & 0 deletions pkgs/test/nixos-functions/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ in lib.optionalAttrs stdenv.hostPlatform.isLinux (
system.nixos = dummyVersioning;
boot.loader.grub.enable = false;
fileSystems."/".device = "/dev/null";
system.stateVersion = lib.trivial.release;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was redundant because of the default in test-instrumentation.nix. Removing in #171647.

}).toplevel;

nixosTest-test = pkgs.nixosTest ({ lib, pkgs, figlet, ... }: {
name = "nixosTest-test";
nodes.machine = { pkgs, ... }: {
system.nixos = dummyVersioning;
environment.systemPackages = [ pkgs.hello figlet ];
system.stateVersion = lib.trivial.release;
};
testScript = ''
machine.succeed("hello | figlet >/dev/console")
Expand Down