Discussion:
[Nix-dev] Using system.autoUpgrade with a git channel
John Ramsden via nix-dev
2017-07-06 23:46:49 UTC
Permalink
I'm currently using a checked out version of the channels repository
as my channel. I was previously using the integrated channel and using
'system.autoUpgrade.enable = true'. I assume I can no longer use this
service for upgrades while I'm using git. Is there any way to run auto
upgrades while using a checked out git repository?

I was also wondering what exactly the 'nixos-rebuild switch' command's
'--upgrade' flag does. I was unable to tell from the module, and the man
page just says:

--upgrade
Fetch the latest version of NixOS from the NixOS channel.

Does this means the command just pulls new additions to the nix channel
that is selected?

Seeing as the NixOS channel is just a git repository, is there a way I
can configure the auto upgrades to work with my checked out git
repository? All I've done is cherrypicked a few commits and added them
to the 17.03 channel locally.
--
John Ramsden
Vladimír Čunát via nix-dev
2017-07-07 05:56:53 UTC
Permalink
Post by John Ramsden via nix-dev
I was also wondering what exactly the 'nixos-rebuild switch' command's
'--upgrade' flag does.
It does
$ nix-channel --update nixos
Best see the source if you want details, as it's relatively simple:
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/tools/nixos-rebuild.sh#L197

--Vladimir
John Ramsden via nix-dev
2017-07-07 06:36:35 UTC
Permalink
Thanks that's helpful. In other words if I'm using a checked out git
repository I'm no longer able to use 'system.autoUpgrade'.
--
John Ramsden
Post by Vladimír Čunát via nix-dev
Post by John Ramsden via nix-dev
I was also wondering what exactly the 'nixos-rebuild switch' command's
'--upgrade' flag does.
It does
$ nix-channel --update nixos
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/tools/nixos-rebuild.sh#L197
--Vladimir
Danylo Hlynskyi via nix-dev
2017-07-08 03:35:54 UTC
Permalink
I've seen this in a wild

system.autoUpgrade.enable = true;
system.autoUpgrade.flags = lib.mkForce
[ "--no-build-output"
"-I" "nixpkgs=/etc/nixos/nixpkgs-channels"
];
systemd.services.nixos-upgrade.path = [ pkgs.git ];
systemd.services.nixos-upgrade.preStart = ''
cd /etc/nixos/nixpkgs-channels
${pkgs.git}/bin/git pull
'';


https://github.com/garbas/dotfiles/blob/a76e12166efa57edded8c381074104fefe5c7da6/nixos/floki.nix#L27-L36

2017-07-07 9:36 GMT+03:00 John Ramsden via nix-dev <
Post by John Ramsden via nix-dev
Thanks that's helpful. In other words if I'm using a checked out git
repository I'm no longer able to use 'system.autoUpgrade'.
--
John Ramsden
Post by Vladimír Čunát via nix-dev
Post by John Ramsden via nix-dev
I was also wondering what exactly the 'nixos-rebuild switch' command's
'--upgrade' flag does.
It does
$ nix-channel --update nixos
https://github.com/NixOS/nixpkgs/blob/master/nixos/
modules/installer/tools/nixos-rebuild.sh#L197
Post by Vladimír Čunát via nix-dev
--Vladimir
_______________________________________________
nix-dev mailing list
https://mailman.science.uu.nl/mailman/listinfo/nix-dev
John Ramsden via nix-dev
2017-07-08 21:36:02 UTC
Permalink
Cool, might have to do some experimenting.

--
John Ramsden
Post by Danylo Hlynskyi via nix-dev
I've seen this in a wild
system.autoUpgrade.enable = true;
system.autoUpgrade.flags = lib.mkForce
[ "--no-build-output"
"-I" "nixpkgs=/etc/nixos/nixpkgs-channels"
];
systemd.services.nixos-upgrade.path = [ pkgs.git ];
systemd.services.nixos-upgrade.preStart = ''
cd /etc/nixos/nixpkgs-channels
${pkgs.git}/bin/git pull
'';
https://github.com/garbas/dotfiles/blob/a76e12166efa57edded8c381074104fefe5c7da6/nixos/floki.nix#L27-L36>
Post by John Ramsden via nix-dev
--
John Ramsden
Post by Vladimír Čunát via nix-dev
I was also wondering what exactly the 'nixos-rebuild switch' command's>> > > '--upgrade' flag does.
It does
$ nix-channel --update nixos
Best see the source if you want details, as it's relatively simple:>> > https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/tools/nixos-rebuild.sh#L197>> >
--Vladimir
_______________________________________________
nix-dev mailing list
https://mailman.science.uu.nl/mailman/listinfo/nix-dev
Loading...