nix: init core subflake
Some checks failed
Cache outputs / build-custom-packages (push) Has been cancelled
Publish every Git push to master to FlakeHub / flakehub-publish (push) Has been cancelled
Build project site / build (push) Has been cancelled
Build devcontainers / build-devcontainers (push) Has been cancelled
Check flake outputs / check-outputs (push) Has been cancelled
Build personalized bootstrap ISO / build-iso (x86_64-linux) (push) Has been cancelled
Build project site / deploy (push) Has been cancelled

It is heavily preferred if a private config is only meant to use the
project's module and also wants to avoid the heavy list of inputs it
isn't going to use anyways (which happens for 99% of the time).
This commit is contained in:
Gabriel Arazas 2025-04-29 15:42:28 +08:00
parent 9f4abd3c50
commit e2af893f64
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
10 changed files with 82 additions and 12 deletions

View File

@ -1,13 +1,9 @@
# This is simply to make using my flake modules a bit easier for my private # This is simply to make using my flake modules a bit easier for my private
# configurations. # configurations.
{ config, lib, ... }: { inputs, ... }:
{ {
flake.flakeModules = { flake.flakeModules = {
default = ../../modules/flake-parts; inherit (inputs.fds-core.flakeModules) default baseSetupConfig;
# 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;
}; };
} }

View File

@ -100,6 +100,6 @@
flake = { flake = {
# Extending home-manager with my custom modules, if anyone cares. # Extending home-manager with my custom modules, if anyone cares.
homeModules.default = ../../modules/home-manager; homeModules.default = inputs.fds-core.homeModules.default;
}; };
} }

View File

@ -154,6 +154,6 @@ in {
flake = { flake = {
# Listing my public NixOS modules if anyone cares. # Listing my public NixOS modules if anyone cares.
nixosModules.default = ../../modules/nixos; nixosModules.default = inputs.fds-core.nixosModules.default;
}; };
} }

View File

@ -26,5 +26,5 @@
inputs.self.nixvimModules.bahaghari inputs.self.nixvimModules.bahaghari
]; ];
flake = { nixvimModules.default = ../../modules/nixvim; }; flake = { nixvimModules.default = inputs.fds-core.nixvimModules.default; };
} }

View File

@ -1,4 +1,4 @@
{ lib, ... }: { inputs, lib, ... }:
{ {
setups.wrapper-manager = { setups.wrapper-manager = {
@ -20,5 +20,5 @@
}; };
}; };
flake.wrapperManagerModules.default = ../../modules/wrapper-manager; flake.wrapperManagerModules.default = inputs.fds-core.wrapperManagerModules.default;
} }

12
flake.lock generated
View File

@ -84,6 +84,17 @@
"type": "github" "type": "github"
} }
}, },
"fds-core": {
"locked": {
"path": "./nix",
"type": "path"
},
"original": {
"path": "./nix",
"type": "path"
},
"parent": []
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -996,6 +1007,7 @@
"deploy": "deploy", "deploy": "deploy",
"disko": "disko", "disko": "disko",
"emacs-overlay": "emacs-overlay", "emacs-overlay": "emacs-overlay",
"fds-core": "fds-core",
"flake-compat-fds": "flake-compat-fds", "flake-compat-fds": "flake-compat-fds",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",

View File

@ -15,6 +15,9 @@
# branches at the following section, that's edging on the "too-much" scale # branches at the following section, that's edging on the "too-much" scale
# for my fragile internet bandwidth. # for my fragile internet bandwidth.
inputs = { 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 # I know NixOS can be stable but we're going cutting edge, baybee! While
# `nixpkgs-unstable` branch could be faster delivering updates, it is # `nixpkgs-unstable` branch could be faster delivering updates, it is
# looser when it comes to stability for the entirety of this # looser when it comes to stability for the entirety of this
@ -112,6 +115,6 @@
inputs.flake-parts.lib.mkFlake { inherit inputs; } { inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" ]; systems = [ "x86_64-linux" "aarch64-linux" ];
imports = [ ./modules/flake-parts ./configs/flake-parts ]; imports = [ inputs.fds-core.flakeModules.default ./configs/flake-parts ];
}; };
} }

7
nix/README.adoc Normal file
View File

@ -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.

44
nix/default.nix Normal file
View File

@ -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;
}

8
nix/flake.nix Normal file
View File

@ -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 ./. { };
}