forked from nix-community/nixvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
142 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
/nix/store/5ixvasljzz7fixv2nd28c8d6bsnam3ap-nixos-system-nixos-21.03.20201227.2f47650 | ||
/nix/store/r2p2qi63zznjdf0gjif7v8qmsm5g72d7-nixos-system-nixos-21.03.20201227.2f47650 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
imports = [ | ||
./statuslines/lightline.nix | ||
./statuslines/airline.nix | ||
./colorschemes/gruvbox.nix | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ pkgs, config, lib, ... }: | ||
with lib; | ||
let | ||
cfg = config.programs.nixvim.plugins.airline; | ||
helpers = import ../helpers.nix { inherit lib; }; | ||
|
||
sectionType = with types; nullOr (oneOf [ str (listOf str)]); | ||
sectionOption = mkOption { | ||
default = null; | ||
type = sectionType; | ||
description = "Configuration for this section. Can be either a statusline-format string or a list of modules to be passed to airline#section#create_*."; | ||
}; | ||
in { | ||
options = { | ||
programs.nixvim.plugins.airline = { | ||
enable = mkEnableOption "Enable airline"; | ||
|
||
extensions = mkOption { | ||
default = null; | ||
type = with types; nullOr attrs; | ||
description = "A list of extensions and their configuration"; | ||
}; | ||
|
||
onTop = mkOption { | ||
default = false; | ||
type = types.bool; | ||
description = "Whether to show the statusline on the top instead of the bottom"; | ||
}; | ||
|
||
sections = mkOption { | ||
default = null; | ||
type = with types; nullOr (submodule { | ||
options = { | ||
a = sectionOption; | ||
b = sectionOption; | ||
c = sectionOption; | ||
x = sectionOption; | ||
y = sectionOption; | ||
z = sectionOption; | ||
}; | ||
}); | ||
}; | ||
|
||
powerline = mkOption { | ||
default = null; | ||
type = with types; nullOr bool; | ||
description = "Whether to use powerline symbols"; | ||
}; | ||
|
||
theme = mkOption { | ||
default = config.programs.nixvim.colorscheme; | ||
type = with types; nullOr str; | ||
description = "The theme to use for vim-airline. If set, vim-airline-themes will be installed."; | ||
}; | ||
}; | ||
}; | ||
|
||
config = let | ||
sections = {}; | ||
in mkIf cfg.enable { | ||
programs.nixvim = { | ||
extraPlugins = with pkgs.vimPlugins; [ | ||
vim-airline | ||
] ++ optional (!isNull cfg.theme) vim-airline-themes; | ||
globals = { | ||
airline.extensions = cfg.extensions; | ||
|
||
airline_statusline_ontop = mkIf cfg.onTop 1; | ||
airline_powerline_fonts = mkIf (cfg.powerline) 1; | ||
|
||
airline_theme = mkIf (!isNull cfg.theme) cfg.theme; | ||
} // sections; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env sh | ||
# Creates a container and then runs the resulting neovim executable with the configuration | ||
set -e | ||
|
||
sudo nixos-container destroy nvim-test | ||
sudo nixos-container create nvim-test --flake . | ||
|
||
.tmp/sw/bin/nvim -u .tmp/etc/xdg/nvim/sysinit.vim .tmp/etc/xdg/nvim/sysinit.vim |