Compare commits

..

4 Commits

6 changed files with 51 additions and 91 deletions

32
dots/.bin/bak Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# back up a file by copying it to a new file with a .bak extension
# reference: https://askubuntu.com/questions/962489/is-there-any-way-to-create-backup-copy-of-a-file-without-type-its-name-twice
usage() {
echo "Usage: bak [-t|--timestamp] <file to back up>"
exit 1
}
timestamp=false
while [[ $# -gt 0 ]]; do
case $1 in
-t|--timestamp)
timestamp=true
shift
;;
*)
break
;;
esac
done
[ $# -eq 1 ] || usage
if $timestamp; then
date="$(date +%Y-%m-%d_%H-%M-%S)"
cp -vpn "$1"{,."$date".bak}
else
cp -vpn "$1"{,.bak}
fi

View File

@@ -1,26 +0,0 @@
#!/usr/bin/env bash
# Back up my $HOME folder to OneDrive using `restic`.
#
# Adds extra flags needed for using `rclone` with sharepoint WebDav I.e. add
# `--ignore-size --ignore-checksum --update` to the default `rclone.args`.
#
# Select directory in repo using -r rclone:<repo>:<directory>
#
# Runs `backup` command on $HOME and ignore what is listed in `.resticexclude`
#
# ```/etc/restic-env
# export B2_ACCOUNT_ID=
# export B2_ACCOUNT_KEY=
# ```
#
# `restic -r b2:desktop-arch init`
source /etc/restic-env
restic -r "$RESTIC_REPOSITORY:$HOSTNAME" backup \
--tag "hektor" \
--one-file-system \
--files-from="$HOME/.resticinclude" \
--exclude-file="$HOME/.resticexclude" \
--exclude-if-present=".nobackup" \
--verbose=3

View File

@@ -1,44 +0,0 @@
# Restic ignore
# General
.trash
Trash
.cache
cache
Cache
CachedData
CachedExtension
CacheStorage
__pycache__
GPUCache
ShaderCache
build
.git
node_modules
venv
env
# Specifics
$HOME/.android
$HOME/.atom
$HOME/.build
$HOME/.cabal
$HOME/.cargo
$HOME/.conda
$HOME/.config/BraveSoftware/Brave-Browser/Default/Local Storage
$HOME/.config/BraveSoftware/Brave-Browser/Default/Local Extension Settings
$HOME/.config/nvm/versions
$HOME/.config/devcert
$HOME/.espressif
$HOME/.local/share/torbrowser
$HOME/.mozilla
$HOME/.nvm
$HOME/.npm
$HOME/.nuget
$HOME/.yarn
$HOME/.config/yarn
$HOME/doc/disk-images
$HOME/.stremio-server
$HOME/Games
!$HOME/Games/*/drive_c/users/h/AppData
!$HOME/Games/rhino

View File

@@ -1,3 +0,0 @@
/etc
/boot
/home

36
flake.lock generated
View File

@@ -53,11 +53,11 @@
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1770177820,
"narHash": "sha256-0iGDl/ct3rW+h6+sLq4RZaze/U/aQo2L5sLLuyjuVTk=",
"lastModified": 1771041825,
"narHash": "sha256-O+wN3O4yXWsNZBS7qG32fg0UnecVzDAr3aQNz/nT38s=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "c7794d3f46304de5234008c31b5b28a9d5709184",
"rev": "03e6c3789a1952bd68837ff1d358375b953d35e8",
"type": "gitlab"
},
"original": {
@@ -163,11 +163,11 @@
]
},
"locked": {
"lastModified": 1769939035,
"narHash": "sha256-Fok2AmefgVA0+eprw2NDwqKkPGEI5wvR+twiZagBvrg=",
"lastModified": 1770726378,
"narHash": "sha256-kck+vIbGOaM/dHea7aTBxdFYpeUl/jHOy5W3eyRvVx8=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "a8ca480175326551d6c4121498316261cbb5b260",
"rev": "5eaaedde414f6eb1aea8b8525c466dc37bba95ae",
"type": "github"
},
"original": {
@@ -204,11 +204,11 @@
]
},
"locked": {
"lastModified": 1770263241,
"narHash": "sha256-R1WFtIvp38hS9x63dnijdJw1KyIiy30KGea6e6N7LHs=",
"lastModified": 1771037579,
"narHash": "sha256-NX5XuhGcsmk0oEII2PEtMRgvh2KaAv3/WWQsOpxAgR4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "04e5203db66417d548ae1ff188a9f591836dfaa7",
"rev": "05e6dc0f6ed936f918cb6f0f21f1dad1e4c53150",
"type": "github"
},
"original": {
@@ -364,11 +364,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1769302137,
"narHash": "sha256-QEDtctEkOsbx8nlFh4yqPEOtr4tif6KTqWwJ37IM2ds=",
"lastModified": 1770882871,
"narHash": "sha256-nw5g+xl3veea+maxJ2/81tMEA/rPq9aF1H5XF35X+OE=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "a351494b0e35fd7c0b7a1aae82f0afddf4907aa8",
"rev": "af04cb78aa85b2a4d1c15fc7270347e0d0eda97b",
"type": "github"
},
"original": {
@@ -380,11 +380,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1770197578,
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=",
"lastModified": 1771008912,
"narHash": "sha256-gf2AmWVTs8lEq7z/3ZAsgnZDhWIckkb+ZnAo5RzSxJg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2",
"rev": "a82ccc39b39b621151d6732718e3e250109076fa",
"type": "github"
},
"original": {
@@ -672,11 +672,11 @@
]
},
"locked": {
"lastModified": 1770145881,
"narHash": "sha256-ktjWTq+D5MTXQcL9N6cDZXUf9kX8JBLLBLT0ZyOTSYY=",
"lastModified": 1770683991,
"narHash": "sha256-xVfPvXDf9QN3Eh9dV+Lw6IkWG42KSuQ1u2260HKvpnc=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "17eea6f3816ba6568b8c81db8a4e6ca438b30b7c",
"rev": "8b89f44c2cc4581e402111d928869fe7ba9f7033",
"type": "github"
},
"original": {

View File

@@ -11,6 +11,7 @@ let
in
{
imports = [
../../modules/ai-tools.nix
../../modules/cloud
../../modules/comms
../../modules/desktop/niri