1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-28 02:27:44 +00:00

shells: init

This commit is contained in:
RGBCube 2025-07-19 21:01:54 +03:00
parent 4a90dba591
commit 5a699752fd
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M
11 changed files with 99 additions and 55 deletions

View file

@ -0,0 +1,21 @@
{ config, lib, ... }: let
inherit (lib) attrsToList catAttrs mkConst mkIf mkValue sortOn toInt;
in {
options.shells = mkValue {};
options.shellsByPriority = mkConst (config.shells
|> attrsToList
|> sortOn ({ name, ... }: toInt name)
|> catAttrs "value");
config = mkIf config.isDarwin {
environment.shells = config.shellsByPriority;
};
# More at modules/linux/shell/default.nix.
#
# Can't put that here with an optionalAttributes
# becuase of an infinite recursion error, and can't
# do that with a mkIf because the nix-darwin module
# system doesn't have those attributes.
}