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:
parent
b89a42ef13
commit
99b6b41de3
14 changed files with 78 additions and 84 deletions
|
@ -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;
|
||||
};
|
||||
}
|
|
@ -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";
|
||||
};
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
networking.nameservers = ["1.1.1.1" "1.0.0.1"];
|
||||
}
|
|
@ -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"
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./core
|
||||
./nix
|
||||
|
||||
./hardware/printing.nix
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
base = [
|
||||
../modules
|
||||
"${self}/config/nixos"
|
||||
"${self}/config/nixos/core/home-manager.nix"
|
||||
|
||||
"${self}/config/nixos/services/documentation.nix"
|
||||
|
||||
|
|
12
modules/nix/core/default.nix
Normal file
12
modules/nix/core/default.nix
Normal 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;
|
||||
}
|
34
modules/nix/core/home-manager.nix
Normal file
34
modules/nix/core/home-manager.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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;
|
||||
}
|
9
modules/nix/core/networking.nix
Normal file
9
modules/nix/core/networking.nix
Normal 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"];
|
||||
};
|
||||
}
|
19
modules/nix/core/users.nix
Normal file
19
modules/nix/core/users.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,3 +1,6 @@
|
|||
{
|
||||
imports = [./style];
|
||||
imports = [
|
||||
./core
|
||||
./style
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue