mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
flake-parts/setups: import the default modules
This commit is contained in:
parent
670f52ce30
commit
c6bc18035a
@ -42,8 +42,7 @@
|
|||||||
|
|
||||||
# This is to be used by the NixOS `home-manager.sharedModules` anyways.
|
# This is to be used by the NixOS `home-manager.sharedModules` anyways.
|
||||||
sharedModules = [
|
sharedModules = [
|
||||||
# Import our own custom modules from here..
|
# Import our private modules...
|
||||||
../../modules/home-manager
|
|
||||||
../../modules/home-manager/_private
|
../../modules/home-manager/_private
|
||||||
|
|
||||||
# ...plus a bunch of third-party modules.
|
# ...plus a bunch of third-party modules.
|
||||||
|
@ -85,8 +85,7 @@
|
|||||||
# requirements of a host. On second thought, only on flakes with
|
# requirements of a host. On second thought, only on flakes with
|
||||||
# optional NixOS modules.
|
# optional NixOS modules.
|
||||||
sharedModules = [
|
sharedModules = [
|
||||||
# Import our custom modules.
|
# Import our private modules.
|
||||||
../../modules/nixos
|
|
||||||
../../modules/nixos/_private
|
../../modules/nixos/_private
|
||||||
|
|
||||||
inputs.nix-index-database.nixosModules.nix-index
|
inputs.nix-index-database.nixosModules.nix-index
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.setups.home-manager;
|
cfg = config.setups.home-manager;
|
||||||
|
homeManagerModules = ../../home-manager;
|
||||||
|
|
||||||
# A thin wrapper around the home-manager configuration function.
|
# A thin wrapper around the home-manager configuration function.
|
||||||
mkHome = { system, nixpkgsBranch ? "nixpkgs", homeManagerBranch ? "home-manager", extraModules ? [ ] }:
|
mkHome = { system, nixpkgsBranch ? "nixpkgs", homeManagerBranch ? "home-manager", extraModules ? [ ] }:
|
||||||
@ -11,7 +12,7 @@ let
|
|||||||
in
|
in
|
||||||
inputs.${homeManagerBranch}.lib.homeManagerConfiguration {
|
inputs.${homeManagerBranch}.lib.homeManagerConfiguration {
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
foodogsquaredModulesPath = builtins.toString ../../home-manager;
|
foodogsquaredModulesPath = builtins.toString homeManagerModules;
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
@ -236,6 +237,9 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (cfg.configs != { }) {
|
config = lib.mkIf (cfg.configs != { }) {
|
||||||
|
# Import our own home-manager modules.
|
||||||
|
setups.home-manager.sharedModules = [ homeManagerModules ];
|
||||||
|
|
||||||
flake =
|
flake =
|
||||||
let
|
let
|
||||||
# A quick data structure we can pass through multiple build pipelines.
|
# A quick data structure we can pass through multiple build pipelines.
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.setups.nixos;
|
cfg = config.setups.nixos;
|
||||||
|
nixosModules = ../../nixos;
|
||||||
|
|
||||||
# This is used on a lot of the Nix modules below.
|
# This is used on a lot of the Nix modules below.
|
||||||
partsConfig = config;
|
partsConfig = config;
|
||||||
@ -27,7 +28,7 @@ let
|
|||||||
in
|
in
|
||||||
(lib'.makeOverridable nixosSystem) {
|
(lib'.makeOverridable nixosSystem) {
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
foodogsquaredModulesPath = builtins.toString ../../nixos;
|
foodogsquaredModulesPath = builtins.toString nixosModules;
|
||||||
};
|
};
|
||||||
lib = lib';
|
lib = lib';
|
||||||
modules = extraModules ++ [{
|
modules = extraModules ++ [{
|
||||||
@ -494,6 +495,10 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf (cfg.configs != { }) {
|
config = lib.mkIf (cfg.configs != { }) {
|
||||||
setups.nixos.sharedModules = [
|
setups.nixos.sharedModules = [
|
||||||
|
# Import our own public NixOS modules.
|
||||||
|
nixosModules
|
||||||
|
|
||||||
|
# Set the home-manager-related settings.
|
||||||
({ lib, ... }: {
|
({ lib, ... }: {
|
||||||
home-manager.sharedModules = partsConfig.setups.home-manager.sharedModules;
|
home-manager.sharedModules = partsConfig.setups.home-manager.sharedModules;
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
let
|
let
|
||||||
cfg = config.setups.nixvim;
|
cfg = config.setups.nixvim;
|
||||||
partsConfig = config;
|
partsConfig = config;
|
||||||
|
nixvimModules = ../../nixvim;
|
||||||
|
|
||||||
mkNixvimConfig = { system, nixpkgsBranch, modules ? [] }:
|
mkNixvimConfig = { system, nixpkgsBranch, modules ? [] }:
|
||||||
let
|
let
|
||||||
@ -22,6 +23,9 @@ let
|
|||||||
module = {
|
module = {
|
||||||
imports = modules;
|
imports = modules;
|
||||||
};
|
};
|
||||||
|
extraSpecialArgs = {
|
||||||
|
foodogsquaredModulesPath = builtins.toString nixvimModules;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
modulesOption = lib.mkOption {
|
modulesOption = lib.mkOption {
|
||||||
@ -97,6 +101,8 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (cfg.configs != {}) {
|
config = lib.mkIf (cfg.configs != {}) {
|
||||||
|
setups.nixvim.sharedModules = [ nixvimModules ];
|
||||||
|
|
||||||
perSystem = { system, config, lib, ... }:
|
perSystem = { system, config, lib, ... }:
|
||||||
(
|
(
|
||||||
let
|
let
|
||||||
|
Loading…
Reference in New Issue
Block a user