-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos: Refactor and implement support for user files + directories #70
Conversation
Implement support for a submodule representation for files and directories. Strings are automatically converted to appropriate submodule representations and each file and directory is handled based only on their respective submodule's attributes. This means that for most files, a string will suffice, but if more advanced options need to be set for the specific files or directories, a submodule can be used instead. It also, arguably, simplifies the implementation a bit.
4061141
to
e12c1c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great! I'm using this branch for now at least on one system :)
Allow user files and directories to be specified as follows: environment.persistence."/persistent" = { users.talyz = { files = [ ".screenrc" ]; directories = [ "Downloads" ]; }; }; This provides an alternative to the home-manager module and may even deprecate it in the future.
Allow the owner and mode to be set when directories are created in persistent storage by the `create-directories.bash` script. Very useful for directories used to store secrets. Also, make sure the user directories are created with reasonable defaults, i.e. owned by the user and its group, not by `root:root`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this landed :D
Ah, this causes an eval failure if you import the module put don't use it: https://github.com/lovesegfault/nix-config/runs/5011183485?check_suite_focus=true |
An overhaul of the current NixOS module which adds a
users
feature, makes the module more extensible, adds permissions handling, and asserts that no duplicates are specified:Implement support for user files and directories
Allow user files and directories to be specified as follows:
This provides an alternative to the home-manager module and may even deprecate it in the future.
Refactor the module to simplify future extensibility
Implement support for a submodule representation for files and directories. Strings are automatically converted to appropriate submodule representations and each file and directory is handled based only on their respective submodule's attributes. This means that for most files, a string will suffice, but if more advanced options need to be set for the specific files or directories, a submodule can be used instead. It also, arguably, simplifies the implementation a bit.
Add support for custom permissions on created directories
Building on the extensibility mentioned above, allow the owner and mode to be set when directories are created in persistent storage by the
create-directories.bash
script. Very useful for directories used to store secrets.Also, make sure the user directories are created with reasonable defaults, i.e. owned by the user and its group, not by
root:root
.Here is an example of this in use:
Assert that no duplicate files or directories are specified
Make sure the same files or directories aren't specified multiple times, either between persistent storage paths or in the same path.