DEVELOPMENT ENVIRONMENT

~liljamo/nix-arta

ref: 86fcb09e403d23b03f3587e76c0f19f76ae2872d nix-arta/ws/roles/shell/default.nix -rw-r--r-- 1.8 KiB
86fcb09eJonni Liljamo feat(lxc): update authelia config 8 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
  config,
  lib,
  pkgs,
  ...
}: let
  cfg = config.roles.shell;
in {
  options.roles.shell = {
    enable = lib.mkEnableOption "an opnionated shell environment";
  };

  config = lib.mkIf cfg.enable {
    environment.systemPackages = with pkgs; [
      elvish

      ripgrep
      fd

      btop

      sl

      silicon
    ];
    programs.direnv = {
      enable = true;
      nix-direnv.enable = true;
      silent = true;
    };
    hm = {
      home.file = {
        ".config/elvish/lib/direnv.elv" = {
          executable = true;
          source = ./direnv.elv;
        };
        ".config/elvish/rc.elv" = {
          executable = true;
          text = ''
            #!/usr/bin/env elvish
            use direnv
            eval (starship init elvish)
          '';
        };
      };
      programs.bash = {
        enable = true;
        bashrcExtra = ''
          eval "$(direnv hook bash)"
          eval "$(starship init bash)"
        '';
      };
      programs.starship = {
        enable = true;
        settings = {
          add_newline = false;
          scan_timeout = 10;
          /*
          format = lib.concatStrings [
            "$line_break"
            "$shell"
            "$nix_shell"
            "$directory"
            "$character"
          ];
          #format_right = lib.concatStrings [
          #
          #];
          character = {
            success_symbol = " >";
            error_symbol = " >";
          };
          directory = {
            truncation_length = 3;
            truncate_to_repo = true;
            format = "[$path](bold cyan)";
          };
          */
          shell = {
            disabled = false;
            bash_indicator = "bsh";
            elvish_indicator = "elv";
          };
        };
      };
    };
  };
}