nixos: init programs.xonsh

+63
+1
nixos/modules/module-list.nix
··· 84 84 ./programs/venus.nix 85 85 ./programs/wvdial.nix 86 86 ./programs/xfs_quota.nix 87 + ./programs/xonsh.nix 87 88 ./programs/zsh/zsh.nix 88 89 ./rename.nix 89 90 ./security/acme.nix
+62
nixos/modules/programs/xonsh.nix
··· 1 + # This module defines global configuration for the xonsh. 2 + 3 + { config, lib, pkgs, ... }: 4 + 5 + with lib; 6 + 7 + let 8 + 9 + cfge = config.environment; 10 + 11 + cfg = config.programs.xonsh; 12 + 13 + in 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 +