diff options
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r-- | nixos/modules/programs/gnupg.nix | 59 | ||||
-rw-r--r-- | nixos/modules/programs/nylas-mail.nix | 37 | ||||
-rw-r--r-- | nixos/modules/programs/oblogout.nix | 16 | ||||
-rw-r--r-- | nixos/modules/programs/qt5ct.nix | 2 | ||||
-rw-r--r-- | nixos/modules/programs/thefuck.nix | 14 | ||||
-rw-r--r-- | nixos/modules/programs/wvdial.nix | 71 | ||||
-rw-r--r-- | nixos/modules/programs/zsh/oh-my-zsh.nix | 20 | ||||
-rw-r--r-- | nixos/modules/programs/zsh/zsh.nix | 71 |
8 files changed, 116 insertions, 174 deletions
diff --git a/nixos/modules/programs/gnupg.nix b/nixos/modules/programs/gnupg.nix index 68adee94f79e..addc9dcca87e 100644 --- a/nixos/modules/programs/gnupg.nix +++ b/nixos/modules/programs/gnupg.nix @@ -55,79 +55,24 @@ in }; config = mkIf cfg.agent.enable { - systemd.user.services.gpg-agent = { - serviceConfig = { - ExecStart = [ - "" - ("${pkgs.gnupg}/bin/gpg-agent --supervised " - + optionalString cfg.agent.enableSSHSupport "--enable-ssh-support") - ]; - ExecReload = "${pkgs.gnupg}/bin/gpgconf --reload gpg-agent"; - }; - }; - systemd.user.sockets.gpg-agent = { wantedBy = [ "sockets.target" ]; - listenStreams = [ "%t/gnupg/S.gpg-agent" ]; - socketConfig = { - FileDescriptorName = "std"; - SocketMode = "0600"; - DirectoryMode = "0700"; - }; }; systemd.user.sockets.gpg-agent-ssh = mkIf cfg.agent.enableSSHSupport { wantedBy = [ "sockets.target" ]; - listenStreams = [ "%t/gnupg/S.gpg-agent.ssh" ]; - socketConfig = { - FileDescriptorName = "ssh"; - Service = "gpg-agent.service"; - SocketMode = "0600"; - DirectoryMode = "0700"; - }; }; systemd.user.sockets.gpg-agent-extra = mkIf cfg.agent.enableExtraSocket { wantedBy = [ "sockets.target" ]; - listenStreams = [ "%t/gnupg/S.gpg-agent.extra" ]; - socketConfig = { - FileDescriptorName = "extra"; - Service = "gpg-agent.service"; - SocketMode = "0600"; - DirectoryMode = "0700"; - }; }; systemd.user.sockets.gpg-agent-browser = mkIf cfg.agent.enableBrowserSocket { wantedBy = [ "sockets.target" ]; - listenStreams = [ "%t/gnupg/S.gpg-agent.browser" ]; - socketConfig = { - FileDescriptorName = "browser"; - Service = "gpg-agent.service"; - SocketMode = "0600"; - DirectoryMode = "0700"; - }; - }; - - systemd.user.services.dirmngr = { - requires = [ "dirmngr.socket" ]; - after = [ "dirmngr.socket" ]; - unitConfig = { - RefuseManualStart = "true"; - }; - serviceConfig = { - ExecStart = "${pkgs.gnupg}/bin/dirmngr --supervised"; - ExecReload = "${pkgs.gnupg}/bin/gpgconf --reload dirmngr"; - }; }; - systemd.user.sockets.dirmngr = { + systemd.user.sockets.dirmngr = mkIf cfg.dirmngr.enable { wantedBy = [ "sockets.target" ]; - listenStreams = [ "%t/gnupg/S.dirmngr" ]; - socketConfig = { - SocketMode = "0600"; - DirectoryMode = "0700"; - }; }; systemd.packages = [ pkgs.gnupg ]; @@ -147,7 +92,7 @@ in ''); assertions = [ - { assertion = cfg.agent.enableSSHSupport && !config.programs.ssh.startAgent; + { assertion = cfg.agent.enableSSHSupport -> !config.programs.ssh.startAgent; message = "You can't use ssh-agent and GnuPG agent with SSH support enabled at the same time!"; } ]; diff --git a/nixos/modules/programs/nylas-mail.nix b/nixos/modules/programs/nylas-mail.nix new file mode 100644 index 000000000000..9a6cf755f2a2 --- /dev/null +++ b/nixos/modules/programs/nylas-mail.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.nylas-mail; + defaultUser = "nylas-mail"; +in { + ###### interface + options = { + services.nylas-mail = { + + enable = mkEnableOption '' + nylas-mail - Open-source mail client built on the modern web with Electron, React, and Flux + ''; + + gnome3-keyring = mkOption { + type = types.bool; + default = true; + description = "Enable gnome3 keyring for nylas-mail."; + }; + }; + }; + + + ###### implementation + + config = mkIf cfg.enable { + + environment.systemPackages = [ pkgs.nylas-mail-bin ]; + + services.gnome3.gnome-keyring = mkIf cfg.gnome3-keyring { + enable = true; + }; + + }; +} diff --git a/nixos/modules/programs/oblogout.nix b/nixos/modules/programs/oblogout.nix index 79a8ddb7ce37..720c29b1eaee 100644 --- a/nixos/modules/programs/oblogout.nix +++ b/nixos/modules/programs/oblogout.nix @@ -27,6 +27,7 @@ in type = types.int; default = 70; description = '' + Opacity percentage of Cairo rendered backgrounds. ''; }; @@ -34,6 +35,7 @@ in type = types.str; default = "black"; description = '' + Colour name or hex code (#ffffff) of the background color. ''; }; @@ -41,6 +43,9 @@ in type = types.str; default = "simplistic"; description = '' + Icon theme for the buttons, must be in the themes folder of + the package, or in + <filename>~/.themes/<name>/oblogout/</filename>. ''; }; @@ -48,6 +53,7 @@ in type = types.str; default = "cancel, logout, restart, shutdown, suspend, hibernate"; description = '' + List and order of buttons to show. ''; }; @@ -55,6 +61,7 @@ in type = types.str; default = "Escape"; description = '' + Cancel logout/shutdown shortcut. ''; }; @@ -62,6 +69,7 @@ in type = types.str; default = "S"; description = '' + Shutdown shortcut. ''; }; @@ -69,6 +77,7 @@ in type = types.str; default = "R"; description = '' + Restart shortcut. ''; }; @@ -76,6 +85,7 @@ in type = types.str; default = "U"; description = '' + Suspend shortcut. ''; }; @@ -83,6 +93,7 @@ in type = types.str; default = "L"; description = '' + Logout shortcut. ''; }; @@ -90,6 +101,7 @@ in type = types.str; default = "K"; description = '' + Lock session shortcut. ''; }; @@ -97,6 +109,7 @@ in type = types.str; default = "H"; description = '' + Hibernate shortcut. ''; }; @@ -104,6 +117,7 @@ in type = types.str; default = "openbox --exit"; description = '' + Command to logout. ''; }; @@ -111,6 +125,7 @@ in type = types.str; default = ""; description = '' + Command to lock screen. ''; }; @@ -118,6 +133,7 @@ in type = types.str; default = ""; description = '' + Command to switch user. ''; }; }; diff --git a/nixos/modules/programs/qt5ct.nix b/nixos/modules/programs/qt5ct.nix index 550634e65be9..aeb7fc508495 100644 --- a/nixos/modules/programs/qt5ct.nix +++ b/nixos/modules/programs/qt5ct.nix @@ -26,6 +26,6 @@ with lib; ###### implementation config = mkIf config.programs.qt5ct.enable { environment.variables.QT_QPA_PLATFORMTHEME = "qt5ct"; - environment.systemPackages = [ pkgs.qt5ct ]; + environment.systemPackages = with pkgs; [ qt5ct libsForQt5.qtstyleplugins ]; }; } diff --git a/nixos/modules/programs/thefuck.nix b/nixos/modules/programs/thefuck.nix index 433a0ca95fef..eb913477cf05 100644 --- a/nixos/modules/programs/thefuck.nix +++ b/nixos/modules/programs/thefuck.nix @@ -3,7 +3,12 @@ with lib; let - cfg = config.programs.thefuck; + prg = config.programs; + cfg = prg.thefuck; + + initScript = '' + eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias}) + ''; in { options = { @@ -24,8 +29,11 @@ in config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ thefuck ]; - environment.shellInit = '' - eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias}) + environment.shellInit = initScript; + + programs.zsh.shellInit = mkIf prg.zsh.enable initScript; + programs.fish.shellInit = mkIf prg.fish.enable '' + ${pkgs.thefuck}/bin/thefuck --alias | source ''; }; } diff --git a/nixos/modules/programs/wvdial.nix b/nixos/modules/programs/wvdial.nix deleted file mode 100644 index 1ed929ed4afa..000000000000 --- a/nixos/modules/programs/wvdial.nix +++ /dev/null @@ -1,71 +0,0 @@ -# Global configuration for wvdial. - -{ config, lib, pkgs, ... }: - -with lib; - -let - - configFile = '' - [Dialer Defaults] - PPPD PATH = ${pkgs.ppp}/sbin/pppd - ${config.environment.wvdial.dialerDefaults} - ''; - - cfg = config.environment.wvdial; - -in -{ - ###### interface - - options = { - - environment.wvdial = { - - dialerDefaults = mkOption { - default = ""; - type = types.str; - example = ''Init1 = AT+CGDCONT=1,"IP","internet.t-mobile"''; - description = '' - Contents of the "Dialer Defaults" section of - <filename>/etc/wvdial.conf</filename>. - ''; - }; - - pppDefaults = mkOption { - default = '' - noipdefault - usepeerdns - defaultroute - persist - noauth - ''; - type = types.str; - description = "Default ppp settings for wvdial."; - }; - - }; - - }; - - ###### implementation - - config = mkIf (cfg.dialerDefaults != "") { - - environment = { - - etc = - [ - { source = pkgs.writeText "wvdial.conf" configFile; - target = "wvdial.conf"; - } - { source = pkgs.writeText "wvdial" cfg.pppDefaults; - target = "ppp/peers/wvdial"; - } - ]; - - }; - - }; - -} diff --git a/nixos/modules/programs/zsh/oh-my-zsh.nix b/nixos/modules/programs/zsh/oh-my-zsh.nix index 446c05da39d0..9077643c4440 100644 --- a/nixos/modules/programs/zsh/oh-my-zsh.nix +++ b/nixos/modules/programs/zsh/oh-my-zsh.nix @@ -15,6 +15,16 @@ in ''; }; + package = mkOption { + default = pkgs.oh-my-zsh; + defaultText = "pkgs.oh-my-zsh"; + description = '' + Package to install for `oh-my-zsh` usage. + ''; + + type = types.package; + }; + plugins = mkOption { default = []; type = types.listOf(types.str); @@ -42,11 +52,15 @@ in }; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ oh-my-zsh ]; - programs.zsh.interactiveShellInit = with pkgs; with builtins; '' + # Prevent zsh from overwriting oh-my-zsh's prompt + programs.zsh.promptInit = mkDefault ""; + + environment.systemPackages = [ cfg.package ]; + + programs.zsh.interactiveShellInit = with builtins; '' # oh-my-zsh configuration generated by NixOS - export ZSH=${oh-my-zsh}/share/oh-my-zsh + export ZSH=${cfg.package}/share/oh-my-zsh ${optionalString (length(cfg.plugins) > 0) "plugins=(${concatStringsSep " " cfg.plugins})" diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix index b276bf9bb73c..615e54c326b7 100644 --- a/nixos/modules/programs/zsh/zsh.nix +++ b/nixos/modules/programs/zsh/zsh.nix @@ -97,45 +97,6 @@ in config = mkIf cfg.enable { - programs.zsh = { - - shellInit = '' - . ${config.system.build.setEnvironment} - - ${cfge.shellInit} - ''; - - loginShellInit = cfge.loginShellInit; - - interactiveShellInit = '' - # history defaults - SAVEHIST=2000 - HISTSIZE=2000 - HISTFILE=$HOME/.zsh_history - - setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK - - # Tell zsh how to find installed completions - for p in ''${(z)NIX_PROFILES}; do - fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions) - done - - ${if cfg.enableCompletion then "autoload -U compinit && compinit" else ""} - - ${optionalString (cfg.enableAutosuggestions) - "source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh" - } - - ${zshAliases} - ${cfg.promptInit} - - ${cfge.interactiveShellInit} - - HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help" - ''; - - }; - environment.etc."zshenv".text = '' # /etc/zshenv: DO NOT EDIT -- this file has been generated automatically. @@ -146,6 +107,10 @@ in if [ -n "$__ETC_ZSHENV_SOURCED" ]; then return; fi export __ETC_ZSHENV_SOURCED=1 + . ${config.system.build.setEnvironment} + + ${cfge.shellInit} + ${cfg.shellInit} # Read system-wide modifications. @@ -163,6 +128,8 @@ in if [ -n "$__ETC_ZPROFILE_SOURCED" ]; then return; fi __ETC_ZPROFILE_SOURCED=1 + ${cfge.loginShellInit} + ${cfg.loginShellInit} # Read system-wide modifications. @@ -182,8 +149,34 @@ in . /etc/zinputrc + # history defaults + SAVEHIST=2000 + HISTSIZE=2000 + HISTFILE=$HOME/.zsh_history + + setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK + + HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help" + + # Tell zsh how to find installed completions + for p in ''${(z)NIX_PROFILES}; do + fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions) + done + + ${optionalString cfg.enableCompletion "autoload -U compinit && compinit"} + + ${optionalString (cfg.enableAutosuggestions) + "source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh" + } + + ${cfge.interactiveShellInit} + ${cfg.interactiveShellInit} + ${zshAliases} + + ${cfg.promptInit} + # Read system-wide modifications. if test -f /etc/zshrc.local; then . /etc/zshrc.local |