at 18.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 cfg = config.programs.xonsh; 10 11in 12 13{ 14 15 options = { 16 17 programs.xonsh = { 18 19 enable = mkOption { 20 default = false; 21 description = '' 22 Whether to configure xonsh as an interactive shell. 23 ''; 24 type = types.bool; 25 }; 26 27 package = mkOption { 28 type = types.package; 29 example = literalExample "pkgs.xonsh.override { configFile = \"/path/to/xonshrc\"; }"; 30 description = '' 31 xonsh package to use. 32 ''; 33 }; 34 35 config = mkOption { 36 default = ""; 37 description = "Control file to customize your shell behavior."; 38 type = types.lines; 39 }; 40 41 }; 42 43 }; 44 45 config = mkIf cfg.enable { 46 47 environment.etc."xonshrc".text = cfg.config; 48 49 environment.systemPackages = [ pkgs.xonsh ]; 50 51 environment.shells = 52 [ "/run/current-system/sw/bin/xonsh" 53 "/var/run/current-system/sw/bin/xonsh" 54 "${pkgs.xonsh}/bin/xonsh" 55 ]; 56 57 }; 58 59} 60