mirror of
https://github.com/RGBCube/ncc
synced 2025-07-28 02:27:44 +00:00
shells: init
This commit is contained in:
parent
4a90dba591
commit
5a699752fd
11 changed files with 99 additions and 55 deletions
21
modules/common/shell/default.nix
Normal file
21
modules/common/shell/default.nix
Normal 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.
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue