1 { config, lib, pkgs, ... }:
3 let cfg = config.system.autoUpgradeWithPinch;
6 system.autoUpgradeWithPinch = {
12 Whether to periodically upgrade NixOS to the latest version.
13 Presumes that /etc/nixos is a git repo with a remote and
14 contains a pinch file called "channels".
22 Specification (in the format described by
23 <citerefentry><refentrytitle>systemd.time</refentrytitle>
24 <manvolnum>7</manvolnum></citerefentry>) of the time at
25 which the update will occur.
31 config = lib.mkIf cfg.enable {
32 nixpkgs.overlays = [ (import ../overlays/pinch.nix) ];
33 systemd.services.nixos-upgrade = {
34 description = "NixOS Upgrade";
35 restartIfChanged = false;
36 unitConfig.X-StopOnRemoval = false;
37 serviceConfig.Type = "oneshot";
38 environment = config.nix.envVars // {
39 inherit (config.environment.sessionVariables) NIX_PATH;
41 } // config.networking.proxy.envVars;
44 config.nix.package.out
62 ${config.system.build.nixos-rebuild}/bin/nixos-rebuild switch --no-build-output