You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add some way to create literal files (not just symlinks to files). This might be achievable by adding "home.file.<name>.mode", like environment.etc does for it's files. Where the default value is "symlink" but if you set to to, for example 700. Then it would just create a file with said permission (700).
Why?
This would be nice to have for files that programs feel a need to write to, but you need some default value/text, and you don't want to save the programs changes. You cant just use .source = (mkOutOfStoreSymlink "your-config/some-file"). Since this would propegate the changes that the program does to your config.
An example of where this would be nice is Vesktop. Where .config/vesktop/state.json has to have the field "firstLaunch" to avoid the welcome / initial config screen. But Vesktop writes to this file to save some other stuff like window pos/size etc. So id like to avoid having those changes show in my config since it dirties the git history.
The alternative is something like this:
# vesktop checks if state.json has the "firstLaunch" to
# determin if it should show the "Welcome to vesktop" page
home.activation = {
# We have to do it like this since vesktop needs be able to
# write to it (a symlink to the store would have been unwritabe)
# If vesktop cant write to it then it chrashes
createVesktiopStateJson = let
state_path = "~/.config/vesktop/state.json";
data = builtins.toJSON {
# (the other setting dont matter)
firstLaunch = false; # the value of this is ignored lol
};
in
lib.hm.dag.entryAfter ["linkGeneration"] ''
echo '${data}' > ${state_path}
'';
};
The text was updated successfully, but these errors were encountered:
Description
Add some way to create literal files (not just symlinks to files). This might be achievable by adding "home.file.<name>.mode", like environment.etc does for it's files. Where the default value is "symlink" but if you set to to, for example 700. Then it would just create a file with said permission (700).
Why?
This would be nice to have for files that programs feel a need to write to, but you need some default value/text, and you don't want to save the programs changes. You cant just use .source = (mkOutOfStoreSymlink "your-config/some-file"). Since this would propegate the changes that the program does to your config.
An example of where this would be nice is Vesktop. Where .config/vesktop/state.json has to have the field "firstLaunch" to avoid the welcome / initial config screen. But Vesktop writes to this file to save some other stuff like window pos/size etc. So id like to avoid having those changes show in my config since it dirties the git history.
The alternative is something like this:
The text was updated successfully, but these errors were encountered: