devos/profiles
2021-04-28 22:04:34 +02:00
..
amd Format files 2021-04-06 20:59:09 +02:00
bluetooth Init 2021-04-06 13:37:40 +02:00
core Add comma 2021-04-20 08:10:58 +02:00
develop Add podman and docker 2021-04-28 11:16:17 +02:00
flatpak a 2021-04-09 19:51:39 +02:00
game Add mumble 2021-04-20 08:10:41 +02:00
hosts_block add a temp hosts block 2021-04-15 14:44:23 +02:00
laptop Format files 2021-04-06 20:59:09 +02:00
networkmanager Init 2021-04-06 13:37:40 +02:00
print Init 2021-04-06 13:37:40 +02:00
pwn replace r2 with rz 2021-04-15 19:27:15 +02:00
school Refactor configs 2021-04-11 18:04:01 +02:00
ssh Init 2021-04-06 13:37:40 +02:00
sway Refactor configs 2021-04-11 18:04:01 +02:00
three_dee Refactor configs 2021-04-11 18:04:01 +02:00
tor Add tor 2021-04-25 23:43:46 +02:00
torrents a 2021-04-09 19:51:39 +02:00
workstation Add gvfs 2021-04-28 11:16:08 +02:00
README.md treewide cleanups and refactoring for initial tests (#157) 2021-03-14 07:10:51 +00:00

Profiles

Profiles are a convenient shorthand for the definition of options in contrast to their declaration. They're built into the NixOS module system for a reason: to elegantly provide a clear separation of concerns.

If you need guidance, a community branch is maintained to help get up to speed on their usage.

Constraints

For the sake of consistency, a profile should always be defined in a default.nix containing a nixos module config. A profile's directory is used for quick modularization of interelated bits.

Notes:
  • For declaring module options, there's the modules directory.
  • This directory takes inspiration from upstream .
  • Sticking to a simple spec has refreshing advantages. hercules-ci expects all profiles to be defined in a default.nix, allowing them to be built automatically when added. Congruently, suites expect default.nix to avoid having to manage their paths manually.

Subprofiles

Profiles can also define subprofiles. They follow the same constraints outlined above. A good top level profile should be a high level concern, such as your personal development environment while the subprofiles should be more focused program configurations such as your text editor, and shell configs. This way, you can either pull in the whole development profile, or pick and choose individual programs.

Example

profiles/develop/default.nix:

{
  imports = [ ./zsh ];
  # some generic development concerns ...
}

profiles/develop/zsh/default.nix:

{  ... }:
{
  programs.zsh.enable = true;
  # zsh specific options ...
}

Conclusion

Profiles are the most important concept in DevOS. They allow us to keep our Nix expressions self contained and modular. This way we can maximize reuse across hosts while minimizing boilerplate. Remember, anything machine specific belongs in your host files instead.