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

shells: fix a lot of logic and use activation scripts

This commit is contained in:
RGBCube 2025-07-26 00:05:57 +03:00
parent e759456954
commit f673d73cd2
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M
5 changed files with 165 additions and 132 deletions

View file

@ -1,9 +1,15 @@
{ config, lib, pkgs, ... }: let
inherit (lib) concatStringsSep;
inherit (lib) concatStringsSep const flatten getAttr mapAttrsToList unique;
in {
users.defaultUserShell = pkgs.crash;
environment.sessionVariables.SHELLS = config.shellsByPriority
|> map (drv: "${drv}${drv.shellPath}")
|> concatStringsSep ":";
# TODO: This should be a per-user session variable. But we can't set
# a home-manager session variable because that's initialized by the
# shell itself! Lol.
environment.sessionVariables.SHELLS = config.home-manager.users
|> mapAttrsToList (const <| getAttr "shellsByPriority")
|> flatten
|> map (drv: "${drv}${drv.shellPath}")
|> unique
|> concatStringsSep ":";
}