feat: Switch off snowfall

This commit is contained in:
punkfairie 2024-11-21 21:21:55 -08:00
parent 4cbe791f22
commit 1585665ca8
Signed by: punkfairie
GPG key ID: 8CEDBFDF5C0D613D
3 changed files with 41 additions and 93 deletions

0
config/default.nix Normal file
View file

View file

@ -1,34 +1,47 @@
{
description = "💤 LazyVim + NixVim = LixyVim";
outputs =
inputs:
inputs.snowfall-lib.mkFlake {
inherit inputs;
src = ./.;
alias.packages.default = "lixyvim";
overlays = with inputs; [ nixvim.overlays.default ];
outputs-builder = channels: {
formatter = channels.nixpkgs.nixfmt-rfc-style;
};
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
nixvim.url = "github:nix-community/nixvim";
flake-parts.url = "github:hercules-ci/flake-parts";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "unstable";
outputs =
{ nixvim, flake-parts, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{ pkgs, system, ... }:
let
nixvimLib = nixvim.lib.${system};
nixvim' = nixvim.legacyPackages.${system};
nixvimModule = {
inherit pkgs;
module = import ./config; # import the module directly
# You can use `extraSpecialArgs` to pass additional arguments to your module files
extraSpecialArgs = {
# inherit (inputs) foo;
};
};
nvim = nixvim'.makeNixvimWithModule nixvimModule;
in
{
checks = {
# Run `nix flake check .` to verify that your config is not broken
default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
};
packages = {
# Lets you run `nix run .` to start nixvim
default = nvim;
};
};
};
}

View file

@ -1,65 +0,0 @@
{ lib
, pkgs
, inputs
, neovim-settings ? { }
, neovim-config ? { }
, ...
}:
let
raw-modules = lib.snowfall.fs.get-default-nix-files-recursive (
lib.snowfall.fs.get-file "/modules/nixvim"
);
wrapped-modules = builtins.map
(
raw-module:
args@{ ... }:
let
module = import raw-module;
result =
if builtins.isFunction module then
module
(
args
// {
# NOTE: nixvim doesn't allow for these to be customized so we must work around the
# module system here...
inherit lib pkgs;
}
)
else
module;
in
result // { _file = raw-module; }
)
raw-modules;
raw-neovim = pkgs.nixvim.makeNixvimWithModule {
inherit pkgs;
module = {
imports = wrapped-modules;
config = lib.mkMerge [
{
_module.args = {
settings = neovim-settings;
lib = lib.mkForce lib;
};
}
neovim-config
];
};
};
neovim = raw-neovim.overrideAttrs (attrs: {
meta = attrs.meta // {
# NOTE: The default platforms specified aren't actually all
# supported by nixvim. Instead, only support the ones that can build with
# the module system.
platforms = builtins.attrNames inputs.nixvim.legacyPackages;
};
});
in
neovim