treewide: migrate config/system/core to modules

Moved everything from core into modules. I want to get all the NixOS
stuff moved first, and do home-manager after. I used the different
profiles to disable configuration that might break my server, as it has
its own configuration already. This will need to be refactored later, as
I want to ultimately only use the local module system.
This commit is contained in:
Anthony Rodriguez 2025-01-14 12:01:33 +01:00
parent b89a42ef13
commit 99b6b41de3
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
14 changed files with 78 additions and 84 deletions

View file

@ -1,31 +0,0 @@
{
config,
inputs,
...
}: let
inherit (config.local.systemVars) username;
in {
imports = [
inputs.home-manager.nixosModules.default
];
home-manager = {
backupFileExtension = "backup";
useGlobalPkgs = true;
useUserPackages = true;
};
home-manager.users.${username} = {
home = {
homeDirectory = "/home/${username}";
stateVersion = "24.05";
};
programs.home-manager.enable = true;
};
programs = {
# make HM-managed GTK stuff work
dconf.enable = true;
};
}

View file

@ -1,26 +0,0 @@
{
pkgs,
lib,
inputs,
...
}: {
imports = [
inputs.lanzaboote.nixosModules.lanzaboote
];
environment.systemPackages = [
# For debugging and troubleshooting Secure Boot.
pkgs.sbctl
];
# Lanzaboote currently replaces the systemd-boot module.
# This setting is usually set to true in configuration.nix
# generated at installation time. So we force it to false
# for now.
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
}

View file

@ -1,3 +0,0 @@
{
networking.nameservers = ["1.1.1.1" "1.0.0.1"];
}

View file

@ -1,13 +0,0 @@
{config, ...}: {
users.users.${config.local.systemVars.username} = {
isNormalUser = true;
description = config.local.homeVars.fullName or "User";
extraGroups = [
"networkmanager"
"audio"
"video"
"wheel"
"plugdev"
];
};
}

View file

@ -1,6 +1,5 @@
{
imports = [
./core
./nix
./hardware/printing.nix

View file

@ -13,7 +13,6 @@
base = [
../modules
"${self}/config/nixos"
"${self}/config/nixos/core/home-manager.nix"
"${self}/config/nixos/services/documentation.nix"

View file

@ -0,0 +1,12 @@
{lib, ...}: {
imports = [
./boot.nix
./home-manager.nix
./locales.nix
./networking.nix
./users.nix
./security.nix
];
system.stateVersion = lib.mkDefault "24.05";
zramSwap.enable = true;
}

View file

@ -0,0 +1,34 @@
{
inputs,
lib,
config,
...
}: let
inherit (config.local.systemVars) username;
in {
imports = [
inputs.home-manager.nixosModules.default
];
config = lib.mkIf (!config.local.profiles.server.enable) {
home-manager = {
backupFileExtension = "backup";
useGlobalPkgs = true;
useUserPackages = true;
};
home-manager.users.${username} = {
home = {
homeDirectory = "/home/${username}";
stateVersion = "24.05";
};
programs.home-manager.enable = true;
};
programs = {
# make HM-managed GTK stuff work
dconf.enable = true;
};
};
}

View file

@ -1,10 +1,4 @@
{lib, ...}: {
imports = [
./boot.nix
./users.nix
./security.nix
./networking.nix
];
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
@ -20,7 +14,5 @@
};
};
system.stateVersion = lib.mkDefault "24.05";
time.timeZone = lib.mkDefault "Europe/Paris";
zramSwap.enable = true;
}

View file

@ -0,0 +1,9 @@
{
lib,
config,
...
}: {
config = lib.mkIf (!config.local.profiles.server.enable) {
networking.nameservers = ["1.1.1.1" "1.0.0.1"];
};
}

View file

@ -0,0 +1,19 @@
{
lib,
config,
...
}: {
config = lib.mkIf (!config.local.profiles.server.enable) {
users.users.${config.local.systemVars.username} = {
isNormalUser = true;
description = config.local.homeVars.fullName or "User";
extraGroups = [
"networkmanager"
"audio"
"video"
"wheel"
"plugdev"
];
};
};
}

View file

@ -1,3 +1,6 @@
{
imports = [./style];
imports = [
./core
./style
];
}