Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeshift: init at 22.06.1 #126481

Merged
merged 1 commit into from
Jun 11, 2022
Merged

Conversation

ShamrockLee
Copy link
Contributor

@ShamrockLee ShamrockLee commented Jun 10, 2021

Motivation for this change

Timeshift is commonly seen in Debian-based distros, and is enabled by default on Ubuntu and Linux Mint.

If applied, users will be able to restore their broken distros from timeshift snapshots.

closes #89348

I'm not sure if it's useful for NixOS users, since we already have a powerful package manager that does in-place snapshots and rollback for us. (There is a comment in the package request about the possible use case when updating to a new version.)
Nevertheless, nix users on other distros may find it helpful to be able to install this from Nix and to restore inside that distro or from NixOS.

To-do
  • The "periodic snapshot" functionality requires crontab access from superuser. (this can be disabled)
  • timeshift-gtk expects /etc/timeshift/timeshift.json or /etc/timeshift/default.json to exist before it starts. I'm not sure how other packages manage that. (Solved by patching src/Core/Main.vala with substituteInPlace)
  • The snapshot creation/restore functionality has not tested yet. It would be great to add corresponding NixOS tests.
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 labels Jun 10, 2021
@ShamrockLee ShamrockLee force-pushed the timeshift branch 2 times, most recently from 6feb3ba to 74701ea Compare June 10, 2021 16:05
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

Please format the files with nixpkgs-fmt.

pkgs/applications/backup/timeshift/default.nix Outdated Show resolved Hide resolved
pkgs/applications/backup/timeshift/default.nix Outdated Show resolved Hide resolved
pkgs/applications/backup/timeshift/default.nix Outdated Show resolved Hide resolved
pkgs/applications/backup/timeshift/default.nix Outdated Show resolved Hide resolved
pkgs/applications/backup/timeshift/minimal.nix Outdated Show resolved Hide resolved
pkgs/applications/backup/timeshift/wrapper.nix Outdated Show resolved Hide resolved
pkgs/applications/backup/timeshift/wrapper.nix Outdated Show resolved Hide resolved
pkgs/applications/backup/timeshift/wrapper.nix Outdated Show resolved Hide resolved
pkgs/applications/backup/timeshift/wrapper.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
@ShamrockLee ShamrockLee force-pushed the timeshift branch 5 times, most recently from 4867d83 to 2741bc1 Compare November 10, 2021 05:19
@ShamrockLee ShamrockLee marked this pull request as ready for review November 10, 2021 16:40
@ShamrockLee ShamrockLee changed the title [WIP] timeshift: init at 20.11.1 timeshift: init at 20.11.1 Nov 10, 2021
@dotlambda
Copy link
Member

We might want to switch to https://github.com/linuxmint/timeshift.

@ShamrockLee ShamrockLee changed the title timeshift: init at 20.11.1 timeshift: init at 22.06.1 Jun 3, 2022
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

I am not super sure about all the wrapping and seperation but should be fine.

pkgs/applications/backup/timeshift/wrapper.nix Outdated Show resolved Hide resolved
pkgs/applications/backup/timeshift/wrapper.nix Outdated Show resolved Hide resolved
pkgs/applications/backup/timeshift/unwrapped.nix Outdated Show resolved Hide resolved
pkgs/applications/backup/timeshift/unwrapped.nix Outdated Show resolved Hide resolved
@ShamrockLee
Copy link
Contributor Author

@SuperSandro2000 There are quite a few changes regarding the postPatch phase. Please take a look before merging.

@SuperSandro2000 SuperSandro2000 merged commit 332ff38 into NixOS:master Jun 11, 2022
@ShamrockLee ShamrockLee deleted the timeshift branch June 11, 2022 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: timeshift (System restore tool for Linux)
3 participants