refactor: prepare for home-manager module & cleanup

This commit is contained in:
NotAShelf 2023-02-06 21:57:52 +03:00
parent 89be2b9d37
commit 4874df92b6
No known key found for this signature in database
GPG key ID: 5B5C8895F28445F1

128
flake.nix
View file

@ -189,7 +189,7 @@
in in
{ {
lib = { lib = {
nvim = (import ./modules/lib/stdlib-extended.nix nixpkgs.lib).nvim; nvim = (import ./lib/stdlib-extended.nix nixpkgs.lib).nvim;
inherit neovimConfiguration; inherit neovimConfiguration;
}; };
@ -200,69 +200,85 @@
neovim-tidal = buildPkg prev [tidalConfig]; neovim-tidal = buildPkg prev [tidalConfig];
}; };
} }
// (flake-utils.lib.eachDefaultSystem (system: let // (flake-utils.lib.eachDefaultSystem (
pkgs = import nixpkgs { system: let
inherit system; pkgs = import nixpkgs {
overlays = [ inherit system;
inputs.tidalcycles.overlays.default overlays = [
(final: prev: { inputs.tidalcycles.overlays.default
rnix-lsp = inputs.rnix-lsp.defaultPackage.${system}; (final: prev: {
nil = inputs.nil.packages.${system}.default; rnix-lsp = inputs.rnix-lsp.defaultPackage.${system};
}) nil = inputs.nil.packages.${system}.default;
]; })
}; ];
};
docs = import ./docs { docs = import ./docs {
inherit pkgs; inherit pkgs;
nmdSrc = inputs.nmd; nmdSrc = inputs.nmd;
}; };
tidalPkg = buildPkg pkgs [tidalConfig]; # Available Configurations
nixPkg = buildPkg pkgs [nixConfig]; tidalPkg = buildPkg pkgs [tidalConfig];
maximalPkg = buildPkg pkgs [maximalConfig]; nixPkg = buildPkg pkgs [nixConfig];
in { maximalPkg = buildPkg pkgs [maximalConfig];
apps = in {
rec { apps =
nix = { rec {
type = "app"; nix = {
program = nvimBin nixPkg;
};
maximal = {
type = "app";
program = nvimBin maximalPkg;
};
default = nix;
}
// (
if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"])
then {
tidal = {
type = "app"; type = "app";
program = nvimBin tidalPkg; program = nvimBin nixPkg;
}; };
maximal = {
type = "app";
program = nvimBin maximalPkg;
};
default = nix;
} }
else {} // (
); if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"])
then {
tidal = {
type = "app";
program = nvimBin tidalPkg;
};
}
else {}
);
devShells.default = pkgs.mkShell {nativeBuildInputs = [nixPkg];}; devShells.default = pkgs.mkShell {nativeBuildInputs = [nixPkg];};
packages = packages =
{ {
docs-html = docs.manual.html; # Documentation
docs-manpages = docs.manPages; docs = docs.manual.html;
docs-json = docs.options.json; docs-html = docs.manual.html;
default = nixPkg; docs-manpages = docs.manPages;
nix = nixPkg; docs-json = docs.options.json;
maximal = maximalPkg;
} # Available Configurations
// ( default = nixPkg;
if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) nix = nixPkg;
then { maximal = maximalPkg;
tidal = tidalPkg;
} }
else {} // (
); if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"])
})); then {
tidal = tidalPkg;
}
else {}
);
nixosModules.hm-module = {
imports = [
./lib/hm.nix
# {nixpkgs.overlays = [inputs.self.overlays.default];} what?
];
};
}
));
# Flake inputs
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";