https://github.com/notashelf/nix-user-experiment
Experiments in hacking in support for linking files relative to user's $HOME without relying on Home-Manager
https://github.com/notashelf/nix-user-experiment
Last synced: 8 months ago
JSON representation
Experiments in hacking in support for linking files relative to user's $HOME without relying on Home-Manager
- Host: GitHub
- URL: https://github.com/notashelf/nix-user-experiment
- Owner: NotAShelf
- License: mit
- Created: 2024-11-25T01:14:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-25T01:17:52.000Z (over 1 year ago)
- Last Synced: 2025-01-21T20:48:32.903Z (over 1 year ago)
- Language: Nix
- Size: 11.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nix-user-experiment
Experiments in hacking in support for linking files relative to user's $HOME
without relying on Home-Manager.
Goals for this experiment is to create a
- First Party
- Robust
- Customizable
interface for replacing `home.file` in Home-Manager.
## Implementation
Currently duplicates nixpkgs' users module, with the addition of a `files`
submodule - copied from the `environment.etc` module.
The theoretical framework for the implementation is:
```nix
lib.mapAttrs' (_: {name, files, home, ...}: {
name = name;
value.rules = lib.map (rule:
lib.concatStringsSep " " [
"L+" # prepend "L+" to each string
rule.target
rule.mode
rule.user
rule.group
rule.source
]
) (lib.filter (f: f.enable) (lib.attrValues files));
}) (lib.filterAttrs (_: u: u.files != {}) config.uses.users)
```
## Notes
This is not production ready, it will not evaluate (due to an infinite
recursion) and even if it did I would discourage you from using it.
## License
Licensed under the MIT License, following upstream Nixpkgs. See
[LICENSE](LICENSE) for more details.