flocon/modules/options/homeVars.nix

32 lines
641 B
Nix
Raw Permalink Normal View History

treewide: refactor structure I have decided to refactor the entire structure of my repository, as the old one was getting quite cluttered and I needed something that made more sense. I've decided to go with the following, which will be explained in the README when I find the time to do it. The gist of it is: - Put everything shared into its shared directory - Rewrite the theme module (now style) to be more split, as it is theming a lot of different apps - Merge nixos and home-manager configurations back into a singular config directory Thanks a lot to llakala for the massive help she was with my Nix code. commit 66ff9820f8edc98350544df6848cfcc30c9deb77 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 19:23:28 2024 +0100 shared/nixosModules/style: use sharedModules commit 127129404976e88d2b314f7bba87685a9c290685 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 19:23:13 2024 +0100 treewide: remove unused nvidia file commit ab18a424182e95f2e7767184e2dc2358426157ca Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 19:02:34 2024 +0100 flake: remove uneeded directory for nodes commit f8afc9f4615b725064279530984d13cb73860d6e Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 18:43:19 2024 +0100 shared/nixosModules/style: split everything into its file commit 851a4d0d32176bd8fcbca5dfb7ca88f1cbb9b368 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 11:15:40 2024 +0100 repo: update README commit e01237d59a134b1f31ddfdbc9c9edcc0eabf9f98 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 11:00:56 2024 +0100 hosts/solaire: delete unused modules directory commit 1c3665ec1cd283274c9775c31bb347a06ab7243d Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 11:00:24 2024 +0100 pkgs: move to shared/pkgs commit 587e8d321bfe956b3a67c159e071e62f5bca1227 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:57:03 2024 +0100 treewide: split up options from theming module, rename to style As an initial step towards refactoring the theming module, the options have been split up from the configuration itself. This will allow to find available options quicker, and separate concerns nicely. It was also renamed to style, to avoid confusion with its own options (eg. gtk.theme). commit 87bb04f0653b9363e692084ae15eae8de30b4f1c Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:19:59 2024 +0100 config/nixos/core/boot: remove unused arguments commit 8e7c0584efaaf2e5a7bec37fd79d33fee13cf813 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:19:46 2024 +0100 hosts: move host-specific configuration to hosts/{host}/config commit a600143e8a116f211ae21b637517515e6a055a20 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:19:24 2024 +0100 nvidia: move to hosts/solaire commit 7174a33a447256eda6e0de5efbf83083bb5f94e8 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:14:06 2024 +0100 treewide: reorganize general structure commit b86f1470ed00f84246fb91fa6eb7a5f9afe22695 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:03:08 2024 +0100 hosts/solaire: set global vars commit de6ea242c08762535e629260c659d01caef1eb7b Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:24:59 2024 +0100 system/network: replace hard-coded values with global vars commit 5acf11adcad6872d52efcdff0e95a07afa1bce81 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:24:51 2024 +0100 system/core/users: replace hard-coded values with global vars commit 96425172a04c7c43cc0989b6dda19305bf3a5e0d Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:24:30 2024 +0100 hosts/vamos: set global vars commit 8338818b7d84541fd37d2a195e845aff575c3d53 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:24:23 2024 +0100 hosts: import local modules by default commit ffb60ac8694b0fa18851a1a3ce8b0f77bd050531 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:23:54 2024 +0100 flake: update eachSystem to use lib.systems.flakeExposed commit e98a15db1d449c7a8993abac2ede6fdb5fe84958 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:23:33 2024 +0100 modules: create modules to hold global variables
2024-12-18 18:24:59 +00:00
{
config,
lib,
options,
...
}: let
inherit (lib) mkIf mkOption;
inherit (lib.types) str;
in {
options.local.homeVars = {
fullName = mkOption {
type = str;
description = "your full name (used for git commits and user description)";
default = null;
};
email = mkOption {
type = str;
description = "your email (used for git commits)";
default = null;
};
};
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.assertions = mkIf (!config.local.profiles.server.enable) [
treewide: refactor structure I have decided to refactor the entire structure of my repository, as the old one was getting quite cluttered and I needed something that made more sense. I've decided to go with the following, which will be explained in the README when I find the time to do it. The gist of it is: - Put everything shared into its shared directory - Rewrite the theme module (now style) to be more split, as it is theming a lot of different apps - Merge nixos and home-manager configurations back into a singular config directory Thanks a lot to llakala for the massive help she was with my Nix code. commit 66ff9820f8edc98350544df6848cfcc30c9deb77 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 19:23:28 2024 +0100 shared/nixosModules/style: use sharedModules commit 127129404976e88d2b314f7bba87685a9c290685 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 19:23:13 2024 +0100 treewide: remove unused nvidia file commit ab18a424182e95f2e7767184e2dc2358426157ca Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 19:02:34 2024 +0100 flake: remove uneeded directory for nodes commit f8afc9f4615b725064279530984d13cb73860d6e Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 18:43:19 2024 +0100 shared/nixosModules/style: split everything into its file commit 851a4d0d32176bd8fcbca5dfb7ca88f1cbb9b368 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 11:15:40 2024 +0100 repo: update README commit e01237d59a134b1f31ddfdbc9c9edcc0eabf9f98 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 11:00:56 2024 +0100 hosts/solaire: delete unused modules directory commit 1c3665ec1cd283274c9775c31bb347a06ab7243d Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 11:00:24 2024 +0100 pkgs: move to shared/pkgs commit 587e8d321bfe956b3a67c159e071e62f5bca1227 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:57:03 2024 +0100 treewide: split up options from theming module, rename to style As an initial step towards refactoring the theming module, the options have been split up from the configuration itself. This will allow to find available options quicker, and separate concerns nicely. It was also renamed to style, to avoid confusion with its own options (eg. gtk.theme). commit 87bb04f0653b9363e692084ae15eae8de30b4f1c Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:19:59 2024 +0100 config/nixos/core/boot: remove unused arguments commit 8e7c0584efaaf2e5a7bec37fd79d33fee13cf813 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:19:46 2024 +0100 hosts: move host-specific configuration to hosts/{host}/config commit a600143e8a116f211ae21b637517515e6a055a20 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:19:24 2024 +0100 nvidia: move to hosts/solaire commit 7174a33a447256eda6e0de5efbf83083bb5f94e8 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:14:06 2024 +0100 treewide: reorganize general structure commit b86f1470ed00f84246fb91fa6eb7a5f9afe22695 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 10:03:08 2024 +0100 hosts/solaire: set global vars commit de6ea242c08762535e629260c659d01caef1eb7b Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:24:59 2024 +0100 system/network: replace hard-coded values with global vars commit 5acf11adcad6872d52efcdff0e95a07afa1bce81 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:24:51 2024 +0100 system/core/users: replace hard-coded values with global vars commit 96425172a04c7c43cc0989b6dda19305bf3a5e0d Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:24:30 2024 +0100 hosts/vamos: set global vars commit 8338818b7d84541fd37d2a195e845aff575c3d53 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:24:23 2024 +0100 hosts: import local modules by default commit ffb60ac8694b0fa18851a1a3ce8b0f77bd050531 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:23:54 2024 +0100 flake: update eachSystem to use lib.systems.flakeExposed commit e98a15db1d449c7a8993abac2ede6fdb5fe84958 Author: Anthony Rodriguez <anthony@nezia.dev> Date: Wed Dec 18 09:23:33 2024 +0100 modules: create modules to hold global variables
2024-12-18 18:24:59 +00:00
{
assertion = options.local.homeVars.fullName.isDefined;
}
{
assertion = options.local.homeVars.email.isDefined;
}
];
}