mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
parent
6695b1d477
commit
82ee14ff60
124 changed files with 1848 additions and 1891 deletions
|
|
@ -4,20 +4,15 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.autorandr;
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
meta.maintainers = [ maintainers.GaetanLepage ];
|
||||
meta.maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
options = {
|
||||
services.autorandr = {
|
||||
enable = mkEnableOption "" // {
|
||||
enable = lib.mkEnableOption "" // {
|
||||
description = ''
|
||||
Whether to enable the Autorandr systemd service.
|
||||
This module is complementary to {option}`programs.autorandr`
|
||||
|
|
@ -25,15 +20,15 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
ignoreLid = mkOption {
|
||||
ignoreLid = lib.mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
type = lib.types.bool;
|
||||
description = "Treat outputs as connected even if their lids are closed.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.autorandr" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -47,7 +42,7 @@ in
|
|||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.autorandr}/bin/autorandr --change ${optionalString cfg.ignoreLid "--ignore-lid"}";
|
||||
ExecStart = "${pkgs.autorandr}/bin/autorandr --change ${lib.optionalString cfg.ignoreLid "--ignore-lid"}";
|
||||
};
|
||||
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
|
|
|
|||
|
|
@ -4,23 +4,20 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.avizo;
|
||||
settingsFormat = pkgs.formats.ini { };
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.pltanton ];
|
||||
meta.maintainers = [ lib.hm.maintainers.pltanton ];
|
||||
|
||||
options.services.avizo = {
|
||||
enable = mkEnableOption "avizo, a simple notification daemon";
|
||||
enable = lib.mkEnableOption "avizo, a simple notification daemon";
|
||||
|
||||
settings = mkOption {
|
||||
settings = lib.mkOption {
|
||||
type = (pkgs.formats.ini { }).type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
default = {
|
||||
time = 1.0;
|
||||
|
|
@ -36,11 +33,11 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.avizo;
|
||||
defaultText = literalExpression "pkgs.avizo";
|
||||
example = literalExpression ''
|
||||
defaultText = lib.literalExpression "pkgs.avizo";
|
||||
example = lib.literalExpression ''
|
||||
pkgs.avizo.overrideAttrs (final: prev: {
|
||||
patchPhase = "cp ''${./images}/*.png data/images/";
|
||||
})
|
||||
|
|
@ -49,10 +46,12 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [ (hm.assertions.assertPlatform "services.avizo" pkgs platforms.linux) ];
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.avizo" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
xdg.configFile."avizo/config.ini" = mkIf (cfg.settings != { }) {
|
||||
xdg.configFile."avizo/config.ini" = lib.mkIf (cfg.settings != { }) {
|
||||
source = settingsFormat.generate "avizo-config.ini" cfg.settings;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,17 +4,22 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
inherit (lib)
|
||||
mkEnableOption
|
||||
mkOption
|
||||
optional
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.barrier;
|
||||
in
|
||||
{
|
||||
|
||||
meta.maintainers = with maintainers; [ kritnich ];
|
||||
meta.maintainers = with lib.maintainers; [ kritnich ];
|
||||
|
||||
imports = [
|
||||
(mkRemovedOptionModule [ "services" "barrier" "client" "tray" ] ''
|
||||
(lib.mkRemovedOptionModule [ "services" "barrier" "client" "tray" ] ''
|
||||
The tray option is non-functional and has been removed.
|
||||
'')
|
||||
];
|
||||
|
|
@ -51,7 +56,7 @@ in
|
|||
extraFlags = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ "-f" ];
|
||||
defaultText = literalExpression ''[ "-f" ]'';
|
||||
defaultText = lib.literalExpression ''[ "-f" ]'';
|
||||
description = ''
|
||||
Additional flags to pass to {command}`barrierc`.
|
||||
See {command}`barrierc --help`.
|
||||
|
|
@ -61,7 +66,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.client.enable {
|
||||
config = lib.mkIf cfg.client.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.barrier" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -85,5 +90,4 @@ in
|
|||
);
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,45 +4,40 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.betterlockscreen;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = with maintainers; [ sebtm ];
|
||||
meta.maintainers = with lib.maintainers; [ sebtm ];
|
||||
|
||||
options = {
|
||||
services.betterlockscreen = {
|
||||
enable = mkEnableOption "betterlockscreen, a screen-locker module";
|
||||
enable = lib.mkEnableOption "betterlockscreen, a screen-locker module";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.betterlockscreen;
|
||||
defaultText = literalExpression "pkgs.betterlockscreen";
|
||||
defaultText = lib.literalExpression "pkgs.betterlockscreen";
|
||||
description = "Package providing {command}`betterlockscreen`.";
|
||||
};
|
||||
|
||||
arguments = mkOption {
|
||||
type = types.listOf types.str;
|
||||
arguments = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = "List of arguments appended to `./betterlockscreen --lock [args]`";
|
||||
};
|
||||
|
||||
inactiveInterval = mkOption {
|
||||
type = types.int;
|
||||
inactiveInterval = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 10;
|
||||
description = ''
|
||||
Value used for {option}`services.screen-locker.inactiveInterval`.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.betterlockscreen" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -52,7 +47,7 @@ in
|
|||
services.screen-locker = {
|
||||
enable = true;
|
||||
inactiveInterval = cfg.inactiveInterval;
|
||||
lockCmd = "${cfg.package}/bin/betterlockscreen --lock ${concatStringsSep " " cfg.arguments}";
|
||||
lockCmd = "${cfg.package}/bin/betterlockscreen --lock ${lib.concatStringsSep " " cfg.arguments}";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,10 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options = {
|
||||
services.blueman-applet = {
|
||||
enable = mkEnableOption "" // {
|
||||
enable = lib.mkEnableOption "" // {
|
||||
description = ''
|
||||
Whether to enable the Blueman applet.
|
||||
|
||||
|
|
@ -25,9 +22,9 @@ with lib;
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf config.services.blueman-applet.enable {
|
||||
config = lib.mkIf config.services.blueman-applet.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.blueman-applet" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.blueman-applet" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.blueman-applet = {
|
||||
|
|
|
|||
|
|
@ -4,22 +4,19 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
serviceConfig = config.services.borgmatic;
|
||||
programConfig = config.programs.borgmatic;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.DamienCassou ];
|
||||
meta.maintainers = [ lib.maintainers.DamienCassou ];
|
||||
|
||||
options = {
|
||||
services.borgmatic = {
|
||||
enable = mkEnableOption "Borgmatic service";
|
||||
enable = lib.mkEnableOption "Borgmatic service";
|
||||
|
||||
frequency = mkOption {
|
||||
type = types.str;
|
||||
frequency = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "hourly";
|
||||
description = ''
|
||||
How often to run borgmatic when
|
||||
|
|
@ -33,7 +30,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf serviceConfig.enable {
|
||||
config = lib.mkIf serviceConfig.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.borgmatic" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,26 +4,24 @@
|
|||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption optional types;
|
||||
|
||||
cfg = config.services.cachix-agent;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
meta.maintainers = [ lib.maintainers.rycee ];
|
||||
|
||||
options.services.cachix-agent = {
|
||||
enable = mkEnableOption "Cachix Deploy Agent: <https://docs.cachix.org/deploy/>";
|
||||
enable = lib.mkEnableOption "Cachix Deploy Agent: <https://docs.cachix.org/deploy/>";
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
description = "The unique agent name.";
|
||||
};
|
||||
|
||||
verbose = mkEnableOption "verbose output";
|
||||
verbose = lib.mkEnableOption "verbose output";
|
||||
|
||||
profile = mkOption {
|
||||
type = types.str;
|
||||
|
|
@ -39,12 +37,12 @@ in
|
|||
description = "Cachix URI to use.";
|
||||
};
|
||||
|
||||
package = mkPackageOption pkgs "cachix" { };
|
||||
package = lib.mkPackageOption pkgs "cachix" { };
|
||||
|
||||
credentialsFile = mkOption {
|
||||
type = types.path;
|
||||
default = "${config.xdg.configHome}/cachix-agent.token";
|
||||
defaultText = literalExpression ''"''${config.xdg.configHome}/cachix-agent.token"'';
|
||||
defaultText = lib.literalExpression ''"''${config.xdg.configHome}/cachix-agent.token"'';
|
||||
description = ''
|
||||
Required file that needs to contain
|
||||
`CACHIX_AGENT_TOKEN=...`.
|
||||
|
|
@ -52,7 +50,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.cachix-agent" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -71,7 +69,7 @@ in
|
|||
# We don't want to kill children processes as those are deployments.
|
||||
KillMode = "process";
|
||||
Restart = "on-failure";
|
||||
ExecStart = escapeShellArgs (
|
||||
ExecStart = lib.escapeShellArgs (
|
||||
[ "${cfg.package}/bin/cachix" ]
|
||||
++ optional cfg.verbose "--verbose"
|
||||
++ optional (cfg.host != null) "--host ${cfg.host}"
|
||||
|
|
|
|||
|
|
@ -4,24 +4,19 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.caffeine;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.uvnikita ];
|
||||
meta.maintainers = [ lib.maintainers.uvnikita ];
|
||||
|
||||
options = {
|
||||
services.caffeine = {
|
||||
enable = mkEnableOption "Caffeine service";
|
||||
enable = lib.mkEnableOption "Caffeine service";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.caffeine" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption optional types;
|
||||
|
||||
cfg = config.services.cbatticon;
|
||||
|
||||
|
|
@ -22,7 +20,7 @@ let
|
|||
"--${commandName} ${cmd}"
|
||||
);
|
||||
|
||||
commandLine = concatStringsSep " " (
|
||||
commandLine = lib.concatStringsSep " " (
|
||||
[ "${package}/bin/cbatticon" ]
|
||||
++ makeCommand "command-critical-level" cfg.commandCriticalLevel
|
||||
++ makeCommand "command-left-click" cfg.commandLeftClick
|
||||
|
|
@ -40,11 +38,11 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.pmiddend ];
|
||||
meta.maintainers = [ lib.maintainers.pmiddend ];
|
||||
|
||||
options = {
|
||||
services.cbatticon = {
|
||||
enable = mkEnableOption "cbatticon";
|
||||
enable = lib.mkEnableOption "cbatticon";
|
||||
|
||||
commandCriticalLevel = mkOption {
|
||||
type = types.nullOr types.lines;
|
||||
|
|
@ -124,7 +122,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.cbatticon" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,22 +4,21 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.clipman;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.jwygoda ];
|
||||
meta.maintainers = [ lib.maintainers.jwygoda ];
|
||||
|
||||
options.services.clipman = {
|
||||
enable = mkEnableOption "clipman, a simple clipboard manager for Wayland";
|
||||
enable = lib.mkEnableOption "clipman, a simple clipboard manager for Wayland";
|
||||
|
||||
package = mkPackageOption pkgs "clipman" { };
|
||||
package = lib.mkPackageOption pkgs "clipman" { };
|
||||
|
||||
systemdTarget = mkOption {
|
||||
type = types.str;
|
||||
systemdTarget = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = config.wayland.systemd.target;
|
||||
defaultText = literalExpression "config.wayland.systemd.target";
|
||||
defaultText = lib.literalExpression "config.wayland.systemd.target";
|
||||
example = "sway-session.target";
|
||||
description = ''
|
||||
The systemd target that will automatically start the clipman service.
|
||||
|
|
@ -31,7 +30,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.clipman" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,19 +4,16 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.clipmenu;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.DamienCassou ];
|
||||
meta.maintainers = [ lib.maintainers.DamienCassou ];
|
||||
|
||||
options.services.clipmenu = {
|
||||
enable = mkEnableOption "clipmenu, the clipboard management daemon";
|
||||
enable = lib.mkEnableOption "clipmenu, the clipboard management daemon";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
@ -36,14 +33,14 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.clipmenu" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
home.sessionVariables = mkIf (cfg.launcher != null) { CM_LAUNCHER = cfg.launcher; };
|
||||
home.sessionVariables = lib.mkIf (cfg.launcher != null) { CM_LAUNCHER = cfg.launcher; };
|
||||
|
||||
systemd.user.services.clipmenu = {
|
||||
Unit = {
|
||||
|
|
@ -55,7 +52,7 @@ in
|
|||
ExecStart = "${cfg.package}/bin/clipmenud";
|
||||
Environment = [
|
||||
"PATH=${
|
||||
makeBinPath (
|
||||
lib.makeBinPath (
|
||||
with pkgs;
|
||||
[
|
||||
coreutils
|
||||
|
|
|
|||
|
|
@ -10,18 +10,17 @@ let
|
|||
cfg = config.services.conky;
|
||||
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.kaleo ];
|
||||
meta.maintainers = [ lib.hm.maintainers.kaleo ];
|
||||
|
||||
options = {
|
||||
services.conky = {
|
||||
enable = mkEnableOption "Conky, a light-weight system monitor";
|
||||
enable = lib.mkEnableOption "Conky, a light-weight system monitor";
|
||||
|
||||
package = mkPackageOption pkgs "conky" { };
|
||||
package = lib.mkPackageOption pkgs "conky" { };
|
||||
|
||||
extraConfig = lib.mkOption {
|
||||
type = types.lines;
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Configuration used by the Conky daemon. Check
|
||||
|
|
@ -33,8 +32,8 @@ with lib;
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [ (hm.assertions.assertPlatform "services.conky" pkgs platforms.linux) ];
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [ (lib.hm.assertions.assertPlatform "services.conky" pkgs lib.platforms.linux) ];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
|
|
@ -49,7 +48,7 @@ with lib;
|
|||
RestartSec = "3";
|
||||
ExecStart = toString (
|
||||
[ "${cfg.package}/bin/conky" ]
|
||||
++ optional (cfg.extraConfig != "") "--config ${pkgs.writeText "conky.conf" cfg.extraConfig}"
|
||||
++ lib.optional (cfg.extraConfig != "") "--config ${pkgs.writeText "conky.conf" cfg.extraConfig}"
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,17 +4,16 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkIf types;
|
||||
|
||||
cfg = config.services.darkman;
|
||||
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
|
||||
scriptsOptionType =
|
||||
kind:
|
||||
mkOption {
|
||||
lib.mkOption {
|
||||
type = types.attrsOf (
|
||||
types.oneOf [
|
||||
types.path
|
||||
|
|
@ -22,7 +21,7 @@ let
|
|||
]
|
||||
);
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
gtk-theme = '''
|
||||
''${pkgs.dconf}/bin/dconf write \
|
||||
|
|
@ -43,33 +42,33 @@ let
|
|||
|
||||
generateScripts =
|
||||
folder:
|
||||
mapAttrs' (
|
||||
lib.mapAttrs' (
|
||||
k: v: {
|
||||
name = "${folder}/${k}";
|
||||
value = {
|
||||
source =
|
||||
if builtins.isPath v || isDerivation v then
|
||||
if builtins.isPath v || lib.isDerivation v then
|
||||
v
|
||||
else
|
||||
pkgs.writeShellScript (hm.strings.storeFileName k) v;
|
||||
pkgs.writeShellScript (lib.hm.strings.storeFileName k) v;
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.xlambein ];
|
||||
meta.maintainers = [ lib.maintainers.xlambein ];
|
||||
|
||||
options.services.darkman = {
|
||||
enable = mkEnableOption ''
|
||||
enable = lib.mkEnableOption ''
|
||||
darkman, a tool that automatically switches dark-mode on and off based on
|
||||
the time of the day'';
|
||||
|
||||
package = mkPackageOption pkgs "darkman" { nullable = true; };
|
||||
package = lib.mkPackageOption pkgs "darkman" { nullable = true; };
|
||||
|
||||
settings = mkOption {
|
||||
settings = lib.mkOption {
|
||||
type = types.submodule { freeformType = yamlFormat.type; };
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
lat = 52.3;
|
||||
lng = 4.8;
|
||||
|
|
@ -89,7 +88,7 @@ in
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.darkman" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.darkman" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
|
@ -100,7 +99,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
xdg.dataFile = mkMerge [
|
||||
xdg.dataFile = lib.mkMerge [
|
||||
(mkIf (cfg.darkModeScripts != { }) (generateScripts "dark-mode.d" cfg.darkModeScripts))
|
||||
(mkIf (cfg.lightModeScripts != { }) (generateScripts "light-mode.d" cfg.lightModeScripts))
|
||||
];
|
||||
|
|
@ -119,13 +118,13 @@ in
|
|||
Service = {
|
||||
Type = "dbus";
|
||||
BusName = "nl.whynothugo.darkman";
|
||||
ExecStart = "${getExe cfg.package} run";
|
||||
ExecStart = "${lib.getExe cfg.package} run";
|
||||
Restart = "on-failure";
|
||||
TimeoutStopSec = 15;
|
||||
Slice = "background.slice";
|
||||
};
|
||||
|
||||
Install.WantedBy = mkDefault [ "graphical-session.target" ];
|
||||
Install.WantedBy = lib.mkDefault [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,22 +4,20 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.devilspie2;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.dawidsowa ];
|
||||
meta.maintainers = [ lib.maintainers.dawidsowa ];
|
||||
|
||||
options = {
|
||||
services.devilspie2 = {
|
||||
enable = mkEnableOption ''
|
||||
enable = lib.mkEnableOption ''
|
||||
Devilspie2, a window matching utility, allowing the user to
|
||||
perform scripted actions on windows as they are created'';
|
||||
|
||||
config = mkOption {
|
||||
type = types.lines;
|
||||
config = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Content of file placed in the devilspie2 config directory.
|
||||
|
|
@ -33,7 +31,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.devilspie2" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.dropbox;
|
||||
|
|
@ -16,23 +13,23 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.eyjhb ];
|
||||
meta.maintainers = [ lib.maintainers.eyjhb ];
|
||||
|
||||
options = {
|
||||
services.dropbox = {
|
||||
enable = mkEnableOption "Dropbox daemon";
|
||||
enable = lib.mkEnableOption "Dropbox daemon";
|
||||
|
||||
path = mkOption {
|
||||
type = types.path;
|
||||
path = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "${config.home.homeDirectory}/Dropbox";
|
||||
defaultText = literalExpression ''"''${config.home.homeDirectory}/Dropbox"'';
|
||||
defaultText = lib.literalExpression ''"''${config.home.homeDirectory}/Dropbox"'';
|
||||
apply = toString; # Prevent copies to Nix store.
|
||||
description = "Where to put the Dropbox directory.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.dropbox" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -76,9 +73,9 @@ in
|
|||
${homeBaseDir}/.dropbox ${config.home.homeDirectory}/.dropbox
|
||||
fi
|
||||
|
||||
if [[ ! -d ${escapeShellArg cfg.path} ]]; then
|
||||
if [[ ! -d ${lib.escapeShellArg cfg.path} ]]; then
|
||||
run ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \
|
||||
${homeBaseDir}/Dropbox ${escapeShellArg cfg.path}
|
||||
${homeBaseDir}/Dropbox ${lib.escapeShellArg cfg.path}
|
||||
fi
|
||||
|
||||
# get the dropbox bins if needed
|
||||
|
|
|
|||
|
|
@ -4,23 +4,26 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
literalExpression
|
||||
mkOption
|
||||
optional
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.dunst;
|
||||
|
||||
eitherStrBoolIntList = with types; either str (either bool (either int (listOf str)));
|
||||
|
||||
toDunstIni = generators.toINI {
|
||||
toDunstIni = lib.generators.toINI {
|
||||
mkKeyValue =
|
||||
key: value:
|
||||
let
|
||||
value' =
|
||||
if isBool value then
|
||||
if lib.isBool value then
|
||||
(lib.hm.booleans.yesNo value)
|
||||
else if isString value then
|
||||
else if lib.isString value then
|
||||
''"${value}"''
|
||||
else
|
||||
toString value;
|
||||
|
|
@ -59,11 +62,11 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
meta.maintainers = [ lib.maintainers.rycee ];
|
||||
|
||||
options = {
|
||||
services.dunst = {
|
||||
enable = mkEnableOption "the dunst notification daemon";
|
||||
enable = lib.mkEnableOption "the dunst notification daemon";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
@ -133,96 +136,100 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.dunst" pkgs platforms.linux)
|
||||
];
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.dunst" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source =
|
||||
"${pkgs.dunst}/share/dbus-1/services/org.knopwob.dunst.service";
|
||||
xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source =
|
||||
"${pkgs.dunst}/share/dbus-1/services/org.knopwob.dunst.service";
|
||||
|
||||
services.dunst.settings.global.icon_path =
|
||||
let
|
||||
useCustomTheme =
|
||||
cfg.iconTheme.package != hicolorTheme.package
|
||||
|| cfg.iconTheme.name != hicolorTheme.name
|
||||
|| cfg.iconTheme.size != hicolorTheme.size;
|
||||
services.dunst.settings.global.icon_path =
|
||||
let
|
||||
useCustomTheme =
|
||||
cfg.iconTheme.package != hicolorTheme.package
|
||||
|| cfg.iconTheme.name != hicolorTheme.name
|
||||
|| cfg.iconTheme.size != hicolorTheme.size;
|
||||
|
||||
basePaths = [
|
||||
"/run/current-system/sw"
|
||||
config.home.profileDirectory
|
||||
cfg.iconTheme.package
|
||||
] ++ optional useCustomTheme hicolorTheme.package;
|
||||
basePaths = [
|
||||
"/run/current-system/sw"
|
||||
config.home.profileDirectory
|
||||
cfg.iconTheme.package
|
||||
] ++ optional useCustomTheme hicolorTheme.package;
|
||||
|
||||
themes = [
|
||||
cfg.iconTheme
|
||||
] ++ optional useCustomTheme (hicolorTheme // { size = cfg.iconTheme.size; });
|
||||
themes = [
|
||||
cfg.iconTheme
|
||||
] ++ optional useCustomTheme (hicolorTheme // { size = cfg.iconTheme.size; });
|
||||
|
||||
categories = [
|
||||
"actions"
|
||||
"animations"
|
||||
"apps"
|
||||
"categories"
|
||||
"devices"
|
||||
"emblems"
|
||||
"emotes"
|
||||
"filesystem"
|
||||
"intl"
|
||||
"legacy"
|
||||
"mimetypes"
|
||||
"places"
|
||||
"status"
|
||||
"stock"
|
||||
];
|
||||
categories = [
|
||||
"actions"
|
||||
"animations"
|
||||
"apps"
|
||||
"categories"
|
||||
"devices"
|
||||
"emblems"
|
||||
"emotes"
|
||||
"filesystem"
|
||||
"intl"
|
||||
"legacy"
|
||||
"mimetypes"
|
||||
"places"
|
||||
"status"
|
||||
"stock"
|
||||
];
|
||||
|
||||
mkPath =
|
||||
{
|
||||
basePath,
|
||||
theme,
|
||||
category,
|
||||
}:
|
||||
"${basePath}/share/icons/${theme.name}/${theme.size}/${category}";
|
||||
in
|
||||
concatMapStringsSep ":" mkPath (cartesianProduct {
|
||||
basePath = basePaths;
|
||||
theme = themes;
|
||||
category = categories;
|
||||
});
|
||||
|
||||
systemd.user.services.dunst = {
|
||||
Unit = {
|
||||
Description = "Dunst notification daemon";
|
||||
After = [ config.wayland.systemd.target ];
|
||||
PartOf = [ config.wayland.systemd.target ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "dbus";
|
||||
BusName = "org.freedesktop.Notifications";
|
||||
ExecStart = escapeShellArgs (
|
||||
[ "${cfg.package}/bin/dunst" ]
|
||||
++
|
||||
# Using `-config` breaks dunst's drop-ins, so only use it when an alternative path is set
|
||||
optionals (cfg.configFile != null) [
|
||||
"-config"
|
||||
cfg.configFile
|
||||
]
|
||||
mkPath =
|
||||
{
|
||||
basePath,
|
||||
theme,
|
||||
category,
|
||||
}:
|
||||
"${basePath}/share/icons/${theme.name}/${theme.size}/${category}";
|
||||
in
|
||||
lib.concatMapStringsSep ":" mkPath (
|
||||
lib.cartesianProduct {
|
||||
basePath = basePaths;
|
||||
theme = themes;
|
||||
category = categories;
|
||||
}
|
||||
);
|
||||
Environment = optionalString (cfg.waylandDisplay != "") "WAYLAND_DISPLAY=${cfg.waylandDisplay}";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf (cfg.settings != { }) {
|
||||
xdg.configFile."dunst/dunstrc" = {
|
||||
text = toDunstIni cfg.settings;
|
||||
onChange = ''
|
||||
${pkgs.procps}/bin/pkill -u "$USER" ''${VERBOSE+-e} dunst || true
|
||||
'';
|
||||
};
|
||||
})
|
||||
]);
|
||||
systemd.user.services.dunst = {
|
||||
Unit = {
|
||||
Description = "Dunst notification daemon";
|
||||
After = [ config.wayland.systemd.target ];
|
||||
PartOf = [ config.wayland.systemd.target ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "dbus";
|
||||
BusName = "org.freedesktop.Notifications";
|
||||
ExecStart = lib.escapeShellArgs (
|
||||
[ "${cfg.package}/bin/dunst" ]
|
||||
++
|
||||
# Using `-config` breaks dunst's drop-ins, so only use it when an alternative path is set
|
||||
lib.optionals (cfg.configFile != null) [
|
||||
"-config"
|
||||
cfg.configFile
|
||||
]
|
||||
);
|
||||
Environment = lib.optionalString (cfg.waylandDisplay != "") "WAYLAND_DISPLAY=${cfg.waylandDisplay}";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
(lib.mkIf (cfg.settings != { }) {
|
||||
xdg.configFile."dunst/dunstrc" = {
|
||||
text = toDunstIni cfg.settings;
|
||||
onChange = ''
|
||||
${pkgs.procps}/bin/pkill -u "$USER" ''${VERBOSE+-e} dunst || true
|
||||
'';
|
||||
};
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.dwm-status;
|
||||
|
||||
jsonFormat = pkgs.formats.json { };
|
||||
|
|
@ -31,12 +30,12 @@ in
|
|||
{
|
||||
options = {
|
||||
services.dwm-status = {
|
||||
enable = mkEnableOption "dwm-status user service";
|
||||
enable = lib.mkEnableOption "dwm-status user service";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.dwm-status;
|
||||
defaultText = literalExpression "pkgs.dwm-status";
|
||||
defaultText = lib.literalExpression "pkgs.dwm-status";
|
||||
example = "pkgs.dwm-status.override { enableAlsaUtils = false; }";
|
||||
description = "Which dwm-status package to use.";
|
||||
};
|
||||
|
|
@ -49,7 +48,7 @@ in
|
|||
extraConfig = mkOption {
|
||||
type = jsonFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
separator = "#";
|
||||
|
||||
|
|
@ -67,7 +66,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.dwm-status" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,27 +4,31 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
mkOption
|
||||
optional
|
||||
optionalAttrs
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.emacs;
|
||||
emacsCfg = config.programs.emacs;
|
||||
emacsBinPath = "${cfg.package}/bin";
|
||||
emacsVersion = getVersion cfg.package;
|
||||
emacsVersion = lib.getVersion cfg.package;
|
||||
|
||||
clientWMClass = if versionAtLeast emacsVersion "28" then "Emacsd" else "Emacs";
|
||||
clientWMClass = if lib.versionAtLeast emacsVersion "28" then "Emacsd" else "Emacs";
|
||||
|
||||
# Workaround for https://debbugs.gnu.org/47511
|
||||
needsSocketWorkaround = versionOlder emacsVersion "28" && cfg.socketActivation.enable;
|
||||
needsSocketWorkaround = lib.versionOlder emacsVersion "28" && cfg.socketActivation.enable;
|
||||
|
||||
# Adapted from upstream emacs.desktop
|
||||
clientDesktopItem = pkgs.writeTextDir "share/applications/emacsclient.desktop" (
|
||||
generators.toINI { } {
|
||||
lib.generators.toINI { } {
|
||||
"Desktop Entry" = {
|
||||
Type = "Application";
|
||||
Exec = "${emacsBinPath}/emacsclient ${concatStringsSep " " cfg.client.arguments} %F";
|
||||
Exec = "${emacsBinPath}/emacsclient ${lib.concatStringsSep " " cfg.client.arguments} %F";
|
||||
Terminal = false;
|
||||
Name = "Emacs Client";
|
||||
Icon = "emacs";
|
||||
|
|
@ -44,15 +48,15 @@ let
|
|||
socketPath = "${socketDir}/server";
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.tadfisher ];
|
||||
meta.maintainers = [ lib.maintainers.tadfisher ];
|
||||
|
||||
options.services.emacs = {
|
||||
enable = mkEnableOption "the Emacs daemon";
|
||||
enable = lib.mkEnableOption "the Emacs daemon";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = if emacsCfg.enable then emacsCfg.finalPackage else pkgs.emacs;
|
||||
defaultText = literalExpression ''
|
||||
defaultText = lib.literalExpression ''
|
||||
if config.programs.emacs.enable then config.programs.emacs.finalPackage
|
||||
else pkgs.emacs
|
||||
'';
|
||||
|
|
@ -72,7 +76,7 @@ in
|
|||
};
|
||||
|
||||
client = {
|
||||
enable = mkEnableOption "generation of Emacs client desktop file";
|
||||
enable = lib.mkEnableOption "generation of Emacs client desktop file";
|
||||
arguments = mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [ "-c" ];
|
||||
|
|
@ -86,13 +90,13 @@ in
|
|||
# socket path, though allowing for such is not easy to do as systemd socket
|
||||
# units don't perform variable expansion for 'ListenStream'.
|
||||
socketActivation = {
|
||||
enable = mkEnableOption "systemd socket activation for the Emacs service";
|
||||
enable = lib.mkEnableOption "systemd socket activation for the Emacs service";
|
||||
};
|
||||
|
||||
startWithUserSession = mkOption {
|
||||
type = with types; either bool (enum [ "graphical" ]);
|
||||
default = !cfg.socketActivation.enable;
|
||||
defaultText = literalExpression "!config.services.emacs.socketActivation.enable";
|
||||
defaultText = lib.literalExpression "!config.services.emacs.socketActivation.enable";
|
||||
example = "graphical";
|
||||
description = ''
|
||||
Whether to launch Emacs service with the systemd user session. If it is
|
||||
|
|
@ -114,122 +118,124 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf pkgs.stdenv.isLinux {
|
||||
systemd.user.services.emacs =
|
||||
{
|
||||
Unit =
|
||||
{
|
||||
Description = "Emacs text editor";
|
||||
Documentation = "info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
(mkIf pkgs.stdenv.isLinux {
|
||||
systemd.user.services.emacs =
|
||||
{
|
||||
Unit =
|
||||
{
|
||||
Description = "Emacs text editor";
|
||||
Documentation = "info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
||||
|
||||
After = optional (cfg.startWithUserSession == "graphical") "graphical-session.target";
|
||||
PartOf = optional (cfg.startWithUserSession == "graphical") "graphical-session.target";
|
||||
After = optional (cfg.startWithUserSession == "graphical") "graphical-session.target";
|
||||
PartOf = optional (cfg.startWithUserSession == "graphical") "graphical-session.target";
|
||||
|
||||
# Avoid killing the Emacs session, which may be full of
|
||||
# unsaved buffers.
|
||||
X-RestartIfChanged = false;
|
||||
}
|
||||
// optionalAttrs needsSocketWorkaround {
|
||||
# Emacs deletes its socket when shutting down, which systemd doesn't
|
||||
# handle, resulting in a server without a socket.
|
||||
# See https://github.com/nix-community/home-manager/issues/2018
|
||||
RefuseManualStart = true;
|
||||
# Avoid killing the Emacs session, which may be full of
|
||||
# unsaved buffers.
|
||||
X-RestartIfChanged = false;
|
||||
}
|
||||
// optionalAttrs needsSocketWorkaround {
|
||||
# Emacs deletes its socket when shutting down, which systemd doesn't
|
||||
# handle, resulting in a server without a socket.
|
||||
# See https://github.com/nix-community/home-manager/issues/2018
|
||||
RefuseManualStart = true;
|
||||
};
|
||||
|
||||
Service =
|
||||
{
|
||||
Type = "notify";
|
||||
|
||||
# We wrap ExecStart in a login shell so Emacs starts with the user's
|
||||
# environment, most importantly $PATH and $NIX_PROFILES. It may be
|
||||
# worth investigating a more targeted approach for user services to
|
||||
# import the user environment.
|
||||
ExecStart = ''${pkgs.runtimeShell} -l -c "${emacsBinPath}/emacs --fg-daemon${
|
||||
# In case the user sets 'server-directory' or 'server-name' in
|
||||
# their Emacs config, we want to specify the socket path explicitly
|
||||
# so launching 'emacs.service' manually doesn't break emacsclient
|
||||
# when using socket activation.
|
||||
lib.optionalString cfg.socketActivation.enable "=${lib.escapeShellArg socketPath}"
|
||||
} ${lib.escapeShellArgs cfg.extraOptions}"'';
|
||||
|
||||
# Emacs will exit with status 15 after having received SIGTERM, which
|
||||
# is the default "KillSignal" value systemd uses to stop services.
|
||||
SuccessExitStatus = 15;
|
||||
|
||||
Restart = "on-failure";
|
||||
}
|
||||
// optionalAttrs needsSocketWorkaround {
|
||||
# Use read-only directory permissions to prevent emacs from
|
||||
# deleting systemd's socket file before exiting.
|
||||
ExecStartPost = "${pkgs.coreutils}/bin/chmod --changes -w ${socketDir}";
|
||||
ExecStopPost = "${pkgs.coreutils}/bin/chmod --changes +w ${socketDir}";
|
||||
};
|
||||
}
|
||||
// optionalAttrs (cfg.startWithUserSession != false) {
|
||||
Install = {
|
||||
WantedBy = [
|
||||
(if cfg.startWithUserSession == true then "default.target" else "graphical-session.target")
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
Service =
|
||||
{
|
||||
Type = "notify";
|
||||
home = {
|
||||
packages = optional cfg.client.enable (lib.hiPrio clientDesktopItem);
|
||||
|
||||
# We wrap ExecStart in a login shell so Emacs starts with the user's
|
||||
# environment, most importantly $PATH and $NIX_PROFILES. It may be
|
||||
# worth investigating a more targeted approach for user services to
|
||||
# import the user environment.
|
||||
ExecStart = ''${pkgs.runtimeShell} -l -c "${emacsBinPath}/emacs --fg-daemon${
|
||||
# In case the user sets 'server-directory' or 'server-name' in
|
||||
# their Emacs config, we want to specify the socket path explicitly
|
||||
# so launching 'emacs.service' manually doesn't break emacsclient
|
||||
# when using socket activation.
|
||||
optionalString cfg.socketActivation.enable "=${escapeShellArg socketPath}"
|
||||
} ${escapeShellArgs cfg.extraOptions}"'';
|
||||
sessionVariables = mkIf cfg.defaultEditor {
|
||||
EDITOR = lib.getBin (
|
||||
pkgs.writeShellScript "editor" ''exec ${lib.getBin cfg.package}/bin/emacsclient "''${@:---create-frame}"''
|
||||
);
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
# Emacs will exit with status 15 after having received SIGTERM, which
|
||||
# is the default "KillSignal" value systemd uses to stop services.
|
||||
SuccessExitStatus = 15;
|
||||
(mkIf (cfg.socketActivation.enable && pkgs.stdenv.isLinux) {
|
||||
systemd.user.sockets.emacs = {
|
||||
Unit = {
|
||||
Description = "Emacs text editor";
|
||||
Documentation = "info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
||||
};
|
||||
|
||||
Socket = {
|
||||
ListenStream = socketPath;
|
||||
FileDescriptorName = "server";
|
||||
SocketMode = "0600";
|
||||
DirectoryMode = "0700";
|
||||
# This prevents the service from immediately starting again
|
||||
# after being stopped, due to the function
|
||||
# `server-force-stop' present in `kill-emacs-hook', which
|
||||
# calls `server-running-p', which opens the socket file.
|
||||
FlushPending = true;
|
||||
};
|
||||
|
||||
Restart = "on-failure";
|
||||
}
|
||||
// optionalAttrs needsSocketWorkaround {
|
||||
# Use read-only directory permissions to prevent emacs from
|
||||
# deleting systemd's socket file before exiting.
|
||||
ExecStartPost = "${pkgs.coreutils}/bin/chmod --changes -w ${socketDir}";
|
||||
ExecStopPost = "${pkgs.coreutils}/bin/chmod --changes +w ${socketDir}";
|
||||
};
|
||||
}
|
||||
// optionalAttrs (cfg.startWithUserSession != false) {
|
||||
Install = {
|
||||
WantedBy = [
|
||||
(if cfg.startWithUserSession == true then "default.target" else "graphical-session.target")
|
||||
];
|
||||
WantedBy = [ "sockets.target" ];
|
||||
# Adding this Requires= dependency ensures that systemd
|
||||
# manages the socket file, in the case where the service is
|
||||
# started when the socket is stopped.
|
||||
# The socket unit is implicitly ordered before the service.
|
||||
RequiredBy = [ "emacs.service" ];
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
home = {
|
||||
packages = optional cfg.client.enable (hiPrio clientDesktopItem);
|
||||
|
||||
sessionVariables = mkIf cfg.defaultEditor {
|
||||
EDITOR = getBin (
|
||||
pkgs.writeShellScript "editor" ''exec ${getBin cfg.package}/bin/emacsclient "''${@:---create-frame}"''
|
||||
);
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf (cfg.socketActivation.enable && pkgs.stdenv.isLinux) {
|
||||
systemd.user.sockets.emacs = {
|
||||
Unit = {
|
||||
Description = "Emacs text editor";
|
||||
Documentation = "info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
||||
};
|
||||
|
||||
Socket = {
|
||||
ListenStream = socketPath;
|
||||
FileDescriptorName = "server";
|
||||
SocketMode = "0600";
|
||||
DirectoryMode = "0700";
|
||||
# This prevents the service from immediately starting again
|
||||
# after being stopped, due to the function
|
||||
# `server-force-stop' present in `kill-emacs-hook', which
|
||||
# calls `server-running-p', which opens the socket file.
|
||||
FlushPending = true;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "sockets.target" ];
|
||||
# Adding this Requires= dependency ensures that systemd
|
||||
# manages the socket file, in the case where the service is
|
||||
# started when the socket is stopped.
|
||||
# The socket unit is implicitly ordered before the service.
|
||||
RequiredBy = [ "emacs.service" ];
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf pkgs.stdenv.isDarwin {
|
||||
launchd.agents.emacs = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${cfg.package}/bin/emacs"
|
||||
"--fg-daemon"
|
||||
] ++ cfg.extraOptions;
|
||||
RunAtLoad = true;
|
||||
KeepAlive = {
|
||||
Crashed = true;
|
||||
SuccessfulExit = false;
|
||||
(mkIf pkgs.stdenv.isDarwin {
|
||||
launchd.agents.emacs = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${cfg.package}/bin/emacs"
|
||||
"--fg-daemon"
|
||||
] ++ cfg.extraOptions;
|
||||
RunAtLoad = true;
|
||||
KeepAlive = {
|
||||
Crashed = true;
|
||||
SuccessfulExit = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,22 +4,20 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.etesync-dav;
|
||||
|
||||
toEnvironmentCfg =
|
||||
vars: (concatStringsSep " " (mapAttrsToList (k: v: "${k}=${escapeShellArg v}") vars));
|
||||
vars: (lib.concatStringsSep " " (lib.mapAttrsToList (k: v: "${k}=${lib.escapeShellArg v}") vars));
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.valodim ];
|
||||
meta.maintainers = [ lib.maintainers.valodim ];
|
||||
|
||||
options.services.etesync-dav = {
|
||||
enable = mkEnableOption "etesync-dav";
|
||||
enable = lib.mkEnableOption "etesync-dav";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
@ -42,7 +40,7 @@ in
|
|||
]
|
||||
);
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
ETESYNC_LISTEN_ADDRESS = "localhost";
|
||||
ETESYNC_LISTEN_PORT = 37358;
|
||||
|
|
@ -54,7 +52,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.etesync-dav" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.flameshot;
|
||||
|
|
@ -17,19 +14,19 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.hamhut1066 ];
|
||||
meta.maintainers = [ lib.maintainers.hamhut1066 ];
|
||||
|
||||
options.services.flameshot = {
|
||||
enable = mkEnableOption "Flameshot";
|
||||
enable = lib.mkEnableOption "Flameshot";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.flameshot;
|
||||
defaultText = literalExpression "pkgs.flameshot";
|
||||
defaultText = lib.literalExpression "pkgs.flameshot";
|
||||
description = "Package providing {command}`flameshot`.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
settings = lib.mkOption {
|
||||
inherit (iniFormat) type;
|
||||
default = { };
|
||||
example = {
|
||||
|
|
@ -46,14 +43,14 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.flameshot" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile = mkIf (cfg.settings != { }) {
|
||||
xdg.configFile = lib.mkIf (cfg.settings != { }) {
|
||||
"flameshot/flameshot.ini".source = iniFile;
|
||||
};
|
||||
|
||||
|
|
@ -66,7 +63,7 @@ in
|
|||
"tray.target"
|
||||
];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
X-Restart-Triggers = mkIf (cfg.settings != { }) [ "${iniFile}" ];
|
||||
X-Restart-Triggers = lib.mkIf (cfg.settings != { }) [ "${iniFile}" ];
|
||||
};
|
||||
|
||||
Install = {
|
||||
|
|
|
|||
|
|
@ -4,20 +4,18 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.fluidsynth;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.valodim ];
|
||||
meta.maintainers = [ lib.maintainers.valodim ];
|
||||
|
||||
options = {
|
||||
services.fluidsynth = {
|
||||
enable = mkEnableOption "fluidsynth midi synthesizer";
|
||||
enable = lib.mkEnableOption "fluidsynth midi synthesizer";
|
||||
|
||||
soundFont = mkOption {
|
||||
type = types.path;
|
||||
|
|
@ -52,7 +50,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.fluidsynth" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,13 +4,12 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.fnott;
|
||||
|
||||
concatStringsSep' = sep: list: concatStringsSep sep (remove "" list);
|
||||
concatStringsSep' = sep: list: lib.concatStringsSep sep (lib.remove "" list);
|
||||
|
||||
iniFormat = pkgs.formats.ini { };
|
||||
in
|
||||
|
|
@ -19,14 +18,14 @@ in
|
|||
|
||||
options = {
|
||||
services.fnott = {
|
||||
enable = mkEnableOption ''
|
||||
enable = lib.mkEnableOption ''
|
||||
fnott, a lightweight Wayland notification daemon for wlroots-based compositors
|
||||
'';
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.fnott;
|
||||
defaultText = literalExpression "pkgs.fnott";
|
||||
defaultText = lib.literalExpression "pkgs.fnott";
|
||||
description = "Package providing {command}`fnott`.";
|
||||
};
|
||||
|
||||
|
|
@ -67,7 +66,7 @@ in
|
|||
{manpage}`fnott.ini(5)` for a list of available options and <https://codeberg.org/dnkl/fnott/src/branch/master/fnott.ini>
|
||||
for an example configuration.
|
||||
'';
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
main = {
|
||||
notification-margin = 5;
|
||||
|
|
@ -84,8 +83,10 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [ (hm.assertions.assertPlatform "services.fnott" pkgs platforms.linux) ];
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.fnott" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
|
|
@ -103,8 +104,8 @@ in
|
|||
BusName = "org.freedesktop.Notifications";
|
||||
ExecStart = concatStringsSep' " " [
|
||||
"${cfg.package}/bin/fnott"
|
||||
"-c ${escapeShellArg cfg.configFile}"
|
||||
(escapeShellArgs cfg.extraFlags)
|
||||
"-c ${lib.escapeShellArg cfg.configFile}"
|
||||
(lib.escapeShellArgs cfg.extraFlags)
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) literalExpression mkOption types;
|
||||
|
||||
cfg = config.services.fusuma;
|
||||
|
||||
|
|
@ -60,14 +58,15 @@ let
|
|||
};
|
||||
|
||||
makeBinPath =
|
||||
packages: foldl (a: b: if a == "" then b else "${a}:${b}") "" (map (pkg: "${pkg}/bin") packages);
|
||||
packages:
|
||||
lib.foldl (a: b: if a == "" then b else "${a}:${b}") "" (map (pkg: "${pkg}/bin") packages);
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.iosmanthus ];
|
||||
meta.maintainers = [ lib.hm.maintainers.iosmanthus ];
|
||||
|
||||
options.services.fusuma = {
|
||||
enable = mkEnableOption "the fusuma systemd service to automatically enable touchpad gesture";
|
||||
enable = lib.mkEnableOption "the fusuma systemd service to automatically enable touchpad gesture";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
@ -118,7 +117,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.fusuma" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,26 +4,23 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.getmail;
|
||||
|
||||
accounts = filter (a: a.getmail.enable) (attrValues config.accounts.email.accounts);
|
||||
accounts = lib.filter (a: a.getmail.enable) (lib.attrValues config.accounts.email.accounts);
|
||||
|
||||
# Note: The getmail service does not expect a path, but just the filename!
|
||||
renderConfigFilepath = a: if a.primary then "getmailrc" else "getmail${a.name}";
|
||||
configFiles = concatMapStringsSep " " (a: " --rcfile ${renderConfigFilepath a}") accounts;
|
||||
configFiles = lib.concatMapStringsSep " " (a: " --rcfile ${renderConfigFilepath a}") accounts;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
services.getmail = {
|
||||
enable = mkEnableOption "the getmail systemd service to automatically retrieve mail";
|
||||
enable = lib.mkEnableOption "the getmail systemd service to automatically retrieve mail";
|
||||
|
||||
frequency = mkOption {
|
||||
type = types.str;
|
||||
frequency = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "*:0/5";
|
||||
example = "hourly";
|
||||
description = ''
|
||||
|
|
@ -38,7 +35,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.getmail" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,10 +4,14 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
literalExpression
|
||||
maintainers
|
||||
mkIf
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.git-sync;
|
||||
|
||||
|
|
@ -28,9 +32,9 @@ let
|
|||
++ repo.extraPackages
|
||||
)
|
||||
}"
|
||||
"GIT_SYNC_DIRECTORY=${strings.escapeShellArg repo.path}"
|
||||
"GIT_SYNC_DIRECTORY=${lib.strings.escapeShellArg repo.path}"
|
||||
"GIT_SYNC_COMMAND=${cfg.package}/bin/git-sync"
|
||||
"GIT_SYNC_REPOSITORY=${strings.escapeShellArg repo.uri}"
|
||||
"GIT_SYNC_REPOSITORY=${lib.strings.escapeShellArg repo.uri}"
|
||||
"GIT_SYNC_INTERVAL=${toString repo.interval}"
|
||||
];
|
||||
ExecStart = "${cfg.package}/bin/git-sync-on-inotify";
|
||||
|
|
@ -50,7 +54,7 @@ let
|
|||
};
|
||||
|
||||
mkService = if pkgs.stdenv.isLinux then mkUnit else mkAgent;
|
||||
services = mapAttrs' (name: repo: {
|
||||
services = lib.mapAttrs' (name: repo: {
|
||||
name = "git-sync-${name}";
|
||||
value = mkService name repo;
|
||||
}) cfg.repositories;
|
||||
|
|
@ -115,7 +119,7 @@ in
|
|||
|
||||
options = {
|
||||
services.git-sync = {
|
||||
enable = mkEnableOption "git-sync services";
|
||||
enable = lib.mkEnableOption "git-sync services";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
@ -144,9 +148,11 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf pkgs.stdenv.isLinux { systemd.user.services = services; })
|
||||
(mkIf pkgs.stdenv.isDarwin { launchd.agents = services; })
|
||||
]);
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
(mkIf pkgs.stdenv.isLinux { systemd.user.services = services; })
|
||||
(mkIf pkgs.stdenv.isDarwin { launchd.agents = services; })
|
||||
]
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,24 +4,21 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.gnome-keyring;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
meta.maintainers = [ lib.maintainers.rycee ];
|
||||
|
||||
options = {
|
||||
services.gnome-keyring = {
|
||||
enable = mkEnableOption "GNOME Keyring";
|
||||
enable = lib.mkEnableOption "GNOME Keyring";
|
||||
|
||||
components = mkOption {
|
||||
type = types.listOf (
|
||||
types.enum [
|
||||
components = lib.mkOption {
|
||||
type = lib.types.listOf (
|
||||
lib.types.enum [
|
||||
"pkcs11"
|
||||
"secrets"
|
||||
"ssh"
|
||||
|
|
@ -36,7 +33,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.gnome-keyring" pkgs lib.platforms.linux)
|
||||
{
|
||||
|
|
@ -58,12 +55,12 @@ in
|
|||
Service = {
|
||||
ExecStart =
|
||||
let
|
||||
args = concatStringsSep " " (
|
||||
args = lib.concatStringsSep " " (
|
||||
[
|
||||
"--start"
|
||||
"--foreground"
|
||||
]
|
||||
++ optional (cfg.components != [ ]) ("--components=" + concatStringsSep "," cfg.components)
|
||||
++ lib.optional (cfg.components != [ ]) ("--components=" + lib.concatStringsSep "," cfg.components)
|
||||
);
|
||||
in
|
||||
"${pkgs.gnome-keyring}/bin/gnome-keyring-daemon ${args}";
|
||||
|
|
|
|||
|
|
@ -5,10 +5,14 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
mkOption
|
||||
optional
|
||||
optionalString
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.gpg-agent;
|
||||
gpgPkg = config.programs.gpg.package;
|
||||
|
|
@ -55,7 +59,7 @@ let
|
|||
gpgconf =
|
||||
dir:
|
||||
let
|
||||
hash = substring 0 24 (hexStringToBase32 (builtins.hashString "sha1" homedir));
|
||||
hash = lib.substring 0 24 (hexStringToBase32 (builtins.hashString "sha1" homedir));
|
||||
subdir = if homedir == options.programs.gpg.homedir.default then "${dir}" else "d.${hash}/${dir}";
|
||||
in
|
||||
if pkgs.stdenv.isDarwin then
|
||||
|
|
@ -68,7 +72,7 @@ let
|
|||
hexStringToBase32 =
|
||||
let
|
||||
mod = a: b: a - a / b * b;
|
||||
pow2 = elemAt [
|
||||
pow2 = lib.elemAt [
|
||||
1
|
||||
2
|
||||
4
|
||||
|
|
@ -80,10 +84,10 @@ let
|
|||
256
|
||||
];
|
||||
|
||||
base32Alphabet = stringToCharacters "ybndrfg8ejkmcpqxot1uwisza345h769";
|
||||
hexToIntTable = listToAttrs (
|
||||
genList (x: {
|
||||
name = toLower (toHexString x);
|
||||
base32Alphabet = lib.stringToCharacters "ybndrfg8ejkmcpqxot1uwisza345h769";
|
||||
hexToIntTable = lib.listToAttrs (
|
||||
lib.genList (x: {
|
||||
name = lib.toLower (lib.toHexString x);
|
||||
value = x;
|
||||
}) 16
|
||||
);
|
||||
|
|
@ -107,7 +111,7 @@ let
|
|||
in
|
||||
if bufBits >= 5 then
|
||||
{
|
||||
ret = ret + elemAt base32Alphabet (buf' / pow2 extraBits);
|
||||
ret = ret + lib.elemAt base32Alphabet (buf' / pow2 extraBits);
|
||||
buf = mod buf' (pow2 extraBits);
|
||||
bufBits = bufBits' - 5;
|
||||
}
|
||||
|
|
@ -118,7 +122,7 @@ let
|
|||
bufBits = bufBits';
|
||||
};
|
||||
in
|
||||
hexString: (foldl' go initState (stringToCharacters hexString)).ret;
|
||||
hexString: (lib.foldl' go initState (lib.stringToCharacters hexString)).ret;
|
||||
|
||||
# Systemd socket unit generator.
|
||||
mkSocket =
|
||||
|
|
@ -156,10 +160,10 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
meta.maintainers = [ lib.maintainers.rycee ];
|
||||
|
||||
imports = [
|
||||
(mkRemovedOptionModule [
|
||||
(lib.mkRemovedOptionModule [
|
||||
"services"
|
||||
"gpg-agent"
|
||||
"pinentryFlavor"
|
||||
|
|
@ -168,7 +172,7 @@ in
|
|||
|
||||
options = {
|
||||
services.gpg-agent = {
|
||||
enable = mkEnableOption "GnuPG private key agent";
|
||||
enable = lib.mkEnableOption "GnuPG private key agent";
|
||||
|
||||
defaultCacheTtl = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
|
|
@ -294,7 +298,7 @@ in
|
|||
};
|
||||
pinentryPackage = mkOption {
|
||||
type = types.nullOr types.package;
|
||||
example = literalExpression "pkgs.pinentry-gnome3";
|
||||
example = lib.literalExpression "pkgs.pinentry-gnome3";
|
||||
default = null;
|
||||
description = ''
|
||||
Which pinentry interface to use. If not `null`, it sets
|
||||
|
|
@ -317,109 +321,111 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
home.file."${homedir}/gpg-agent.conf".text = concatStringsSep "\n" (
|
||||
optional (cfg.enableSshSupport) "enable-ssh-support"
|
||||
++ optional cfg.grabKeyboardAndMouse "grab"
|
||||
++ optional (!cfg.enableScDaemon) "disable-scdaemon"
|
||||
++ optional (cfg.noAllowExternalCache) "no-allow-external-cache"
|
||||
++ optional (cfg.defaultCacheTtl != null) "default-cache-ttl ${toString cfg.defaultCacheTtl}"
|
||||
++ optional (
|
||||
cfg.defaultCacheTtlSsh != null
|
||||
) "default-cache-ttl-ssh ${toString cfg.defaultCacheTtlSsh}"
|
||||
++ optional (cfg.maxCacheTtl != null) "max-cache-ttl ${toString cfg.maxCacheTtl}"
|
||||
++ optional (cfg.maxCacheTtlSsh != null) "max-cache-ttl-ssh ${toString cfg.maxCacheTtlSsh}"
|
||||
++ optional (cfg.pinentryPackage != null) "pinentry-program ${lib.getExe cfg.pinentryPackage}"
|
||||
++ [ cfg.extraConfig ]
|
||||
);
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
home.file."${homedir}/gpg-agent.conf".text = lib.concatStringsSep "\n" (
|
||||
optional (cfg.enableSshSupport) "enable-ssh-support"
|
||||
++ optional cfg.grabKeyboardAndMouse "grab"
|
||||
++ optional (!cfg.enableScDaemon) "disable-scdaemon"
|
||||
++ optional (cfg.noAllowExternalCache) "no-allow-external-cache"
|
||||
++ optional (cfg.defaultCacheTtl != null) "default-cache-ttl ${toString cfg.defaultCacheTtl}"
|
||||
++ optional (
|
||||
cfg.defaultCacheTtlSsh != null
|
||||
) "default-cache-ttl-ssh ${toString cfg.defaultCacheTtlSsh}"
|
||||
++ optional (cfg.maxCacheTtl != null) "max-cache-ttl ${toString cfg.maxCacheTtl}"
|
||||
++ optional (cfg.maxCacheTtlSsh != null) "max-cache-ttl-ssh ${toString cfg.maxCacheTtlSsh}"
|
||||
++ optional (cfg.pinentryPackage != null) "pinentry-program ${lib.getExe cfg.pinentryPackage}"
|
||||
++ [ cfg.extraConfig ]
|
||||
);
|
||||
|
||||
home.sessionVariablesExtra = optionalString cfg.enableSshSupport ''
|
||||
if [ -z "$SSH_AUTH_SOCK" ]; then
|
||||
export SSH_AUTH_SOCK="$(${gpgPkg}/bin/gpgconf --list-dirs agent-ssh-socket)"
|
||||
fi
|
||||
'';
|
||||
home.sessionVariablesExtra = optionalString cfg.enableSshSupport ''
|
||||
if [ -z "$SSH_AUTH_SOCK" ]; then
|
||||
export SSH_AUTH_SOCK="$(${gpgPkg}/bin/gpgconf --list-dirs agent-ssh-socket)"
|
||||
fi
|
||||
'';
|
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration gpgInitStr;
|
||||
programs.zsh.initContent = mkIf cfg.enableZshIntegration gpgZshInitStr;
|
||||
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration gpgFishInitStr;
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration gpgInitStr;
|
||||
programs.zsh.initContent = mkIf cfg.enableZshIntegration gpgZshInitStr;
|
||||
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration gpgFishInitStr;
|
||||
|
||||
programs.nushell.extraEnv = mkIf cfg.enableNushellIntegration gpgNushellInitStr;
|
||||
}
|
||||
programs.nushell.extraEnv = mkIf cfg.enableNushellIntegration gpgNushellInitStr;
|
||||
}
|
||||
|
||||
(mkIf (cfg.sshKeys != null) {
|
||||
# Trailing newlines are important
|
||||
home.file."${homedir}/sshcontrol".text = concatMapStrings (s: ''
|
||||
${s}
|
||||
'') cfg.sshKeys;
|
||||
})
|
||||
|
||||
(mkMerge [
|
||||
(mkIf pkgs.stdenv.isLinux {
|
||||
systemd.user.services.gpg-agent = {
|
||||
Unit = {
|
||||
Description = "GnuPG cryptographic agent and passphrase cache";
|
||||
Documentation = "man:gpg-agent(1)";
|
||||
Requires = "gpg-agent.socket";
|
||||
After = "gpg-agent.socket";
|
||||
# This is a socket-activated service:
|
||||
RefuseManualStart = true;
|
||||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = "${gpgPkg}/bin/gpg-agent --supervised" + optionalString cfg.verbose " --verbose";
|
||||
ExecReload = "${gpgPkg}/bin/gpgconf --reload gpg-agent";
|
||||
Environment = [ "GNUPGHOME=${homedir}" ];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.sockets.gpg-agent = mkSocket {
|
||||
desc = "GnuPG cryptographic agent and passphrase cache";
|
||||
docs = "man:gpg-agent(1)";
|
||||
stream = "S.gpg-agent";
|
||||
fdName = "std";
|
||||
};
|
||||
|
||||
systemd.user.sockets.gpg-agent-ssh = mkIf cfg.enableSshSupport (mkSocket ({
|
||||
desc = "GnuPG cryptographic agent (ssh-agent emulation)";
|
||||
docs = "man:gpg-agent(1) man:ssh-add(1) man:ssh-agent(1) man:ssh(1)";
|
||||
stream = "S.gpg-agent.ssh";
|
||||
fdName = "ssh";
|
||||
}));
|
||||
|
||||
systemd.user.sockets.gpg-agent-extra = mkIf cfg.enableExtraSocket (mkSocket {
|
||||
desc = "GnuPG cryptographic agent and passphrase cache (restricted)";
|
||||
docs = "man:gpg-agent(1) man:ssh(1)";
|
||||
stream = "S.gpg-agent.extra";
|
||||
fdName = "extra";
|
||||
});
|
||||
(mkIf (cfg.sshKeys != null) {
|
||||
# Trailing newlines are important
|
||||
home.file."${homedir}/sshcontrol".text = lib.concatMapStrings (s: ''
|
||||
${s}
|
||||
'') cfg.sshKeys;
|
||||
})
|
||||
|
||||
(mkIf pkgs.stdenv.isDarwin {
|
||||
launchd.agents.gpg-agent = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${gpgPkg}/bin/gpg-agent"
|
||||
"--supervised"
|
||||
] ++ optional cfg.verbose "--verbose";
|
||||
EnvironmentVariables = {
|
||||
GNUPGHOME = homedir;
|
||||
(lib.mkMerge [
|
||||
(mkIf pkgs.stdenv.isLinux {
|
||||
systemd.user.services.gpg-agent = {
|
||||
Unit = {
|
||||
Description = "GnuPG cryptographic agent and passphrase cache";
|
||||
Documentation = "man:gpg-agent(1)";
|
||||
Requires = "gpg-agent.socket";
|
||||
After = "gpg-agent.socket";
|
||||
# This is a socket-activated service:
|
||||
RefuseManualStart = true;
|
||||
};
|
||||
KeepAlive = {
|
||||
Crashed = true;
|
||||
SuccessfulExit = false;
|
||||
};
|
||||
ProcessType = "Background";
|
||||
RunAtLoad = cfg.enableSshSupport;
|
||||
Sockets = {
|
||||
Agent = mkAgentSock "S.gpg-agent";
|
||||
Ssh = mkIf cfg.enableSshSupport (mkAgentSock "S.gpg-agent.ssh");
|
||||
Extra = mkIf cfg.enableExtraSocket (mkAgentSock "S.gpg-agent.extra");
|
||||
|
||||
Service = {
|
||||
ExecStart = "${gpgPkg}/bin/gpg-agent --supervised" + optionalString cfg.verbose " --verbose";
|
||||
ExecReload = "${gpgPkg}/bin/gpgconf --reload gpg-agent";
|
||||
Environment = [ "GNUPGHOME=${homedir}" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
])
|
||||
]);
|
||||
|
||||
systemd.user.sockets.gpg-agent = mkSocket {
|
||||
desc = "GnuPG cryptographic agent and passphrase cache";
|
||||
docs = "man:gpg-agent(1)";
|
||||
stream = "S.gpg-agent";
|
||||
fdName = "std";
|
||||
};
|
||||
|
||||
systemd.user.sockets.gpg-agent-ssh = mkIf cfg.enableSshSupport (mkSocket {
|
||||
desc = "GnuPG cryptographic agent (ssh-agent emulation)";
|
||||
docs = "man:gpg-agent(1) man:ssh-add(1) man:ssh-agent(1) man:ssh(1)";
|
||||
stream = "S.gpg-agent.ssh";
|
||||
fdName = "ssh";
|
||||
});
|
||||
|
||||
systemd.user.sockets.gpg-agent-extra = mkIf cfg.enableExtraSocket (mkSocket {
|
||||
desc = "GnuPG cryptographic agent and passphrase cache (restricted)";
|
||||
docs = "man:gpg-agent(1) man:ssh(1)";
|
||||
stream = "S.gpg-agent.extra";
|
||||
fdName = "extra";
|
||||
});
|
||||
})
|
||||
|
||||
(mkIf pkgs.stdenv.isDarwin {
|
||||
launchd.agents.gpg-agent = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${gpgPkg}/bin/gpg-agent"
|
||||
"--supervised"
|
||||
] ++ optional cfg.verbose "--verbose";
|
||||
EnvironmentVariables = {
|
||||
GNUPGHOME = homedir;
|
||||
};
|
||||
KeepAlive = {
|
||||
Crashed = true;
|
||||
SuccessfulExit = false;
|
||||
};
|
||||
ProcessType = "Background";
|
||||
RunAtLoad = cfg.enableSshSupport;
|
||||
Sockets = {
|
||||
Agent = mkAgentSock "S.gpg-agent";
|
||||
Ssh = mkIf cfg.enableSshSupport (mkAgentSock "S.gpg-agent.ssh");
|
||||
Extra = mkIf cfg.enableExtraSocket (mkAgentSock "S.gpg-agent.extra");
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
])
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption mkIf types;
|
||||
|
||||
cfg = config.services.grobi;
|
||||
|
||||
|
|
@ -15,11 +13,11 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.mbrgm ];
|
||||
meta.maintainers = [ lib.maintainers.mbrgm ];
|
||||
|
||||
options = {
|
||||
services.grobi = {
|
||||
enable = mkEnableOption "the grobi display setup daemon";
|
||||
enable = lib.mkEnableOption "the grobi display setup daemon";
|
||||
|
||||
executeAfter = mkOption {
|
||||
type = with types; listOf str;
|
||||
|
|
@ -36,7 +34,7 @@ in
|
|||
rules = mkOption {
|
||||
type = with types; listOf (attrsOf eitherStrBoolIntList);
|
||||
default = [ ];
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
[
|
||||
{
|
||||
name = "Home";
|
||||
|
|
|
|||
|
|
@ -4,16 +4,14 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.gromit-mpx;
|
||||
|
||||
# Select the appropriate hot key:
|
||||
hotkey =
|
||||
if isInt cfg.hotKey then
|
||||
if lib.isInt cfg.hotKey then
|
||||
"--keycode ${toString cfg.hotKey}"
|
||||
else if cfg.hotKey != null then
|
||||
"--key ${cfg.hotKey}"
|
||||
|
|
@ -22,7 +20,7 @@ let
|
|||
|
||||
# Select the appropriate undo key:
|
||||
undokey =
|
||||
if isInt cfg.undoKey then
|
||||
if lib.isInt cfg.undoKey then
|
||||
"--undo-keycode ${toString cfg.undoKey}"
|
||||
else if cfg.undoKey != null then
|
||||
"--undo-key ${cfg.undoKey}"
|
||||
|
|
@ -30,7 +28,7 @@ let
|
|||
"--undo-key none";
|
||||
|
||||
# The command line to send to gromit-mpx:
|
||||
commandArgs = concatStringsSep " " [
|
||||
commandArgs = lib.concatStringsSep " " [
|
||||
hotkey
|
||||
undokey
|
||||
];
|
||||
|
|
@ -39,7 +37,7 @@ let
|
|||
# state. That will break our config so we set it manually which,
|
||||
# thanks to the read-only Nix store, prevents Gromit from writing to
|
||||
# it.
|
||||
keyFile = generators.toINI { } {
|
||||
keyFile = lib.generators.toINI { } {
|
||||
General.ShowIntroOnStartup = false;
|
||||
Drawing.Opacity = cfg.opacity;
|
||||
};
|
||||
|
|
@ -60,19 +58,19 @@ let
|
|||
# Create a string of tool attributes:
|
||||
toolAttrs =
|
||||
tool:
|
||||
concatStringsSep " " (
|
||||
lib.concatStringsSep " " (
|
||||
[ "size=${toString tool.size}" ]
|
||||
++ optional (tool.type != "eraser") ''color="${tool.color}"''
|
||||
++ optional (tool.arrowSize != null) "arrowsize=${toString tool.arrowSize}"
|
||||
++ lib.optional (tool.type != "eraser") ''color="${tool.color}"''
|
||||
++ lib.optional (tool.arrowSize != null) "arrowsize=${toString tool.arrowSize}"
|
||||
);
|
||||
|
||||
# Optional tool modifier string:
|
||||
toolMod =
|
||||
tool: if tool.modifiers != [ ] then "[" + concatStringsSep ", " tool.modifiers + "]" else "";
|
||||
tool: if tool.modifiers != [ ] then "[" + lib.concatStringsSep ", " tool.modifiers + "]" else "";
|
||||
|
||||
# A single tool configuration:
|
||||
toolToCfg = n: tool: ''
|
||||
"tool-${toString n}" = ${toUpper tool.type} (${toolAttrs tool});
|
||||
"tool-${toString n}" = ${lib.toUpper tool.type} (${toolAttrs tool});
|
||||
"${tool.device}"${toolMod tool} = "tool-${toString n}";
|
||||
'';
|
||||
|
||||
|
|
@ -136,10 +134,10 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.pjones ];
|
||||
meta.maintainers = [ lib.maintainers.pjones ];
|
||||
|
||||
options.services.gromit-mpx = {
|
||||
enable = mkEnableOption "Gromit-MPX annotation tool";
|
||||
enable = lib.mkEnableOption "Gromit-MPX annotation tool";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
@ -224,13 +222,13 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.gromit-mpx" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
xdg.configFile."gromit-mpx.ini".text = keyFile;
|
||||
xdg.configFile."gromit-mpx.cfg".text = concatStringsSep "\n" (imap1 toolToCfg cfg.tools);
|
||||
xdg.configFile."gromit-mpx.cfg".text = lib.concatStringsSep "\n" (lib.imap1 toolToCfg cfg.tools);
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.hound;
|
||||
|
||||
|
|
@ -27,10 +25,10 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.adisbladis ];
|
||||
meta.maintainers = [ lib.maintainers.adisbladis ];
|
||||
|
||||
options.services.hound = {
|
||||
enable = mkEnableOption "hound";
|
||||
enable = lib.mkEnableOption "hound";
|
||||
|
||||
maxConcurrentIndexers = mkOption {
|
||||
type = types.ints.positive;
|
||||
|
|
@ -54,7 +52,7 @@ in
|
|||
repositories = mkOption {
|
||||
type = types.attrsOf jsonFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
SomeGitRepo = {
|
||||
url = "https://www.github.com/YourOrganization/RepoOne.git";
|
||||
|
|
@ -67,7 +65,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.hound" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -86,13 +84,13 @@ in
|
|||
Service = {
|
||||
Environment = [
|
||||
"PATH=${
|
||||
makeBinPath [
|
||||
lib.makeBinPath [
|
||||
pkgs.mercurial
|
||||
pkgs.git
|
||||
]
|
||||
}"
|
||||
];
|
||||
ExecStart = "${pkgs.hound}/bin/houndd ${concatStringsSep " " houndOptions}";
|
||||
ExecStart = "${pkgs.hound}/bin/houndd ${lib.concatStringsSep " " houndOptions}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,10 +4,13 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
listToAttrs
|
||||
optionalAttrs
|
||||
;
|
||||
|
||||
cfg = config.services.imapnotify;
|
||||
|
||||
|
|
@ -15,7 +18,9 @@ let
|
|||
|
||||
configName = account: "imapnotify-${safeName account.name}-config.json";
|
||||
|
||||
imapnotifyAccounts = filter (a: a.imapnotify.enable) (attrValues config.accounts.email.accounts);
|
||||
imapnotifyAccounts = lib.filter (a: a.imapnotify.enable) (
|
||||
lib.attrValues config.accounts.email.accounts
|
||||
);
|
||||
|
||||
genAccountUnit =
|
||||
account:
|
||||
|
|
@ -32,7 +37,7 @@ let
|
|||
Service = {
|
||||
# Use the nix store path for config to ensure service restarts when it changes
|
||||
ExecStart =
|
||||
"${getExe cfg.package} -conf '${genAccountConfig account}'"
|
||||
"${lib.getExe cfg.package} -conf '${genAccountConfig account}'"
|
||||
+ " ${lib.optionalString (account.imapnotify.extraArgs != [ ]) (
|
||||
toString account.imapnotify.extraArgs
|
||||
)}";
|
||||
|
|
@ -41,7 +46,7 @@ let
|
|||
Type = "simple";
|
||||
Environment =
|
||||
[ "PATH=${cfg.path}" ]
|
||||
++ optional account.notmuch.enable "NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/default/config";
|
||||
++ lib.optional account.notmuch.enable "NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/default/config";
|
||||
};
|
||||
|
||||
Install = {
|
||||
|
|
@ -63,7 +68,7 @@ let
|
|||
{
|
||||
# Use the nix store path for config to ensure service restarts when it changes
|
||||
ProgramArguments = [
|
||||
"${getExe cfg.package}"
|
||||
"${lib.getExe cfg.package}"
|
||||
"-conf"
|
||||
"${genAccountConfig account}"
|
||||
];
|
||||
|
|
@ -115,17 +120,17 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.nickhu ];
|
||||
meta.maintainers = [ lib.maintainers.nickhu ];
|
||||
|
||||
options = {
|
||||
services.imapnotify = {
|
||||
enable = mkEnableOption "imapnotify";
|
||||
enable = lib.mkEnableOption "imapnotify";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.goimapnotify;
|
||||
defaultText = literalExpression "pkgs.goimapnotify";
|
||||
example = literalExpression "pkgs.imapnotify";
|
||||
defaultText = lib.literalExpression "pkgs.goimapnotify";
|
||||
example = lib.literalExpression "pkgs.imapnotify";
|
||||
description = "The imapnotify package to use";
|
||||
};
|
||||
|
||||
|
|
@ -146,18 +151,18 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions =
|
||||
let
|
||||
checkAccounts =
|
||||
pred: msg:
|
||||
let
|
||||
badAccounts = filter pred imapnotifyAccounts;
|
||||
badAccounts = lib.filter pred imapnotifyAccounts;
|
||||
in
|
||||
{
|
||||
assertion = badAccounts == [ ];
|
||||
message =
|
||||
"imapnotify: Missing ${msg} for accounts: " + concatMapStringsSep ", " (a: a.name) badAccounts;
|
||||
"imapnotify: Missing ${msg} for accounts: " + lib.concatMapStringsSep ", " (a: a.name) badAccounts;
|
||||
};
|
||||
in
|
||||
[
|
||||
|
|
|
|||
|
|
@ -4,10 +4,15 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
concatStringsSep
|
||||
literalExpression
|
||||
mkIf
|
||||
mkOption
|
||||
optionalString
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.kanshi;
|
||||
|
||||
|
|
@ -42,12 +47,12 @@ let
|
|||
else if x ? include then
|
||||
''include "${x.include}"''
|
||||
else
|
||||
throw "Unknown tags ${attrNames x}";
|
||||
throw "Unknown tags ${lib.attrNames x}";
|
||||
|
||||
directivesStr = concatStringsSep "\n" (map tagToStr cfg.settings);
|
||||
|
||||
oldDirectivesStr = ''
|
||||
${concatStringsSep "\n" (mapAttrsToList (n: v: profileStr (v // { name = n; })) cfg.profiles)}
|
||||
${concatStringsSep "\n" (lib.mapAttrsToList (n: v: profileStr (v // { name = n; })) cfg.profiles)}
|
||||
${cfg.extraConfig}
|
||||
'';
|
||||
|
||||
|
|
@ -194,7 +199,7 @@ let
|
|||
};
|
||||
|
||||
exec = mkOption {
|
||||
type = with types; coercedTo str singleton (listOf str);
|
||||
type = with types; coercedTo str lib.singleton (listOf str);
|
||||
default = [ ];
|
||||
example = "[ \${pkg.sway}/bin/swaymsg workspace 1, move workspace to eDP-1 ]";
|
||||
description = ''
|
||||
|
|
@ -216,10 +221,10 @@ let
|
|||
in
|
||||
{
|
||||
|
||||
meta.maintainers = [ hm.maintainers.nurelin ];
|
||||
meta.maintainers = [ lib.hm.maintainers.nurelin ];
|
||||
|
||||
options.services.kanshi = {
|
||||
enable = mkEnableOption "kanshi, a Wayland daemon that automatically configures outputs";
|
||||
enable = lib.mkEnableOption "kanshi, a Wayland daemon that automatically configures outputs";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
@ -314,67 +319,70 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.kanshi" pkgs lib.platforms.linux)
|
||||
{
|
||||
assertion = (cfg.profiles == { } && cfg.extraConfig == "") || (length cfg.settings) == 0;
|
||||
message = "Cannot mix kanshi.settings with kanshi.profiles or kanshi.extraConfig";
|
||||
}
|
||||
{
|
||||
assertion =
|
||||
let
|
||||
profiles = filter (x: x ? profile) cfg.settings;
|
||||
in
|
||||
length (filter (x: any (a: a ? alias && a.alias != null) x.profile.outputs) profiles) == 0;
|
||||
message = "Output kanshi.*.output.alias can only be defined on global scope";
|
||||
}
|
||||
];
|
||||
}
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.kanshi" pkgs lib.platforms.linux)
|
||||
{
|
||||
assertion = (cfg.profiles == { } && cfg.extraConfig == "") || (lib.length cfg.settings) == 0;
|
||||
message = "Cannot mix kanshi.settings with kanshi.profiles or kanshi.extraConfig";
|
||||
}
|
||||
{
|
||||
assertion =
|
||||
let
|
||||
profiles = lib.filter (x: x ? profile) cfg.settings;
|
||||
in
|
||||
lib.length (lib.filter (x: lib.any (a: a ? alias && a.alias != null) x.profile.outputs) profiles)
|
||||
== 0;
|
||||
message = "Output kanshi.*.output.alias can only be defined on global scope";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
(mkIf (cfg.profiles != { }) {
|
||||
warnings = [
|
||||
"kanshi.profiles option is deprecated. Use kanshi.settings instead."
|
||||
];
|
||||
})
|
||||
(mkIf (cfg.profiles != { }) {
|
||||
warnings = [
|
||||
"kanshi.profiles option is deprecated. Use kanshi.settings instead."
|
||||
];
|
||||
})
|
||||
|
||||
(mkIf (cfg.extraConfig != "") {
|
||||
warnings = [
|
||||
"kanshi.extraConfig option is deprecated. Use kanshi.settings instead."
|
||||
];
|
||||
})
|
||||
(mkIf (cfg.extraConfig != "") {
|
||||
warnings = [
|
||||
"kanshi.extraConfig option is deprecated. Use kanshi.settings instead."
|
||||
];
|
||||
})
|
||||
|
||||
{
|
||||
home.packages = [ cfg.package ];
|
||||
{
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."kanshi/config" =
|
||||
let
|
||||
generatedConfigStr =
|
||||
if cfg.profiles == { } && cfg.extraConfig == "" then directivesStr else oldDirectivesStr;
|
||||
in
|
||||
mkIf (generatedConfigStr != "") { text = generatedConfigStr; };
|
||||
xdg.configFile."kanshi/config" =
|
||||
let
|
||||
generatedConfigStr =
|
||||
if cfg.profiles == { } && cfg.extraConfig == "" then directivesStr else oldDirectivesStr;
|
||||
in
|
||||
mkIf (generatedConfigStr != "") { text = generatedConfigStr; };
|
||||
|
||||
systemd.user.services.kanshi = {
|
||||
Unit = {
|
||||
Description = "Dynamic output configuration";
|
||||
Documentation = "man:kanshi(1)";
|
||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||
PartOf = cfg.systemdTarget;
|
||||
Requires = cfg.systemdTarget;
|
||||
After = cfg.systemdTarget;
|
||||
systemd.user.services.kanshi = {
|
||||
Unit = {
|
||||
Description = "Dynamic output configuration";
|
||||
Documentation = "man:kanshi(1)";
|
||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||
PartOf = cfg.systemdTarget;
|
||||
Requires = cfg.systemdTarget;
|
||||
After = cfg.systemdTarget;
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${cfg.package}/bin/kanshi";
|
||||
Restart = "always";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ cfg.systemdTarget ];
|
||||
};
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${cfg.package}/bin/kanshi";
|
||||
Restart = "always";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ cfg.systemdTarget ];
|
||||
};
|
||||
};
|
||||
}
|
||||
]);
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.kbfs;
|
||||
|
|
@ -15,10 +12,10 @@ in
|
|||
{
|
||||
options = {
|
||||
services.kbfs = {
|
||||
enable = mkEnableOption "Keybase File System";
|
||||
enable = lib.mkEnableOption "Keybase File System";
|
||||
|
||||
mountPoint = mkOption {
|
||||
type = types.str;
|
||||
mountPoint = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "keybase";
|
||||
description = ''
|
||||
Mount point for the Keybase filesystem, relative to
|
||||
|
|
@ -26,8 +23,8 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
extraFlags = mkOption {
|
||||
type = types.listOf types.str;
|
||||
extraFlags = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
example = [
|
||||
"-label kbfs"
|
||||
|
|
@ -40,7 +37,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.kbfs" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,41 +4,38 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.kdeconnect;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.adisbladis ];
|
||||
meta.maintainers = [ lib.maintainers.adisbladis ];
|
||||
|
||||
options = {
|
||||
services.kdeconnect = {
|
||||
enable = mkEnableOption "KDE connect";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
enable = lib.mkEnableOption "KDE connect";
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.kdePackages.kdeconnect-kde;
|
||||
example = literalExpression "pkgs.plasma5Packages.kdeconnect-kde";
|
||||
example = lib.literalExpression "pkgs.plasma5Packages.kdeconnect-kde";
|
||||
description = "The KDE connect package to use";
|
||||
};
|
||||
|
||||
indicator = mkOption {
|
||||
type = types.bool;
|
||||
indicator = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable kdeconnect-indicator service.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf cfg.enable {
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.kdeconnect" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.kdeconnect" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.kdeconnect = {
|
||||
|
|
@ -55,7 +52,7 @@ in
|
|||
Service = {
|
||||
Environment = [ "PATH=${config.home.profileDirectory}/bin" ];
|
||||
ExecStart =
|
||||
if strings.versionAtLeast (versions.majorMinor cfg.package.version) "24.05" then
|
||||
if lib.strings.versionAtLeast (lib.versions.majorMinor cfg.package.version) "24.05" then
|
||||
"${cfg.package}/bin/kdeconnectd"
|
||||
else
|
||||
"${cfg.package}/libexec/kdeconnectd";
|
||||
|
|
@ -64,9 +61,9 @@ in
|
|||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.indicator {
|
||||
(lib.mkIf cfg.indicator {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.kdeconnect" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.kdeconnect" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.kdeconnect-indicator = {
|
||||
|
|
|
|||
|
|
@ -4,18 +4,15 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.keybase;
|
||||
|
||||
in
|
||||
{
|
||||
options.services.keybase.enable = mkEnableOption "Keybase";
|
||||
options.services.keybase.enable = lib.mkEnableOption "Keybase";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.keybase" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.keynav;
|
||||
|
|
@ -14,10 +11,10 @@ let
|
|||
in
|
||||
{
|
||||
options.services.keynav = {
|
||||
enable = mkEnableOption "keynav";
|
||||
enable = lib.mkEnableOption "keynav";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.keynav" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,23 +4,20 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.lieer;
|
||||
|
||||
syncAccounts = filter (a: a.lieer.enable && a.lieer.sync.enable) (
|
||||
attrValues config.accounts.email.accounts
|
||||
syncAccounts = lib.filter (a: a.lieer.enable && a.lieer.sync.enable) (
|
||||
lib.attrValues config.accounts.email.accounts
|
||||
);
|
||||
|
||||
escapeUnitName =
|
||||
name:
|
||||
let
|
||||
good = upperChars ++ lowerChars ++ stringToCharacters "0123456789-_";
|
||||
subst = c: if any (x: x == c) good then c else "-";
|
||||
good = lib.upperChars ++ lib.lowerChars ++ lib.stringToCharacters "0123456789-_";
|
||||
subst = c: if lib.any (x: x == c) good then c else "-";
|
||||
in
|
||||
stringAsChars subst name;
|
||||
lib.stringAsChars subst name;
|
||||
|
||||
serviceUnit = account: {
|
||||
name = escapeUnitName "lieer-${account.name}";
|
||||
|
|
@ -59,17 +56,17 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.tadfisher ];
|
||||
meta.maintainers = [ lib.maintainers.tadfisher ];
|
||||
|
||||
options.services.lieer.enable = mkEnableOption "lieer Gmail synchronization service";
|
||||
options.services.lieer.enable = lib.mkEnableOption "lieer Gmail synchronization service";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.lieer" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
programs.lieer.enable = true;
|
||||
systemd.user.services = listToAttrs (map serviceUnit syncAccounts);
|
||||
systemd.user.timers = listToAttrs (map timerUnit syncAccounts);
|
||||
systemd.user.services = lib.listToAttrs (map serviceUnit syncAccounts);
|
||||
systemd.user.timers = lib.listToAttrs (map timerUnit syncAccounts);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,21 +4,19 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.linux-wallpaperengine;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.ckgxrg ];
|
||||
meta.maintainers = [ lib.hm.maintainers.ckgxrg ];
|
||||
|
||||
options.services.linux-wallpaperengine = {
|
||||
enable = mkEnableOption "linux-wallpaperengine, an implementation of Wallpaper Engine functionality";
|
||||
enable = lib.mkEnableOption "linux-wallpaperengine, an implementation of Wallpaper Engine functionality";
|
||||
|
||||
package = mkPackageOption pkgs "linux-wallpaperengine" { };
|
||||
package = lib.mkPackageOption pkgs "linux-wallpaperengine" { };
|
||||
|
||||
assetsPath = mkOption {
|
||||
type = types.path;
|
||||
|
|
@ -103,7 +101,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.linux-wallpaperengine" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -112,10 +110,10 @@ in
|
|||
|
||||
systemd.user.services."linux-wallpaperengine" =
|
||||
let
|
||||
args = lists.forEach cfg.wallpapers (
|
||||
args = lib.lists.forEach cfg.wallpapers (
|
||||
each:
|
||||
concatStringsSep " " (
|
||||
cli.toGNUCommandLine { } {
|
||||
lib.concatStringsSep " " (
|
||||
lib.cli.toGNUCommandLine { } {
|
||||
screen-root = each.monitor;
|
||||
inherit (each) scaling fps;
|
||||
silent = each.audio.silent;
|
||||
|
|
@ -136,10 +134,10 @@ in
|
|||
};
|
||||
Service = {
|
||||
ExecStart =
|
||||
getExe cfg.package
|
||||
lib.getExe cfg.package
|
||||
+ " --assets-dir ${cfg.assetsPath} "
|
||||
+ "--clamping ${cfg.clamping} "
|
||||
+ (strings.concatStringsSep " " args);
|
||||
+ (lib.strings.concatStringsSep " " args);
|
||||
Restart = "on-failure";
|
||||
};
|
||||
Install = {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.lorri;
|
||||
|
|
@ -14,27 +11,27 @@ let
|
|||
in
|
||||
{
|
||||
meta.maintainers = [
|
||||
maintainers.gerschtli
|
||||
maintainers.nyarly
|
||||
lib.maintainers.gerschtli
|
||||
lib.maintainers.nyarly
|
||||
];
|
||||
|
||||
options.services.lorri = {
|
||||
enable = mkEnableOption "lorri build daemon";
|
||||
enable = lib.mkEnableOption "lorri build daemon";
|
||||
|
||||
enableNotifications = mkEnableOption "lorri build notifications";
|
||||
enableNotifications = lib.mkEnableOption "lorri build notifications";
|
||||
|
||||
package = lib.mkPackageOption pkgs "lorri" { };
|
||||
|
||||
nixPackage = mkOption {
|
||||
type = types.package;
|
||||
nixPackage = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.nix;
|
||||
defaultText = literalExpression "pkgs.nix";
|
||||
example = literalExpression "pkgs.nixVersions.unstable";
|
||||
defaultText = lib.literalExpression "pkgs.nix";
|
||||
example = lib.literalExpression "pkgs.nixVersions.unstable";
|
||||
description = "Which nix package to use.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.lorri" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -95,7 +92,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
services.lorri-notify = mkIf cfg.enableNotifications {
|
||||
services.lorri-notify = lib.mkIf cfg.enableNotifications {
|
||||
Unit = {
|
||||
Description = "lorri build notifications";
|
||||
After = "lorri.service";
|
||||
|
|
@ -123,7 +120,7 @@ in
|
|||
Restart = "on-failure";
|
||||
Environment =
|
||||
let
|
||||
path = makeSearchPath "bin" (
|
||||
path = lib.makeSearchPath "bin" (
|
||||
with pkgs;
|
||||
[
|
||||
bash
|
||||
|
|
|
|||
|
|
@ -4,29 +4,27 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.mako;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.onny ];
|
||||
meta.maintainers = [ lib.maintainers.onny ];
|
||||
|
||||
imports = [ (mkRenamedOptionModule [ "programs" "mako" ] [ "services" "mako" ]) ];
|
||||
imports = [ (lib.mkRenamedOptionModule [ "programs" "mako" ] [ "services" "mako" ]) ];
|
||||
|
||||
options = {
|
||||
services.mako = {
|
||||
enable = mkEnableOption ''
|
||||
enable = lib.mkEnableOption ''
|
||||
Mako, lightweight notification daemon for Wayland
|
||||
'';
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.mako;
|
||||
defaultText = literalExpression "pkgs.mako";
|
||||
defaultText = lib.literalExpression "pkgs.mako";
|
||||
description = "The mako package to use.";
|
||||
};
|
||||
|
||||
|
|
@ -314,7 +312,7 @@ in
|
|||
extraConfig = mkOption {
|
||||
default = "";
|
||||
type = types.lines;
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
[urgency=low]
|
||||
border-color=#b8bb26
|
||||
'';
|
||||
|
|
@ -330,8 +328,10 @@ in
|
|||
optionalInteger = name: val: lib.optionalString (val != null) "${name}=${toString val}";
|
||||
optionalString = name: val: lib.optionalString (val != null) "${name}=${val}";
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
assertions = [ (hm.assertions.assertPlatform "services.mako" pkgs platforms.linux) ];
|
||||
lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.mako" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
|
|
|
|||
|
|
@ -4,30 +4,28 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.mbsync;
|
||||
|
||||
mbsyncOptions =
|
||||
[ "--all" ]
|
||||
++ optional (cfg.verbose) "--verbose"
|
||||
++ optional (cfg.configFile != null) "--config ${cfg.configFile}";
|
||||
++ lib.optional (cfg.verbose) "--verbose"
|
||||
++ lib.optional (cfg.configFile != null) "--config ${cfg.configFile}";
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.pjones ];
|
||||
meta.maintainers = [ lib.maintainers.pjones ];
|
||||
|
||||
options.services.mbsync = {
|
||||
enable = mkEnableOption "mbsync";
|
||||
enable = lib.mkEnableOption "mbsync";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.isync;
|
||||
defaultText = literalExpression "pkgs.isync";
|
||||
example = literalExpression "pkgs.isync";
|
||||
defaultText = lib.literalExpression "pkgs.isync";
|
||||
example = lib.literalExpression "pkgs.isync";
|
||||
description = "The package to use for the mbsync binary.";
|
||||
};
|
||||
|
||||
|
|
@ -80,7 +78,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.mbsync" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -93,12 +91,12 @@ in
|
|||
Service =
|
||||
{
|
||||
Type = "oneshot";
|
||||
ExecStart = "${cfg.package}/bin/mbsync ${concatStringsSep " " mbsyncOptions}";
|
||||
ExecStart = "${cfg.package}/bin/mbsync ${lib.concatStringsSep " " mbsyncOptions}";
|
||||
}
|
||||
// (optionalAttrs (cfg.postExec != null) {
|
||||
// (lib.optionalAttrs (cfg.postExec != null) {
|
||||
ExecStartPost = cfg.postExec;
|
||||
})
|
||||
// (optionalAttrs (cfg.preExec != null) {
|
||||
// (lib.optionalAttrs (cfg.preExec != null) {
|
||||
ExecStartPre = cfg.preExec;
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,10 +5,13 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
generators
|
||||
mkIf
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.mopidy;
|
||||
|
||||
|
|
@ -18,13 +21,17 @@ let
|
|||
toMopidyConf = generators.toINI {
|
||||
mkKeyValue = generators.mkKeyValueDefault {
|
||||
mkValueString =
|
||||
v: if isList v then "\n " + concatStringsSep "\n " v else generators.mkValueStringDefault { } v;
|
||||
v:
|
||||
if lib.isList v then
|
||||
"\n " + lib.concatStringsSep "\n " v
|
||||
else
|
||||
generators.mkValueStringDefault { } v;
|
||||
} " = ";
|
||||
};
|
||||
|
||||
mopidyEnv = pkgs.buildEnv {
|
||||
name = "mopidy-with-extensions-${pkgs.mopidy.version}";
|
||||
paths = closePropagation cfg.extensionPackages;
|
||||
paths = lib.closePropagation cfg.extensionPackages;
|
||||
pathsToLink = [ "/${pkgs.mopidyPackages.python.sitePackages}" ];
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
ignoreCollisions = true;
|
||||
|
|
@ -60,7 +67,7 @@ let
|
|||
|
||||
settingsFormat = mopidyConfFormat { };
|
||||
|
||||
configFilePaths = concatStringsSep ":" (
|
||||
configFilePaths = lib.concatStringsSep ":" (
|
||||
[ "${config.xdg.configHome}/mopidy/mopidy.conf" ] ++ cfg.extraConfigFiles
|
||||
);
|
||||
|
||||
|
|
@ -68,15 +75,15 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.foo-dogsquared ];
|
||||
meta.maintainers = [ lib.hm.maintainers.foo-dogsquared ];
|
||||
|
||||
options.services.mopidy = {
|
||||
enable = mkEnableOption "Mopidy music player daemon";
|
||||
enable = lib.mkEnableOption "Mopidy music player daemon";
|
||||
|
||||
extensionPackages = mkOption {
|
||||
type = with types; listOf package;
|
||||
default = [ ];
|
||||
example = literalExpression "with pkgs; [ mopidy-spotify mopidy-mpd mopidy-mpris ]";
|
||||
example = lib.literalExpression "with pkgs; [ mopidy-spotify mopidy-mpd mopidy-mpris ]";
|
||||
description = ''
|
||||
Mopidy extensions that should be loaded by the service.
|
||||
'';
|
||||
|
|
@ -85,7 +92,7 @@ in
|
|||
settings = mkOption {
|
||||
type = settingsFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
file = {
|
||||
media_dirs = [
|
||||
|
|
@ -131,7 +138,9 @@ in
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [ (hm.assertions.assertPlatform "services.mopidy" pkgs platforms.linux) ];
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.mopidy" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
xdg.configFile."mopidy/mopidy.conf".source =
|
||||
settingsFormat.generate "mopidy-${config.home.username}" cfg.settings;
|
||||
|
|
|
|||
|
|
@ -4,24 +4,21 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.mpd-discord-rpc;
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
configFile = tomlFormat.generate "config.toml" cfg.settings;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.kranzes ];
|
||||
meta.maintainers = [ lib.maintainers.kranzes ];
|
||||
|
||||
options.services.mpd-discord-rpc = {
|
||||
enable = mkEnableOption "the mpd-discord-rpc service";
|
||||
enable = lib.mkEnableOption "the mpd-discord-rpc service";
|
||||
|
||||
settings = mkOption {
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
hosts = [ "localhost:6600" ];
|
||||
format = {
|
||||
|
|
@ -36,17 +33,17 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.mpd-discord-rpc;
|
||||
defaultText = literalExpression "pkgs.mpd-discord-rpc";
|
||||
defaultText = lib.literalExpression "pkgs.mpd-discord-rpc";
|
||||
description = "mpd-discord-rpc package to use.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.mpd-discord-rpc" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.mpd-discord-rpc" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
xdg.configFile."discord-rpc/config.toml".source = configFile;
|
||||
|
|
|
|||
|
|
@ -4,18 +4,16 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
|
||||
cfg = config.services.mpdris2;
|
||||
|
||||
toIni = generators.toINI {
|
||||
toIni = lib.generators.toINI {
|
||||
mkKeyValue =
|
||||
key: value:
|
||||
let
|
||||
value' = if isBool value then (if value then "True" else "False") else toString value;
|
||||
value' = if lib.isBool value then (if value then "True" else "False") else toString value;
|
||||
in
|
||||
"${key} = ${value'}";
|
||||
};
|
||||
|
|
@ -27,7 +25,7 @@ let
|
|||
port = cfg.mpd.port;
|
||||
music_dir = cfg.mpd.musicDirectory;
|
||||
}
|
||||
// optionalAttrs (cfg.mpd.password != null) {
|
||||
// lib.optionalAttrs (cfg.mpd.password != null) {
|
||||
password = cfg.mpd.password;
|
||||
};
|
||||
|
||||
|
|
@ -39,7 +37,7 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.pjones ];
|
||||
meta.maintainers = [ lib.maintainers.pjones ];
|
||||
|
||||
options.services.mpdris2 = {
|
||||
enable = mkEnableOption "mpDris2 the MPD to MPRIS2 bridge";
|
||||
|
|
@ -49,7 +47,7 @@ in
|
|||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.mpdris2;
|
||||
defaultText = literalExpression "pkgs.mpdris2";
|
||||
defaultText = lib.literalExpression "pkgs.mpdris2";
|
||||
description = "The mpDris2 package to use.";
|
||||
};
|
||||
|
||||
|
|
@ -90,7 +88,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.mpdris2" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,20 +4,17 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.mpris-proxy;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.thibautmarty ];
|
||||
meta.maintainers = [ lib.maintainers.thibautmarty ];
|
||||
|
||||
options.services.mpris-proxy.enable = mkEnableOption "a proxy forwarding Bluetooth MIDI controls via MPRIS2 to control media players";
|
||||
options.services.mpris-proxy.enable = lib.mkEnableOption "a proxy forwarding Bluetooth MIDI controls via MPRIS2 to control media players";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.mpris-proxy" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,13 +4,17 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
# Documentation was partially copied from the muchsync manual.
|
||||
# See http://www.muchsync.org/muchsync.html
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
escapeShellArg
|
||||
mkOption
|
||||
optional
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.muchsync;
|
||||
syncOptions = {
|
||||
options = {
|
||||
|
|
@ -132,13 +136,13 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = with maintainers; [ euxane ];
|
||||
meta.maintainers = with lib.maintainers; [ euxane ];
|
||||
|
||||
options.services.muchsync = {
|
||||
remotes = mkOption {
|
||||
type = with types; attrsOf (submodule syncOptions);
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
server = {
|
||||
frequency = "*:0/10";
|
||||
|
|
@ -156,12 +160,13 @@ in
|
|||
let
|
||||
mapRemotes =
|
||||
gen:
|
||||
with attrsets;
|
||||
mapAttrs' (name: remoteCfg: nameValuePair "muchsync-${name}" (gen name remoteCfg)) cfg.remotes;
|
||||
lib.attrsets.mapAttrs' (
|
||||
name: remoteCfg: lib.attrsets.nameValuePair "muchsync-${name}" (gen name remoteCfg)
|
||||
) cfg.remotes;
|
||||
in
|
||||
mkIf (cfg.remotes != { }) {
|
||||
lib.mkIf (cfg.remotes != { }) {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.muchsync" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.muchsync" pkgs lib.platforms.linux)
|
||||
|
||||
{
|
||||
assertion = config.programs.notmuch.enable;
|
||||
|
|
@ -184,7 +189,7 @@ in
|
|||
''"NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}"''
|
||||
''"NMBGIT=${config.home.sessionVariables.NMBGIT}"''
|
||||
];
|
||||
ExecStart = concatStringsSep " " (
|
||||
ExecStart = lib.concatStringsSep " " (
|
||||
[ "${pkgs.muchsync}/bin/muchsync" ]
|
||||
++ [ "-s ${escapeShellArg remoteCfg.sshCommand}" ]
|
||||
++ optional (!remoteCfg.upload) "--noup"
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.network-manager-applet;
|
||||
|
|
@ -14,17 +11,17 @@ let
|
|||
in
|
||||
{
|
||||
meta.maintainers = [
|
||||
maintainers.rycee
|
||||
maintainers.midirhee12
|
||||
lib.maintainers.rycee
|
||||
lib.maintainers.midirhee12
|
||||
];
|
||||
|
||||
options = {
|
||||
services.network-manager-applet = {
|
||||
enable = mkEnableOption "the Network Manager applet (nm-applet)";
|
||||
enable = lib.mkEnableOption "the Network Manager applet (nm-applet)";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.network-manager-applet" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -50,7 +47,7 @@ in
|
|||
Service = {
|
||||
ExecStart = toString (
|
||||
[ "${pkgs.networkmanagerapplet}/bin/nm-applet" ]
|
||||
++ optional config.xsession.preferStatusNotifierItems "--indicator"
|
||||
++ lib.optional config.xsession.preferStatusNotifierItems "--indicator"
|
||||
);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.nextcloud-client;
|
||||
|
|
@ -15,24 +12,24 @@ in
|
|||
{
|
||||
options = {
|
||||
services.nextcloud-client = {
|
||||
enable = mkEnableOption "Nextcloud Client";
|
||||
enable = lib.mkEnableOption "Nextcloud Client";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.nextcloud-client;
|
||||
defaultText = literalExpression "pkgs.nextcloud-client";
|
||||
defaultText = lib.literalExpression "pkgs.nextcloud-client";
|
||||
description = "The package to use for the nextcloud client binary.";
|
||||
};
|
||||
|
||||
startInBackground = mkOption {
|
||||
type = types.bool;
|
||||
startInBackground = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to start the Nextcloud client in the background.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.nextcloud-client" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -46,7 +43,8 @@ in
|
|||
|
||||
Service = {
|
||||
Environment = [ "PATH=${config.home.profileDirectory}/bin" ];
|
||||
ExecStart = "${cfg.package}/bin/nextcloud" + (optionalString cfg.startInBackground " --background");
|
||||
ExecStart =
|
||||
"${cfg.package}/bin/nextcloud" + (lib.optionalString cfg.startInBackground " --background");
|
||||
};
|
||||
|
||||
Install = {
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.nix.gc;
|
||||
darwinIntervals = [
|
||||
"hourly"
|
||||
|
|
@ -73,7 +72,7 @@ let
|
|||
if config.nix.enable && config.nix.package != null then config.nix.package else pkgs.nix;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.shivaraj-bh ];
|
||||
meta.maintainers = [ lib.maintainers.shivaraj-bh ];
|
||||
|
||||
options = {
|
||||
nix.gc = {
|
||||
|
|
@ -137,54 +136,56 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.automatic (mkMerge [
|
||||
(mkIf pkgs.stdenv.isLinux {
|
||||
systemd.user.services.nix-gc = {
|
||||
Unit = {
|
||||
Description = "Nix Garbage Collector";
|
||||
config = lib.mkIf cfg.automatic (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf pkgs.stdenv.isLinux {
|
||||
systemd.user.services.nix-gc = {
|
||||
Unit = {
|
||||
Description = "Nix Garbage Collector";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = toString (
|
||||
pkgs.writeShellScript "nix-gc" "exec ${nixPackage}/bin/nix-collect-garbage ${
|
||||
lib.optionalString (cfg.options != null) cfg.options
|
||||
}"
|
||||
);
|
||||
};
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = toString (
|
||||
pkgs.writeShellScript "nix-gc" "exec ${nixPackage}/bin/nix-collect-garbage ${
|
||||
lib.optionalString (cfg.options != null) cfg.options
|
||||
}"
|
||||
);
|
||||
systemd.user.timers.nix-gc = {
|
||||
Unit = {
|
||||
Description = "Nix Garbage Collector";
|
||||
};
|
||||
Timer = {
|
||||
OnCalendar = "${cfg.frequency}";
|
||||
RandomizedDelaySec = cfg.randomizedDelaySec;
|
||||
Persistent = cfg.persistent;
|
||||
Unit = "nix-gc.service";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.user.timers.nix-gc = {
|
||||
Unit = {
|
||||
Description = "Nix Garbage Collector";
|
||||
};
|
||||
Timer = {
|
||||
OnCalendar = "${cfg.frequency}";
|
||||
RandomizedDelaySec = cfg.randomizedDelaySec;
|
||||
Persistent = cfg.persistent;
|
||||
Unit = "nix-gc.service";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
})
|
||||
})
|
||||
|
||||
(mkIf pkgs.stdenv.isDarwin {
|
||||
assertions = [
|
||||
{
|
||||
assertion = elem cfg.frequency darwinIntervals;
|
||||
message = "On Darwin nix.gc.frequency must be one of: ${toString darwinIntervals}.";
|
||||
}
|
||||
];
|
||||
(lib.mkIf pkgs.stdenv.isDarwin {
|
||||
assertions = [
|
||||
{
|
||||
assertion = lib.elem cfg.frequency darwinIntervals;
|
||||
message = "On Darwin nix.gc.frequency must be one of: ${toString darwinIntervals}.";
|
||||
}
|
||||
];
|
||||
|
||||
launchd.agents.nix-gc = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${nixPackage}/bin/nix-collect-garbage"
|
||||
] ++ lib.optional (cfg.options != null) cfg.options;
|
||||
StartCalendarInterval = mkCalendarInterval cfg.frequency;
|
||||
launchd.agents.nix-gc = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${nixPackage}/bin/nix-collect-garbage"
|
||||
] ++ lib.optional (cfg.options != null) cfg.options;
|
||||
StartCalendarInterval = mkCalendarInterval cfg.frequency;
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,25 +4,22 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.notify-osd;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.imalison ];
|
||||
meta.maintainers = [ lib.maintainers.imalison ];
|
||||
|
||||
options = {
|
||||
services.notify-osd = {
|
||||
enable = mkEnableOption "notify-osd";
|
||||
enable = lib.mkEnableOption "notify-osd";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.notify-osd;
|
||||
defaultText = literalExpression "pkgs.notify-osd";
|
||||
defaultText = lib.literalExpression "pkgs.notify-osd";
|
||||
description = ''
|
||||
Package containing the {command}`notify-osd` program.
|
||||
'';
|
||||
|
|
@ -30,7 +27,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.notify-osd" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
|
||||
cfg = config.services.ollama;
|
||||
|
||||
|
|
@ -19,13 +17,13 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.terlar ];
|
||||
meta.maintainers = [ lib.maintainers.terlar ];
|
||||
|
||||
options = {
|
||||
services.ollama = {
|
||||
enable = mkEnableOption "ollama server for local large language models";
|
||||
enable = lib.mkEnableOption "ollama server for local large language models";
|
||||
|
||||
package = mkPackageOption pkgs "ollama" { };
|
||||
package = lib.mkPackageOption pkgs "ollama" { };
|
||||
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
|
|
@ -96,8 +94,8 @@ in
|
|||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = "${getExe ollamaPackage} serve";
|
||||
Environment = (mapAttrsToList (n: v: "${n}=${v}") cfg.environmentVariables) ++ [
|
||||
ExecStart = "${lib.getExe ollamaPackage} serve";
|
||||
Environment = (lib.mapAttrsToList (n: v: "${n}=${v}") cfg.environmentVariables) ++ [
|
||||
"OLLAMA_HOST=${cfg.host}:${toString cfg.port}"
|
||||
];
|
||||
};
|
||||
|
|
@ -111,7 +109,7 @@ in
|
|||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${getExe ollamaPackage}"
|
||||
"${lib.getExe ollamaPackage}"
|
||||
"serve"
|
||||
];
|
||||
EnvironmentVariables = cfg.environmentVariables // {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.opensnitch-ui;
|
||||
|
|
@ -14,15 +11,15 @@ let
|
|||
in
|
||||
{
|
||||
|
||||
meta.maintainers = [ maintainers.onny ];
|
||||
meta.maintainers = [ lib.maintainers.onny ];
|
||||
|
||||
options = {
|
||||
services.opensnitch-ui = {
|
||||
enable = mkEnableOption "Opensnitch client";
|
||||
enable = lib.mkEnableOption "Opensnitch client";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.opensnitch-ui" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,20 +4,19 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
|
||||
cfg = config.services.osmscout-server;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.Thra11 ];
|
||||
meta.maintainers = [ lib.maintainers.Thra11 ];
|
||||
|
||||
options = {
|
||||
services.osmscout-server = {
|
||||
enable = mkEnableOption "OSM Scout Server";
|
||||
enable = lib.mkEnableOption "OSM Scout Server";
|
||||
|
||||
package = mkPackageOption pkgs "osmscout-server" { };
|
||||
package = lib.mkPackageOption pkgs "osmscout-server" { };
|
||||
|
||||
network = {
|
||||
startWhenNeeded = mkOption {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.owncloud-client;
|
||||
|
|
@ -15,15 +12,15 @@ in
|
|||
{
|
||||
options = {
|
||||
services.owncloud-client = {
|
||||
enable = mkEnableOption "Owncloud Client";
|
||||
enable = lib.mkEnableOption "Owncloud Client";
|
||||
|
||||
package = mkPackageOption pkgs "owncloud-client" { };
|
||||
package = lib.mkPackageOption pkgs "owncloud-client" { };
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.owncloud-client" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.owncloud-client" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.owncloud-client = {
|
||||
|
|
|
|||
|
|
@ -4,33 +4,30 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.pantalaimon;
|
||||
|
||||
iniFmt = pkgs.formats.ini { };
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.jojosch ];
|
||||
meta.maintainers = [ lib.maintainers.jojosch ];
|
||||
|
||||
options = {
|
||||
services.pantalaimon = {
|
||||
enable = mkEnableOption "Pantalaimon, an E2EE aware proxy daemon for matrix clients";
|
||||
enable = lib.mkEnableOption "Pantalaimon, an E2EE aware proxy daemon for matrix clients";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.pantalaimon;
|
||||
defaultText = literalExpression "pkgs.pantalaimon";
|
||||
defaultText = lib.literalExpression "pkgs.pantalaimon";
|
||||
description = "Package providing the {command}`pantalaimon` executable to use.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
settings = lib.mkOption {
|
||||
type = iniFmt.type;
|
||||
default = { };
|
||||
defaultText = literalExpression "{ }";
|
||||
example = literalExpression ''
|
||||
defaultText = lib.literalExpression "{ }";
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
Default = {
|
||||
LogLevel = "Debug";
|
||||
|
|
@ -55,7 +52,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.pantalaimon" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,22 +4,19 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.parcellite;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.gleber ];
|
||||
meta.maintainers = [ lib.maintainers.gleber ];
|
||||
|
||||
options.services.parcellite = {
|
||||
enable = mkEnableOption "Parcellite";
|
||||
enable = lib.mkEnableOption "Parcellite";
|
||||
|
||||
extraOptions = mkOption {
|
||||
type = types.listOf types.str;
|
||||
extraOptions = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
example = [ "--no-icon" ];
|
||||
description = ''
|
||||
|
|
@ -27,16 +24,16 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.parcellite;
|
||||
defaultText = literalExpression "pkgs.parcellite";
|
||||
example = literalExpression "pkgs.clipit";
|
||||
defaultText = lib.literalExpression "pkgs.parcellite";
|
||||
example = lib.literalExpression "pkgs.clipit";
|
||||
description = "Parcellite derivation to use.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.parcellite" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -59,7 +56,7 @@ in
|
|||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = "${cfg.package}/bin/${cfg.package.pname} ${escapeShellArgs cfg.extraOptions}";
|
||||
ExecStart = "${cfg.package}/bin/${cfg.package.pname} ${lib.escapeShellArgs cfg.extraOptions}";
|
||||
Restart = "on-abort";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,24 +4,23 @@
|
|||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.pass-secret-service;
|
||||
|
||||
busName = "org.freedesktop.secrets";
|
||||
in
|
||||
{
|
||||
meta.maintainers = with maintainers; [
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
cab404
|
||||
cyntheticfox
|
||||
];
|
||||
|
||||
options.services.pass-secret-service = {
|
||||
enable = mkEnableOption "Pass libsecret service";
|
||||
enable = lib.mkEnableOption "Pass libsecret service";
|
||||
|
||||
package = mkPackageOption pkgs "pass-secret-service" { };
|
||||
package = lib.mkPackageOption pkgs "pass-secret-service" { };
|
||||
|
||||
storePath = mkOption {
|
||||
type = with types; nullOr str;
|
||||
|
|
@ -37,9 +36,9 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.pass-secret-service" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.pass-secret-service" pkgs lib.platforms.linux)
|
||||
{
|
||||
assertion = !config.services.gnome-keyring.enable;
|
||||
message = ''
|
||||
|
|
@ -64,7 +63,7 @@ in
|
|||
|
||||
Service = {
|
||||
Type = "dbus";
|
||||
ExecStart = "${binPath} ${optionalString (cfg.storePath != null) "--path ${cfg.storePath}"}";
|
||||
ExecStart = "${binPath} ${lib.optionalString (cfg.storePath != null) "--path ${cfg.storePath}"}";
|
||||
BusName = busName;
|
||||
Environment = [ "GNUPGHOME=${config.programs.gpg.homedir}" ];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,22 +4,19 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.pasystray;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.pltanton ];
|
||||
meta.maintainers = [ lib.hm.maintainers.pltanton ];
|
||||
|
||||
options = {
|
||||
services.pasystray = {
|
||||
enable = mkEnableOption "PulseAudio system tray";
|
||||
enable = lib.mkEnableOption "PulseAudio system tray";
|
||||
|
||||
extraOptions = mkOption {
|
||||
type = types.listOf types.str;
|
||||
extraOptions = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Extra command-line arguments to pass to {command}`pasystray`.
|
||||
|
|
@ -28,9 +25,9 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.pasystray" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.pasystray" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.pasystray = {
|
||||
|
|
@ -51,13 +48,13 @@ in
|
|||
Service = {
|
||||
Environment =
|
||||
let
|
||||
toolPaths = makeBinPath [
|
||||
toolPaths = lib.makeBinPath [
|
||||
pkgs.paprefs
|
||||
pkgs.pavucontrol
|
||||
];
|
||||
in
|
||||
[ "PATH=${toolPaths}" ];
|
||||
ExecStart = escapeShellArgs ([ "${pkgs.pasystray}/bin/pasystray" ] ++ cfg.extraOptions);
|
||||
ExecStart = lib.escapeShellArgs ([ "${pkgs.pasystray}/bin/pasystray" ] ++ cfg.extraOptions);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,21 +4,19 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.pbgopy;
|
||||
package = pkgs.pbgopy;
|
||||
|
||||
commandLine = concatStringsSep " " (
|
||||
commandLine = lib.concatStringsSep " " (
|
||||
[
|
||||
"${package}/bin/pbgopy serve"
|
||||
"--port ${toString cfg.port}"
|
||||
"--ttl ${cfg.cache.ttl}"
|
||||
]
|
||||
++ optional (cfg.httpAuth != null) "--basic-auth ${escapeShellArg cfg.httpAuth}"
|
||||
++ lib.optional (cfg.httpAuth != null) "--basic-auth ${lib.escapeShellArg cfg.httpAuth}"
|
||||
);
|
||||
|
||||
in
|
||||
|
|
@ -26,7 +24,7 @@ in
|
|||
meta.maintainers = [ ];
|
||||
|
||||
options.services.pbgopy = {
|
||||
enable = mkEnableOption "pbgopy";
|
||||
enable = lib.mkEnableOption "pbgopy";
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
|
|
@ -57,7 +55,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.pbgopy" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -10,10 +10,8 @@ let
|
|||
inherit (builtins)
|
||||
elemAt
|
||||
isAttrs
|
||||
isBool
|
||||
length
|
||||
mapAttrs
|
||||
toJSON
|
||||
;
|
||||
inherit (lib)
|
||||
boolToString
|
||||
|
|
@ -28,9 +26,7 @@ let
|
|||
mkDefault
|
||||
mkIf
|
||||
mkOption
|
||||
optional
|
||||
types
|
||||
warn
|
||||
getExe
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,34 +4,31 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.plan9port;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.ehmry ];
|
||||
meta.maintainers = [ lib.maintainers.ehmry ];
|
||||
|
||||
options.services.plan9port = {
|
||||
fontsrv.enable = mkEnableOption "the Plan 9 file system access to host fonts";
|
||||
plumber.enable = mkEnableOption "the Plan 9 file system for interprocess messaging";
|
||||
fontsrv.enable = lib.mkEnableOption "the Plan 9 file system access to host fonts";
|
||||
plumber.enable = lib.mkEnableOption "the Plan 9 file system for interprocess messaging";
|
||||
};
|
||||
|
||||
config = mkIf (cfg.fontsrv.enable || cfg.plumber.enable) {
|
||||
config = lib.mkIf (cfg.fontsrv.enable || cfg.plumber.enable) {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.plan9port" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.plan9port" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.fontsrv = mkIf cfg.fontsrv.enable {
|
||||
systemd.user.services.fontsrv = lib.mkIf cfg.fontsrv.enable {
|
||||
Unit.Description = "the Plan 9 file system access to host fonts";
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
Service.ExecStart = "${pkgs.plan9port}/bin/9 fontsrv";
|
||||
};
|
||||
|
||||
systemd.user.services.plumber = mkIf cfg.plumber.enable {
|
||||
systemd.user.services.plumber = lib.mkIf cfg.plumber.enable {
|
||||
Unit.Description = "file system for interprocess messaging";
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
Service.ExecStart = "${pkgs.plan9port}/bin/9 plumber -f";
|
||||
|
|
|
|||
|
|
@ -4,29 +4,26 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.playerctld;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.fendse ];
|
||||
meta.maintainers = [ lib.hm.maintainers.fendse ];
|
||||
|
||||
options.services.playerctld = {
|
||||
enable = mkEnableOption "playerctld daemon";
|
||||
enable = lib.mkEnableOption "playerctld daemon";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.playerctl;
|
||||
defaultText = literalExpression "pkgs.playerctl";
|
||||
defaultText = lib.literalExpression "pkgs.playerctl";
|
||||
description = "The playerctl package to use.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.playerctld" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
jsonFormat = pkgs.formats.json { };
|
||||
|
|
@ -14,23 +11,23 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.starcraft66 ];
|
||||
meta.maintainers = [ lib.maintainers.starcraft66 ];
|
||||
|
||||
options = {
|
||||
services.plex-mpv-shim = {
|
||||
enable = mkEnableOption "Plex mpv shim";
|
||||
enable = lib.mkEnableOption "Plex mpv shim";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.plex-mpv-shim;
|
||||
defaultText = literalExpression "pkgs.plex-mpv-shim";
|
||||
defaultText = lib.literalExpression "pkgs.plex-mpv-shim";
|
||||
description = "The package to use for the Plex mpv shim.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
settings = lib.mkOption {
|
||||
type = jsonFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
adaptive_transcode = false;
|
||||
allow_http = false;
|
||||
|
|
@ -51,12 +48,12 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.plex-mpv-shim" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
xdg.configFile."plex-mpv-shim/conf.json" = mkIf (cfg.settings != { }) {
|
||||
xdg.configFile."plex-mpv-shim/conf.json" = lib.mkIf (cfg.settings != { }) {
|
||||
source = jsonFormat.generate "conf.json" cfg.settings;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.podman;
|
||||
|
||||
podman-lib = import ./podman-lib.nix { inherit pkgs lib config; };
|
||||
|
|
@ -27,7 +28,7 @@ let
|
|||
TLSVerify = buildDef.tlsVerify;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = optionals buildDef.autoStart [
|
||||
WantedBy = lib.optionals buildDef.autoStart [
|
||||
"default.target"
|
||||
"multi-user.target"
|
||||
];
|
||||
|
|
@ -93,7 +94,7 @@ let
|
|||
environment = mkOption {
|
||||
type = podman-lib.primitiveAttrs;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
VAR1 = "0:100";
|
||||
VAR2 = true;
|
||||
|
|
@ -106,7 +107,7 @@ let
|
|||
extraConfig = mkOption {
|
||||
type = podman-lib.extraConfigType;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
Build = {
|
||||
Arch = "aarch64";
|
||||
|
|
@ -128,7 +129,7 @@ let
|
|||
|
||||
file = mkOption {
|
||||
type = types.str;
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
`"xdg.configFile."containerfiles/my-img/Containerfile"`
|
||||
or
|
||||
`"https://github.com/.../my-img/Containerfile"`
|
||||
|
|
@ -179,11 +180,11 @@ in
|
|||
|
||||
config =
|
||||
let
|
||||
buildQuadlets = mapAttrsToList toQuadletInternal cfg.builds;
|
||||
buildQuadlets = lib.mapAttrsToList toQuadletInternal cfg.builds;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
lib.mkIf cfg.enable {
|
||||
services.podman.internal.quadletDefinitions = buildQuadlets;
|
||||
assertions = flatten (map (build: build.assertions) buildQuadlets);
|
||||
assertions = lib.flatten (map (build: build.assertions) buildQuadlets);
|
||||
|
||||
xdg.configFile."podman/images.manifest".text = podman-lib.generateManifestText buildQuadlets;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.podman;
|
||||
|
||||
podman-lib = import ./podman-lib.nix { inherit pkgs lib config; };
|
||||
|
|
@ -25,11 +24,14 @@ let
|
|||
|
||||
dependencyBySuffix =
|
||||
type: value:
|
||||
if (hasInfix ".${type}" value) then
|
||||
if (lib.hasInfix ".${type}" value) then
|
||||
let
|
||||
name = extractQuadletReference type value;
|
||||
in
|
||||
if (hasAttr name cfg.internal.builtQuadlets) then [ (cfg.internal.builtQuadlets.${name}) ] else [ ]
|
||||
if (lib.hasAttr name cfg.internal.builtQuadlets) then
|
||||
[ (cfg.internal.builtQuadlets.${name}) ]
|
||||
else
|
||||
[ ]
|
||||
else
|
||||
[ ];
|
||||
|
||||
|
|
@ -55,25 +57,29 @@ let
|
|||
builtins.concatLists (map (checkQuadletReference types) value)
|
||||
else
|
||||
let
|
||||
type = findFirst (t: hasInfix ".${t}" value) null types;
|
||||
type = lib.findFirst (t: lib.hasInfix ".${t}" value) null types;
|
||||
in
|
||||
if (type != null) then
|
||||
let
|
||||
quadletName = extractQuadletReference type value;
|
||||
quadletsOfType = filterAttrs (n: v: v.quadletData.resourceType == type) cfg.internal.builtQuadlets;
|
||||
quadletsOfType = lib.filterAttrs (
|
||||
n: v: v.quadletData.resourceType == type
|
||||
) cfg.internal.builtQuadlets;
|
||||
in
|
||||
if (hasAttr quadletName quadletsOfType) then
|
||||
if (lib.hasAttr quadletName quadletsOfType) then
|
||||
[
|
||||
(replaceStrings [ quadletName ] [ "podman-${quadletName}" ] value)
|
||||
(lib.replaceStrings [ quadletName ] [ "podman-${quadletName}" ] value)
|
||||
]
|
||||
else
|
||||
[ value ]
|
||||
else if ((hasInfix "/nix/store" value) == false && hasAttr value cfg.internal.builtQuadlets) then
|
||||
else if
|
||||
((lib.hasInfix "/nix/store" value) == false && lib.hasAttr value cfg.internal.builtQuadlets)
|
||||
then
|
||||
lib.warn ''
|
||||
A value for Podman container '${name}' might use a reference to another quadlet: ${value}.
|
||||
Append the type '.${
|
||||
cfg.internal.builtQuadlets.${value}.quadletData.resourceType
|
||||
}' to '${baseName value}' if this is intended.
|
||||
}' to '${lib.baseName value}' if this is intended.
|
||||
'' [ value ]
|
||||
else
|
||||
[ value ];
|
||||
|
|
@ -104,7 +110,7 @@ let
|
|||
Volume = checkQuadletReference [ "volume" ] containerDef.volumes;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = optionals containerDef.autoStart [
|
||||
WantedBy = lib.optionals containerDef.autoStart [
|
||||
"default.target"
|
||||
"multi-user.target"
|
||||
];
|
||||
|
|
@ -226,7 +232,7 @@ let
|
|||
environment = mkOption {
|
||||
type = podman-lib.primitiveAttrs;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
VAR1 = "0:100";
|
||||
VAR2 = true;
|
||||
|
|
@ -268,7 +274,7 @@ let
|
|||
extraConfig = mkOption {
|
||||
type = podman-lib.extraConfigType;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
Container = {
|
||||
User = 1000;
|
||||
|
|
@ -320,8 +326,8 @@ let
|
|||
network = mkOption {
|
||||
type = with types; either str (listOf str);
|
||||
default = [ ];
|
||||
apply = value: if isString value then [ value ] else value;
|
||||
example = literalMD ''
|
||||
apply = value: if lib.isString value then [ value ] else value;
|
||||
example = lib.literalMD ''
|
||||
`"host"`
|
||||
or
|
||||
`"bridge_network_1"`
|
||||
|
|
@ -392,11 +398,11 @@ in
|
|||
|
||||
config =
|
||||
let
|
||||
containerQuadlets = mapAttrsToList toQuadletInternal cfg.containers;
|
||||
containerQuadlets = lib.mapAttrsToList toQuadletInternal cfg.containers;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
lib.mkIf cfg.enable {
|
||||
services.podman.internal.quadletDefinitions = containerQuadlets;
|
||||
assertions = flatten (map (container: container.assertions) containerQuadlets);
|
||||
assertions = lib.flatten (map (container: container.assertions) containerQuadlets);
|
||||
|
||||
# manifest file
|
||||
xdg.configFile."podman/containers.manifest".text =
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.podman;
|
||||
|
||||
podman-lib = import ./podman-lib.nix { inherit pkgs lib config; };
|
||||
|
|
@ -29,7 +30,7 @@ let
|
|||
TLSVerify = imageDef.tlsVerify;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = optionals imageDef.autoStart [
|
||||
WantedBy = lib.optionals imageDef.autoStart [
|
||||
"default.target"
|
||||
"multi-user.target"
|
||||
];
|
||||
|
|
@ -99,7 +100,7 @@ let
|
|||
extraConfig = mkOption {
|
||||
type = podman-lib.extraConfigType;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
Image = {
|
||||
ContainersConfModule = "/etc/nvd.conf";
|
||||
|
|
@ -162,10 +163,10 @@ in
|
|||
|
||||
config =
|
||||
let
|
||||
imageQuadlets = mapAttrsToList toQuadletInternal cfg.images;
|
||||
imageQuadlets = lib.mapAttrsToList toQuadletInternal cfg.images;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
lib.mkIf cfg.enable {
|
||||
services.podman.internal.quadletDefinitions = imageQuadlets;
|
||||
assertions = flatten (map (image: image.assertions) imageQuadlets);
|
||||
assertions = lib.flatten (map (image: image.assertions) imageQuadlets);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.podman;
|
||||
|
||||
|
|
@ -25,7 +22,7 @@ let
|
|||
|
||||
unpackPhase = ''
|
||||
mkdir -p $out/quadlets
|
||||
${concatStringsSep "\n" (
|
||||
${lib.concatStringsSep "\n" (
|
||||
map (
|
||||
v:
|
||||
"echo 'linking ${v.quadletData.serviceName}.${v.quadletData.resourceType}'; ln -s ${v.out}/quadlets/${v.quadletData.serviceName}.${v.quadletData.resourceType} $out/quadlets"
|
||||
|
|
@ -46,7 +43,7 @@ let
|
|||
'';
|
||||
|
||||
passthru = {
|
||||
outPath = self.out;
|
||||
outPath = lib.self.out;
|
||||
quadletData = quadlet;
|
||||
};
|
||||
};
|
||||
|
|
@ -76,9 +73,9 @@ let
|
|||
}
|
||||
];
|
||||
in
|
||||
flatten (map (name: processEntry name (getAttr name entries)) (attrNames entries));
|
||||
lib.flatten (map (name: processEntry name (lib.getAttr name entries)) (lib.attrNames entries));
|
||||
|
||||
allUnitFiles = concatMap (
|
||||
allUnitFiles = lib.concatMap (
|
||||
builtQuadlet: accumulateUnitFiles "" "${builtQuadlet.outPath}/units" builtQuadlet.quadletData
|
||||
) builtQuadlets;
|
||||
|
||||
|
|
@ -86,7 +83,7 @@ let
|
|||
# merge from multiple sources. so we link each file explicitly, which is fine for all unique files
|
||||
generateSystemdFileLinks =
|
||||
files:
|
||||
listToAttrs (
|
||||
lib.listToAttrs (
|
||||
map (unitFile: {
|
||||
name = "${config.xdg.configHome}/systemd/user/${unitFile.key}";
|
||||
value = {
|
||||
|
|
@ -99,7 +96,7 @@ in
|
|||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.file = generateSystemdFileLinks allUnitFiles;
|
||||
|
||||
# if the length of builtQuadlets is 0, then we don't need register the activation script
|
||||
|
|
@ -107,10 +104,10 @@ in
|
|||
lib.hm.dag.entryAfter [ "reloadSystemd" ] activationCleanupScript
|
||||
);
|
||||
|
||||
services.podman.internal.builtQuadlets = listToAttrs (
|
||||
services.podman.internal.builtQuadlets = lib.listToAttrs (
|
||||
map (pkg: {
|
||||
name =
|
||||
(removePrefix "podman-" pkg.passthru.quadletData.serviceName)
|
||||
(lib.removePrefix "podman-" pkg.passthru.quadletData.serviceName)
|
||||
+ "."
|
||||
+ pkg.passthru.quadletData.resourceType;
|
||||
value = pkg;
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.podman;
|
||||
|
||||
podman-lib = import ./podman-lib.nix { inherit pkgs lib config; };
|
||||
|
|
@ -44,7 +43,7 @@ let
|
|||
PATH = (
|
||||
builtins.concatStringsSep ":" [
|
||||
"${podman-lib.newuidmapPaths}"
|
||||
"${makeBinPath [
|
||||
"${lib.makeBinPath [
|
||||
pkgs.su
|
||||
pkgs.coreutils
|
||||
]}"
|
||||
|
|
@ -112,7 +111,7 @@ let
|
|||
extraConfig = mkOption {
|
||||
type = podman-lib.extraConfigType;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
Network = {
|
||||
ContainerConfModule = "/etc/nvd.conf";
|
||||
|
|
@ -179,11 +178,11 @@ in
|
|||
|
||||
config =
|
||||
let
|
||||
networkQuadlets = mapAttrsToList toQuadletInternal cfg.networks;
|
||||
networkQuadlets = lib.mapAttrsToList toQuadletInternal cfg.networks;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
lib.mkIf cfg.enable {
|
||||
services.podman.internal.quadletDefinitions = networkQuadlets;
|
||||
assertions = flatten (map (network: network.assertions) networkQuadlets);
|
||||
assertions = lib.flatten (map (network: network.assertions) networkQuadlets);
|
||||
|
||||
xdg.configFile."podman/networks.manifest".text = podman-lib.generateManifestText networkQuadlets;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,8 +4,14 @@
|
|||
config,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
inherit (lib)
|
||||
concatStringsSep
|
||||
isList
|
||||
mapAttrsToList
|
||||
types
|
||||
;
|
||||
|
||||
normalizeKeyValue =
|
||||
k: v:
|
||||
let
|
||||
|
|
@ -32,7 +38,7 @@ let
|
|||
path
|
||||
]);
|
||||
|
||||
toQuadletIni = generators.toINI {
|
||||
toQuadletIni = lib.generators.toINI {
|
||||
listsAsDuplicateKeys = true;
|
||||
mkKeyValue = normalizeKeyValue;
|
||||
};
|
||||
|
|
@ -40,7 +46,7 @@ let
|
|||
# meant for ini. favours b when two values are unmergeable
|
||||
deepMerge =
|
||||
a: b:
|
||||
foldl' (
|
||||
lib.foldl' (
|
||||
result: key:
|
||||
let
|
||||
aVal = if builtins.hasAttr key a then a.${key} else null;
|
||||
|
|
@ -53,7 +59,7 @@ let
|
|||
&& builtins.length list > 0
|
||||
&& builtins.typeOf (builtins.head list) == builtins.typeOf val;
|
||||
in
|
||||
if isAttrs aVal && isAttrs bVal then
|
||||
if lib.isAttrs aVal && lib.isAttrs bVal then
|
||||
result // { ${key} = deepMerge aVal bVal; }
|
||||
else if isList aVal && isList bVal then
|
||||
result // { ${key} = aVal ++ bVal; }
|
||||
|
|
@ -102,7 +108,7 @@ in
|
|||
buildSectionAsserts =
|
||||
section: attrs:
|
||||
if builtins.hasAttr section configRules then
|
||||
flatten (
|
||||
lib.flatten (
|
||||
mapAttrsToList (
|
||||
attrName: attrValue:
|
||||
if builtins.hasAttr attrName configRules.${section} then
|
||||
|
|
@ -126,7 +132,7 @@ in
|
|||
let
|
||||
imageTags = (extraConfig.Build or { }).ImageTag or [ ];
|
||||
containsRequiredTag = builtins.elem "homemanager/${quadletName}" imageTags;
|
||||
imageTagsStr = concatMapStringsSep ''" "'' toString imageTags;
|
||||
imageTagsStr = lib.concatMapStringsSep ''" "'' toString imageTags;
|
||||
in
|
||||
[
|
||||
{
|
||||
|
|
@ -136,10 +142,12 @@ in
|
|||
];
|
||||
# Flatten assertions from all sections in `extraConfig`.
|
||||
in
|
||||
flatten (concatLists [
|
||||
(mapAttrsToList buildSectionAsserts extraConfig)
|
||||
(checkImageTag extraConfig)
|
||||
]);
|
||||
lib.flatten (
|
||||
lib.concatLists [
|
||||
(mapAttrsToList buildSectionAsserts extraConfig)
|
||||
(checkImageTag extraConfig)
|
||||
]
|
||||
);
|
||||
|
||||
extraConfigType =
|
||||
with types;
|
||||
|
|
@ -156,9 +164,9 @@ in
|
|||
quadlets:
|
||||
let
|
||||
# create a list of all unique quadlet.resourceType in quadlets
|
||||
quadletTypes = unique (map (quadlet: quadlet.resourceType) quadlets);
|
||||
quadletTypes = lib.unique (map (quadlet: quadlet.resourceType) quadlets);
|
||||
# if quadletTypes is > 1, then all quadlets are not the same type
|
||||
allQuadletsSameType = length quadletTypes <= 1;
|
||||
allQuadletsSameType = lib.length quadletTypes <= 1;
|
||||
|
||||
# ensures the service name is formatted correctly to be easily read
|
||||
# by the activation script and matches `podman <resource> ls` output
|
||||
|
|
@ -200,8 +208,8 @@ in
|
|||
removeBlankLines =
|
||||
text:
|
||||
let
|
||||
lines = splitString "\n" text;
|
||||
nonEmptyLines = filter (line: line != "") lines;
|
||||
lines = lib.splitString "\n" text;
|
||||
nonEmptyLines = lib.filter (line: line != "") lines;
|
||||
in
|
||||
concatStringsSep "\n" nonEmptyLines;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,23 +4,20 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.podman;
|
||||
in
|
||||
{
|
||||
options.services.podman = {
|
||||
autoUpdate = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Automatically update the podman images.";
|
||||
};
|
||||
|
||||
onCalendar = mkOption {
|
||||
type = types.str;
|
||||
onCalendar = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "Sun *-*-* 00:00";
|
||||
description = ''
|
||||
The systemd `OnCalendar` expression for the update. See
|
||||
|
|
@ -30,63 +27,65 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.autoUpdate.enable {
|
||||
systemd.user.services."podman-auto-update" = {
|
||||
Unit = {
|
||||
Description = "Podman auto-update service";
|
||||
Documentation = "man:podman-auto-update(1)";
|
||||
Wants = [ "network-online.target" ];
|
||||
After = [ "network-online.target" ];
|
||||
};
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf cfg.autoUpdate.enable {
|
||||
systemd.user.services."podman-auto-update" = {
|
||||
Unit = {
|
||||
Description = "Podman auto-update service";
|
||||
Documentation = "man:podman-auto-update(1)";
|
||||
Wants = [ "network-online.target" ];
|
||||
After = [ "network-online.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Environment = "PATH=${
|
||||
builtins.concatStringsSep ":" [
|
||||
"/run/wrappers/bin"
|
||||
"/run/current-system/sw/bin"
|
||||
"${config.home.homeDirectory}/.nix-profile/bin"
|
||||
]
|
||||
}";
|
||||
ExecStart = "${cfg.package}/bin/podman auto-update";
|
||||
ExecStartPost = "${cfg.package}/bin/podman image prune -f";
|
||||
TimeoutStartSec = "300s";
|
||||
TimeoutStopSec = "10s";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers."podman-auto-update" = {
|
||||
Unit = {
|
||||
Description = "Podman auto-update timer";
|
||||
};
|
||||
|
||||
Timer = {
|
||||
OnCalendar = cfg.autoUpdate.onCalendar;
|
||||
RandomizedDelaySec = 300;
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
})
|
||||
({
|
||||
xdg.configFile."systemd/user/podman-user-wait-network-online.service.d/50-exec-search-path.conf".text =
|
||||
''
|
||||
[Service]
|
||||
ExecSearchPath=${
|
||||
makeBinPath (
|
||||
with pkgs;
|
||||
[
|
||||
bashInteractive
|
||||
systemd
|
||||
coreutils
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Environment = "PATH=${
|
||||
builtins.concatStringsSep ":" [
|
||||
"/run/wrappers/bin"
|
||||
"/run/current-system/sw/bin"
|
||||
"${config.home.homeDirectory}/.nix-profile/bin"
|
||||
]
|
||||
)
|
||||
}:/bin
|
||||
'';
|
||||
})
|
||||
]);
|
||||
}";
|
||||
ExecStart = "${cfg.package}/bin/podman auto-update";
|
||||
ExecStartPost = "${cfg.package}/bin/podman image prune -f";
|
||||
TimeoutStartSec = "300s";
|
||||
TimeoutStopSec = "10s";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers."podman-auto-update" = {
|
||||
Unit = {
|
||||
Description = "Podman auto-update timer";
|
||||
};
|
||||
|
||||
Timer = {
|
||||
OnCalendar = cfg.autoUpdate.onCalendar;
|
||||
RandomizedDelaySec = 300;
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
})
|
||||
{
|
||||
xdg.configFile."systemd/user/podman-user-wait-network-online.service.d/50-exec-search-path.conf".text =
|
||||
''
|
||||
[Service]
|
||||
ExecSearchPath=${
|
||||
lib.makeBinPath (
|
||||
with pkgs;
|
||||
[
|
||||
bashInteractive
|
||||
systemd
|
||||
coreutils
|
||||
]
|
||||
)
|
||||
}:/bin
|
||||
'';
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.podman;
|
||||
|
||||
podman-lib = import ./podman-lib.nix { inherit pkgs lib config; };
|
||||
|
|
@ -17,7 +16,7 @@ let
|
|||
let
|
||||
quadlet = podman-lib.deepMerge {
|
||||
Install = {
|
||||
WantedBy = optionals volumeDef.autoStart [
|
||||
WantedBy = lib.optionals volumeDef.autoStart [
|
||||
"default.target"
|
||||
"multi-user.target"
|
||||
];
|
||||
|
|
@ -27,7 +26,7 @@ let
|
|||
PATH = (
|
||||
builtins.concatStringsSep ":" [
|
||||
"${podman-lib.newuidmapPaths}"
|
||||
"${makeBinPath [
|
||||
"${lib.makeBinPath [
|
||||
pkgs.su
|
||||
pkgs.coreutils
|
||||
]}"
|
||||
|
|
@ -117,7 +116,7 @@ let
|
|||
extraConfig = mkOption {
|
||||
type = podman-lib.extraConfigType;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
Volume = {
|
||||
ContainerConfModule = "/etc/nvd.conf";
|
||||
|
|
@ -191,11 +190,11 @@ in
|
|||
|
||||
config =
|
||||
let
|
||||
volumeQuadlets = mapAttrsToList toQuadletInternal cfg.volumes;
|
||||
volumeQuadlets = lib.mapAttrsToList toQuadletInternal cfg.volumes;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
lib.mkIf cfg.enable {
|
||||
services.podman.internal.quadletDefinitions = volumeQuadlets;
|
||||
assertions = flatten (map (volume: volume.assertions) volumeQuadlets);
|
||||
assertions = lib.flatten (map (volume: volume.assertions) volumeQuadlets);
|
||||
|
||||
xdg.configFile."podman/volumes.manifest".text = podman-lib.generateManifestText volumeQuadlets;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,10 +5,13 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
concatLists
|
||||
mkIf
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.polybar;
|
||||
opt = options.services.polybar;
|
||||
|
|
@ -24,8 +27,8 @@ let
|
|||
# foo-0 = "a";
|
||||
# foo-1 = "b";
|
||||
# }
|
||||
if isList val then
|
||||
concatLists (imap0 (i: convertPolybarKeyVal "${key}-${toString i}") val)
|
||||
if lib.isList val then
|
||||
concatLists (lib.imap0 (i: convertPolybarKeyVal "${key}-${toString i}") val)
|
||||
# Convert {
|
||||
# foo.text = "a";
|
||||
# foo.font = 1;
|
||||
|
|
@ -33,29 +36,29 @@ let
|
|||
# foo = "a";
|
||||
# foo-font = 1;
|
||||
# }
|
||||
else if isAttrs val && !lib.isDerivation val then
|
||||
else if lib.isAttrs val && !lib.isDerivation val then
|
||||
concatLists (
|
||||
mapAttrsToList (k: convertPolybarKeyVal (if k == "text" then key else "${key}-${k}")) val
|
||||
lib.mapAttrsToList (k: convertPolybarKeyVal (if k == "text" then key else "${key}-${k}")) val
|
||||
)
|
||||
# Base case
|
||||
else
|
||||
[ (nameValuePair key val) ];
|
||||
[ (lib.nameValuePair key val) ];
|
||||
|
||||
convertPolybarSection =
|
||||
_: attrs: listToAttrs (concatLists (mapAttrsToList convertPolybarKeyVal attrs));
|
||||
_: attrs: lib.listToAttrs (concatLists (lib.mapAttrsToList convertPolybarKeyVal attrs));
|
||||
|
||||
# Converts an attrset to INI text, quoting values as expected by polybar.
|
||||
# This does no more fancy conversion.
|
||||
toPolybarIni = generators.toINI {
|
||||
toPolybarIni = lib.generators.toINI {
|
||||
mkKeyValue =
|
||||
key: value:
|
||||
let
|
||||
quoted = v: if hasPrefix " " v || hasSuffix " " v then ''"${v}"'' else v;
|
||||
quoted = v: if lib.hasPrefix " " v || lib.hasSuffix " " v then ''"${v}"'' else v;
|
||||
|
||||
value' =
|
||||
if isBool value then
|
||||
if lib.isBool value then
|
||||
(if value then "true" else "false")
|
||||
else if (isString value && key != "include-file") then
|
||||
else if (lib.isString value && key != "include-file") then
|
||||
quoted value
|
||||
else
|
||||
toString value;
|
||||
|
|
@ -73,7 +76,7 @@ let
|
|||
if isDeclarativeConfig then
|
||||
pkgs.writeText "polybar.conf" ''
|
||||
${toPolybarIni cfg.config}
|
||||
${toPolybarIni (mapAttrs convertPolybarSection cfg.settings)}
|
||||
${toPolybarIni (lib.mapAttrs convertPolybarSection cfg.settings)}
|
||||
${cfg.extraConfig}
|
||||
''
|
||||
else
|
||||
|
|
@ -83,7 +86,7 @@ in
|
|||
{
|
||||
options = {
|
||||
services.polybar = {
|
||||
enable = mkEnableOption "Polybar status bar";
|
||||
enable = lib.mkEnableOption "Polybar status bar";
|
||||
|
||||
package = lib.mkPackageOption pkgs "polybar" {
|
||||
example = ''
|
||||
|
|
@ -108,7 +111,7 @@ in
|
|||
See also {option}`services.polybar.settings` for a more nix-friendly format.
|
||||
'';
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
"bar/top" = {
|
||||
monitor = "\''${env:MONITOR:eDP1}";
|
||||
|
|
@ -177,7 +180,7 @@ in
|
|||
```
|
||||
'';
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
"module/volume" = {
|
||||
type = "internal/pulseaudio";
|
||||
|
|
@ -225,7 +228,7 @@ in
|
|||
(lib.hm.assertions.assertPlatform "services.polybar" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
meta.maintainers = with maintainers; [ h7x4 ];
|
||||
meta.maintainers = with lib.maintainers; [ h7x4 ];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
xdg.configFile."polybar/config.ini" = mkIf (configFile != null) { source = configFile; };
|
||||
|
|
|
|||
|
|
@ -4,35 +4,34 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) types;
|
||||
inherit (lib.strings) toJSON;
|
||||
|
||||
cfg = config.services.poweralertd;
|
||||
escapeSystemdExecArg =
|
||||
arg:
|
||||
let
|
||||
s =
|
||||
if isPath arg then
|
||||
if lib.isPath arg then
|
||||
"${arg}"
|
||||
else if isString arg then
|
||||
else if lib.isString arg then
|
||||
arg
|
||||
else if isInt arg || isFloat arg || isDerivation arg then
|
||||
else if lib.isInt arg || lib.isFloat arg || lib.isDerivation arg then
|
||||
toString arg
|
||||
else
|
||||
throw "escapeSystemdExecArg only allows strings, paths, numbers and derivations";
|
||||
in
|
||||
replaceStrings [ "%" "$" ] [ "%%" "$$" ] (toJSON s);
|
||||
escapeSystemdExecArgs = concatMapStringsSep " " escapeSystemdExecArg;
|
||||
lib.replaceStrings [ "%" "$" ] [ "%%" "$$" ] (toJSON s);
|
||||
escapeSystemdExecArgs = lib.concatMapStringsSep " " escapeSystemdExecArg;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.thibautmarty ];
|
||||
meta.maintainers = [ lib.maintainers.thibautmarty ];
|
||||
|
||||
options.services.poweralertd = {
|
||||
enable = mkEnableOption "the Upower-powered power alertd";
|
||||
enable = lib.mkEnableOption "the Upower-powered power alertd";
|
||||
|
||||
extraArgs = mkOption {
|
||||
extraArgs = lib.mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [ ];
|
||||
example = [
|
||||
|
|
@ -45,7 +44,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.poweralertd" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.pueue;
|
||||
|
|
@ -15,17 +12,17 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.AndersonTorres ];
|
||||
meta.maintainers = [ lib.maintainers.AndersonTorres ];
|
||||
|
||||
options.services.pueue = {
|
||||
enable = mkEnableOption "Pueue, CLI process scheduler and manager";
|
||||
enable = lib.mkEnableOption "Pueue, CLI process scheduler and manager";
|
||||
|
||||
package = mkPackageOption pkgs "pueue" { nullable = true; };
|
||||
package = lib.mkPackageOption pkgs "pueue" { nullable = true; };
|
||||
|
||||
settings = mkOption {
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
daemon = {
|
||||
default_parallel_tasks = 2;
|
||||
|
|
@ -39,8 +36,10 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [ (hm.assertions.assertPlatform "services.pueue" pkgs platforms.linux) ];
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.pueue" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
|
|
|
|||
|
|
@ -4,21 +4,18 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.pulseeffects;
|
||||
|
||||
presetOpts = optionalString (cfg.preset != "") "--load-preset ${cfg.preset}";
|
||||
presetOpts = lib.optionalString (cfg.preset != "") "--load-preset ${cfg.preset}";
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.jonringer ];
|
||||
meta.maintainers = [ lib.hm.maintainers.jonringer ];
|
||||
|
||||
options.services.pulseeffects = {
|
||||
enable = mkEnableOption ''
|
||||
enable = lib.mkEnableOption ''
|
||||
Pulseeffects daemon
|
||||
Note, it is necessary to add
|
||||
```nix
|
||||
|
|
@ -26,15 +23,15 @@ in
|
|||
```
|
||||
to your system configuration for the daemon to work correctly'';
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.pulseeffects-legacy;
|
||||
defaultText = literalExpression "pkgs.pulseeffects-legacy";
|
||||
defaultText = lib.literalExpression "pkgs.pulseeffects-legacy";
|
||||
description = "Pulseeffects package to use.";
|
||||
};
|
||||
|
||||
preset = mkOption {
|
||||
type = types.str;
|
||||
preset = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
description = ''
|
||||
Which preset to use when starting pulseeffects.
|
||||
|
|
@ -43,7 +40,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.pulseeffects" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.random-background;
|
||||
|
||||
|
|
@ -22,11 +21,11 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
meta.maintainers = [ lib.maintainers.rycee ];
|
||||
|
||||
options = {
|
||||
services.random-background = {
|
||||
enable = mkEnableOption "" // {
|
||||
enable = lib.mkEnableOption "" // {
|
||||
description = ''
|
||||
Whether to enable random desktop background.
|
||||
|
||||
|
|
@ -83,44 +82,46 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge ([
|
||||
{
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.random-background" pkgs platforms.linux)
|
||||
];
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.random-background" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.random-background = {
|
||||
Unit = {
|
||||
Description = "Set random desktop background using feh";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
systemd.user.services.random-background = {
|
||||
Unit = {
|
||||
Description = "Set random desktop background using feh";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.feh}/bin/feh ${flags} ${cfg.imageDirectory}";
|
||||
IOSchedulingClass = "idle";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.feh}/bin/feh ${flags} ${cfg.imageDirectory}";
|
||||
IOSchedulingClass = "idle";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
(mkIf (cfg.interval != null) {
|
||||
systemd.user.timers.random-background = {
|
||||
Unit = {
|
||||
Description = "Set random desktop background using feh";
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
(lib.mkIf (cfg.interval != null) {
|
||||
systemd.user.timers.random-background = {
|
||||
Unit = {
|
||||
Description = "Set random desktop background using feh";
|
||||
};
|
||||
|
||||
Timer = {
|
||||
OnUnitActiveSec = cfg.interval;
|
||||
};
|
||||
Timer = {
|
||||
OnUnitActiveSec = cfg.interval;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
]));
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,16 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
# TODO: Fix the formatting of the resulting config.
|
||||
let
|
||||
inherit (lib)
|
||||
generators
|
||||
isAttrs
|
||||
literalExpression
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.recoll;
|
||||
|
||||
# The key-value generator for Recoll config format. For future references,
|
||||
|
|
@ -18,15 +24,15 @@ let
|
|||
mkRecollConfKeyValue = generators.mkKeyValueDefault {
|
||||
mkValueString =
|
||||
let
|
||||
mkQuoted = v: ''"${escape [ ''"'' ] v}"'';
|
||||
mkQuoted = v: ''"${lib.escape [ ''"'' ] v}"'';
|
||||
in
|
||||
v:
|
||||
if v == true then
|
||||
"1"
|
||||
else if v == false then
|
||||
"0"
|
||||
else if isList v then
|
||||
concatMapStringsSep " " mkQuoted v
|
||||
else if lib.isList v then
|
||||
lib.concatMapStringsSep " " mkQuoted v
|
||||
else
|
||||
generators.mkValueStringDefault { } v;
|
||||
} " = ";
|
||||
|
|
@ -43,7 +49,7 @@ let
|
|||
inherit listsAsDuplicateKeys;
|
||||
mkKeyValue = mkRecollConfKeyValue;
|
||||
};
|
||||
mkSectionName = name: strings.escape [ "[" "]" ] name;
|
||||
mkSectionName = name: lib.strings.escape [ "[" "]" ] name;
|
||||
convert =
|
||||
k: v:
|
||||
if isAttrs v then
|
||||
|
|
@ -58,11 +64,11 @@ let
|
|||
# There's a possibility of attributes with attrsets overriding other
|
||||
# top-level attributes with non-attrsets so we're forcing the attrsets to
|
||||
# come last.
|
||||
_config = mapAttrsToList convert (filterAttrs (k: v: !isAttrs v) attr);
|
||||
_config' = mapAttrsToList convert (filterAttrs (k: v: isAttrs v) attr);
|
||||
_config = lib.mapAttrsToList convert (lib.filterAttrs (k: v: !isAttrs v) attr);
|
||||
_config' = lib.mapAttrsToList convert (lib.filterAttrs (k: v: isAttrs v) attr);
|
||||
config = _config ++ _config';
|
||||
in
|
||||
concatStringsSep "\n" config;
|
||||
lib.concatStringsSep "\n" config;
|
||||
|
||||
# A specific type for Recoll config format. Taken from `pkgs.formats`
|
||||
# implementation from nixpkgs. See the 'Nix-representable formats' from the
|
||||
|
|
@ -97,10 +103,10 @@ let
|
|||
settingsFormat = recollConfFormat { };
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.foo-dogsquared ];
|
||||
meta.maintainers = [ lib.maintainers.foo-dogsquared ];
|
||||
|
||||
options.services.recoll = {
|
||||
enable = mkEnableOption "Recoll file index service";
|
||||
enable = lib.mkEnableOption "Recoll file index service";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
@ -159,7 +165,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.recoll" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -185,7 +191,7 @@ in
|
|||
|
||||
Service = {
|
||||
ExecStart = "${cfg.package}/bin/recollindex";
|
||||
Environment = [ "RECOLL_CONFDIR=${escapeShellArg cfg.configDir}" ];
|
||||
Environment = [ "RECOLL_CONFDIR=${lib.escapeShellArg cfg.configDir}" ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
commonOptions = import ./lib/options.nix {
|
||||
inherit config lib pkgs;
|
||||
|
|
@ -27,5 +24,5 @@ in
|
|||
{
|
||||
inherit (commonOptions) imports meta;
|
||||
options.services.gammastep = commonOptions.options;
|
||||
config = mkIf config.services.gammastep.enable commonOptions.config;
|
||||
config = lib.mkIf config.services.gammastep.enable commonOptions.config;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,17 +12,15 @@
|
|||
xdgConfigFilePath,
|
||||
serviceDocumentation,
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption mkIf types;
|
||||
|
||||
cfg = config.services.${moduleName};
|
||||
settingsFormat = pkgs.formats.ini { };
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = with maintainers; [
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
rycee
|
||||
thiagokokada
|
||||
];
|
||||
|
|
@ -31,7 +29,7 @@ in
|
|||
let
|
||||
mkRenamed =
|
||||
old: new:
|
||||
mkRenamedOptionModule
|
||||
lib.mkRenamedOptionModule
|
||||
(
|
||||
[
|
||||
"services"
|
||||
|
|
@ -48,7 +46,7 @@ in
|
|||
];
|
||||
in
|
||||
[
|
||||
(mkRemovedOptionModule [ "services" moduleName "extraOptions" ]
|
||||
(lib.mkRemovedOptionModule [ "services" moduleName "extraOptions" ]
|
||||
"All ${programName} configuration is now available through services.${moduleName}.settings instead."
|
||||
)
|
||||
(mkRenamed [ "brightness" "day" ] "brightness-day")
|
||||
|
|
@ -56,7 +54,7 @@ in
|
|||
];
|
||||
|
||||
options = {
|
||||
enable = mkEnableOption programName;
|
||||
enable = lib.mkEnableOption programName;
|
||||
|
||||
dawnTime = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
|
|
@ -134,13 +132,13 @@ in
|
|||
package = mkOption {
|
||||
type = types.package;
|
||||
default = defaultPackage;
|
||||
defaultText = literalExpression examplePackage;
|
||||
defaultText = lib.literalExpression examplePackage;
|
||||
description = ''
|
||||
${programName} derivation to use.
|
||||
'';
|
||||
};
|
||||
|
||||
enableVerboseLogging = mkEnableOption "verbose service logging";
|
||||
enableVerboseLogging = lib.mkEnableOption "verbose service logging";
|
||||
|
||||
tray = mkOption {
|
||||
type = types.bool;
|
||||
|
|
@ -154,7 +152,7 @@ in
|
|||
settings = mkOption {
|
||||
type = types.submodule { freeformType = settingsFormat.type; };
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
${mainSection} = {
|
||||
adjustment-method = "randr";
|
||||
|
|
@ -174,7 +172,7 @@ in
|
|||
|
||||
config = {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.${moduleName}" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.${moduleName}" pkgs lib.platforms.linux)
|
||||
|
||||
{
|
||||
assertion =
|
||||
|
|
@ -238,7 +236,7 @@ in
|
|||
configFullPath = config.xdg.configHome + "/${xdgConfigFilePath}";
|
||||
in
|
||||
"${cfg.package}/bin/${command} "
|
||||
+ cli.toGNUCommandLineShell { } {
|
||||
+ lib.cli.toGNUCommandLineShell { } {
|
||||
v = cfg.enableVerboseLogging;
|
||||
c = configFullPath;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
commonOptions = import ./lib/options.nix {
|
||||
inherit config lib pkgs;
|
||||
|
|
@ -26,5 +23,5 @@ in
|
|||
{
|
||||
inherit (commonOptions) imports meta;
|
||||
options.services.redshift = commonOptions.options;
|
||||
config = mkIf config.services.redshift.enable commonOptions.config;
|
||||
config = lib.mkIf config.services.redshift.enable commonOptions.config;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.rsibreak;
|
||||
|
|
@ -15,11 +13,11 @@ in
|
|||
{
|
||||
options.services.rsibreak = {
|
||||
|
||||
enable = mkEnableOption "rsibreak";
|
||||
enable = lib.mkEnableOption "rsibreak";
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.rsibreak" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -5,27 +5,25 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.safeeyes;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.rosuavio ];
|
||||
meta.maintainers = [ lib.hm.maintainers.rosuavio ];
|
||||
|
||||
options = {
|
||||
services.safeeyes = {
|
||||
enable = mkEnableOption "The Safe Eyes OSGI service";
|
||||
enable = lib.mkEnableOption "The Safe Eyes OSGI service";
|
||||
|
||||
package = mkPackageOption pkgs "safeeyes" { };
|
||||
package = lib.mkPackageOption pkgs "safeeyes" { };
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.safeeyes" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.safeeyes" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
|
@ -41,7 +39,7 @@ in
|
|||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = getExe pkgs.safeeyes;
|
||||
ExecStart = lib.getExe pkgs.safeeyes;
|
||||
Restart = "on-failure";
|
||||
RestartSec = 3;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,17 +5,21 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
mkRenamedOptionModule
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.screen-locker;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [
|
||||
hm.maintainers.jrobsonchase
|
||||
hm.maintainers.rszamszur
|
||||
lib.hm.maintainers.jrobsonchase
|
||||
lib.hm.maintainers.rszamszur
|
||||
];
|
||||
|
||||
imports =
|
||||
|
|
@ -45,7 +49,7 @@ in
|
|||
];
|
||||
|
||||
options.services.screen-locker = {
|
||||
enable = mkEnableOption "screen locker for X session";
|
||||
enable = lib.mkEnableOption "screen locker for X session";
|
||||
|
||||
lockCmd = mkOption {
|
||||
type = types.str;
|
||||
|
|
@ -136,67 +140,69 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.screen-locker" pkgs lib.platforms.linux)
|
||||
];
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.screen-locker" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.xss-lock = {
|
||||
Unit = {
|
||||
Description = "xss-lock, session locker service";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
systemd.user.services.xss-lock = {
|
||||
Unit = {
|
||||
Description = "xss-lock, session locker service";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = concatStringsSep " " (
|
||||
[
|
||||
"${cfg.xss-lock.package}/bin/xss-lock"
|
||||
"-s \${XDG_SESSION_ID}"
|
||||
]
|
||||
++ cfg.xss-lock.extraOptions
|
||||
++ [ "-- ${cfg.lockCmd}" ]
|
||||
);
|
||||
Environment = cfg.lockCmdEnv;
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
}
|
||||
(mkIf (!cfg.xautolock.enable) {
|
||||
systemd.user.services.xss-lock.Service.ExecStartPre = "${pkgs.xorg.xset}/bin/xset s ${
|
||||
toString (cfg.inactiveInterval * 60)
|
||||
} ${toString cfg.xss-lock.screensaverCycle}";
|
||||
})
|
||||
(mkIf cfg.xautolock.enable {
|
||||
systemd.user.services.xautolock-session = {
|
||||
Unit = {
|
||||
Description = "xautolock, session locker service";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
Service = {
|
||||
ExecStart = lib.concatStringsSep " " (
|
||||
[
|
||||
"${cfg.xss-lock.package}/bin/xss-lock"
|
||||
"-s \${XDG_SESSION_ID}"
|
||||
]
|
||||
++ cfg.xss-lock.extraOptions
|
||||
++ [ "-- ${cfg.lockCmd}" ]
|
||||
);
|
||||
Environment = cfg.lockCmdEnv;
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
}
|
||||
(mkIf (!cfg.xautolock.enable) {
|
||||
systemd.user.services.xss-lock.Service.ExecStartPre = "${pkgs.xorg.xset}/bin/xset s ${
|
||||
toString (cfg.inactiveInterval * 60)
|
||||
} ${toString cfg.xss-lock.screensaverCycle}";
|
||||
})
|
||||
(mkIf cfg.xautolock.enable {
|
||||
systemd.user.services.xautolock-session = {
|
||||
Unit = {
|
||||
Description = "xautolock, session locker service";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = concatStringsSep " " (
|
||||
[
|
||||
"${cfg.xautolock.package}/bin/xautolock"
|
||||
"-time ${toString cfg.inactiveInterval}"
|
||||
"-locker '${pkgs.systemd}/bin/loginctl lock-session \${XDG_SESSION_ID}'"
|
||||
]
|
||||
++ optional cfg.xautolock.detectSleep "-detectsleep"
|
||||
++ cfg.xautolock.extraOptions
|
||||
);
|
||||
Restart = "always";
|
||||
Service = {
|
||||
ExecStart = lib.concatStringsSep " " (
|
||||
[
|
||||
"${cfg.xautolock.package}/bin/xautolock"
|
||||
"-time ${toString cfg.inactiveInterval}"
|
||||
"-locker '${pkgs.systemd}/bin/loginctl lock-session \${XDG_SESSION_ID}'"
|
||||
]
|
||||
++ lib.optional cfg.xautolock.detectSleep "-detectsleep"
|
||||
++ cfg.xautolock.extraOptions
|
||||
);
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,17 +5,15 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
meta.maintainers = [ maintainers.somasis ];
|
||||
meta.maintainers = [ lib.maintainers.somasis ];
|
||||
|
||||
options = {
|
||||
services.sctd = {
|
||||
enable = mkEnableOption "sctd";
|
||||
enable = lib.mkEnableOption "sctd";
|
||||
|
||||
baseTemperature = mkOption {
|
||||
type = types.ints.between 2500 9000;
|
||||
baseTemperature = lib.mkOption {
|
||||
type = lib.types.ints.between 2500 9000;
|
||||
default = 4500;
|
||||
description = ''
|
||||
The base color temperature used by sctd, which should be between 2500 and 9000.
|
||||
|
|
@ -27,8 +25,8 @@ with lib;
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf config.services.sctd.enable {
|
||||
assertions = [ (hm.assertions.assertPlatform "services.sctd" pkgs platforms.linux) ];
|
||||
config = lib.mkIf config.services.sctd.enable {
|
||||
assertions = [ (lib.hm.assertions.assertPlatform "services.sctd" pkgs lib.platforms.linux) ];
|
||||
|
||||
systemd.user.services.sctd = {
|
||||
Unit = {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
}:
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.signaturepdf;
|
||||
extraConfigToArgs =
|
||||
extraConfig:
|
||||
|
|
@ -19,8 +21,8 @@ in
|
|||
{
|
||||
meta.maintainers = [ lib.maintainers.DamienCassou ];
|
||||
|
||||
options.services.signaturepdf = with lib; {
|
||||
enable = mkEnableOption "signaturepdf; signing, organizing, editing metadatas or compressing PDFs";
|
||||
options.services.signaturepdf = {
|
||||
enable = lib.mkEnableOption "signaturepdf; signing, organizing, editing metadatas or compressing PDFs";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
|||
|
|
@ -5,22 +5,20 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.snixembed;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.DamienCassou ];
|
||||
meta.maintainers = [ lib.maintainers.DamienCassou ];
|
||||
|
||||
options = {
|
||||
services.snixembed = {
|
||||
enable = mkEnableOption "snixembed: proxy StatusNotifierItems as XEmbedded systemtray-spec icons";
|
||||
enable = lib.mkEnableOption "snixembed: proxy StatusNotifierItems as XEmbedded systemtray-spec icons";
|
||||
|
||||
package = mkPackageOption pkgs "snixembed" { };
|
||||
package = lib.mkPackageOption pkgs "snixembed" { };
|
||||
|
||||
beforeUnits = mkOption {
|
||||
type = with types; listOf str;
|
||||
beforeUnits = lib.mkOption {
|
||||
type = with lib.types; listOf str;
|
||||
default = [ ];
|
||||
example = [ "safeeyes.service" ];
|
||||
description = ''
|
||||
|
|
@ -30,9 +28,9 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.snixembed" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.snixembed" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.snixembed = {
|
||||
|
|
@ -47,7 +45,7 @@ in
|
|||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = getExe pkgs.snixembed;
|
||||
ExecStart = lib.getExe pkgs.snixembed;
|
||||
Restart = "on-failure";
|
||||
RestartSec = 3;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) literalExpression;
|
||||
|
||||
cfg = config.services.spotifyd;
|
||||
|
||||
|
|
@ -18,10 +17,10 @@ let
|
|||
in
|
||||
{
|
||||
options.services.spotifyd = {
|
||||
enable = mkEnableOption "SpotifyD connect";
|
||||
enable = lib.mkEnableOption "SpotifyD connect";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.spotifyd;
|
||||
defaultText = literalExpression "pkgs.spotifyd";
|
||||
example = literalExpression "(pkgs.spotifyd.override { withKeyring = true; })";
|
||||
|
|
@ -31,7 +30,7 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
description = "Configuration for spotifyd";
|
||||
|
|
@ -47,7 +46,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.spotifyd" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
config,
|
||||
options,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
|
|
|
|||
|
|
@ -5,9 +5,13 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
mkOption
|
||||
types
|
||||
literalExpression
|
||||
;
|
||||
|
||||
cfg = config.services.stalonetray;
|
||||
|
||||
|
|
@ -15,7 +19,7 @@ in
|
|||
{
|
||||
options = {
|
||||
services.stalonetray = {
|
||||
enable = mkEnableOption "Stalonetray system tray";
|
||||
enable = lib.mkEnableOption "Stalonetray system tray";
|
||||
|
||||
package = mkOption {
|
||||
default = pkgs.stalonetray;
|
||||
|
|
@ -55,52 +59,54 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.stalonetray" pkgs platforms.linux)
|
||||
];
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.stalonetray" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
systemd.user.services.stalonetray = {
|
||||
Unit = {
|
||||
Description = "Stalonetray system tray";
|
||||
PartOf = [ "tray.target" ];
|
||||
systemd.user.services.stalonetray = {
|
||||
Unit = {
|
||||
Description = "Stalonetray system tray";
|
||||
PartOf = [ "tray.target" ];
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "tray.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = "${cfg.package}/bin/stalonetray";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "tray.target" ];
|
||||
};
|
||||
(mkIf (cfg.config != { }) {
|
||||
xdg.configFile."stalonetrayrc".text =
|
||||
let
|
||||
valueToString =
|
||||
v:
|
||||
if lib.isBool v then
|
||||
(if v then "true" else "false")
|
||||
else if (v == null) then
|
||||
"none"
|
||||
else
|
||||
''"${toString v}"'';
|
||||
in
|
||||
lib.concatStrings (
|
||||
lib.mapAttrsToList (k: v: ''
|
||||
${k} ${valueToString v}
|
||||
'') cfg.config
|
||||
);
|
||||
})
|
||||
|
||||
Service = {
|
||||
ExecStart = "${cfg.package}/bin/stalonetray";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf (cfg.config != { }) {
|
||||
xdg.configFile."stalonetrayrc".text =
|
||||
let
|
||||
valueToString =
|
||||
v:
|
||||
if isBool v then
|
||||
(if v then "true" else "false")
|
||||
else if (v == null) then
|
||||
"none"
|
||||
else
|
||||
''"${toString v}"'';
|
||||
in
|
||||
concatStrings (
|
||||
mapAttrsToList (k: v: ''
|
||||
${k} ${valueToString v}
|
||||
'') cfg.config
|
||||
);
|
||||
})
|
||||
|
||||
(mkIf (cfg.extraConfig != "") {
|
||||
xdg.configFile."stalonetrayrc".text = cfg.extraConfig;
|
||||
})
|
||||
]);
|
||||
(mkIf (cfg.extraConfig != "") {
|
||||
xdg.configFile."stalonetrayrc".text = cfg.extraConfig;
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,31 +5,27 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.status-notifier-watcher;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.pltanton ];
|
||||
meta.maintainers = [ lib.hm.maintainers.pltanton ];
|
||||
|
||||
options = {
|
||||
services.status-notifier-watcher = {
|
||||
enable = mkEnableOption "Status Notifier Watcher";
|
||||
enable = lib.mkEnableOption "Status Notifier Watcher";
|
||||
|
||||
package = mkOption {
|
||||
package = lib.mkOption {
|
||||
default = pkgs.haskellPackages.status-notifier-item;
|
||||
defaultText = literalExpression "pkgs.haskellPackages.status-notifier-item";
|
||||
type = types.package;
|
||||
example = literalExpression "pkgs.haskellPackages.status-notifier-item";
|
||||
defaultText = lib.literalExpression "pkgs.haskellPackages.status-notifier-item";
|
||||
type = lib.types.package;
|
||||
example = lib.literalExpression "pkgs.haskellPackages.status-notifier-item";
|
||||
description = "The package to use for the status notifier watcher binary.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.status-notifier-watcher" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -5,15 +5,18 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
literalExpression
|
||||
;
|
||||
|
||||
cfg = config.services.swayidle;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.c0deaddict ];
|
||||
meta.maintainers = [ lib.maintainers.c0deaddict ];
|
||||
|
||||
options.services.swayidle =
|
||||
let
|
||||
|
|
@ -64,7 +67,7 @@ in
|
|||
|
||||
in
|
||||
{
|
||||
enable = mkEnableOption "idle manager for Wayland";
|
||||
enable = lib.mkEnableOption "idle manager for Wayland";
|
||||
|
||||
package = lib.mkPackageOption pkgs "swayidle" { };
|
||||
|
||||
|
|
@ -110,9 +113,9 @@ in
|
|||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.swayidle" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.swayidle" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.swayidle = {
|
||||
|
|
@ -128,7 +131,7 @@ in
|
|||
Type = "simple";
|
||||
Restart = "always";
|
||||
# swayidle executes commands using "sh -c", so the PATH needs to contain a shell.
|
||||
Environment = [ "PATH=${makeBinPath [ pkgs.bash ]}" ];
|
||||
Environment = [ "PATH=${lib.makeBinPath [ pkgs.bash ]}" ];
|
||||
ExecStart =
|
||||
let
|
||||
mkTimeout =
|
||||
|
|
@ -138,7 +141,7 @@ in
|
|||
(toString t.timeout)
|
||||
t.command
|
||||
]
|
||||
++ optionals (t.resumeCommand != null) [
|
||||
++ lib.optionals (t.resumeCommand != null) [
|
||||
"resume"
|
||||
t.resumeCommand
|
||||
];
|
||||
|
|
@ -148,9 +151,10 @@ in
|
|||
e.command
|
||||
];
|
||||
|
||||
args = cfg.extraArgs ++ (concatMap mkTimeout cfg.timeouts) ++ (concatMap mkEvent cfg.events);
|
||||
args =
|
||||
cfg.extraArgs ++ (lib.concatMap mkTimeout cfg.timeouts) ++ (lib.concatMap mkEvent cfg.events);
|
||||
in
|
||||
"${getExe cfg.package} ${escapeShellArgs args}";
|
||||
"${lib.getExe cfg.package} ${lib.escapeShellArgs args}";
|
||||
};
|
||||
|
||||
Install = {
|
||||
|
|
|
|||
|
|
@ -5,22 +5,25 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
optionalString
|
||||
;
|
||||
|
||||
cfg = config.services.swayosd;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.pltanton ];
|
||||
meta.maintainers = [ lib.hm.maintainers.pltanton ];
|
||||
|
||||
options.services.swayosd = {
|
||||
enable = mkEnableOption ''
|
||||
enable = lib.mkEnableOption ''
|
||||
swayosd, a GTK based on screen display for keyboard shortcuts like
|
||||
caps-lock and volume'';
|
||||
|
||||
package = mkPackageOption pkgs "swayosd" { };
|
||||
package = lib.mkPackageOption pkgs "swayosd" { };
|
||||
|
||||
topMargin = mkOption {
|
||||
type = types.nullOr (
|
||||
|
|
@ -53,9 +56,9 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.swayosd" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.swayosd" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
|
@ -77,7 +80,7 @@ in
|
|||
ExecStart =
|
||||
"${cfg.package}/bin/swayosd-server"
|
||||
+ (optionalString (cfg.display != null) " --display ${cfg.display}")
|
||||
+ (optionalString (cfg.stylePath != null) " --style ${escapeShellArg cfg.stylePath}")
|
||||
+ (optionalString (cfg.stylePath != null) " --style ${lib.escapeShellArg cfg.stylePath}")
|
||||
+ (optionalString (cfg.topMargin != null) " --top-margin ${toString cfg.topMargin}");
|
||||
Restart = "always";
|
||||
RestartSec = "2s";
|
||||
|
|
|
|||
|
|
@ -5,16 +5,19 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
literalExpression
|
||||
;
|
||||
|
||||
cfg = config.services.sxhkd;
|
||||
|
||||
keybindingsStr = concatStringsSep "\n" (
|
||||
mapAttrsToList (
|
||||
keybindingsStr = lib.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (
|
||||
hotkey: command:
|
||||
optionalString (command != null) ''
|
||||
lib.optionalString (command != null) ''
|
||||
${hotkey}
|
||||
${command}
|
||||
''
|
||||
|
|
@ -24,7 +27,7 @@ let
|
|||
in
|
||||
{
|
||||
imports = [
|
||||
(mkRemovedOptionModule [
|
||||
(lib.mkRemovedOptionModule [
|
||||
"services"
|
||||
"sxhkd"
|
||||
"extraPath"
|
||||
|
|
@ -32,7 +35,7 @@ in
|
|||
];
|
||||
|
||||
options.services.sxhkd = {
|
||||
enable = mkEnableOption "simple X hotkey daemon";
|
||||
enable = lib.mkEnableOption "simple X hotkey daemon";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
@ -79,14 +82,14 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.sxhkd" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."sxhkd/sxhkdrc".text = concatStringsSep "\n" [
|
||||
xdg.configFile."sxhkd/sxhkdrc".text = lib.concatStringsSep "\n" [
|
||||
keybindingsStr
|
||||
cfg.extraConfig
|
||||
];
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ let
|
|||
inherit (lib)
|
||||
literalExpression
|
||||
mkOption
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
types
|
||||
;
|
||||
|
||||
|
|
@ -226,7 +224,7 @@ in
|
|||
|
||||
options = {
|
||||
services.syncthing = {
|
||||
enable = mkEnableOption ''
|
||||
enable = lib.mkEnableOption ''
|
||||
Syncthing, a self-hosted open-source alternative to Dropbox and Bittorrent Sync.
|
||||
'';
|
||||
|
||||
|
|
@ -408,7 +406,7 @@ in
|
|||
will be reverted on restart if [overrideFolders](#opt-services.syncthing.overrideFolders)
|
||||
is enabled.
|
||||
'';
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
"/home/user/sync" = {
|
||||
id = "syncme";
|
||||
|
|
@ -492,7 +490,7 @@ in
|
|||
There are 4 different types of versioning with different parameters.
|
||||
See <https://docs.syncthing.net/users/versioning.html>.
|
||||
'';
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
[
|
||||
{
|
||||
versioning = {
|
||||
|
|
@ -631,7 +629,7 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
package = mkPackageOption pkgs "syncthing" { };
|
||||
package = lib.mkPackageOption pkgs "syncthing" { };
|
||||
|
||||
tray = mkOption {
|
||||
type =
|
||||
|
|
|
|||
|
|
@ -5,20 +5,18 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
meta.maintainers = [ maintainers.asymmetric ];
|
||||
meta.maintainers = [ lib.maintainers.asymmetric ];
|
||||
|
||||
options = {
|
||||
services.systembus-notify = {
|
||||
enable = mkEnableOption "systembus-notify - system bus notification daemon";
|
||||
enable = lib.mkEnableOption "systembus-notify - system bus notification daemon";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.services.systembus-notify.enable {
|
||||
config = lib.mkIf config.services.systembus-notify.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.systembus-notify" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.systembus-notify" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.systembus-notify = {
|
||||
|
|
|
|||
|
|
@ -5,33 +5,31 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.taffybar;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
meta.maintainers = [ lib.maintainers.rycee ];
|
||||
|
||||
options = {
|
||||
services.taffybar = {
|
||||
enable = mkEnableOption "Taffybar";
|
||||
enable = lib.mkEnableOption "Taffybar";
|
||||
|
||||
package = mkOption {
|
||||
package = lib.mkOption {
|
||||
default = pkgs.taffybar;
|
||||
defaultText = literalExpression "pkgs.taffybar";
|
||||
type = types.package;
|
||||
example = literalExpression "pkgs.taffybar";
|
||||
defaultText = lib.literalExpression "pkgs.taffybar";
|
||||
type = lib.types.package;
|
||||
example = lib.literalExpression "pkgs.taffybar";
|
||||
description = "The package to use for the Taffybar binary.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.services.taffybar.enable {
|
||||
config = lib.mkIf config.services.taffybar.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.taffybar" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.taffybar" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.taffybar = {
|
||||
|
|
|
|||
|
|
@ -5,20 +5,18 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
meta.maintainers = [ lib.maintainers.rycee ];
|
||||
|
||||
options = {
|
||||
services.tahoe-lafs = {
|
||||
enable = mkEnableOption "Tahoe-LAFS";
|
||||
enable = lib.mkEnableOption "Tahoe-LAFS";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.services.tahoe-lafs.enable {
|
||||
config = lib.mkIf config.services.tahoe-lafs.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.tahoe-lafs" pkgs platforms.linux)
|
||||
(lib.hm.assertions.assertPlatform "services.tahoe-lafs" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.tahoe-lafs = {
|
||||
|
|
|
|||
|
|
@ -5,26 +5,24 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.taskwarrior-sync;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = with maintainers; [
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
euxane
|
||||
minijackson
|
||||
];
|
||||
|
||||
options.services.taskwarrior-sync = {
|
||||
enable = mkEnableOption "Taskwarrior periodic sync";
|
||||
enable = lib.mkEnableOption "Taskwarrior periodic sync";
|
||||
|
||||
package = mkPackageOption pkgs "taskwarrior" { example = "pkgs.taskwarrior3"; };
|
||||
package = lib.mkPackageOption pkgs "taskwarrior" { example = "pkgs.taskwarrior3"; };
|
||||
|
||||
frequency = mkOption {
|
||||
type = types.str;
|
||||
frequency = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "*:0/5";
|
||||
description = ''
|
||||
How often to run `taskwarrior sync`. This
|
||||
|
|
@ -36,7 +34,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.taskwarrior-sync" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) types;
|
||||
|
||||
boolTrue = {
|
||||
type = types.bool;
|
||||
|
|
@ -115,35 +114,35 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.mager ];
|
||||
meta.maintainers = [ lib.hm.maintainers.mager ];
|
||||
|
||||
options = {
|
||||
services.trayer = {
|
||||
enable = mkEnableOption "trayer, the lightweight GTK2+ systray for UNIX desktops";
|
||||
enable = lib.mkEnableOption "trayer, the lightweight GTK2+ systray for UNIX desktops";
|
||||
|
||||
package = mkOption {
|
||||
package = lib.mkOption {
|
||||
default = pkgs.trayer;
|
||||
defaultText = literalExpression "pkgs.trayer";
|
||||
defaultText = lib.literalExpression "pkgs.trayer";
|
||||
type = types.package;
|
||||
example = literalExpression "pkgs.trayer";
|
||||
example = lib.literalExpression "pkgs.trayer";
|
||||
description = "The package to use for the trayer binary.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
settings = lib.mkOption {
|
||||
type = with types; attrsOf (nullOr (either str (either bool int)));
|
||||
description = ''
|
||||
Trayer configuration as a set of attributes. Further details can be
|
||||
found in [trayer's README](https://github.com/sargon/trayer-srg/blob/master/README).
|
||||
|
||||
${concatStringsSep "\n" (
|
||||
mapAttrsToList (n: v: ''
|
||||
${lib.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (n: v: ''
|
||||
{var}`${n}`
|
||||
: ${v.type.description} (default: `${builtins.toJSON v.default}`)
|
||||
'') knownSettings
|
||||
)}
|
||||
'';
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
edge = "top";
|
||||
padding = 6;
|
||||
|
|
@ -155,7 +154,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable ({
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.trayer" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -164,9 +163,9 @@ in
|
|||
|
||||
systemd.user.services.trayer =
|
||||
let
|
||||
valueToString = v: if isBool v then (if v then "true" else "false") else "${toString v}";
|
||||
valueToString = v: if lib.isBool v then (if v then "true" else "false") else "${toString v}";
|
||||
parameter = k: v: "--${k} ${valueToString v}";
|
||||
parameters = concatStringsSep " " (mapAttrsToList parameter cfg.settings);
|
||||
parameters = lib.concatStringsSep " " (lib.mapAttrsToList parameter cfg.settings);
|
||||
in
|
||||
{
|
||||
Unit = {
|
||||
|
|
@ -181,5 +180,5 @@ in
|
|||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,16 @@
|
|||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
stdenv,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
mkEnableOption
|
||||
types
|
||||
literalExpression
|
||||
;
|
||||
|
||||
cfg = config.services.twmn;
|
||||
|
||||
|
|
@ -34,7 +37,7 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ hm.maintainers.austreelis ];
|
||||
meta.maintainers = [ lib.hm.maintainers.austreelis ];
|
||||
|
||||
options.services.twmn = {
|
||||
enable = mkEnableOption "twmn, a tiling window manager notification daemon";
|
||||
|
|
@ -304,7 +307,7 @@ in
|
|||
#################
|
||||
# Implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.twmn" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
|
@ -313,7 +316,7 @@ in
|
|||
|
||||
xdg.configFile."twmn/twmn.conf".text =
|
||||
let
|
||||
conf = recursiveUpdate {
|
||||
conf = lib.recursiveUpdate {
|
||||
gui = {
|
||||
always_on_top = if cfg.window.alwaysOnTop then "true" else "false";
|
||||
background_color = cfg.window.color;
|
||||
|
|
@ -337,7 +340,7 @@ in
|
|||
};
|
||||
# map null values to empty strings because formats.toml generator fails
|
||||
# when encountering a null.
|
||||
icons = mapAttrs (_: toString) cfg.icons;
|
||||
icons = lib.mapAttrs (_: toString) cfg.icons;
|
||||
main = {
|
||||
duration = toString cfg.duration;
|
||||
host = cfg.host;
|
||||
|
|
@ -350,10 +353,10 @@ in
|
|||
|
||||
mkSection = section: conf: ''
|
||||
[${section}]
|
||||
${concatStringsSep "\n" (mapAttrsToList mkLine conf)}
|
||||
${lib.concatStringsSep "\n" (lib.mapAttrsToList mkLine conf)}
|
||||
'';
|
||||
in
|
||||
concatStringsSep "\n" (mapAttrsToList mkSection conf) + "\n";
|
||||
lib.concatStringsSep "\n" (lib.mapAttrsToList mkSection conf) + "\n";
|
||||
|
||||
systemd.user.services.twmnd = {
|
||||
Unit = {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue