at 17.09-beta 1.1 kB view raw
1# This module defines global configuration for the xonsh. 2 3{ config, lib, pkgs, ... }: 4 5with lib; 6 7let 8 9 cfge = config.environment; 10 11 cfg = config.programs.xonsh; 12 13in 14 15{ 16 17 options = { 18 19 programs.xonsh = { 20 21 enable = mkOption { 22 default = false; 23 description = '' 24 Whether to configure xnosh as an interactive shell. 25 ''; 26 type = types.bool; 27 }; 28 29 package = mkOption { 30 type = types.package; 31 example = literalExample "pkgs.xonsh.override { configFile = \"/path/to/xonshrc\"; }"; 32 description = '' 33 xonsh package to use. 34 ''; 35 }; 36 37 config = mkOption { 38 default = ""; 39 description = "Control file to customize your shell behavior."; 40 type = types.lines; 41 }; 42 43 }; 44 45 }; 46 47 config = mkIf cfg.enable { 48 49 environment.etc."xonshrc".text = cfg.config; 50 51 environment.systemPackages = [ pkgs.xonsh ]; 52 53 environment.shells = 54 [ "/run/current-system/sw/bin/xonsh" 55 "/var/run/current-system/sw/bin/xonsh" 56 "${pkgs.xonsh}/bin/xonsh" 57 ]; 58 59 }; 60 61} 62