summaryrefslogtreecommitdiffstats
path: root/common/commandline
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2021-04-18 16:58:23 +0200
committerMinijackson <minijackson@riseup.net>2021-04-18 16:58:23 +0200
commit8ffe5ce23fa1548304a3fa25f2bd0e89837f5a0b (patch)
treecd0de6a4642b76b42002dae5291c307d30727bc6 /common/commandline
parent46ac3d5464712d6b0e0bee4ac62543abcbf2db2c (diff)
downloadnixos-config-reborn-8ffe5ce23fa1548304a3fa25f2bd0e89837f5a0b.tar.gz
nixos-config-reborn-8ffe5ce23fa1548304a3fa25f2bd0e89837f5a0b.zip
revamp with nix flakes + desktop config
Diffstat (limited to 'common/commandline')
-rw-r--r--common/commandline/dircolors.nix7
-rw-r--r--common/commandline/git.nix87
-rw-r--r--common/commandline/htop.nix2
-rw-r--r--common/commandline/tmux.nix2
-rw-r--r--common/commandline/zsh.nix21
5 files changed, 70 insertions, 49 deletions
diff --git a/common/commandline/dircolors.nix b/common/commandline/dircolors.nix
index 7ef3a4d..f7bdae1 100644
--- a/common/commandline/dircolors.nix
+++ b/common/commandline/dircolors.nix
@@ -1,4 +1,6 @@
1{ config, ... }: 1inputs:
2
3{ config, lib, ... }:
2 4
3{ 5{
4 home-manager.users.minijackson = { ... }: 6 home-manager.users.minijackson = { ... }:
@@ -69,6 +71,7 @@
69 71
70 home-manager.users.root = { ... }: 72 home-manager.users.root = { ... }:
71 { 73 {
72 programs.dircolors = config.home-manager.users.minijackson.programs.dircolors; 74 programs.dircolors =
75 lib.mkDefault config.home-manager.users.minijackson.programs.dircolors;
73 }; 76 };
74} 77}
diff --git a/common/commandline/git.nix b/common/commandline/git.nix
index 597ef64..e231356 100644
--- a/common/commandline/git.nix
+++ b/common/commandline/git.nix
@@ -1,58 +1,61 @@
1{ config, pkgs, ... }: 1inputs:
2
3{ config, pkgs, lib, ... }:
2 4
3{ 5{
4 # TODO: add signing 6 # TODO: add signing
5 home-manager.users.minijackson = { ... }: 7 home-manager.users.minijackson = { ... }: {
6 {
7 programs.git = { 8 programs.git = {
8 enable = true; 9 enable = true;
9 package = pkgs.gitAndTools.gitFull; 10 package = pkgs.gitAndTools.gitFull;
10 userEmail = "minijackson@riseup.net"; 11 userEmail = "minijackson@riseup.net";
11 userName = "Minijackson"; 12 userName = "Minijackson";
12 13
13 extraConfig = let 14 extraConfig =
14 deltaCommand = "${pkgs.gitAndTools.delta}/bin/delta"; 15 let
15 in { 16 deltaCommand = "${pkgs.gitAndTools.delta}/bin/delta";
16 core = { 17 in
17 whitespace = "trailing-space,space-before-tab"; 18 {
18 pager = deltaCommand; 19 core = {
19 interactive.diffFilter = "${deltaCommand} --color-only"; 20 whitespace = "trailing-space,space-before-tab";
20 }; 21 pager = deltaCommand;
21 merge = { tool = "nvimdiff"; }; 22 interactive.diffFilter = "${deltaCommand} --color-only";
22 "mergetool \"nvimdiff\"" = { cmd = "nvim -d \"$LOCAL\" \"$MERGED\" \"$REMOTE\""; }; 23 };
23 24 merge = { tool = "nvimdiff"; };
24 delta = with config.theme.colors; { 25 "mergetool \"nvimdiff\"" = { cmd = "nvim -d \"$LOCAL\" \"$MERGED\" \"$REMOTE\""; };
25 features = "line-numbers decorations"; 26
26 whitespace-error-style = "22 reverse"; 27 delta = with config.theme.colors; {
27 decorations = { 28 features = "line-numbers decorations";
28 minus-style = "normal red"; 29 whitespace-error-style = "22 reverse";
29 minus-non-emph-style = "normal red"; 30 decorations = {
30 minus-emph-style = "normal brightred"; 31 minus-style = "normal red";
31 minus-empty-line-marker-style = "normal red"; 32 minus-non-emph-style = "normal red";
32 33 minus-emph-style = "normal brightred";
33 plus-style = "reverse green"; 34 minus-empty-line-marker-style = "normal red";
34 plus-non-emph-style = "reverse green"; 35
35 plus-emph-style = "reverse brightgreen"; 36 plus-style = "reverse green";
36 plus-empty-line-marker-style = "reverse green"; 37 plus-non-emph-style = "reverse green";
37 38 plus-emph-style = "reverse brightgreen";
38 whitespace-error-style = "reverse green"; 39 plus-empty-line-marker-style = "reverse green";
39 40
40 line-numbers-minus-style = "brightred"; 41 whitespace-error-style = "reverse green";
41 line-numbers-zero-style = "brightblack"; 42
42 line-numbers-plus-style = "brightgreen"; 43 line-numbers-minus-style = "brightred";
43 44 line-numbers-zero-style = "brightblack";
44 file-style = "bright${dominantName}"; 45 line-numbers-plus-style = "brightgreen";
45 line-numbers-left-style = dominantName; 46
46 line-numbers-right-style = dominantName; 47 file-style = "bright${dominantName}";
48 line-numbers-left-style = dominantName;
49 line-numbers-right-style = dominantName;
50 };
47 }; 51 };
48 };
49 52
50 }; 53 };
51 }; 54 };
52 }; 55 };
53 56
54 home-manager.users.root = { ... }: 57 home-manager.users.root = { ... }: {
55 { 58 programs.git =
56 programs.git = config.home-manager.users.minijackson.programs.git; 59 lib.mkDefault config.home-manager.users.minijackson.programs.git;
57 }; 60 };
58} 61}
diff --git a/common/commandline/htop.nix b/common/commandline/htop.nix
index f9732a6..95763a0 100644
--- a/common/commandline/htop.nix
+++ b/common/commandline/htop.nix
@@ -1,3 +1,5 @@
1inputs:
2
1{ config, ... }: 3{ config, ... }:
2 4
3{ 5{
diff --git a/common/commandline/tmux.nix b/common/commandline/tmux.nix
index aa4de9c..84d2cc8 100644
--- a/common/commandline/tmux.nix
+++ b/common/commandline/tmux.nix
@@ -1,3 +1,5 @@
1inputs:
2
1{ config, pkgs, ... } : 3{ config, pkgs, ... } :
2 4
3let 5let
diff --git a/common/commandline/zsh.nix b/common/commandline/zsh.nix
index 3376321..28899b1 100644
--- a/common/commandline/zsh.nix
+++ b/common/commandline/zsh.nix
@@ -1,3 +1,5 @@
1inputs:
2
1{ config, lib, pkgs, ... }: 3{ config, lib, pkgs, ... }:
2 4
3with import ../../lib/theme.nix { inherit lib; }; 5with import ../../lib/theme.nix { inherit lib; };
@@ -13,9 +15,6 @@ in
13 source "${pkgs.grml-zsh-config}/etc/zsh/zshrc" 15 source "${pkgs.grml-zsh-config}/etc/zsh/zshrc"
14 is4 && xsource "${pkgs.grml-zsh-config}/etc/zsh/keephack" 16 is4 && xsource "${pkgs.grml-zsh-config}/etc/zsh/keephack"
15 17
16 PATH="${pkgs.pazi}/bin:$PATH"
17 eval "$(pazi init zsh)"
18
19 source "${pkgs.zsh-history-substring-search}/share/zsh-history-substring-search/zsh-history-substring-search.zsh" 18 source "${pkgs.zsh-history-substring-search}/share/zsh-history-substring-search/zsh-history-substring-search.zsh"
20 19
21 function () { 20 function () {
@@ -30,8 +29,6 @@ in
30 (mapAttrsToList 29 (mapAttrsToList
31 (variable: value: "${variable}=\"${value}\"") 30 (variable: value: "${variable}=\"${value}\"")
32 config.programs.less.envVariables)} 31 config.programs.less.envVariables)}
33
34 #eval "$(${pkgs.starship}/bin/starship init zsh)"
35 ''; 32 '';
36 33
37 # otherwise it'll override the grml prompt 34 # otherwise it'll override the grml prompt
@@ -56,4 +53,18 @@ in
56 }; 53 };
57 54
58 users.defaultUserShell = pkgs.zsh; 55 users.defaultUserShell = pkgs.zsh;
56
57 home-manager.users.minijackson = { ... }: {
58 # Allows zsh config from home-manager
59 programs.zsh = {
60 enable = true;
61 # Completion is already handled by the GRML conf
62 enableCompletion = false;
63 };
64 };
65
66 home-manager.users.root = { ... }: {
67 programs.zsh =
68 lib.mkDefault config.home-manager.users.minijackson.programs.zsh;
69 };
59} 70}