summaryrefslogtreecommitdiffstats
path: root/common/commandline.nix
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2020-12-03 16:45:06 +0100
committerMinijackson <minijackson@riseup.net>2020-12-03 16:45:06 +0100
commit3f0e83cb4816e637d8c916fb77217e1c5824dbe5 (patch)
tree65b48ffe6e82459cde97b8ee61a597402ba2617b /common/commandline.nix
downloadnixos-config-reborn-3f0e83cb4816e637d8c916fb77217e1c5824dbe5.tar.gz
nixos-config-reborn-3f0e83cb4816e637d8c916fb77217e1c5824dbe5.zip
initial commit: most of previous configuration reworked
Diffstat (limited to 'common/commandline.nix')
-rw-r--r--common/commandline.nix108
1 files changed, 108 insertions, 0 deletions
diff --git a/common/commandline.nix b/common/commandline.nix
new file mode 100644
index 0000000..36fae26
--- /dev/null
+++ b/common/commandline.nix
@@ -0,0 +1,108 @@
1{ config, pkgs, lib, ... }:
2
3with import ../lib/theme.nix { inherit lib; };
4let
5 dominantEscapeCode = fgEscapeCode config.theme.colors.dominant;
6 bgDominantEscapeCode = bgEscapeCode config.theme.colors.dominant;
7 backgroundEscapeCode = fgEscapeCode config.theme.colors.background;
8in
9{
10 imports = [
11 ./commandline/dircolors.nix
12 ./commandline/git.nix
13 ./commandline/htop.nix
14 ./commandline/tmux.nix
15 ./commandline/zsh.nix
16 ];
17
18 environment.shellAliases = {
19 ll = "ls -l";
20 e = "\${EDITOR}";
21 cpr = "${pkgs.rsync}/bin/rsync -ah --inplace --info=progress2";
22 };
23
24 programs.bash = {
25 enableCompletion = true;
26 interactiveShellInit = ''
27 eval "$(${pkgs.starship}/bin/starship init bash)"
28
29 PATH="${pkgs.pazi}/bin:$PATH"
30 eval "$(pazi init bash)"
31 '';
32 };
33
34 programs.less = {
35 envVariables = {
36 LESS = "-W -z-4 -R -J";
37 LESS_TERMCAP_mb = dominantEscapeCode;
38 LESS_TERMCAP_md = dominantEscapeCode;
39 LESS_TERMCAP_so =
40 bgDominantEscapeCode + backgroundEscapeCode + "$(tput bold)";
41 };
42 };
43
44 security.sudo.extraConfig =
45 let
46 lectureFile = builtins.toFile "sudoers.lecture" ''
47 
48 ${dominantEscapeCode}"Bee" careful __
49 ${dominantEscapeCode}with sudo! // \
50 \\_/ //
51 '''-.._.-'''-.._.. -(||)(')
52 ''''
53
54 '';
55 in
56 ''
57 Defaults lecture = always
58 Defaults lecture_file = "${lectureFile}"
59 '';
60
61 home-manager.users.minijackson = { ... }:
62 {
63 # TODO
64 xdg.configFile."starship.toml".text = ''
65 [directory]
66 fish_style_pwd_dir_length = 2
67 style = "bold blue"
68
69 [git_branch]
70 symbol = "branch "
71
72 [git_status]
73 ahead = "^"
74 behind = "v"
75 deleted = "x"
76
77 [jobs]
78 symbol = "+ "
79
80 [package]
81 symbol = "version "
82 style = "bold green"
83 disabled = true
84
85 [rust]
86 symbol = "rust "
87 style = "bold dimmed yellow"
88
89 [nix_shell]
90 style = "bold blue"
91
92 [character]
93 symbol = ">"
94 '';
95
96 programs.bat = {
97 enable = true;
98 config = {
99 theme = "TwoDark";
100 };
101 };
102 };
103
104 home-manager.users.root = { ... }:
105 {
106 programs.bat = config.home-manager.users.minijackson.programs.bat;
107 };
108}