grimm-nixos-laptop/load_common.nix

210 lines
5.0 KiB
Nix
Raw Normal View History

2024-03-24 16:59:47 +01:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.grimmShared;
2024-04-10 16:51:28 +02:00
sync_mod = types.submodule ({ config, ... }: {
options = {
remote = mkOption {
type = types.nonEmptyStr;
description = "path on the cloud server";
};
2024-04-10 16:51:28 +02:00
local = mkOption {
type = types.nonEmptyStr;
default = "$HOME/" + (lib.strings.concatStrings (builtins.match "/*(.+)" config.remote));
description = "local path to sync";
};
};
});
2024-04-10 16:42:11 +02:00
2024-04-10 16:51:28 +02:00
sway_conf = types.submodule ({ config, ... }: rec {
2024-04-10 16:42:11 +02:00
options = {
keybinds = mkOption {
type = types.attrsOf types.str;
2024-04-10 16:51:28 +02:00
default = { };
2024-04-10 16:42:11 +02:00
description = "set of keybinds assigning key combo to action";
};
autolaunch = mkOption {
type = types.listOf types.str;
2024-04-10 16:51:28 +02:00
default = [ ];
2024-04-10 16:42:11 +02:00
description = "set of commands to be run at sway startup";
};
extraConfig = mkOption {
type = types.str;
default = "";
description = "additional sway config to be included";
};
definitions = mkOption {
type = types.attrsOf types.str;
2024-04-10 16:51:28 +02:00
default = { };
2024-04-10 16:42:11 +02:00
description = "set of definitions assigning variable to value";
};
modes = mkOption {
type = types.attrsOf sway_conf;
2024-04-10 16:51:28 +02:00
default = { };
2024-04-10 16:42:11 +02:00
description = "possible modes to switch to, e.g. resize";
};
};
});
2024-04-10 16:51:28 +02:00
in
{
2024-03-24 16:59:47 +01:00
options.grimmShared = {
enable = mkEnableOption "grimm-shared-common";
2024-04-10 16:51:28 +02:00
2024-03-24 16:59:47 +01:00
locale = mkOption {
type = types.bool;
default = true;
description = "Sets german units but english language";
};
printing = mkOption {
type = types.bool;
default = false;
description = "Enables print and scan related options";
};
portals = mkOption {
type = types.bool;
default = false;
description = "Enables portals for wlr, gtk and kde as well as fixes fonts";
};
network = mkOption {
type = types.bool;
default = false;
description = "Enables network manager, wifi and bluetooth";
};
tooling = {
enable = mkEnableOption "grimm-tooling";
2024-04-10 16:51:28 +02:00
2024-03-24 16:59:47 +01:00
pass = mkOption {
type = types.bool;
default = true;
description = "Enables password-store, gnupg and such secret handling";
};
git_user = mkOption {
type = types.str;
default = "Grimmauld";
description = "Username for git to use";
};
git_email = mkOption {
type = types.str;
default = "${config.grimmShared.tooling.git_user}@grimmauld.de";
description = "Email for git to use";
};
};
sound = mkOption {
type = types.bool;
default = false;
description = "whether to enable sound";
};
graphical = mkOption {
type = types.bool;
default = false;
description = "whether to enable graphical components";
};
gaming = mkOption {
type = types.bool;
default = false;
description = "enables steam, heroic, prism and gamemoded";
};
firefox = {
enable = mkEnableOption "grimm-firefox";
plugins = mkOption {
type = types.attrsOf types.str;
2024-04-10 16:51:28 +02:00
default = { };
2024-03-24 16:59:47 +01:00
description = "set of plugins to install. Format: guid = short-id";
};
disableUserPlugins = mkOption {
type = types.bool;
default = false;
description = "disables user controlled plugins";
};
};
sway = {
enable = mkEnableOption "grimm-sway";
2024-04-10 16:42:11 +02:00
bar = {
enable = mkEnableOption "grimm-sway-bar";
2024-04-10 16:51:28 +02:00
2024-04-10 16:42:11 +02:00
style = mkOption {
type = types.nullOr types.path;
default = null;
description = "waybar style sheet to use";
};
config = mkOption {
type = types.nullOr types.path;
default = null;
description = "waybar config to use";
};
2024-03-26 14:18:33 +01:00
};
2024-04-10 16:42:11 +02:00
config = mkOption {
type = sway_conf;
description = "sway config to use";
2024-03-24 16:59:47 +01:00
};
};
2024-03-26 10:36:33 +01:00
cloudSync = {
enable = mkEnableOption "cloud_sync";
username = mkOption {
type = types.nonEmptyStr;
description = "username to use for cloud login";
};
server = mkOption {
type = types.nonEmptyStr;
description = "server url to use for cloud sync";
};
passwordFile = mkOption {
type = types.nonEmptyStr;
description = "password file to use for login";
};
};
};
2024-03-26 10:36:33 +01:00
options.users.users = mkOption {
type = types.attrsOf (types.submodule {
options = {
syncPaths = mkOption {
type = types.listOf sync_mod;
2024-04-10 16:51:28 +02:00
default = [ ];
description = "paths to sync via nextcloud";
};
2024-03-26 10:36:33 +01:00
};
});
2024-03-24 16:59:47 +01:00
};
imports = [
./common/localisation.nix
./common/printing.nix
./common/portals.nix
./common/networking.nix
./common/toolchains.nix
./common/sound.nix
./common/opengl.nix
./common/gaming.nix
./common/firefox.nix
./common/pass.nix
./common/sway.nix
2024-03-26 10:36:33 +01:00
./common/cloudsync.nix
2024-03-24 16:59:47 +01:00
];
}