2024-05-04 20:57:33 +02:00
|
|
|
{lib, ...}: let
|
2024-01-15 12:42:01 +01:00
|
|
|
inherit (lib) types;
|
|
|
|
# Like mkEnableOption but defaults to true
|
2024-05-04 20:57:33 +02:00
|
|
|
mkDisableOption = option:
|
2024-04-05 11:55:35 +02:00
|
|
|
(lib.mkEnableOption option)
|
|
|
|
// {
|
|
|
|
default = true;
|
|
|
|
example = false;
|
|
|
|
};
|
2024-05-04 20:57:33 +02:00
|
|
|
mkImageOption = {
|
|
|
|
description,
|
|
|
|
url,
|
|
|
|
sha256 ? "",
|
|
|
|
}:
|
2024-04-05 11:55:35 +02:00
|
|
|
lib.mkOption {
|
|
|
|
inherit description;
|
|
|
|
type = types.path;
|
2024-05-04 20:57:33 +02:00
|
|
|
default = builtins.fetchurl {inherit url sha256;};
|
2024-04-05 11:55:35 +02:00
|
|
|
defaultText = lib.literalMD "![${description}](${url})";
|
|
|
|
};
|
2024-01-15 12:42:01 +01:00
|
|
|
|
|
|
|
gui.options = {
|
|
|
|
enable = lib.mkEnableOption "jalil's default gui configuration.";
|
|
|
|
# Fix for using Xinput mode on 8bitdo Ultimate C controller
|
|
|
|
# Inspired by https://aur.archlinux.org/packages/8bitdo-ultimate-controller-udev
|
|
|
|
# Adapted from: https://gist.github.com/interdependence/28452fbfbe692986934fbe1e54c920d4
|
|
|
|
"8bitdoFix" = mkDisableOption "a fix for 8bitdo controllers";
|
|
|
|
steamHardwareSupport = mkDisableOption "steam hardware support";
|
|
|
|
ydotool = lib.mkOption {
|
2024-04-19 19:23:49 +02:00
|
|
|
description = "Jalil's default ydotool configuration.";
|
2024-05-04 20:57:33 +02:00
|
|
|
default = {};
|
2024-01-15 12:42:01 +01:00
|
|
|
type = types.submodule {
|
|
|
|
options.enable = mkDisableOption "ydotool";
|
|
|
|
options.autoStart = mkDisableOption "autostarting ydotool at login";
|
|
|
|
};
|
|
|
|
};
|
2024-01-22 11:08:48 +01:00
|
|
|
sway = mkDisableOption "sway";
|
2024-01-15 12:42:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
styling.options = {
|
2024-05-24 06:29:14 +02:00
|
|
|
enable = mkDisableOption "jalil's default styling (disables stylix)";
|
2024-02-18 16:46:15 +01:00
|
|
|
wallpaper = mkImageOption {
|
2024-01-15 12:42:01 +01:00
|
|
|
description = "The wallpaper to use.";
|
2024-02-18 16:46:15 +01:00
|
|
|
url = "https://raw.githubusercontent.com/lunik1/nixos-logo-gruvbox-wallpaper/d4937c424fad79c1136a904599ba689fcf8d0fad/png/gruvbox-dark-rainbow.png";
|
|
|
|
sha256 = "036gqhbf6s5ddgvfbgn6iqbzgizssyf7820m5815b2gd748jw8zc";
|
2024-01-15 12:42:01 +01:00
|
|
|
};
|
2024-02-18 16:46:15 +01:00
|
|
|
bootLogo = mkImageOption {
|
2024-01-15 12:42:01 +01:00
|
|
|
description = "The logo used by plymouth at boot.";
|
|
|
|
# http://xenia-linux-site.glitch.me/images/cathodegaytube-splash.png
|
2024-02-18 16:46:15 +01:00
|
|
|
url = "https://efimero.github.io/xenia-images/cathodegaytube-splash.png";
|
|
|
|
sha256 = "qKugUfdRNvMwSNah+YmMepY3Nj6mWlKFh7jlGlAQDo8=";
|
2024-01-15 12:42:01 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config.options = {
|
|
|
|
enable = lib.mkEnableOption "jalil's default configuration.";
|
2024-03-02 18:56:30 +01:00
|
|
|
dev = lib.mkOption {
|
2024-04-19 19:23:49 +02:00
|
|
|
description = "Options for setting up a dev environment";
|
2024-05-04 20:57:33 +02:00
|
|
|
default = {};
|
|
|
|
type = types.submodule {options.enable = lib.mkEnableOption "dev configuration";};
|
2024-03-02 18:56:30 +01:00
|
|
|
};
|
2024-01-15 12:42:01 +01:00
|
|
|
gui = lib.mkOption {
|
2024-04-19 19:23:49 +02:00
|
|
|
description = "Jalil's default configuration for a NixOS gui.";
|
2024-05-04 20:57:33 +02:00
|
|
|
default = {};
|
2024-01-15 12:42:01 +01:00
|
|
|
type = types.submodule gui;
|
|
|
|
};
|
|
|
|
styling = lib.mkOption {
|
|
|
|
description = "Jalil's styling options";
|
2024-05-04 20:57:33 +02:00
|
|
|
default = {};
|
2024-01-15 12:42:01 +01:00
|
|
|
type = types.submodule styling;
|
|
|
|
};
|
2024-01-15 22:19:06 +01:00
|
|
|
importSSHKeysFromGithub = lib.mkOption {
|
2024-04-19 19:23:49 +02:00
|
|
|
description = ''
|
2024-01-15 22:19:06 +01:00
|
|
|
Import public ssh keys from a github username.
|
|
|
|
|
|
|
|
This will fetch the keys from https://github.com/$${username}.keys.
|
|
|
|
|
|
|
|
The format is `"$${github-username}" = $${sha256-hash}`. The example
|
|
|
|
will try to fetch the keys from <https://github.com/jalil-salame.keys>.
|
2024-01-31 21:17:59 +01:00
|
|
|
|
|
|
|
**Warning**: this will interfere with services like gitea that override
|
|
|
|
the default ssh behaviour. In that case you want to use
|
|
|
|
`users.users.<name>.openssh.authorizedKeys.keyFiles` on the users you
|
|
|
|
want to allow ssh logins.
|
2024-01-15 22:19:06 +01:00
|
|
|
'';
|
2024-05-04 20:57:33 +02:00
|
|
|
default = {};
|
2024-04-05 11:55:35 +02:00
|
|
|
example = {
|
|
|
|
"jalil-salame" = "sha256:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
|
|
};
|
2024-01-15 22:19:06 +01:00
|
|
|
type = types.attrsOf types.str;
|
|
|
|
};
|
2024-01-15 12:42:01 +01:00
|
|
|
};
|
2024-05-04 20:57:33 +02:00
|
|
|
in {
|
2024-01-15 12:42:01 +01:00
|
|
|
options.jconfig = lib.mkOption {
|
2024-04-19 19:23:49 +02:00
|
|
|
description = "Jalil's default NixOS configuration.";
|
2024-05-04 20:57:33 +02:00
|
|
|
default = {};
|
2024-01-15 12:42:01 +01:00
|
|
|
type = types.submodule config;
|
|
|
|
};
|
|
|
|
}
|