toothbrush / dotfs

DotFS allows per-host configuration by providing dotfiles on a virtual FS.
http://hackage.haskell.org/package/dotfs
BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

static generation of config files #17

Open mklinik opened 12 years ago

mklinik commented 12 years ago

Would it be possible to add a command line option to statically generate copies of the dotfiles in the mountpoint directory instead of using fuse? This way dotfs could be used on cygwin, for example. Or even MS Windows (shudder)

dotfs --static confdir mountpoint
toothbrush commented 12 years ago

I always assumed this was unnecessary since you could mount, cp -R and kill dotfs, but you're right, this is a valid usecase. Would involve a bit more coding, but why not. Maybe the FUSE dependency could even be turned off for Windows users in favour of this static mode. Seems a little tedious to use this way; make a change, regenerate, etc, as opposed to the live-view normally provided, but why not.

On Mon, Apr 23, 2012 at 06:43:05 -0700, quoth Markus Klinik:

Would it be possible to add a command line option to statically generate copies of the dotfiles in the mountpoint directory instead of using fuse? This way dotfs could be used on cygwin, for example. Or even MS Windows (shudder)

dotfs --static confdir mountpoint

Reply to this email directly or view it on GitHub: https://github.com/toothbrush/dotfs/issues/17

mklinik commented 12 years ago

Just to let you know, I'm implementing this feature. It's fairly easy. Basically just readFile >>= process >>= writeFile combined with a directory tree walker. The hardest part is writing a cabal file that works when fuse is not available. I think I finally have to read the cabal documentation instead of just copying stuff from other people's projects ;)

toothbrush commented 12 years ago

Haha, yeah, cabal can be a bit byzantyne. Thanks! This could be quite useful, especially since it turns out HFuse is broken on newer versions of OS X...

On Tue, Apr 24, 2012 at 22:03:10 -0700, quoth Markus Klinik:

Just to let you know, I'm implementing this feature. It's fairly easy. Basically just readFile >>= process >>= writeFile combined with a directory tree walker. The hardest part is writing a cabal file that works when fuse is not available. I think I finally have to read the cabal documentation instead of just copying stuff from other people's projects ;)


Reply to this email directly or view it on GitHub: https://github.com/toothbrush/dotfs/issues/17#issuecomment-5324437

toothbrush commented 12 years ago

Okay, another thought. One of the potential problems is programs (thinking of emacs here, and the .emacs file) perform a writeback of settings. It would be really nice if there was a way to see what has been changed relative to the processed config file as it stands in the repo. Otherwise, next time you do a static generation of files it'll just get lost. Thinking aloud here: how about a dotfs --diff confdir outputpoint which could do the following:

for each config in the confdir:
    processed <- write file /tmp/processed-conf-{original name}
    diff {outputpoint} {processed}
mklinik commented 12 years ago

Hi, can you please check out my branch 'static' and try if the cabal file works on OSX when hfuse is not installed?

On Linux, using cabal configure -f-fuse to disable fuse works fine.

I will try if it works on Windows on Monday, and then file a pull request.

mklinik commented 12 years ago

I also implemented diff mode. See https://github.com/mklinik/dotfs/tree/diffmode. But for some reason it is incredibly slow. Do you have experience with haskell profiling?