mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
nixvim: add nix-darwin wrapper
This commit is contained in:
parent
de9a5913d2
commit
7807c51ccf
4 changed files with 48 additions and 48 deletions
15
README.md
15
README.md
|
@ -40,9 +40,12 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
# For home-manager
|
||||||
nixvim.homeManagerModules.nixvim
|
nixvim.homeManagerModules.nixvim
|
||||||
# Or, if you're not using home-manager:
|
# For NixOS
|
||||||
nixvim.nixosModules.nixvim
|
nixvim.nixosModules.nixvim
|
||||||
|
# For nix-darwin
|
||||||
|
nixvim.nixDarwinModules.nixvim
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.nixvim.enable = true;
|
programs.nixvim.enable = true;
|
||||||
|
@ -75,14 +78,14 @@ flakes, just add the nixvim input:
|
||||||
```
|
```
|
||||||
|
|
||||||
You can now access the module using `inputs.nixvim.homeManagerModules.nixvim`,
|
You can now access the module using `inputs.nixvim.homeManagerModules.nixvim`,
|
||||||
for a home-manager instalation, and `inputs.nixvim.nixosModules.nixvim`, if
|
for a home-manager instalation, `inputs.nixvim.nixosModules.nixvim`, for NixOS,
|
||||||
you're not using it.
|
and `inputs.nixvim.nixDarwinModules.nixvim` for nix-darwin.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
NixVim can be used in three ways: through the home-manager and NixOS modules,
|
NixVim can be used in four ways: through the home-manager, nix-darwin, and NixOS modules,
|
||||||
and through the `makeNixvim` function. To use the modules, just import the
|
and through the `makeNixvim` function. To use the modules, just import the
|
||||||
`nixvim.homeManagerModules.${system}.nixvim` and
|
`nixvim.homeManagerModules.nixvim`, `nixvim.nixDarwinModules.nixvim`, and
|
||||||
`nixvim.nixosModules.${system}.nixvim` modules, depending on which system
|
`nixvim.nixosModules.nixvim` modules, depending on which system
|
||||||
you're using.
|
you're using.
|
||||||
|
|
||||||
If you want to use it standalone, you can use the `makeNixvim` function:
|
If you want to use it standalone, you can use the `makeNixvim` function:
|
||||||
|
|
|
@ -53,5 +53,6 @@
|
||||||
flakeOutput // {
|
flakeOutput // {
|
||||||
nixosModules.nixvim = import ./wrappers/nixos.nix modules;
|
nixosModules.nixvim = import ./wrappers/nixos.nix modules;
|
||||||
homeManagerModules.nixvim = import ./wrappers/hm.nix modules;
|
homeManagerModules.nixvim = import ./wrappers/hm.nix modules;
|
||||||
|
nixDarwinModules.nixvim = import ./wrappers/darwin.nix modules;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
50
tests/flake.lock
generated
50
tests/flake.lock
generated
|
@ -203,17 +203,16 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"beautysh": "beautysh",
|
"beautysh": "beautysh",
|
||||||
"flake-utils": "flake-utils_3",
|
"flake-utils": "flake-utils_3",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_3"
|
||||||
"nmdSrc": "nmdSrc"
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 0,
|
"lastModified": 0,
|
||||||
"narHash": "sha256-x6+KGgpSlPfBvI8YG3hf3lN5FKhJdeLyXDmQdLk34cE=",
|
"narHash": "sha256-008LHsZ1x6jTE46J4+E2jOQTAyexpf7M9fNqSsjQOds=",
|
||||||
"path": "/nix/store/l49ggcslcfsav82lgfb5dzw4a2qajfnp-source",
|
"path": "/nix/store/nj5i7q1lcsw9fzch5kha51li3c8w12h6-source",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/l49ggcslcfsav82lgfb5dzw4a2qajfnp-source",
|
"path": "/nix/store/nj5i7q1lcsw9fzch5kha51li3c8w12h6-source",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -223,52 +222,19 @@
|
||||||
"flake-utils": "flake-utils_4",
|
"flake-utils": "flake-utils_4",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs-stable"
|
"nixpkgs-stable"
|
||||||
],
|
]
|
||||||
"nmdSrc": "nmdSrc_2"
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 0,
|
"lastModified": 0,
|
||||||
"narHash": "sha256-x6+KGgpSlPfBvI8YG3hf3lN5FKhJdeLyXDmQdLk34cE=",
|
"narHash": "sha256-008LHsZ1x6jTE46J4+E2jOQTAyexpf7M9fNqSsjQOds=",
|
||||||
"path": "/nix/store/l49ggcslcfsav82lgfb5dzw4a2qajfnp-source",
|
"path": "/nix/store/nj5i7q1lcsw9fzch5kha51li3c8w12h6-source",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/l49ggcslcfsav82lgfb5dzw4a2qajfnp-source",
|
"path": "/nix/store/nj5i7q1lcsw9fzch5kha51li3c8w12h6-source",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nmdSrc": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1666190571,
|
|
||||||
"narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=",
|
|
||||||
"owner": "rycee",
|
|
||||||
"repo": "nmd",
|
|
||||||
"rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169",
|
|
||||||
"type": "gitlab"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "rycee",
|
|
||||||
"repo": "nmd",
|
|
||||||
"type": "gitlab"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nmdSrc_2": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1666190571,
|
|
||||||
"narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=",
|
|
||||||
"owner": "rycee",
|
|
||||||
"repo": "nmd",
|
|
||||||
"rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169",
|
|
||||||
"type": "gitlab"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "rycee",
|
|
||||||
"repo": "nmd",
|
|
||||||
"type": "gitlab"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"poetry2nix": {
|
"poetry2nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": [
|
"flake-utils": [
|
||||||
|
|
30
wrappers/darwin.nix
Normal file
30
wrappers/darwin.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
modules:
|
||||||
|
{ pkgs, config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkEnableOption mkOption mkOptionType mkForce mkMerge mkIf types;
|
||||||
|
cfg = config.programs.nixvim;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
programs.nixvim = mkOption {
|
||||||
|
type = types.submodule ((modules pkgs) ++ [{
|
||||||
|
options.enable = mkEnableOption "nixvim";
|
||||||
|
config.wrapRc = mkForce true;
|
||||||
|
}]);
|
||||||
|
};
|
||||||
|
nixvim.helpers = mkOption {
|
||||||
|
type = mkOptionType {
|
||||||
|
name = "helpers";
|
||||||
|
description = "Helpers that can be used when writing nixvim configs";
|
||||||
|
check = builtins.isAttrs;
|
||||||
|
};
|
||||||
|
description = "Use this option to access the helpers";
|
||||||
|
default = import ../plugins/helpers.nix { inherit (pkgs) lib; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ cfg.finalPackage ];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue