Add tea and config.
Config is currently not written due to secret management issues.
This commit is contained in:
parent
5fa8417e77
commit
b7b6e0a3dd
2 changed files with 120 additions and 0 deletions
104
home-manager/modules/tea/default.nix
Normal file
104
home-manager/modules/tea/default.nix
Normal file
|
@ -0,0 +1,104 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.eboskma.programs.tea;
|
||||
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
|
||||
loginsType = types.submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
description = "Name of the login";
|
||||
};
|
||||
url = mkOption {
|
||||
type = types.str;
|
||||
description = "URL to the gitea server";
|
||||
};
|
||||
token = mkOption {
|
||||
type = types.str;
|
||||
description = "Gitea API access token";
|
||||
};
|
||||
default = mkOption {
|
||||
type = types.bool;
|
||||
description = "Whether this is the default login";
|
||||
};
|
||||
ssh_host = mkOption {
|
||||
type = types.str;
|
||||
description = "Hostname for the SSH server";
|
||||
};
|
||||
ssh_key = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = "Optional path to the SSH private key";
|
||||
};
|
||||
insecure = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to skip TLS verification";
|
||||
};
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
description = "Gitea username";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flagDefaultsType = types.submodule {
|
||||
options = {
|
||||
remote = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "Prefer a specific git remote to use to select a repository on gitea, instead of relying on the remote associated with main/master/trunk branch. The --remote flag still has precedence over this value.";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
preferencesType = types.submodule {
|
||||
options = {
|
||||
editor = mkOption {
|
||||
type = types.bool;
|
||||
description = "Prefer using an external text editor over inline multiline prompts";
|
||||
default = false;
|
||||
};
|
||||
flag_defaults = mkOption {
|
||||
type = types.nullOr flagDefaultsType;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
settingsType = types.submodule {
|
||||
freeformType = yamlFormat.type;
|
||||
|
||||
options = {
|
||||
logins = mkOption {
|
||||
type = types.listOf loginsType;
|
||||
default = [ ];
|
||||
description = "List of gitea logins";
|
||||
};
|
||||
preferences = mkOption {
|
||||
type = types.nullOr preferencesType;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
options.eboskma.programs.tea = {
|
||||
enable = mkEnableOption "tea";
|
||||
|
||||
settings = mkOption {
|
||||
type = settingsType;
|
||||
default = { };
|
||||
description = "Configuration written to <filename>$XDG_CONFIG_HOME/tea/config.yml</filename>.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
home.packages = [ pkgs.tea ];
|
||||
|
||||
# xdg.configFile."tea/config.yml".source = yamlFormat.generate "tea-config.yml" cfg.settings;
|
||||
};
|
||||
}
|
|
@ -81,6 +81,21 @@ in
|
|||
solvespace.enable = true;
|
||||
ssh.enable = true;
|
||||
sway.enable = true;
|
||||
tea = {
|
||||
enable = true;
|
||||
settings = {
|
||||
logins = [
|
||||
{
|
||||
name = "datarift";
|
||||
url = "https://git.datarift.nl";
|
||||
token = "abc";
|
||||
default = true;
|
||||
ssh_host = "git.datarift.nl";
|
||||
user = "erwin";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
tmux.enable = true;
|
||||
waybar.enable = true;
|
||||
zathura.enable = true;
|
||||
|
@ -211,6 +226,7 @@ in
|
|||
../../home-manager/modules/solvespace
|
||||
../../home-manager/modules/ssh
|
||||
../../home-manager/modules/sway
|
||||
../../home-manager/modules/tea
|
||||
../../home-manager/modules/tmux
|
||||
../../home-manager/modules/waybar
|
||||
../../home-manager/modules/zathura
|
||||
|
|
Loading…
Reference in a new issue