system-manager
system-manager copied to clipboard
Use default config dir
This PR makes the --flake flag optional and uses /etc/system-manager as the default configuration dir. This brings it inline with home-manager switch and nixos-rebuild switch which also use a default dir. This will not be a breaking change for users who are using an alternate location since the --flake flag will still work.
Additionally, this adds an init subcommand which initializes this directory in the default location (or can be manually specified). It will use the example flake.nix provided in the README.md file to create the flake.
If you're okay with these changes, I'll also update the docs to include an example of how to use this.
Thanks.
@r-vdp, I just saw your comment on https://github.com/numtide/system-manager/pull/84#issuecomment-2068733989.
I think this PR is going to fall afoul of your recommendation there since I chose to put the flake in /etc and will need root permissions to run there. However, I think this is the right place for this file for the following reasons:
- The user needs to be
rootin order to use system-manager - This tool is a system-wide tool and
/etcis a common place for system-level configuration files
If you disagree, I can change the default directory to $XDG_CONFIG_HOME/system-manager.
Hi @mike-lloyd03, thank you so much for your contribution, and I'm sorry that it took me so long to get back to you on this.
I think my main gripe with this, is indeed the default, since I am not convinced that either option (/etc/system-manager or $XDG_CONFIG_HOME) is really a good option.
How about we drop the default and we still require people to be explicit about the location of their flake, but we add the init command to make it easier to get started? Do you think that that's a reasonable compromise?
Those who really don't want to type this everytime, can then just create an alias in their shell to always set the default to their preferred value.
Let me know what you think!