Closed llakala closed 3 weeks ago
For an overengineered example, this one is awesome: https://github.com/Gerschtli/nix-config/blob/fe9549e6e398c0c35bf22bd29a6ecb92ba19e7de/flake.nix
Done, with huge thanks to @MattSturgeon for having a wonderful resource with guessUsername and guessHostname.
After redoing the functions to be simpler, they end up resulting in a usage like this:
The repetition of the hostname here is a bit silly. Ideally, it would create the hostname without the need to over-specify it.
Potential references: https://github.com/lilyb01/dotfiles/blob/526532e2193dec53f610cfbbadd9e5aeb746fa82/hosts/flake-module.nix#L6 https://github.com/Harmos274/nixfiles/blob/d00481cbf47225c8c0b981c8d73ab7e202de2c5b/lib/default.nix https://github.com/Goxore/nixconf/blob/22d969809cbfdad01133d5bbafa47617d0427c24/myLib/default.nix#L26
Also, searching things like
mkHost
,mkSystem
,mkNixos
,mkHome
, etc on Github would probably give other helpful examples.