2024-12-18 18:24:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
options,
|
|
|
|
inputs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (lib) attrNames mkEnableOption mkOption pathExists;
|
|
|
|
inherit (lib.types) attrs bool enum package path str;
|
|
|
|
|
|
|
|
cfg = config.local.style;
|
|
|
|
in {
|
|
|
|
options.local.style = {
|
|
|
|
enable = mkEnableOption "style";
|
|
|
|
schemeName = mkOption {
|
|
|
|
description = ''
|
|
|
|
Name of the tinted-theming color scheme to use.
|
|
|
|
'';
|
|
|
|
type = enum (attrNames inputs.basix.schemeData.base16);
|
|
|
|
example = "catppuccin-mocha";
|
|
|
|
default = "catppuccin-mocha";
|
|
|
|
};
|
|
|
|
|
|
|
|
scheme = mkOption {
|
|
|
|
description = ''
|
|
|
|
Computed scheme from `config.local.style.schemeName`.
|
|
|
|
'';
|
|
|
|
type = attrs;
|
|
|
|
readOnly = true;
|
|
|
|
};
|
|
|
|
wallpaper = mkOption {
|
|
|
|
description = ''
|
|
|
|
Location of the wallpaper that will be used throughout the system.
|
|
|
|
'';
|
|
|
|
type = path;
|
|
|
|
example = lib.literalExpression "./wallpaper.png";
|
|
|
|
default = pkgs.fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/e0cf0eb237dc5baba86661a3572b20a6183c1876/wallpapers/nix-wallpaper-nineish-catppuccin-frappe.png?raw=true";
|
|
|
|
hash = "sha256-/HAtpGwLxjNfJvX5/4YZfM8jPNStaM3gisK8+ImRmQ4=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
cursorTheme = {
|
|
|
|
name = mkOption {
|
|
|
|
description = ''
|
|
|
|
Name of the cursor theme.
|
|
|
|
'';
|
|
|
|
default = "phinger-cursors-dark";
|
|
|
|
};
|
|
|
|
package = mkOption {
|
|
|
|
type = package;
|
|
|
|
description = ''
|
|
|
|
Package providing the cursor theme.
|
|
|
|
'';
|
|
|
|
default = pkgs.phinger-cursors;
|
|
|
|
};
|
|
|
|
size = mkOption {
|
|
|
|
description = ''
|
|
|
|
Size of the cursor.
|
|
|
|
'';
|
|
|
|
default = 32;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
avatar = mkOption {
|
|
|
|
description = ''
|
|
|
|
Path to an avatar image (used for hyprlock).
|
|
|
|
'';
|
treewide: huge refactor, move everything into modules
As my configuration was getting more and more complex, I thought it was
time to switch to a completely modular approach. A local module system
has been created, containing profiles (some will be added later, as I
went with as generic as I could, but I would like to make them more
specialized).
NixOS and home-manager modules have also been separated, which I don't
like too much, and will switch to a cleaner implementation of home
management systems.
commit 09a07b15dae18bdb455d7b08c92bfacf9e51c8e9
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Wed Jan 15 22:56:32 2025 +0100
treewide: config/home-manager -> modules/hm
Moved every remaining home-manager piece of configuration to its own
hm
module.
commit d7356d3fdef0d4f6236a3c5a9e668bc291be9655
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Wed Jan 15 14:55:03 2025 +0100
modules/nix/services: add keyd
commit c846cc95ae8f786766649a5e9c4d12d15087b0c4
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 21:41:13 2025 +0100
flake: update inputs
commit 94d59b47b3ca03563dbe5e0e9dd208a74db137be
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 21:41:09 2025 +0100
modules/nix/services: remove kanata
commit 4429b604dd931ce1b585a59416a154b84ec079b4
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 21:41:01 2025 +0100
config/home-manager: remove services/udiskie.nix
commit 376024d4a50cdd91563263f656390c6b2237ab1c
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 20:06:31 2025 +0100
treewide: config/home-manager/services -> modules/hm/services
commit b808281674d6c09cea216d17caa690bda341dcb0
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 19:33:31 2025 +0100
treewide: config/home-manager -> modules/hm
Started moving HM config to the new local modules system.
Conditionally
toggling based on profiles and modules.
commit 2b77ac239e7a8f7cf5ed0384a1e8b49aadf0a008
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 15:10:49 2025 +0100
treewide: config/nixos/services -> modules/nix/services
Moved every service in their own module, and conditionally enable
them
based on profiles.
commit 7aadc0c8feade16770870dcc5563012588794beb
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 14:44:38 2025 +0100
modules/nix/programs/hyprland: make chromium/electron apps run on
Wayland
commit ec285bcc523d30639bac9e6d55ce6b3ab0000e28
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 13:58:52 2025 +0100
treewide: config/nixos/programs -> modules/nix/programs
Here, we also use the option we just added,
`local.modules.hyprland.enable` to toggle Hyprland, as well as the
profiles. Also removed other unused configuration, such as KDE/Gnome.
commit 76a2caa9c7edc14e8dece31ac70777df0fe9bac7
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 14:07:41 2025 +0100
options/modules: add options for Hyprland
commit 9f3d6ae768466330808a7ba9716ad73ad8c1c471
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 13:56:56 2025 +0100
config/nix/programs: cleanup unused files
commit f3c08b843199b64cc232dcbf508d6640a89ce671
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 13:55:17 2025 +0100
treewide: config/nixos/programs/fonts -> modules/nix/core/fonts
commit c37f00205b7bab05d4c6fd565d7d5cce71aab3af
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 13:49:29 2025 +0100
treewide: config/nixos/nix -> modules/nix/core/nix.nix
commit a734372732c62383e7f950b4f8dd9b755d9b29f9
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 13:43:23 2025 +0100
treewide: config/nixos/network -> modules/nix/core/networking
commit 07a9c5f510886f730808c2bd892d11692e6ebc73
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:34:01 2025 +0100
treewide: move hardware into modules
commit 7d1baf7eb5bb5d2d1623414bd8a5ddb0f75e39f4
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:33:21 2025 +0100
options: use mkIf for assertions
commit 9b01b402530df484d4c4dd0f235206dd43f1942b
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:33:00 2025 +0100
hosts: set profiles
We set profiles before moving the config so nothing breaks and we
keep a
working commit history :)
commit 65ea8beba00be7539a3a76bb50286f50ec26e51d
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:22:06 2025 +0100
options: remove isServer since we have server profile
commit 7906864ae17143db11576a3cbae4e372441b437a
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:21:49 2025 +0100
options/profiles: add laptop profile
commit 99b6b41de3337aa11629de14308b678c833dfc97
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:01:33 2025 +0100
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.
commit b89a42ef13c094b5a16aa5c59c027f1b57c412a2
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 11:59:59 2025 +0100
modules/options: add profiles
The next step in the refactoring is to add different profiles, so
that
we may toggle them easily in our hosts. Here's the profiles I went
for:
- desktop: enables everything a desktop computer needs (graphics,
productivity apps, base apps such as browsers...)
- gaming: enables gaming configurations (steam, gamescope...)
- server: enables server configurations (website hosting, git
forge...)
I made sure the server profile can not be enabled if desktop/gaming
are
enabled, as it would not make sense to have desktop applications and
configurations on a server.
commit 851024052d34a3697e0da65069a87b73fe27a651
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 11:02:13 2025 +0100
modules: move style to nix/style
This is temporary, as we're going to get rid of that awkward style
module that was meant to be shared, but ended up being too specific
to
my use-case. We just put it in a nix directory for now, as we will
with
everything else. This will be refactored later to be mixed with the
relevant program's configuration.
commit bb55875491c4d3bc4da4c4039072ab6052d5c552
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 10:56:34 2025 +0100
treewide: move shared/nixosModules to modules
The idea of this refactor is, as the configuration is getting bigger
and
more complex, to move everything into a local modules system. The
idea
is to simplify hosts declaration and add a new layer of abstraction
to
avoid the long and redundant imports in hosts/default.nix, that I am
currently using.
First, we're going to move everything to the modules directory, and
split options from the proper configuration. That allows us to have
an
easier time understanding how the options are structured, as they
will
follow the directory structure and won't be mixed with the module
configuration.
2025-01-15 21:57:01 +00:00
|
|
|
default = ../../assets/avatar.png; # TODO silly, change this
|
2024-12-18 18:24:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
gtk = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = bool;
|
|
|
|
description = "enable GTK theming options";
|
|
|
|
default = cfg.enable;
|
|
|
|
};
|
|
|
|
theme = {
|
|
|
|
name = mkOption {
|
|
|
|
type = str;
|
|
|
|
description = "Name for the GTK theme";
|
|
|
|
default = "Catppuccin-GTK-Purple-Dark";
|
|
|
|
};
|
|
|
|
package = mkOption {
|
|
|
|
type = package;
|
|
|
|
description = "Package providing the GTK theme";
|
|
|
|
|
|
|
|
default = pkgs.magnetic-catppuccin-gtk.override {
|
|
|
|
accent = ["purple"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
iconTheme = {
|
|
|
|
name = mkOption {
|
|
|
|
type = str;
|
|
|
|
description = "The name for the icon theme that will be used for GTK programs";
|
|
|
|
default = "Papirus-Dark";
|
|
|
|
};
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = package;
|
|
|
|
description = "The GTK icon theme to be used";
|
|
|
|
default = pkgs.catppuccin-papirus-folders.override {
|
|
|
|
flavor = "mocha";
|
|
|
|
accent = "lavender";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
treewide: huge refactor, move everything into modules
As my configuration was getting more and more complex, I thought it was
time to switch to a completely modular approach. A local module system
has been created, containing profiles (some will be added later, as I
went with as generic as I could, but I would like to make them more
specialized).
NixOS and home-manager modules have also been separated, which I don't
like too much, and will switch to a cleaner implementation of home
management systems.
commit 09a07b15dae18bdb455d7b08c92bfacf9e51c8e9
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Wed Jan 15 22:56:32 2025 +0100
treewide: config/home-manager -> modules/hm
Moved every remaining home-manager piece of configuration to its own
hm
module.
commit d7356d3fdef0d4f6236a3c5a9e668bc291be9655
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Wed Jan 15 14:55:03 2025 +0100
modules/nix/services: add keyd
commit c846cc95ae8f786766649a5e9c4d12d15087b0c4
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 21:41:13 2025 +0100
flake: update inputs
commit 94d59b47b3ca03563dbe5e0e9dd208a74db137be
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 21:41:09 2025 +0100
modules/nix/services: remove kanata
commit 4429b604dd931ce1b585a59416a154b84ec079b4
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 21:41:01 2025 +0100
config/home-manager: remove services/udiskie.nix
commit 376024d4a50cdd91563263f656390c6b2237ab1c
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 20:06:31 2025 +0100
treewide: config/home-manager/services -> modules/hm/services
commit b808281674d6c09cea216d17caa690bda341dcb0
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 19:33:31 2025 +0100
treewide: config/home-manager -> modules/hm
Started moving HM config to the new local modules system.
Conditionally
toggling based on profiles and modules.
commit 2b77ac239e7a8f7cf5ed0384a1e8b49aadf0a008
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 15:10:49 2025 +0100
treewide: config/nixos/services -> modules/nix/services
Moved every service in their own module, and conditionally enable
them
based on profiles.
commit 7aadc0c8feade16770870dcc5563012588794beb
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 14:44:38 2025 +0100
modules/nix/programs/hyprland: make chromium/electron apps run on
Wayland
commit ec285bcc523d30639bac9e6d55ce6b3ab0000e28
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 13:58:52 2025 +0100
treewide: config/nixos/programs -> modules/nix/programs
Here, we also use the option we just added,
`local.modules.hyprland.enable` to toggle Hyprland, as well as the
profiles. Also removed other unused configuration, such as KDE/Gnome.
commit 76a2caa9c7edc14e8dece31ac70777df0fe9bac7
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 14:07:41 2025 +0100
options/modules: add options for Hyprland
commit 9f3d6ae768466330808a7ba9716ad73ad8c1c471
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 13:56:56 2025 +0100
config/nix/programs: cleanup unused files
commit f3c08b843199b64cc232dcbf508d6640a89ce671
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 13:55:17 2025 +0100
treewide: config/nixos/programs/fonts -> modules/nix/core/fonts
commit c37f00205b7bab05d4c6fd565d7d5cce71aab3af
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 13:49:29 2025 +0100
treewide: config/nixos/nix -> modules/nix/core/nix.nix
commit a734372732c62383e7f950b4f8dd9b755d9b29f9
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 13:43:23 2025 +0100
treewide: config/nixos/network -> modules/nix/core/networking
commit 07a9c5f510886f730808c2bd892d11692e6ebc73
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:34:01 2025 +0100
treewide: move hardware into modules
commit 7d1baf7eb5bb5d2d1623414bd8a5ddb0f75e39f4
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:33:21 2025 +0100
options: use mkIf for assertions
commit 9b01b402530df484d4c4dd0f235206dd43f1942b
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:33:00 2025 +0100
hosts: set profiles
We set profiles before moving the config so nothing breaks and we
keep a
working commit history :)
commit 65ea8beba00be7539a3a76bb50286f50ec26e51d
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:22:06 2025 +0100
options: remove isServer since we have server profile
commit 7906864ae17143db11576a3cbae4e372441b437a
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:21:49 2025 +0100
options/profiles: add laptop profile
commit 99b6b41de3337aa11629de14308b678c833dfc97
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 12:01:33 2025 +0100
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.
commit b89a42ef13c094b5a16aa5c59c027f1b57c412a2
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 11:59:59 2025 +0100
modules/options: add profiles
The next step in the refactoring is to add different profiles, so
that
we may toggle them easily in our hosts. Here's the profiles I went
for:
- desktop: enables everything a desktop computer needs (graphics,
productivity apps, base apps such as browsers...)
- gaming: enables gaming configurations (steam, gamescope...)
- server: enables server configurations (website hosting, git
forge...)
I made sure the server profile can not be enabled if desktop/gaming
are
enabled, as it would not make sense to have desktop applications and
configurations on a server.
commit 851024052d34a3697e0da65069a87b73fe27a651
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 11:02:13 2025 +0100
modules: move style to nix/style
This is temporary, as we're going to get rid of that awkward style
module that was meant to be shared, but ended up being too specific
to
my use-case. We just put it in a nix directory for now, as we will
with
everything else. This will be refactored later to be mixed with the
relevant program's configuration.
commit bb55875491c4d3bc4da4c4039072ab6052d5c552
Author: Anthony Rodriguez <anthony@nezia.dev>
Date: Tue Jan 14 10:56:34 2025 +0100
treewide: move shared/nixosModules to modules
The idea of this refactor is, as the configuration is getting bigger
and
more complex, to move everything into a local modules system. The
idea
is to simplify hosts declaration and add a new layer of abstraction
to
avoid the long and redundant imports in hosts/default.nix, that I am
currently using.
First, we're going to move everything to the modules directory, and
split options from the proper configuration. That allows us to have
an
easier time understanding how the options are structured, as they
will
follow the directory structure and won't be mixed with the module
configuration.
2025-01-15 21:57:01 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2024-12-18 18:24:59 +00:00
|
|
|
assertions = [
|
|
|
|
(let
|
|
|
|
themePath = cfg.gtk.theme.package + /share/themes + "/${cfg.gtk.theme.name}";
|
|
|
|
in {
|
|
|
|
assertion = cfg.gtk.enable -> pathExists themePath;
|
|
|
|
message = ''
|
|
|
|
${toString themePath} set by the GTK module does not exist!
|
|
|
|
|
|
|
|
To suppress this message, make sure that
|
|
|
|
`config.modules.theme.gtk.theme.package` contains
|
|
|
|
the path `${cfg.theme.name}`
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
{
|
|
|
|
assertion = cfg.enable -> options.local.systemVars.username.isDefined;
|
|
|
|
message = ''
|
|
|
|
When enabling system-wide theming, a username needs to be set in `config.local.systemVars.username`.
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
local.style.scheme = inputs.basix.schemeData.base16.${cfg.schemeName};
|
|
|
|
};
|
|
|
|
}
|