Skip to content

Instantly share code, notes, and snippets.

@573
Last active November 21, 2023 21:23
Show Gist options
  • Save 573/3f6152e28a4abfc6631ae0faa3ae9395 to your computer and use it in GitHub Desktop.
Save 573/3f6152e28a4abfc6631ae0faa3ae9395 to your computer and use it in GitHub Desktop.
.ignorelist for rsync of Nixos-WSL update ignorelist regularly

I.e. (follow-up nix-community/NixOS-WSL#340)

# admin pwsh: sc stop LxssManager
# shrink *.vhdx using diskpart: (Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | Where-Object { $_.GetValue("DistributionName") -eq 'NixOS' }).GetValue("BasePath") + "\ext4.vhdx"
# with result above in diskpart: select vdisk file="<result>" and then compact vdisk
# wsl -d NixOS  --user root -e /nix/var/nix/profiles/system/sw/bin/bash # --system parameter only available in M$ Store version for later refs one could do what's written here https://github.com/nix-community/NixOS-WSL#troubleshooting as soon as the store version runs again
# export PATH=/nix/var/nix/profiles/system/sw/bin/:$PATH
# nix-shell -p rsync
# rsync -aP --exclude-from=/mnt/c/temp/ignorelist /home/user/ /mnt/c/my-nixos-wsl-backup/

See discussion linked above for a fix.

When setting up my flake in the new Nixos-WSL instance I do smth along the lines of:

nix-channel --add https://github.com/nixos/nixpkgs/archive/refs/heads/nixos-23.05.tar.gz nixos-23.05
nix-channel --update
nix-shell -I nixpkgs=channel:nixos-23.05 -p git
git clone ...

But again https://gist.github.com/573/71249ff1c8cf02ad2f9474bbb0ffd0e2 might hit

nix --version nix (Nix) 2.13.5

So

$ nix-channel --add https://github.com/nixos/nixpkgs/archive/refs/heads/nixos-unstable.tar.gz nixos-unstable
$ nix-channel --update
this derivation will be built:
  /nix/store/cpaysgdaady821igj824v9nslnxij8ml-nixos-unstable.drv
building '/nix/store/cpaysgdaady821igj824v9nslnxij8ml-nixos-unstable.drv'...
unpacking channels...
$ nix-shell -I nixpkgs=channel:nixos-unstable -p nixVersions.unstable
$ nix --version
nix (Nix) 2.18.1
# rsync-homedir-excludes
#
# A list of files to exclude when backing up *nix home directories using rsync.
#
# Author: Ruben Barkow-Kuder <https://github.com/rubo77/rsync-homedir-excludes>
# Version: 2019-11-30
#
# #Usage:
# USER=<homedir username here>
# rsync -aP --exclude-from=rsync-homedir-excludes.txt /home/$USER/ /media/$USER/linuxbackup/home/$USER/
###############################################
# directories, probably not worth a backup #
# (uncomment the files you don't need) #
###############################################
#.android
#.AndroidStudio*/
#Android/Sdk
#.gradle
#.gvm
#.grails/
#.grails_history
#.kde/share/apps/nepomuk
#.local/share/notbit
#.local/libvirt
#.local/share/libvirt
#.vagrant
#.vagrant.d
#.wine
#.twister
#/twister
#Applications/eclipse*
#/Downloads
#*Popcorntime*
#/.aMule
#/Scribus
#/VirtualBox*
#.local/share/gnome-boxes/images
#/Nextcloud
#_build
#
## Ruby gems
#.rvm
#
## Add Game Folders here:
#
#/games
#.local/share/Steam
#.var/app/com.valvesoftware.Steam/.local/share/Steam
#.steam
#/Steam
#.minecraft
#.technic
#.PlayOnLinux
#.local/share/lutris/runners/wine/
#
## Spotify
#.config/spotify/Users
#.var/app/com.spotify.Client/config/spotify/Users
#
## those folders contain only temporary Videos I want to watch
#/Videos
#/Movies
#
## some history files
#.python_history
#.bash_history
#.zsh_history
#.mysql_history
#
## Python eggs
#.local/lib/python*
#
## Python virtual environments
#PycharmProjects/**/venv
#
## Maven local repository
#/.m2
#
## Unlocked Plasma Vaults
#/Vaults
## Docker
#.docker/machine
#.local/share/containers
################################################
# These directories may definitely be excluded #
################################################
# Contains mounted file systems:
.gvfs
.local/share/gvfs-metadata
# contains the actual encrypted home directory
/.Private
# Session-specific:
/.dbus
.cache
.var/app/*/cache
.var/app/*/.cache
/.Trash
.Trash-1*
.local/share/Trash
/Trash
# Cached info about audio CDs:
.cddb
# Cached packages lists:
.aptitude
# Node Package Manager cache
.npm
# Node Version Manager
.nvm
#Flash-specific:
# Cache for flash, maybe others?
.adobe
# except for Flash persistence, there is no reason to keep this
.macromedia
#Files:
# Contains errors from the current graphical session
.xsession-errors
.xsession-errors.old
.wayland-errors
# Recently used files
.local/share/RecentDocuments
.recently-used
.recently-used.xbel
recently-used.xbel
.thumbnails
.thumb
Thumbs.db
.DS_Store
.localised
.CFUserTextEncoding
.zcompdump*
.wget-hsts
# Common Unix Printing System
/.cups
# run-time configuration information for Subversion
/.subversion
# Python virtual environments
/.virtualenvs
# Session-specific
.Xauthority
.ICEauthority
.gksu.lock
.pulse
.pulse-cookie
.esd_auth
# Lock / Pid files
.VeraCrypt-lock-*
#KDE specific:
# Recent documents on KDE
.kde/share/apps/RecentDocuments
.kde4/share/apps/RecentDocuments
# Contains a history of the Klipper clipboard (KDE)
.kde/share/apps/klipper
.kde4/share/apps/klipper
.local/share/klipper
# You will loose saved scrolling positions of PDFs
.kde/share/apps/okular/docdata
.kde/share/apps/gwenview/recentfolders
.kde4/share/apps/okular/docdata
.kde4/share/apps/gwenview/recentfolders
.local/share/okular/docdata
.local/share/org.kde.gwenview/recentfolders
# Cached other users' profile pics
.kde/share/apps/kmess/displaypics
.kde4/share/apps/kmess/displaypics
# Cached emoticons of others
.kde/share/apps/kmess/customemoticons
.kde4/share/apps/kmess/customemoticons
#Gnome specific:
# tracker data files
.local/share/tracker
#Tor Browser supposed to not be backupped ;)
.local/share/torbrowser
#Firefox-specific (see also Profile folder):
.mozilla/firefox/*/Cache
# in case Fx crashes dumps will be stored in this
.mozilla/firefox/*/minidumps
# session-specific
.mozilla/firefox/*/.parentlock
# phishing database, recreated
.mozilla/firefox/*/urlclassifier3.sqlite
# blacklisted extensions
.mozilla/firefox/*/blocklist.xml
# extension database, recreated on startup
.mozilla/firefox/*/extensions.sqlite
.mozilla/firefox/*/extensions.sqlite-journal
.mozilla/firefox/*/extensions.rdf
.mozilla/firefox/*/extensions.ini
.mozilla/firefox/*/extensions.cache
# cached UI data, recreated
.mozilla/firefox/*/XUL.mfasl
.mozilla/firefox/*/XPC.mfasl
.mozilla/firefox/*/xpti.dat
.mozilla/firefox/*/compreg.dat
# cached plugin data, recreated
.mozilla/firefox/*/pluginreg.dat
#SeaMonkey-specific (see also Profile folder):
.mozilla/seamonkey/*/Cache
# in case Fx crashes dumps will be stored in this
.mozilla/seamonkey/*/minidumps
# session-specific
.mozilla/seamonkey/*/.parentlock
# blacklisted extensions
.mozilla/seamonkey/*/blocklist.xml
# extension database, recreated on startup
.mozilla/seamonkey/*/extensions.sqlite
.mozilla/seamonkey/*/extensions.rdf
.mozilla/seamonkey/*/extensions.ini
# cached UI data, recreated
.mozilla/seamonkey/*/xpti.dat
.mozilla/seamonkey/*/compreg.dat
# cached plugin data, recreated
.mozilla/seamonkey/*/pluginreg.dat
# Thunderbird Cache in your profile folder
.thunderbird/*/Cache
#Opera-specific (related question on Superuser.com: Is documentation available on files and directories in the Opera profile folder?):
.opera/temporary_downloads
.opera/cache
.opera/thumbnails
.opera/opcache
.opera/icons
.opera/application_cache
.opera/widgets/*/cache
.opera/lock
# Keychain dir (manage SSH and GPG keys, front-end to ssh-agent and ssh-add)
/.keychain
#Komodo Edit:
.komodoedit/*/codeintel/db
.komodoedit/*/host-*/*/codeintel
.komodoedit/*/XRE/Cache
.komodoedit/*/XRE/.activatestate/komodo edit/Crash Reports
.komodoedit/*/XRE/.activatestate/komodo edit/*/Cache
.komodoedit/*/XRE/.activatestate/komodo edit/*/minidump
.komodoedit/*/XRE/.parentlock
.komodoedit/*/XRE/extensions.rdf
.komodoedit/*/XRE/extensions.ini
.komodoedit/*/XRE/extensions.cache
.komodoedit/*/XRE/XPC.mfasl
.komodoedit/*/XRE/XUL.mfasl
.komodoedit/*/XRE/xpti.dat
.komodoedit/*/XRE/pluginreg.dat
.komodoedit/*/XRE/compreg.dat
.komodoedit/*/XRE/*.sqlite-journal
.komodoedit/*/pystdout.log
.komodoedit/*/pystderr.log
.komodoedit/*/history.sqlite.bak
.komodoedit/*/running.lock
.komodoedit/*/mutex.lock
.komodoedit/*/*.xmlc
.komodoedit/*/startup-env.tmp
.komodoedit/*/commandments.fifo
.komodoedit/*/history.sqlite
#GnuPG:
.gnupg/rnd
.gnupg/random_seed
.gnupg/.#*
.gnupg/*.lock
.gnupg/gpg-agent-info-*
#Google Earth:
.googleearth/Temp
.googleearth/Cache
#Google Chrome:
.config/google-chrome/ShaderCache
.config/google-chrome/*/Local Storage
.config/google-chrome/*/Session Storage
.config/google-chrome/*/Application Cache
.config/google-chrome/*/History Index *
.config/google-chrome/*/Service Worker/CacheStorage
#Chromium:
.config/chromium/*/Local Storage
.config/chromium/*/Session Storage
.config/chromium/*/Service Worker/CacheStorage
.config/chromium/*/Application Cache
.config/chromium/*/History Index *
/snap/chromium/common/.cache
/snap/chromium/*/.config/chromium/*/Service Worker/CacheStorage
/snap/chromium/*/.local/share/
#Riot
/snap/riot-web/
#Brave
.config/BraveSoftware/Brave-Browser/*/Feature Engagement Tracker/
.config/BraveSoftware/Brave-Browser/*/Local Storage/
.config/BraveSoftware/Brave-Browser/*/Service Worker/CacheStorage/
.config/BraveSoftware/Brave-Browser/*/Session Storage/
.config/BraveSoftware/Brave-Browser/Safe Browsing/
.config/BraveSoftware/Brave-Browser/ShaderCache/
#Local repositories:
.gradle/caches
/.m2/repository
#indexer
.local/share/baloo
.local/share/zeitgeist
.local/share/akonadi
#Other apps:
# Pidgin
.purple/icons
# Cached applets
.guayadeque/cache.db
.java/deployment/cache
.icedteaplugin
.icedtea
.gnome2/epiphany/favicon_cache
# other temporary files
nohup.out
# LibreOffice cache files
.config/libreoffice/4/cache
# freshplayerplugin LSO
.config/freshwrapper-data/Shockwave Flash/WritableRoot/#SharedObjects
# Snap caches
.config/*/Cache
# Atom
.config/Atom/*Cache
.config/Atom/IndexedDB
.atom/compile-cache/
# Vim
.vim/bundle/*
.viminfo
# VS Code
.vscode-oss/extensions/*
.vscode/extensions/*
.config/Code - OSS/logs/
.config/Code/logs/
.config/Code/CachedData/*
# VS Codium
.config/VSCodium/CachedExtensionVSIXs
# VirtualBox
.config/VirtualBox/VBoxSVC.log*
.config/VirtualBox/VBoxGuestAdditions_*
# Rust artefacts
.cargo
.rustup
# Erlang artefacts
.kerl
# golang Cache
go/pkg/mod/cache
# ccache, remove cache but keep config
.ccache/?
.ccache/tmp
# Nvidia OpenGL Shader Cache
.nv/GLCache
# Citrix ICA Client
.ICAClient/logs
.ICAClient/.tmp
.ICAClient/cache/zlcache
# Geany IDE - socket file
.config/geany/geany_socket_*
# LBRY
.config/lbry
.local/share/lbry/lbrynet
# Electron Apps
.config/**/blob_storage
.config/**/Application Cache
.config/**/Cache
.config/**/CachedData
.config/**/Code Cache
.config/**/GPUCache
.config/**/Service Worker/CacheStorage
.var/app/**/blob_storage
.var/app/**/Application Cache
.var/app/**/Cache
.var/app/**/CachedData
.var/app/**/Code Cache
.var/app/**/GPUCache
.var/app/**/Service Worker/CacheStorage
# SC-Controller - socket file
.config/scc/daemon.socket
.local/share/containers
.local/share/docker
.local/share/fff/trash
WSL2-Linux-Kernel-2/source
WSL2-Linux-Kernel
nixpkgs-staging
.config/discord
.android
.bun
.bundle
.clojure
.conda
.dbus-keyrings
.eclipse
.emacs.d
.ghc
.github-runner
.gnupg
.gradle
.ihaskell
.ipy*
.java
.julia
.jupyter
.keras
.lein
.local/share
.mozilla
.mypy_cache
.nix-defexpr
.opam
.parallel
.pki
.pub-cache
.simplex
.ssh
.talon
.texlive*
.tldrc
.vim
.w3m
.yarn
DiagonBuild/_deps
*/target/*/build
*/target/*/deps
*/target/debug
*/target/*/release
*/target/release
*/venv/*/site-packages
*/.devenv/state
*/_diag
elm-pages*
elsa-js-engine-course
hledger
lamdu
micromamba
my-nix
myjupyterlabapp
org-web
*/node_modules
*.qcow2
simplex-chat
smos
static-haskell-nix
yay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment