Reformat all Nix files
This commit is contained in:
parent
9e0c1102a9
commit
355b63cf73
81 changed files with 2293 additions and 1153 deletions
177
options.nix
177
options.nix
|
@ -1,6 +1,14 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
capitalizeFirstLetter = str: (lib.strings.toUpper (builtins.substring 0 1 str)) + (builtins.substring 1 (builtins.stringLength str) str);
|
||||
capitalizeFirstLetter =
|
||||
str:
|
||||
(lib.strings.toUpper (builtins.substring 0 1 str))
|
||||
+ (builtins.substring 1 (builtins.stringLength str) str);
|
||||
in
|
||||
{
|
||||
options.frogeye = {
|
||||
|
@ -18,7 +26,10 @@ in
|
|||
polarity = lib.mkOption {
|
||||
default = "light";
|
||||
description = "Whether to use light theme or dark theme.";
|
||||
type = lib.types.enum [ "light" "dark" ];
|
||||
type = lib.types.enum [
|
||||
"light"
|
||||
"dark"
|
||||
];
|
||||
};
|
||||
desktop = {
|
||||
xorg = lib.mkEnableOption "Enable X11 support";
|
||||
|
@ -35,9 +46,21 @@ in
|
|||
default = 1080;
|
||||
};
|
||||
phasesCommands = {
|
||||
jour = lib.mkOption { type = lib.types.lines; default = ""; description = "Command to execute for phase: jour"; };
|
||||
crepuscule = lib.mkOption { type = lib.types.lines; default = ""; description = "Command to execute for phase: crepuscule"; };
|
||||
nuit = lib.mkOption { type = lib.types.lines; default = ""; description = "Command to execute for phase: nuit"; };
|
||||
jour = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
description = "Command to execute for phase: jour";
|
||||
};
|
||||
crepuscule = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
description = "Command to execute for phase: crepuscule";
|
||||
};
|
||||
nuit = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
description = "Command to execute for phase: nuit";
|
||||
};
|
||||
};
|
||||
};
|
||||
dev = {
|
||||
|
@ -55,78 +78,90 @@ in
|
|||
};
|
||||
storageSize = lib.mkOption {
|
||||
default = "small";
|
||||
type = lib.types.enum [ "small" "big" "phone" ];
|
||||
type = lib.types.enum [
|
||||
"small"
|
||||
"big"
|
||||
"phone"
|
||||
];
|
||||
description = "Type of storage for the device. Used to determine which folder to include.";
|
||||
};
|
||||
folders = lib.mkOption {
|
||||
default = { };
|
||||
description = "Folders used by users";
|
||||
# Top-level so Syncthing can work for all users. Also there's no real home-manager syncthing module.
|
||||
type = lib.types.attrsOf (lib.types.submodule ({ config, name, ... }: {
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
readOnly = true;
|
||||
internal = true;
|
||||
description = "Name accessing this entry";
|
||||
};
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to use this folder.";
|
||||
};
|
||||
path = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Path relative to HOME. Prefer French names which has more varied initials, easing navigation.";
|
||||
};
|
||||
label = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Friendly name";
|
||||
default = capitalizeFirstLetter config.path;
|
||||
};
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "geoffrey";
|
||||
description = "User using this directory.";
|
||||
};
|
||||
fullPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/${config.user}/${config.path}";
|
||||
# Hardcoded due to outside of any user context
|
||||
description = "Absolute path.";
|
||||
};
|
||||
xdgUserDirVariable = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = if config.enable then "XDG_${lib.strings.toUpper name}_DIR" else null;
|
||||
description = "Name for the XDG user dir variable. If set, will automatically create the directory.";
|
||||
};
|
||||
syncthing = lib.mkOption {
|
||||
default = { };
|
||||
description = "Syncthing configuration for the folder";
|
||||
type = lib.types.submodule ({ ... }: {
|
||||
freeformType = (pkgs.formats.json { }).type;
|
||||
options = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.enable && config.syncthing.id != null;
|
||||
description = "Whether to sync.";
|
||||
};
|
||||
id = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = "Syncthing folder id";
|
||||
};
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule (
|
||||
{ config, name, ... }:
|
||||
{
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
readOnly = true;
|
||||
internal = true;
|
||||
description = "Name accessing this entry";
|
||||
};
|
||||
});
|
||||
};
|
||||
versionsMaxDays = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = 365;
|
||||
description = "For big systems, how many days of staggered versions should be kept";
|
||||
};
|
||||
};
|
||||
}));
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to use this folder.";
|
||||
};
|
||||
path = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Path relative to HOME. Prefer French names which has more varied initials, easing navigation.";
|
||||
};
|
||||
label = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Friendly name";
|
||||
default = capitalizeFirstLetter config.path;
|
||||
};
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "geoffrey";
|
||||
description = "User using this directory.";
|
||||
};
|
||||
fullPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/${config.user}/${config.path}";
|
||||
# Hardcoded due to outside of any user context
|
||||
description = "Absolute path.";
|
||||
};
|
||||
xdgUserDirVariable = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = if config.enable then "XDG_${lib.strings.toUpper name}_DIR" else null;
|
||||
description = "Name for the XDG user dir variable. If set, will automatically create the directory.";
|
||||
};
|
||||
syncthing = lib.mkOption {
|
||||
default = { };
|
||||
description = "Syncthing configuration for the folder";
|
||||
type = lib.types.submodule (
|
||||
{ ... }:
|
||||
{
|
||||
freeformType = (pkgs.formats.json { }).type;
|
||||
options = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.enable && config.syncthing.id != null;
|
||||
description = "Whether to sync.";
|
||||
};
|
||||
id = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = "Syncthing folder id";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
versionsMaxDays = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = 365;
|
||||
description = "For big systems, how many days of staggered versions should be kept";
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
hooks.lock = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue