Add syncthing base

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-07-08 15:56:42 +03:00
parent 47325206d0
commit 9dfbe1203d
103 changed files with 1285 additions and 951 deletions

View File

@@ -1,22 +1,26 @@
{ lib, ... }:
let
userOptions = with lib; with types; { config, ... }: {
options.email = mkOption {
type = nullOr str;
description = "Email address of the user.";
};
userOptions =
with lib;
with types;
{ config, ... }:
{
options.email = mkOption {
type = nullOr str;
description = "Email address of the user.";
};
options.fullName = mkOption {
type = nullOr str;
description = "Full name of the user.";
options.fullName = mkOption {
type = nullOr str;
description = "Full name of the user.";
};
};
};
in
{
options = with lib; with types; {
users.users = mkOption {
type = attrsOf (submodule userOptions);
options =
with lib;
with types;
{
users.users = mkOption { type = attrsOf (submodule userOptions); };
};
};
}

View File

@@ -1,32 +1,43 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
cfg = config.wayland.windowManager.hyprland;
in
{
options.wayland.windowManager.hyprland = with lib; with types; {
initExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec-once";
};
options.wayland.windowManager.hyprland =
with lib;
with types;
{
initExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec-once";
};
reloadExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec";
reloadExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec";
};
};
};
config = {
wayland.windowManager.hyprland.settings.exec-once = lib.meta.getExe (pkgs.writeShellApplication {
name = "init-hyprland";
text = cfg.initExtraConfig;
});
wayland.windowManager.hyprland.settings.exec-once = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-hyprland";
text = cfg.initExtraConfig;
}
);
wayland.windowManager.hyprland.settings.exec = lib.meta.getExe (pkgs.writeShellApplication {
name = "reload-hyprland";
text = cfg.reloadExtraConfig;
});
wayland.windowManager.hyprland.settings.exec = lib.meta.getExe (
pkgs.writeShellApplication {
name = "reload-hyprland";
text = cfg.reloadExtraConfig;
}
);
};
}

View File

@@ -1,18 +1,25 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
cfg = config.programs.matugen;
in
{
# https://github.com/Theaninova/matugen/blob/add-home-manager-module/hm-module.nix
options.programs.matugen = with lib; with types; {
enable = mkEnableOption "matugen";
package = mkPackageOption pkgs "matugen" { };
settings = mkOption {
type = attrsOf anything;
description = "Settings to write to config.toml.";
options.programs.matugen =
with lib;
with types;
{
enable = mkEnableOption "matugen";
package = mkPackageOption pkgs "matugen" { };
settings = mkOption {
type = attrsOf anything;
description = "Settings to write to config.toml.";
};
};
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];

View File

@@ -1,11 +1,18 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.theme;
init = pkgs.writeShellApplication {
name = "theme";
runtimeInputs = with pkgs; [ coreutils-full ];
bashOptions = [ "nounset" "pipefail" ];
runtimeInputs = with pkgs; [ coreutils ];
bashOptions = [
"nounset"
"pipefail"
];
runtimeEnv = {
CONFIG = cfg.configDir;
DEFAULT_WALLPAPER = cfg.wallpaper;
@@ -17,336 +24,348 @@ let
in
{
# https://github.com/Theaninova/TheaninovOS/blob/master/modules/home-manager/theme/md3-evo.nix
options.theme = with lib; with types; {
enable = mkEnableOption "theme";
options.theme =
with lib;
with types;
{
enable = mkEnableOption "theme";
configDir = mkOption {
type = str;
default = "${config.xdg.configHome}/theme";
description = "The path to the theme config directory.";
};
wallpaper = mkOption {
type = path;
description = "The path to the default wallpaper";
};
pkg = mkOption {
type = package;
default = init;
readOnly = true;
description = "The package containing the `theme` script";
};
extraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to the theme script.";
};
flavour = mkOption {
type = enum [
"content"
"expressive"
"fidelity"
"fruit-salad"
"monochrome"
"neutral"
"rainbow"
"tonal-spot"
];
default = "tonal-spot";
description = "The flavour of the theme.";
};
mode = mkOption {
type = enum [ "dark" "light" ];
default = "dark";
description = "The default mode of the theme.";
};
contrast = mkOption {
type = numbers.between (-1) 1;
default = 0;
description = "Use a modified contrast.";
};
opacity = mkOption {
type = numbers.between 0 1;
default = 1;
description = "The opacity of apps.";
};
radius = mkOption {
type = ints.unsigned;
default = 8;
description = "The radius of corners.";
};
padding = mkOption {
type = ints.unsigned;
default = 8;
description = "The padding of windows.";
};
blur = mkOption {
type = ints.unsigned;
default = 0;
description = "The blur amount of windows.";
};
color = {
semantic = {
blend = mkOption {
type = bool;
default = false;
description = "Blend the colors.";
};
danger = mkOption {
type = str;
default = "#ff0000";
description = "The color of danger.";
};
warning = mkOption {
type = str;
default = "#ffff00";
description = "The color of warning.";
};
success = mkOption {
type = str;
default = "#00ff00";
description = "The color of success.";
};
info = mkOption {
type = str;
default = "#0000ff";
description = "The color of info.";
};
configDir = mkOption {
type = str;
default = "${config.xdg.configHome}/theme";
description = "The path to the theme config directory.";
};
syntax = {
blend = mkOption {
type = bool;
default = true;
description = "Blend the colors.";
};
keywords = mkOption {
type = str;
default = "#ff8000";
description = "The color of keywords.";
};
functions = mkOption {
type = str;
default = "#0000ff";
description = "The color of functions.";
};
properties = mkOption {
type = str;
default = "#ff00ff";
description = "The color of properties.";
};
constants = mkOption {
type = str;
default = "#ff00ff";
description = "The color of constants.";
};
strings = mkOption {
type = str;
default = "#00ff00";
description = "The color of variables.";
};
numbers = mkOption {
type = str;
default = "#00ffff";
description = "The color of numbers.";
};
structures = mkOption {
type = str;
default = "#ffff00";
description = "The color of structures.";
};
types = mkOption {
type = str;
default = "#00ffff";
description = "The color of types.";
};
wallpaper = mkOption {
type = path;
description = "The path to the default wallpaper";
};
ansi = {
blend = mkOption {
type = bool;
default = true;
description = "Blend the colors.";
};
red = mkOption {
type = str;
default = "#ff0000";
description = "The color of red.";
};
green = mkOption {
type = str;
default = "#00ff00";
description = "The color of green.";
};
yellow = mkOption {
type = str;
default = "#ffff00";
description = "The color of yellow.";
};
orange = mkOption {
type = str;
default = "#ff8000";
description = "The color of orange.";
};
blue = mkOption {
type = str;
default = "#0000ff";
description = "The color of blue.";
};
magenta = mkOption {
type = str;
default = "#ff00ff";
description = "The color of magenta.";
};
cyan = mkOption {
type = str;
default = "#00ffff";
description = "The color of cyan.";
};
};
};
font = {
sansSerif = {
names = mkOption {
type = listOf str;
default = [ "Roboto" ];
description = "The sans serif font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ roboto ];
description = "The sans serif font packages.";
};
pkg = mkOption {
type = package;
default = init;
readOnly = true;
description = "The package containing the `theme` script";
};
serif = {
names = mkOption {
type = listOf str;
default = [ "Roboto Serif" ];
description = "The serif font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ roboto-serif ];
description = "The serif font packages.";
};
extraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to the theme script.";
};
monospace = {
names = mkOption {
type = listOf str;
default = [ "JetBrainsMono Nerd Font" ];
description = "The monospace font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) ];
description = "The monospace font packages.";
};
};
emoji = {
names = mkOption {
type = listOf str;
default = [ "Noto Emoji" "Font Awesome" ];
description = "The emoji font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ noto-fonts-color-emoji font-awesome ];
description = "The emoji font packages.";
};
};
size = mkOption {
type = ints.positive;
default = 12;
description = "The font size.";
};
};
icon = {
names = mkOption {
type = listOf str;
default = [ "Adwaita" ];
description = "The icon theme names.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [
adwaita-icon-theme
nixos-icons
flavour = mkOption {
type = enum [
"content"
"expressive"
"fidelity"
"fruit-salad"
"monochrome"
"neutral"
"rainbow"
"tonal-spot"
];
description = "The icon theme packages.";
default = "tonal-spot";
description = "The flavour of the theme.";
};
mode = mkOption {
type = enum [
"dark"
"light"
];
default = "dark";
description = "The default mode of the theme.";
};
contrast = mkOption {
type = numbers.between (-1) 1;
default = 0;
description = "Use a modified contrast.";
};
opacity = mkOption {
type = numbers.between 0 1;
default = 1;
description = "The opacity of apps.";
};
radius = mkOption {
type = ints.unsigned;
default = 8;
description = "The radius of corners.";
};
padding = mkOption {
type = ints.unsigned;
default = 8;
description = "The padding of windows.";
};
blur = mkOption {
type = ints.unsigned;
default = 0;
description = "The blur amount of windows.";
};
color = {
semantic = {
blend = mkOption {
type = bool;
default = false;
description = "Blend the colors.";
};
danger = mkOption {
type = str;
default = "#ff0000";
description = "The color of danger.";
};
warning = mkOption {
type = str;
default = "#ffff00";
description = "The color of warning.";
};
success = mkOption {
type = str;
default = "#00ff00";
description = "The color of success.";
};
info = mkOption {
type = str;
default = "#0000ff";
description = "The color of info.";
};
};
syntax = {
blend = mkOption {
type = bool;
default = true;
description = "Blend the colors.";
};
keywords = mkOption {
type = str;
default = "#ff8000";
description = "The color of keywords.";
};
functions = mkOption {
type = str;
default = "#0000ff";
description = "The color of functions.";
};
properties = mkOption {
type = str;
default = "#ff00ff";
description = "The color of properties.";
};
constants = mkOption {
type = str;
default = "#ff00ff";
description = "The color of constants.";
};
strings = mkOption {
type = str;
default = "#00ff00";
description = "The color of variables.";
};
numbers = mkOption {
type = str;
default = "#00ffff";
description = "The color of numbers.";
};
structures = mkOption {
type = str;
default = "#ffff00";
description = "The color of structures.";
};
types = mkOption {
type = str;
default = "#00ffff";
description = "The color of types.";
};
};
ansi = {
blend = mkOption {
type = bool;
default = true;
description = "Blend the colors.";
};
red = mkOption {
type = str;
default = "#ff0000";
description = "The color of red.";
};
green = mkOption {
type = str;
default = "#00ff00";
description = "The color of green.";
};
yellow = mkOption {
type = str;
default = "#ffff00";
description = "The color of yellow.";
};
orange = mkOption {
type = str;
default = "#ff8000";
description = "The color of orange.";
};
blue = mkOption {
type = str;
default = "#0000ff";
description = "The color of blue.";
};
magenta = mkOption {
type = str;
default = "#ff00ff";
description = "The color of magenta.";
};
cyan = mkOption {
type = str;
default = "#00ffff";
description = "The color of cyan.";
};
};
};
font = {
sansSerif = {
names = mkOption {
type = listOf str;
default = [ "Roboto" ];
description = "The sans serif font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ roboto ];
description = "The sans serif font packages.";
};
};
serif = {
names = mkOption {
type = listOf str;
default = [ "Roboto Serif" ];
description = "The serif font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ roboto-serif ];
description = "The serif font packages.";
};
};
monospace = {
names = mkOption {
type = listOf str;
default = [ "JetBrainsMono Nerd Font" ];
description = "The monospace font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) ];
description = "The monospace font packages.";
};
};
emoji = {
names = mkOption {
type = listOf str;
default = [
"Noto Emoji"
"Font Awesome"
];
description = "The emoji font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [
noto-fonts-color-emoji
font-awesome
];
description = "The emoji font packages.";
};
};
size = mkOption {
type = ints.positive;
default = 12;
description = "The font size.";
};
};
icon = {
names = mkOption {
type = listOf str;
default = [ "Adwaita" ];
description = "The icon theme names.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [
adwaita-icon-theme
nixos-icons
];
description = "The icon theme packages.";
};
};
cursor = {
names = mkOption {
type = listOf str;
default = [ "Adwaita" ];
description = "The cursor names.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ adwaita-icon-theme ];
description = "The cursor theme packages.";
};
size = mkOption {
type = ints.positive;
default = 32;
description = "The cursor size.";
};
};
};
cursor = {
names = mkOption {
type = listOf str;
default = [ "Adwaita" ];
description = "The cursor names.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ adwaita-icon-theme ];
description = "The cursor theme packages.";
};
size = mkOption {
type = ints.positive;
default = 32;
description = "The cursor size.";
};
};
};
config = lib.mkIf cfg.enable {
home = {
packages =
[ cfg.pkg ] ++
cfg.font.sansSerif.packages ++
cfg.font.serif.packages ++
cfg.font.monospace.packages ++
cfg.font.emoji.packages ++
cfg.icon.packages ++
cfg.cursor.packages;
[ cfg.pkg ]
++ cfg.font.sansSerif.packages
++ cfg.font.serif.packages
++ cfg.font.monospace.packages
++ cfg.font.emoji.packages
++ cfg.icon.packages
++ cfg.cursor.packages;
pointerCursor = {
name = builtins.head cfg.cursor.names;

View File

@@ -1,48 +1,42 @@
{ config, lib, ... }:
let
cfg = config.xdg;
in
{
options.xdg = with lib; with types; {
relativeCacheHome = mkOption {
type = str;
default = ".cache";
description = "Relative path to directory holding application caches.";
};
options.xdg =
with lib;
with types;
{
relativeCacheHome = mkOption {
type = str;
default = ".cache";
description = "Relative path to directory holding application caches.";
};
cacheHome = mkOption {
default = "${config.home.homeDirectory}/${cfg.relativeCacheHome}";
};
cacheHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeCacheHome}"; };
relativeConfigHome = mkOption {
type = str;
default = ".config";
description = "Relative path to directory holding application configurations.";
};
relativeConfigHome = mkOption {
type = str;
default = ".config";
description = "Relative path to directory holding application configurations.";
};
configHome = mkOption {
default = "${config.home.homeDirectory}/${cfg.relativeConfigHome}";
};
configHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeConfigHome}"; };
relativeDataHome = mkOption {
type = str;
default = ".local/share";
description = "Relative path to directory holding application data.";
};
relativeDataHome = mkOption {
type = str;
default = ".local/share";
description = "Relative path to directory holding application data.";
};
dataHome = mkOption {
default = "${config.home.homeDirectory}/${cfg.relativeDataHome}";
};
dataHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeDataHome}"; };
relativeStateHome = mkOption {
type = str;
default = ".local/state";
description = "Relative path to directory holding application states.";
};
relativeStateHome = mkOption {
type = str;
default = ".local/state";
description = "Relative path to directory holding application states.";
};
stateHome = mkOption {
default = "${config.home.homeDirectory}/${cfg.relativeStateHome}";
stateHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeStateHome}"; };
};
};
}