1

Update systemmodules/homemodules paths to allow nixd to differentiate between the two

This commit is contained in:
2026-01-18 15:47:51 +01:00
parent 25ae0f4b85
commit b7e2bba8f0
63 changed files with 173 additions and 195 deletions

View File

@ -11,17 +11,7 @@
...
}:
with mylib.networking; {
imports = [
# Import my system modules
./modules
# Import the host-specific system config
./${hostname}
./cachix.nix
];
modules = {
systemmodules = {
bootloader = {
enable = true;
@ -234,7 +224,7 @@ with mylib.networking; {
# 6 Cyan 14 Cyan
# 7 White 15 White
colors = let
color = config.home-manager.users.${username}.modules.color;
color = config.home-manager.users.${username}.homemodules.color;
in [
# 0 - 7
"000000" # Dark black

View File

@ -11,13 +11,11 @@
./hardware-configuration.nix
./disks.nix
../modules
# General services
../services/fileflows-node.nix
];
modules = {
systemmodules = {
bootloader = {
# Secure boot
loader = "lanzaboote";

View File

@ -2,10 +2,9 @@
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
../modules
];
modules = {
systemmodules = {
network = {
useNetworkManager = true;

View File

@ -14,8 +14,6 @@
# Include the results of the hardware scan.
./hardware-configuration.nix
../modules
# My own services
../services/heidi.nix
../services/formula10.nix
@ -47,7 +45,7 @@
../services/whats-up-docker.nix
];
modules = {
systemmodules = {
docker.networks = [
{
name = "behind-nginx";

View File

@ -4,9 +4,9 @@
mylib,
...
}: let
inherit (config.modules) TEMPLATE;
inherit (config.systemmodules) TEMPLATE;
in {
options.modules.TEMPLATE = import ./options.nix {inherit lib mylib;};
options.systemmodules.TEMPLATE = import ./options.nix {inherit lib mylib;};
config =
lib.mkIf TEMPLATE.enable {

View File

@ -7,9 +7,9 @@
publicKeys,
...
}: let
inherit (config.modules) agenix;
inherit (config.systemmodules) agenix;
in {
options.modules.agenix = import ./options.nix {inherit lib mylib;};
options.systemmodules.agenix = import ./options.nix {inherit lib mylib;};
config = {
# NOTE: Add below snippet to home/christoph/default.nix to generate the secrets.nix file
@ -23,13 +23,13 @@ in {
# {
# ${lib.optionalString
# # If this user defined any secrets...
# (builtins.hasAttr "${username}" nixosConfig.modules.agenix.secrets)
# (builtins.hasAttr "${username}" nixosconfig.systemmodules.agenix.secrets)
# # ...we will add them to the current secrets.nix,
# # s.t. agenix can be used to encrypt/access them.
# (builtins.concatStringsSep "\n"
# (builtins.map
# (mkSecret publicKeys.${username}.ssh)
# nixosConfig.modules.agenix.secrets.${username}))}
# nixosconfig.systemmodules.agenix.secrets.${username}))}
# }
# '';

View File

@ -10,9 +10,9 @@
with lib;
with mylib.virtualisation;
with mylib.modules; let
cfg = config.modules.containers;
cfg = config.systemmodules.containers;
in {
options.modules.containers = import ./options.nix {inherit lib mylib;};
options.systemmodules.containers = import ./options.nix {inherit lib mylib;};
# TODO: These need config options exposed through the module,
# e.g. to set paths/volumes/binds differently per system...

View File

@ -5,9 +5,9 @@
mylib,
...
}: let
inherit (config.modules) bootloader;
inherit (config.systemmodules) bootloader;
in {
options.modules.bootloader = import ./options.nix {inherit lib mylib;};
options.systemmodules.bootloader = import ./options.nix {inherit lib mylib;};
config = lib.mkIf bootloader.enable (lib.mkMerge [
{

View File

@ -5,9 +5,9 @@
pkgs,
...
}: let
inherit (config.modules) desktopportal;
inherit (config.systemmodules) desktopportal;
in {
options.modules.desktopportal = import ./options.nix {inherit lib mylib;};
options.systemmodules.desktopportal = import ./options.nix {inherit lib mylib;};
config = lib.mkIf desktopportal.enable {
xdg = {

View File

@ -5,9 +5,9 @@
pkgs,
...
}: let
inherit (config.modules) docker;
inherit (config.systemmodules) docker;
in {
options.modules.docker = import ./options.nix {inherit lib mylib;};
options.systemmodules.docker = import ./options.nix {inherit lib mylib;};
config = lib.mkIf docker.enable {
environment.variables = lib.mkMerge [

View File

@ -5,9 +5,9 @@
pkgs,
...
}: let
inherit (config.modules) fonts;
inherit (config.systemmodules) fonts;
in {
options.modules.fonts = import ./options.nix {inherit lib mylib;};
options.systemmodules.fonts = import ./options.nix {inherit lib mylib;};
config = lib.mkIf fonts.enable {
fonts = {

View File

@ -6,9 +6,9 @@
pkgs,
...
}: let
inherit (config.modules) impermanence;
inherit (config.systemmodules) impermanence;
in {
options.modules.impermanence = import ./options.nix {inherit lib mylib;};
options.systemmodules.impermanence = import ./options.nix {inherit lib mylib;};
config = let
# NOTE: Setting user/group/mode only has an effect if the

View File

@ -4,9 +4,9 @@
mylib,
...
}: let
inherit (config.modules) mime;
inherit (config.systemmodules) mime;
in {
options.modules.mime = import ./options.nix {inherit lib mylib;};
options.systemmodules.mime = import ./options.nix {inherit lib mylib;};
config = lib.mkIf mime.enable {
xdg = {

View File

@ -8,9 +8,9 @@
with lib;
with mylib.networking;
with mylib.modules; let
cfg = config.modules.network;
cfg = config.systemmodules.network;
in {
options.modules.network = import ./options.nix {inherit lib mylib;};
options.systemmodules.network = import ./options.nix {inherit lib mylib;};
config = mkIf cfg.enable {
services.resolved = {
@ -59,7 +59,7 @@ in {
inherit (cfg) networks;
};
modules.polkit.allowedActions = mkIf cfg.useNetworkManager [
systemmodules.polkit.allowedActions = mkIf cfg.useNetworkManager [
# List NM permissions by running "nmcli general permissions"
"org.freedesktop.NetworkManager.settings.modify.system"
];

View File

@ -7,9 +7,9 @@
}:
with lib;
with mylib.modules; let
cfg = config.modules.polkit;
cfg = config.systemmodules.polkit;
in {
options.modules.polkit = import ./options.nix {inherit lib mylib;};
options.systemmodules.polkit = import ./options.nix {inherit lib mylib;};
config = mkIf cfg.enable {
security.polkit.enable = true;

View File

@ -6,9 +6,9 @@
username,
...
}: let
inherit (config.modules) sops-nix;
inherit (config.systemmodules) sops-nix;
in {
options.modules.sops-nix = import ./options.nix {inherit lib mylib;};
options.systemmodules.sops-nix = import ./options.nix {inherit lib mylib;};
config = {
environment.systemPackages = with pkgs; [

View File

@ -14,8 +14,6 @@
# Include the results of the hardware scan.
./hardware-configuration.nix
../modules
# General services
../services/adguard.nix
../services/nginx-proxy-manager.nix
@ -25,7 +23,7 @@
../services/whats-up-docker.nix
];
modules = {
systemmodules = {
docker.networks = [
{
name = "behind-nginx";