Skip to content
Closed
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
2 changes: 1 addition & 1 deletion nixos/modules/misc/version.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ in

stateVersion = mkOption {
type = types.str;
default = cfg.release;
default = throw "system.stateVersion needs to be set. Use the value of the current release.";
description = ''
Every once in a while, a new NixOS release may change
configuration defaults in a way incompatible with stateful
Expand Down
9 changes: 6 additions & 3 deletions nixos/release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ let
};
};
allTests =
foldAttrs recursiveUpdate {} (map allTestsForSystem supportedSystems);
foldAttrs recursiveUpdate { } (map allTestsForSystem supportedSystems);

pkgs = import ./.. { system = "x86_64-linux"; };


versionModule =
{ system.nixos.versionSuffix = versionSuffix;
{
system.nixos.versionSuffix = versionSuffix;
system.nixos.revision = nixpkgs.rev or nixpkgs.shortRev;
system.stateVersion = mkForce "21.04";
Copy link
Member

Choose a reason for hiding this comment

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

21.04?

};

makeModules = module: rest: [ configuration versionModule module rest ];
Expand Down Expand Up @@ -92,9 +94,10 @@ let
buildFromConfig = module: sel: forAllSystems (system: hydraJob (sel (import ./lib/eval-config.nix {
inherit system;
modules = makeModules module
({ ... }:
({ config, ... }:
{ fileSystems."/".device = mkDefault "/dev/sda1";
boot.loader.grub.device = mkDefault "/dev/sda";
system.stateVersion = mkDefault config.system.version;
});
}).config));

Expand Down