Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on sh.itjust.works

57 replies

feddit.de

That's why you put your config files in a git repository

68

What do you mean? My NixOS config files are in a git repository

8
d_k_boreply
feddit.de

No. I only set up /etc/fstab and /etc/ssh/sshd_config once and they will never change.

6
lemmy.ca

Package manager: This package contains an updated sshd_config file, would you like to replace your existing file with the package maintainer's updated file?

Me, every time: LOL, no

9

Shit, thanks for reminding me. I needed to take care of some pacdiff files

3
exureply
feditown.com

Yes. I use a hacky script to copy them to the right place

6
digdugreply
kbin.social

You could set up btrfs snapshots, too. Of course, don't forget to take a snapshot before you break your configs.

4
ludreply
lemm.ee

Wouldn't you need to use btrfs for that?

How well does btrfs work with full disk encryption?

1

Works great on my laptop. It takes automatic snapshots before and after running the package manager, no problem so far.

2

Evolution:

  • config.json
  • config.json.bak
  • config.json.bak.old
  • config.json.bak.old2
  • config.json.bak.old3.stillworks
  • config.json.bak.old3.stillworks.DONTUSETHIS
  • config.json_(redownloaded_from_source)
36

Sigh...

git revert HEAD
echo \*.json.\* >> .gitignore
git commit
7
  • config.json.almost
  • config.json.broken
  • config.json.shouldwork
5
lemm.ee

/usr/share/bin/notporn/seriously/definitelynotporn

9
programming.dev

Speaking of which, nowadays KDE hides files with these extensions for some reason

9
Johannoreply
feddit.de

Rename to .old

Bam file is gone.

??? Confused look.

The heck?

Ctrl + h

Oh there it is!

7
sh.itjust.works

I absolutely despise the idea of "hidden" files. I don't understand the purpose of not showing them.

2

It's useful to hide clutter. It's easier to look at the file you care about when the file~, file.old, .file.swp, #file#, file,v, etc. aren't in the way.

2
lemmy.ca

An old manager of mine's backup solution was a cronjob that appended .old to every file then made a copy of the most recent one. So he had: file, file.old, file.old.old, file.old.old.old, ...

8

Ah, yes, I also add dates sometimes, very helpful 👍.

And then wonder "wtf did I change them 🤔".

Config files need git nowadays.

2
lemmy.world

Is there a tool to version your configs? I use chezmoi for my dotfiles but that doesn't help system configs

7
lemmy.world

I like adding a backup function to .profile that can take a file or list of files as an argument and make a copy with a date suffix on the file name, and same date additional backups just add a character like ~ at the end. It's in version control, but if I'm testing a change it's just faster to restore the file from a copy in the same place.

5

i so agree. i have a script that copies all file arguments into the directory .backups/YYYY-mm-DD-HHMM/ ... handy for risky git operations too.

3

Obligatory note that /etc/profile and ~/.profile are only run by login shells, and many terminal emulators do not execute a login shell by default.

Unfortunately, there is no standard secondary place* that all shells execute, so check your chosen shell's manual for what it does run on startup and put your functions into one of those. Preferably one that goes in your homedir.

Alternatively have that file source ~/.profile assuming that won't cause an infinite loop.

* And not even a primary if you count *csh, but if you use those you have other problems.

2
lemmy.world

*~

But you should really have a backup system. And often you should have a version control system too.

3

Use etc-keeper, saves everything in a git repo and integrates with a bunch of package managers. Been using it for decades it feels like now.

4
lemmy.world

Bet the world would be a happier place if we had cartoon physics

3

People here really hate our distro for some reason. Isn't it just Arch with extra steps (and all the configs in one file)? Everyone likes Arch! The definition of Arch is extra steps!

1