-
-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
templates: add experimental
evalNixvim
template
- Loading branch information
1 parent
83bda46
commit 50a7d65
Showing
5 changed files
with
93 additions
and
0 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
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,31 @@ | ||
# New Nixvim template | ||
|
||
This template gives you a good starting point for configuring nixvim as a standalone module configuration. | ||
|
||
## Configuring | ||
|
||
To start configuring, just add or modify the module files in `./config`. | ||
If you add new modules, remember to import them in [`./config/default.nix`](./config/default.nix). | ||
|
||
## Using your vim configuration | ||
|
||
To use your configuration simply run the following command | ||
|
||
``` | ||
nix run | ||
``` | ||
|
||
## Configurations and packages | ||
|
||
Your nixvim configuration is created using `evalNixvim`. | ||
This is outputted as the `nixvimConfigurations.<system>.default` flake output. | ||
|
||
You can access your configuration's package outputs `<configuration>.config.build.package`. | ||
This is exported as the flake output `packages.<system>.default`. | ||
This package can be run using `nix run`. | ||
|
||
A test is also available as `<configuration>.config.build.test`. | ||
This is exported as the flake output `checks.<system>.default`. | ||
This test can be run using `nix flake check`. | ||
|
||
<!-- TODO: figure out how to _wrap_ an existing configuration as a nixos/hm module --> |
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,6 @@ | ||
{ | ||
plugins = { | ||
bufferline.enable = true; | ||
web-devicons.enable = true; | ||
}; | ||
} |
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,4 @@ | ||
{ | ||
# Import all your configuration modules here | ||
imports = [ ./bufferline.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
description = "A nixvim configuration"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
nixvim.url = "github:nix-community/nixvim"; | ||
flake-parts.url = "github:hercules-ci/flake-parts"; | ||
}; | ||
|
||
outputs = | ||
{ nixvim, flake-parts, ... }@inputs: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
systems = [ | ||
"x86_64-linux" | ||
"aarch64-linux" | ||
"x86_64-darwin" | ||
"aarch64-darwin" | ||
]; | ||
|
||
imports = [ | ||
# Import nixvim's flake-parts module, to enable defining `nixvimConfigurations` | ||
nixvim.flakeModules.default | ||
]; | ||
|
||
perSystem = | ||
{ config, system, ... }: | ||
{ | ||
nixvimConfigurations = { | ||
default = nixvim.lib.evalNixvim { | ||
inherit system; | ||
modules = [ | ||
./config | ||
]; | ||
}; | ||
}; | ||
|
||
checks = { | ||
# Run `nix flake check .` to verify that your config is not broken | ||
default = config.nixvimConfigurations.default.config.build.test; | ||
}; | ||
|
||
packages = { | ||
# Lets you run `nix run .` to start nixvim | ||
default = config.nixvimConfigurations.default.config.build.package; | ||
}; | ||
}; | ||
}; | ||
} |