setcap-wrapper: Merging with upstream master and resolving conflicts
This commit is contained in:
30
nixos/modules/programs/adb.nix
Normal file
30
nixos/modules/programs/adb.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
meta.maintainers = [ maintainers.mic92 ];
|
||||
|
||||
###### interface
|
||||
options = {
|
||||
programs.adb = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Whether to configure system to use Android Debug Bridge (adb).
|
||||
To grant access to a user, it must be part of adbusers group:
|
||||
<code>users.extraUsers.alice.extraGroups = ["adbusers"];</code>
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
config = mkIf config.programs.adb.enable {
|
||||
services.udev.packages = [ pkgs.android-udev-rules ];
|
||||
environment.systemPackages = [ pkgs.androidenv.platformTools ];
|
||||
users.extraGroups.adbusers = {};
|
||||
};
|
||||
}
|
||||
@@ -16,7 +16,7 @@ let
|
||||
# programmable completion. If we do, enable all modules installed in
|
||||
# the system (and user profile).
|
||||
if shopt -q progcomp &>/dev/null; then
|
||||
. "${pkgs.bashCompletion}/etc/profile.d/bash_completion.sh"
|
||||
. "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh"
|
||||
nullglobStatus=$(shopt -p nullglob)
|
||||
shopt -s nullglob
|
||||
for p in $NIX_PROFILES; do
|
||||
|
||||
31
nixos/modules/programs/gphoto2.nix
Normal file
31
nixos/modules/programs/gphoto2.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
meta.maintainers = [ maintainers.league ];
|
||||
|
||||
###### interface
|
||||
options = {
|
||||
programs.gphoto2 = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Whether to configure system to use gphoto2.
|
||||
To grant digital camera access to a user, the user must
|
||||
be part of the camera group:
|
||||
<code>users.extraUsers.alice.extraGroups = ["camera"];</code>
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
config = mkIf config.programs.gphoto2.enable {
|
||||
services.udev.packages = [ pkgs.libgphoto2 ];
|
||||
environment.systemPackages = [ pkgs.gphoto2 ];
|
||||
users.extraGroups.camera = {};
|
||||
};
|
||||
}
|
||||
30
nixos/modules/programs/info.nix
Normal file
30
nixos/modules/programs/info.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
options = {
|
||||
|
||||
programs.info.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable info pages and the <command>info</command> command.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
config = mkIf config.programs.info.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.texinfoInteractive ];
|
||||
|
||||
environment.pathsToLink = [ "/info" "/share/info" ];
|
||||
|
||||
environment.extraOutputsToInstall = [ "info" ];
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
58
nixos/modules/programs/java.nix
Normal file
58
nixos/modules/programs/java.nix
Normal file
@@ -0,0 +1,58 @@
|
||||
# This module provides JAVA_HOME, with a different way to install java
|
||||
# system-wide.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.java;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
options = {
|
||||
|
||||
programs.java = {
|
||||
|
||||
enable = mkEnableOption "java" // {
|
||||
description = ''
|
||||
Install and setup the Java development kit.
|
||||
<note>
|
||||
<para>This adds JAVA_HOME to the global environment, by sourcing the
|
||||
jdk's setup-hook on shell init. It is equivalent to starting a shell
|
||||
through 'nix-shell -p jdk', or roughly the following system-wide
|
||||
configuration:
|
||||
</para>
|
||||
<programlisting>
|
||||
environment.variables.JAVA_HOME = ''${pkgs.jdk.home}/lib/openjdk;
|
||||
environment.systemPackages = [ pkgs.jdk ];
|
||||
</programlisting>
|
||||
</note>
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
default = pkgs.jdk;
|
||||
defaultText = "pkgs.jdk";
|
||||
description = ''
|
||||
Java package to install. Typical values are pkgs.jdk or pkgs.jre.
|
||||
'';
|
||||
type = types.package;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
environment.shellInit = ''
|
||||
test -e ${cfg.package}/nix-support/setup-hook && source ${cfg.package}/nix-support/setup-hook
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
@@ -9,14 +9,14 @@ let
|
||||
in
|
||||
{
|
||||
options.programs.mosh = {
|
||||
enable = mkOption {
|
||||
description = ''
|
||||
Whether to enable mosh. Note, this will open ports in your firewall!
|
||||
'';
|
||||
default = false;
|
||||
example = true;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
enable = mkOption {
|
||||
description = ''
|
||||
Whether to enable mosh. Note, this will open ports in your firewall!
|
||||
'';
|
||||
default = false;
|
||||
example = true;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
160
nixos/modules/programs/oblogout.nix
Normal file
160
nixos/modules/programs/oblogout.nix
Normal file
@@ -0,0 +1,160 @@
|
||||
# Global configuration for oblogout.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.programs.oblogout;
|
||||
|
||||
in
|
||||
{
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
programs.oblogout = {
|
||||
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to install OBLogout and create <filename>/etc/oblogout.conf</filename>.
|
||||
See <filename>${pkgs.oblogout}/share/doc/README</filename>.
|
||||
'';
|
||||
};
|
||||
|
||||
opacity = mkOption {
|
||||
type = types.int;
|
||||
default = 70;
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
bgcolor = mkOption {
|
||||
type = types.str;
|
||||
default = "black";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
buttontheme = mkOption {
|
||||
type = types.str;
|
||||
default = "simplistic";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
buttons = mkOption {
|
||||
type = types.str;
|
||||
default = "cancel, logout, restart, shutdown, suspend, hibernate";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
cancel = mkOption {
|
||||
type = types.str;
|
||||
default = "Escape";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
shutdown = mkOption {
|
||||
type = types.str;
|
||||
default = "S";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
restart = mkOption {
|
||||
type = types.str;
|
||||
default = "R";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
suspend = mkOption {
|
||||
type = types.str;
|
||||
default = "U";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
logout = mkOption {
|
||||
type = types.str;
|
||||
default = "L";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
lock = mkOption {
|
||||
type = types.str;
|
||||
default = "K";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
hibernate = mkOption {
|
||||
type = types.str;
|
||||
default = "H";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
clogout = mkOption {
|
||||
type = types.str;
|
||||
default = "openbox --exit";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
clock = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
|
||||
cswitchuser = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = ''
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.oblogout ];
|
||||
|
||||
environment.etc."oblogout.conf".text = ''
|
||||
[settings]
|
||||
usehal = false
|
||||
|
||||
[looks]
|
||||
opacity = ${toString cfg.opacity}
|
||||
bgcolor = ${cfg.bgcolor}
|
||||
buttontheme = ${cfg.buttontheme}
|
||||
buttons = ${cfg.buttons}
|
||||
|
||||
[shortcuts]
|
||||
cancel = ${cfg.cancel}
|
||||
shutdown = ${cfg.shutdown}
|
||||
restart = ${cfg.restart}
|
||||
suspend = ${cfg.suspend}
|
||||
logout = ${cfg.logout}
|
||||
lock = ${cfg.lock}
|
||||
hibernate = ${cfg.hibernate}
|
||||
|
||||
[commands]
|
||||
shutdown = systemctl poweroff
|
||||
restart = systemctl reboot
|
||||
suspend = systemctl suspend
|
||||
hibernate = systemctl hibernate
|
||||
logout = ${cfg.clogout}
|
||||
lock = ${cfg.clock}
|
||||
switchuser = ${cfg.cswitchuser}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -99,7 +99,6 @@ in
|
||||
groupdel = { rootOK = true; };
|
||||
login = { startSession = true; allowNullPassword = true; showMotd = true; updateWtmp = true; };
|
||||
chpasswd = { rootOK = true; };
|
||||
chgpasswd = { rootOK = true; };
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ in
|
||||
|
||||
setXAuthLocation = mkOption {
|
||||
type = types.bool;
|
||||
default = config.services.xserver.enable;
|
||||
description = ''
|
||||
Whether to set the path to <command>xauth</command> for X11-forwarded connections.
|
||||
This causes a dependency on X11 packages.
|
||||
@@ -165,6 +164,9 @@ in
|
||||
|
||||
config = {
|
||||
|
||||
programs.ssh.setXAuthLocation =
|
||||
mkDefault (config.services.xserver.enable || config.programs.ssh.forwardX11 || config.services.openssh.forwardX11);
|
||||
|
||||
assertions =
|
||||
[ { assertion = cfg.forwardX11 -> cfg.setXAuthLocation;
|
||||
message = "cannot enable X11 forwarding without setting XAuth location";
|
||||
|
||||
24
nixos/modules/programs/vim.nix
Normal file
24
nixos/modules/programs/vim.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.vim;
|
||||
in {
|
||||
options.programs.vim = {
|
||||
defaultEditor = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = ''
|
||||
When enabled, installs vim and configures vim to be the default editor
|
||||
using the EDITOR environment variable.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.defaultEditor {
|
||||
environment.systemPackages = [ pkgs.vim ];
|
||||
environment.variables = { EDITOR = mkOverride 900 "vim"; };
|
||||
};
|
||||
}
|
||||
@@ -25,7 +25,10 @@ in
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to configure zsh as an interactive shell.
|
||||
Whether to configure zsh as an interactive shell. To enable zsh for
|
||||
a particular user, use the <option>users.users.<name?>.shell</option>
|
||||
option for that user. To enable zsh system-wide use the
|
||||
<option>users.defaultUserShell</option> option.
|
||||
'';
|
||||
type = types.bool;
|
||||
};
|
||||
@@ -81,6 +84,21 @@ in
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
enableSyntaxHighlighting = mkOption {
|
||||
default = false;
|
||||
description = ''
|
||||
Enable zsh-syntax-highlighting
|
||||
'';
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
enableAutosuggestions = mkOption {
|
||||
default = false;
|
||||
description = ''
|
||||
Enable zsh-autosuggestions
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
@@ -99,9 +117,9 @@ in
|
||||
|
||||
interactiveShellInit = ''
|
||||
# history defaults
|
||||
export SAVEHIST=2000
|
||||
export HISTSIZE=2000
|
||||
export HISTFILE=$HOME/.zsh_history
|
||||
SAVEHIST=2000
|
||||
HISTSIZE=2000
|
||||
HISTFILE=$HOME/.zsh_history
|
||||
|
||||
setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK
|
||||
|
||||
@@ -117,6 +135,14 @@ in
|
||||
|
||||
${if cfg.enableCompletion then "autoload -U compinit && compinit" else ""}
|
||||
|
||||
${optionalString (cfg.enableSyntaxHighlighting)
|
||||
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
}
|
||||
|
||||
${optionalString (cfg.enableAutosuggestions)
|
||||
"source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||
}
|
||||
|
||||
HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help"
|
||||
'';
|
||||
|
||||
@@ -179,7 +205,8 @@ in
|
||||
environment.etc."zinputrc".source = ./zinputrc;
|
||||
|
||||
environment.systemPackages = [ pkgs.zsh ]
|
||||
++ optional cfg.enableCompletion pkgs.nix-zsh-completions;
|
||||
++ optional cfg.enableCompletion pkgs.nix-zsh-completions
|
||||
++ optional cfg.enableSyntaxHighlighting pkgs.zsh-syntax-highlighting;
|
||||
|
||||
environment.pathsToLink = optional cfg.enableCompletion "/share/zsh";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user