~ruther/nixos-config

ref: a1128e507b85a32d4a700727c24d11151284a954 nixos-config/home/modules/sessions/default-hm-impl.nix -rw-r--r-- 728 bytes
a1128e50 — Frantisek Bohacek feat(home): add desktop session startup options 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{ config, lib, ... }:

let
  cfg = config.desktopSessions;
in {
  options.desktopSessions.autoStart = {
    enableBashIntegration = lib.mkEnableOption "enable bash integration to .profile" // { default = true; };
    enableZshIntegration = lib.mkEnableOption "enable zsh integration to .zprofile" // { default = true; };
  };

  config = lib.mkIf (cfg.enable) {
    programs.zsh.profileExtra = lib.optionalString (cfg.autoStart.enable && cfg.autoStart.enableZshIntegration) cfg.autoStart.profileSelectContent;
    programs.bash.profileExtra = lib.optionalString (cfg.autoStart.enable && cfg.autoStart.enableBashIntegration) cfg.autoStart.profileSelectContent;

    home.file.".start-session".source = cfg.selectSession;
  };

}
Do not follow this link