modules: move profiles custom namespace to suites

We now have a "proper" profiles modules ala-nixpkgs so we'll have to move
these to make it less confusing.
This commit is contained in:
Gabriel Arazas 2024-01-22 14:48:55 +08:00
parent 44ae723bd9
commit 9b7cc8a850
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
30 changed files with 49 additions and 49 deletions

View File

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
profiles = { suites = {
dev = { dev = {
enable = true; enable = true;
shell.enable = true; shell.enable = true;

View File

@ -10,7 +10,7 @@ in
lib.mkEnableOption "configuration of foo-dogsquared's shell of choice and its toolbelt"; lib.mkEnableOption "configuration of foo-dogsquared's shell of choice and its toolbelt";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
profiles.dev.shell.enable = lib.mkDefault true; suites.dev.shell.enable = lib.mkDefault true;
programs.bash = { programs.bash = {
enable = true; enable = true;

View File

@ -11,7 +11,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# Install all of the desktop stuff. # Install all of the desktop stuff.
profiles.desktop = { suites.desktop = {
enable = true; enable = true;
audio.enable = true; audio.enable = true;
audio.pipewire.enable = true; audio.pipewire.enable = true;

View File

@ -18,7 +18,7 @@ in
terminal-multiplexer.enable = lib.mkDefault true; terminal-multiplexer.enable = lib.mkDefault true;
}; };
profiles.dev = { suites.dev = {
enable = true; enable = true;
extras.enable = true; extras.enable = true;
coreutils-replacement.enable = true; coreutils-replacement.enable = true;

View File

@ -26,7 +26,7 @@ in
]; ];
# Enable the desktop audio profile for extra auditorial goodies. # Enable the desktop audio profile for extra auditorial goodies.
profiles.desktop.audio = { suites.desktop.audio = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
pipewire.enable = lib.mkDefault true; pipewire.enable = lib.mkDefault true;
}; };

View File

@ -21,7 +21,7 @@
]; ];
}; };
profiles = { suites = {
dev = { dev = {
enable = true; enable = true;
shell.enable = true; shell.enable = true;

View File

@ -30,7 +30,7 @@
}; };
# Some niceties. # Some niceties.
profiles.desktop.enable = true; suites.desktop.enable = true;
services.xserver.displayManager = { services.xserver.displayManager = {
gdm = { gdm = {

View File

@ -39,7 +39,7 @@
sops.age.keyFile = "/var/lib/sops-nix/key.txt"; sops.age.keyFile = "/var/lib/sops-nix/key.txt";
# My custom configuration with my custom modules starts here. # My custom configuration with my custom modules starts here.
profiles = { suites = {
archiving.enable = true; archiving.enable = true;
browsers.chromium.enable = true; browsers.chromium.enable = true;
filesystem.setups.personal-webstorage.enable = true; filesystem.setups.personal-webstorage.enable = true;

View File

@ -11,7 +11,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# Bring in some of them good tools. # Bring in some of them good tools.
profiles.filesystem.tools.enable = true; suites.filesystem.tools.enable = true;
# We're using some better filesystems so we're using it. # We're using some better filesystems so we're using it.
boot.initrd.supportedFilesystems = [ "btrfs" ]; boot.initrd.supportedFilesystems = [ "btrfs" ];

View File

@ -43,7 +43,7 @@ in
]; ];
# Put on your cloak, kid. # Put on your cloak, kid.
profiles.vpn.personal.enable = true; suites.vpn.personal.enable = true;
# We'll go with a software firewall. We're mostly configuring it as if we're # We'll go with a software firewall. We're mostly configuring it as if we're
# using a server even though the chances of that is pretty slim. # using a server even though the chances of that is pretty slim.

View File

@ -60,7 +60,7 @@ in
"ssh-key" = { }; "ssh-key" = { };
}); });
profiles.filesystem.setups = { suites.filesystem.setups = {
archive.enable = true; archive.enable = true;
external-hdd.enable = true; external-hdd.enable = true;
}; };

View File

@ -100,7 +100,7 @@ in
"secrets-config" = { }; "secrets-config" = { };
}); });
profiles.filesystem.setups.archive.enable = true; suites.filesystem.setups.archive.enable = true;
services.yt-dlp = { services.yt-dlp = {
enable = true; enable = true;

View File

@ -14,7 +14,7 @@ in
config = lib.mkIf cfg.enable (lib.mkMerge [ config = lib.mkIf cfg.enable (lib.mkMerge [
{ {
# Bring all of the desktop goodies. # Bring all of the desktop goodies.
profiles.desktop = { suites.desktop = {
enable = true; enable = true;
audio.enable = true; audio.enable = true;
fonts.enable = true; fonts.enable = true;
@ -35,7 +35,7 @@ in
# Make it in multiple languages. Take note the input method engine is set # Make it in multiple languages. Take note the input method engine is set
# up by the workflow module of choice... # up by the workflow module of choice...
profiles.i18n.enable = true; suites.i18n.enable = true;
# ...which is by the way is this one. # ...which is by the way is this one.
workflows.workflows.a-happy-gnome.enable = true; workflows.workflows.a-happy-gnome.enable = true;
@ -43,7 +43,7 @@ in
(lib.mkIf (hasAnyWorkflowEnabled [ "a-happy-gnome" "knome" "mosey-branch" ]) { (lib.mkIf (hasAnyWorkflowEnabled [ "a-happy-gnome" "knome" "mosey-branch" ]) {
hosts.ni.networking.setup = "networkmanager"; hosts.ni.networking.setup = "networkmanager";
profiles.i18n.setup = "ibus"; suites.i18n.setup = "ibus";
}) })
]); ]);
} }

View File

@ -11,7 +11,7 @@ in
config = lib.mkIf cfg.enable (lib.mkMerge [ config = lib.mkIf cfg.enable (lib.mkMerge [
{ {
# Bring all of the software development goodies. # Bring all of the software development goodies.
profiles.dev = { suites.dev = {
enable = true; enable = true;
extras.enable = true; extras.enable = true;
hardware.enable = true; hardware.enable = true;

View File

@ -10,7 +10,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# Bring all of the goodies. # Bring all of the goodies.
profiles.gaming = { suites.gaming = {
enable = true; enable = true;
emulators.enable = true; emulators.enable = true;
retro-computing.enable = true; retro-computing.enable = true;
@ -28,7 +28,7 @@ in
programs.steam.remotePlay.openFirewall = true; programs.steam.remotePlay.openFirewall = true;
# Enable the Wine setup for Linux gaming with Windows games. # Enable the Wine setup for Linux gaming with Windows games.
profiles.desktop.wine.enable = true; suites.desktop.wine.enable = true;
# Yes... Play your Brawl Stars and Clash Royale in NixOS. :) # Yes... Play your Brawl Stars and Clash Royale in NixOS. :)
virtualisation.waydroid.enable = true; virtualisation.waydroid.enable = true;

View File

@ -53,7 +53,7 @@
# All of the keys required to deploy the secrets. # All of the keys required to deploy the secrets.
sops.age.keyFile = "/var/lib/sops-nix/key.txt"; sops.age.keyFile = "/var/lib/sops-nix/key.txt";
profiles.server = { suites.server = {
enable = true; enable = true;
cleanup.enable = true; cleanup.enable = true;
}; };

View File

@ -30,6 +30,6 @@
programs.git.package = lib.mkForce pkgs.git; programs.git.package = lib.mkForce pkgs.git;
# Setting the development environment mainly for container-related work. # Setting the development environment mainly for container-related work.
profiles.dev.enable = true; suites.dev.enable = true;
profiles.dev.containers.enable = true; suites.dev.containers.enable = true;
} }

View File

@ -2,10 +2,10 @@
{ config, lib, pkgs, ... }@attrs: { config, lib, pkgs, ... }@attrs:
let let
cfg = config.profiles.desktop; cfg = config.suites.desktop;
in in
{ {
options.profiles.desktop = { options.suites.desktop = {
enable = lib.mkEnableOption "installations of desktop apps"; enable = lib.mkEnableOption "installations of desktop apps";
graphics.enable = graphics.enable =
lib.mkEnableOption "installations of graphics-related apps"; lib.mkEnableOption "installations of graphics-related apps";

View File

@ -2,9 +2,9 @@
# If you're looking for text editors, go to `./editors.nix`. # If you're looking for text editors, go to `./editors.nix`.
{ config, lib, pkgs, ... }@attrs: { config, lib, pkgs, ... }@attrs:
let cfg = config.profiles.dev; let cfg = config.suites.dev;
in { in {
options.profiles.dev = { options.suites.dev = {
enable = enable =
lib.mkEnableOption "basic set of programs for development setup"; lib.mkEnableOption "basic set of programs for development setup";
shell.enable = shell.enable =

View File

@ -7,9 +7,9 @@
# for me is not worth to maintain. # for me is not worth to maintain.
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let cfg = config.profiles.editors; let cfg = config.suites.editors;
in { in {
options.profiles.editors = { options.suites.editors = {
neovim.enable = lib.mkEnableOption "basic Neovim setup"; neovim.enable = lib.mkEnableOption "basic Neovim setup";
vscode.enable = lib.mkEnableOption "basic Visual Studio Code setup"; vscode.enable = lib.mkEnableOption "basic Visual Studio Code setup";
}; };

View File

@ -1,9 +1,9 @@
# Instant setup for using internationalized languages. # Instant setup for using internationalized languages.
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let cfg = config.profiles.i18n; let cfg = config.suites.i18n;
in { in {
options.profiles.i18n.enable = options.suites.i18n.enable =
lib.mkEnableOption "fcitx5 as input method engine"; lib.mkEnableOption "fcitx5 as input method engine";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -1,9 +1,9 @@
# All of your embarrassing moments, marked here forever. # All of your embarrassing moments, marked here forever.
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let cfg = config.profiles.archiving; let cfg = config.suites.archiving;
in { in {
options.profiles.archiving.enable = options.suites.archiving.enable =
lib.mkEnableOption "installation of various archiving tools"; lib.mkEnableOption "installation of various archiving tools";
# This is not going to set BorgBackup NixOS services for you. # This is not going to set BorgBackup NixOS services for you.

View File

@ -4,10 +4,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.profiles.browsers; cfg = config.suites.browsers;
in in
{ {
options.profiles.browsers = { options.suites.browsers = {
firefox.enable = lib.mkEnableOption "Firefox and its fixed configuration"; firefox.enable = lib.mkEnableOption "Firefox and its fixed configuration";
chromium.enable = lib.mkEnableOption "Chromium and its fixed configuration"; chromium.enable = lib.mkEnableOption "Chromium and its fixed configuration";
}; };

View File

@ -3,9 +3,9 @@
# That can be found in the `themes` module. # That can be found in the `themes` module.
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
let cfg = config.profiles.desktop; let cfg = config.suites.desktop;
in { in {
options.profiles.desktop = { options.suites.desktop = {
enable = enable =
lib.mkEnableOption "basic desktop-related services and default programs"; lib.mkEnableOption "basic desktop-related services and default programs";
audio.enable = audio.enable =

View File

@ -1,9 +1,9 @@
# The module for anything dev-related. # The module for anything dev-related.
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let cfg = config.profiles.dev; let cfg = config.suites.dev;
in { in {
options.profiles.dev = { options.suites.dev = {
enable = lib.mkEnableOption "basic configuration for software development"; enable = lib.mkEnableOption "basic configuration for software development";
extras.enable = lib.mkEnableOption "additional shell utilities"; extras.enable = lib.mkEnableOption "additional shell utilities";
hardware.enable = lib.mkEnableOption "additional hardware-related dev utilities"; hardware.enable = lib.mkEnableOption "additional hardware-related dev utilities";

View File

@ -1,6 +1,6 @@
# A bunch of predefined filesystem configurations for several devices. This is # A bunch of predefined filesystem configurations for several devices. This is
# nice for setting up shop for certain tasks with the flick of the switch to ON # nice for setting up shop for certain tasks with the flick of the switch to ON
# (e.g., `config.profiles.filesystem.archive.enable = true`) and not have # (e.g., `config.suites.filesystem.archive.enable = true`) and not have
# conflicting settings all throughout the configuration. # conflicting settings all throughout the configuration.
# #
# Much of the filesystem setups are taking advantage of systemd's fstab # Much of the filesystem setups are taking advantage of systemd's fstab
@ -9,10 +9,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.profiles.filesystem; cfg = config.suites.filesystem;
in in
{ {
options.profiles.filesystem = { options.suites.filesystem = {
tools.enable = lib.mkEnableOption "filesystem-related settings"; tools.enable = lib.mkEnableOption "filesystem-related settings";
setups = { setups = {
archive.enable = lib.mkEnableOption "automounting offline archive"; archive.enable = lib.mkEnableOption "automounting offline archive";

View File

@ -2,10 +2,10 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
let let
cfg = config.profiles.gaming; cfg = config.suites.gaming;
in in
{ {
options.profiles.gaming = { options.suites.gaming = {
enable = lib.mkEnableOption "basic gaming setup"; enable = lib.mkEnableOption "basic gaming setup";
emulators.enable = lib.mkEnableOption "installation of individual game emulators"; emulators.enable = lib.mkEnableOption "installation of individual game emulators";
retro-computing.enable = lib.mkEnableOption "installation of retro computer systems"; retro-computing.enable = lib.mkEnableOption "installation of retro computer systems";

View File

@ -4,10 +4,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.profiles.i18n; cfg = config.suites.i18n;
in in
{ {
options.profiles.i18n = { options.suites.i18n = {
enable = lib.mkEnableOption "main i18n config"; enable = lib.mkEnableOption "main i18n config";
setup = lib.mkOption { setup = lib.mkOption {
type = lib.types.enum [ "fcitx5" "ibus" ]; type = lib.types.enum [ "fcitx5" "ibus" ];

View File

@ -4,10 +4,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.profiles.server; cfg = config.suites.server;
in in
{ {
options.profiles.server = { options.suites.server = {
enable = lib.mkEnableOption "server-related settings"; enable = lib.mkEnableOption "server-related settings";
cleanup.enable = lib.mkEnableOption "cleanup service for the system"; cleanup.enable = lib.mkEnableOption "cleanup service for the system";
auto-upgrade.enable = lib.mkEnableOption "unattended system upgrades"; auto-upgrade.enable = lib.mkEnableOption "unattended system upgrades";
@ -17,7 +17,7 @@ in
({ ({
assertions = [{ assertions = [{
assertion = assertion =
!config.profiles.desktop.enable || !config.profiles.server.enable; !config.suites.desktop.enable || !config.suites.server.enable;
message = '' message = ''
Desktop profile is also enabled. The profiles `desktop` and `server` Desktop profile is also enabled. The profiles `desktop` and `server`
are mutually exclusive. are mutually exclusive.

View File

@ -1,10 +1,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.profiles.vpn; cfg = config.suites.vpn;
in in
{ {
options.profiles.vpn = { options.suites.vpn = {
personal.enable = lib.mkEnableOption "personal VPN configuration with Wireguard"; personal.enable = lib.mkEnableOption "personal VPN configuration with Wireguard";
}; };