~ruther/nixos-config

ref: 2d155643bad02a834884b2a4264ba3177c52ca5d nixos-config/home/modules/sessions/default-hm-impl.nix -rw-r--r-- 728 bytes
2d155643 — Frantisek Bohacek feat: add spicetify 1 year, 5 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;
  };

}