diff --git a/configs/flake-parts/flake-parts.nix b/configs/flake-parts/flake-parts.nix index e8083f9e..a036c7f3 100644 --- a/configs/flake-parts/flake-parts.nix +++ b/configs/flake-parts/flake-parts.nix @@ -1,13 +1,9 @@ # This is simply to make using my flake modules a bit easier for my private # configurations. -{ config, lib, ... }: +{ inputs, ... }: { flake.flakeModules = { - default = ../../modules/flake-parts; - - # A little module to make it convenient for setting up the baseline of all - # of the configurations. - baseSetupsConfig = ../../modules/flake-parts/profiles/fds-template.nix; + inherit (inputs.fds-core.flakeModules) default baseSetupConfig; }; } diff --git a/configs/flake-parts/home-manager.nix b/configs/flake-parts/home-manager.nix index b966ecac..8cf59b98 100644 --- a/configs/flake-parts/home-manager.nix +++ b/configs/flake-parts/home-manager.nix @@ -100,6 +100,6 @@ flake = { # Extending home-manager with my custom modules, if anyone cares. - homeModules.default = ../../modules/home-manager; + homeModules.default = inputs.fds-core.homeModules.default; }; } diff --git a/configs/flake-parts/nixos.nix b/configs/flake-parts/nixos.nix index 6ef3b341..fc1ad32d 100644 --- a/configs/flake-parts/nixos.nix +++ b/configs/flake-parts/nixos.nix @@ -154,6 +154,6 @@ in { flake = { # Listing my public NixOS modules if anyone cares. - nixosModules.default = ../../modules/nixos; + nixosModules.default = inputs.fds-core.nixosModules.default; }; } diff --git a/configs/flake-parts/nixvim.nix b/configs/flake-parts/nixvim.nix index 6d7320f5..25f5568f 100644 --- a/configs/flake-parts/nixvim.nix +++ b/configs/flake-parts/nixvim.nix @@ -26,5 +26,5 @@ inputs.self.nixvimModules.bahaghari ]; - flake = { nixvimModules.default = ../../modules/nixvim; }; + flake = { nixvimModules.default = inputs.fds-core.nixvimModules.default; }; } diff --git a/configs/flake-parts/wrapper-manager.nix b/configs/flake-parts/wrapper-manager.nix index ec35d0f9..c2cb4274 100644 --- a/configs/flake-parts/wrapper-manager.nix +++ b/configs/flake-parts/wrapper-manager.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ inputs, lib, ... }: { setups.wrapper-manager = { @@ -20,5 +20,5 @@ }; }; - flake.wrapperManagerModules.default = ../../modules/wrapper-manager; + flake.wrapperManagerModules.default = inputs.fds-core.wrapperManagerModules.default; } diff --git a/flake.lock b/flake.lock index e6ade226..c1b77126 100644 --- a/flake.lock +++ b/flake.lock @@ -84,6 +84,17 @@ "type": "github" } }, + "fds-core": { + "locked": { + "path": "./nix", + "type": "path" + }, + "original": { + "path": "./nix", + "type": "path" + }, + "parent": [] + }, "flake-compat": { "flake": false, "locked": { @@ -996,6 +1007,7 @@ "deploy": "deploy", "disko": "disko", "emacs-overlay": "emacs-overlay", + "fds-core": "fds-core", "flake-compat-fds": "flake-compat-fds", "flake-parts": "flake-parts", "flake-utils": "flake-utils", diff --git a/flake.nix b/flake.nix index b3aaddea..de26a024 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,9 @@ # branches at the following section, that's edging on the "too-much" scale # for my fragile internet bandwidth. inputs = { + # The core modules found in this project. + fds-core.url = "path:./nix"; + # I know NixOS can be stable but we're going cutting edge, baybee! While # `nixpkgs-unstable` branch could be faster delivering updates, it is # looser when it comes to stability for the entirety of this @@ -112,6 +115,6 @@ inputs.flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" "aarch64-linux" ]; - imports = [ ./modules/flake-parts ./configs/flake-parts ]; + imports = [ inputs.fds-core.flakeModules.default ./configs/flake-parts ]; }; } diff --git a/nix/README.adoc b/nix/README.adoc new file mode 100644 index 00000000..1a7c682b --- /dev/null +++ b/nix/README.adoc @@ -0,0 +1,7 @@ += Core Nix entrypoint +:toc: + +This contains the entrypoint for all of the components found in the project. +It comes both in flake and non-flake entrypoints. +Most of the components exported here shouldn't require anything from other Nix projects to Nix flake inputs. +Examples of this includes modules and Nix objects that is meant to be imported in the environment. diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 00000000..bc59bf81 --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,44 @@ +# The entrypoint of the core. We're just requiring an empty attrset for now for +# forward compatibility in case it changes (90% it won't but I don't trust the +# remaining 10% ;p). +{ }: + +{ + nixosModules = rec { + default = ../modules/nixos; + + publicModules = default; + privateModules = ../modules/nixos/_private; + bahaghari = ../subprojects/bahaghari/modules; + }; + + homeModules = rec { + default = ../modules/home-manager; + + publicModules = default; + privateModules = ../modules/home-manager/_private; + bahaghari = ../subprojects/bahaghari/modules; + }; + + nixvimModules = rec { + default = ../modules/nixvim; + + publicModules = default; + privateModules = ../modules/nixvim/_private; + bahaghari = ../subprojects/bahaghari/modules; + }; + + wrapperManagerModules = rec { + default = ../modules/wrapper-manager; + + publicModules = default; + privateModules = ../modules/wrapper-manager/_private; + }; + + flakeModules = { + default = ../modules/flake-parts; + baseSetupConfig = ../modules/flake-parts/profiles/fds-template.nix; + }; + + bahaghariLib = ../subprojects/bahaghari/lib; +} diff --git a/nix/flake.nix b/nix/flake.nix new file mode 100644 index 00000000..0cec401e --- /dev/null +++ b/nix/flake.nix @@ -0,0 +1,8 @@ +# This is mainly for "public" consumption of the modules and several components +# found in my project which shouldn't really require no flake inputs +# whatsoever. +{ + description = "foodogsquared's core flake for its modules"; + + outputs = { ... }: import ./. { }; +}