diff options
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r-- | nixos/modules/programs/environment.nix | 2 | ||||
-rw-r--r-- | nixos/modules/programs/freetds.nix | 61 | ||||
-rw-r--r-- | nixos/modules/programs/shadow.nix | 6 | ||||
-rw-r--r-- | nixos/modules/programs/uim.nix | 29 | ||||
-rw-r--r-- | nixos/modules/programs/virtualbox.nix | 2 |
5 files changed, 96 insertions, 4 deletions
diff --git a/nixos/modules/programs/environment.nix b/nixos/modules/programs/environment.nix index e7bde81fb23..6bf98442013 100644 --- a/nixos/modules/programs/environment.nix +++ b/nixos/modules/programs/environment.nix @@ -51,7 +51,7 @@ in STRIGI_PLUGIN_PATH = [ "${i}/lib/strigi/" ]; QT_PLUGIN_PATH = [ "${i}/lib/qt4/plugins" "${i}/lib/kde4/plugins" ]; QTWEBKIT_PLUGIN_PATH = [ "${i}/lib/mozilla/plugins/" ]; - GTK_PATH = [ "${i}/lib/gtk-2.0" ]; + GTK_PATH = [ "${i}/lib/gtk-2.0" "${i}/lib/gtk-3.0" ]; XDG_CONFIG_DIRS = [ "${i}/etc/xdg" ]; XDG_DATA_DIRS = [ "${i}/share" ]; MOZ_PLUGIN_PATH = [ "${i}/lib/mozilla/plugins" ]; diff --git a/nixos/modules/programs/freetds.nix b/nixos/modules/programs/freetds.nix new file mode 100644 index 00000000000..398fd104363 --- /dev/null +++ b/nixos/modules/programs/freetds.nix @@ -0,0 +1,61 @@ +# Global configuration for freetds environment. + +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.environment.freetds; + +in +{ + ###### interface + + options = { + + environment.freetds = mkOption { + type = types.attrsOf types.str; + default = {}; + example = { + MYDATABASE = + '' + host = 10.0.2.100 + port = 1433 + tds version = 7.2 + ''; + }; + description = + '' + Configure freetds database entries. Each attribute denotes + a section within freetds.conf, and the value (a string) is the config + content for that section. When at least one entry is configured + the global environment variables FREETDSCONF, FREETDS and SYBASE + will be configured to allow the programs that use freetds to find the + library and config. + ''; + + }; + + }; + + ###### implementation + + config = mkIf (length (attrNames cfg) > 0) { + + environment.variables.FREETDSCONF = "/etc/freetds.conf"; + environment.variables.FREETDS = "/etc/freetds.conf"; + environment.variables.SYBASE = "${pkgs.freetds}"; + + environment.etc."freetds.conf" = { text = + (concatStrings (mapAttrsToList (name: value: + '' + [${name}] + ${value} + '' + ) cfg)); + }; + + }; + +} diff --git a/nixos/modules/programs/shadow.nix b/nixos/modules/programs/shadow.nix index 658b08b3d87..5c2ea07c554 100644 --- a/nixos/modules/programs/shadow.nix +++ b/nixos/modules/programs/shadow.nix @@ -83,7 +83,7 @@ in security.pam.services = { chsh = { rootOK = true; }; chfn = { rootOK = true; }; - su = { rootOK = true; forwardXAuth = true; }; + su = { rootOK = true; forwardXAuth = true; logFailures = true; }; passwd = {}; # Note: useradd, groupadd etc. aren't setuid root, so it # doesn't really matter what the PAM config says as long as it @@ -100,7 +100,9 @@ in chgpasswd = { rootOK = true; }; }; - security.setuidPrograms = [ "passwd" "chfn" "su" "newgrp" ]; + security.setuidPrograms = [ "passwd" "chfn" "su" "newgrp" + "newuidmap" "newgidmap" # new in shadow 4.2.x + ]; }; diff --git a/nixos/modules/programs/uim.nix b/nixos/modules/programs/uim.nix new file mode 100644 index 00000000000..237da3415dc --- /dev/null +++ b/nixos/modules/programs/uim.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +let + cfg = config.uim; +in +{ + options = { + uim = { + enable = mkOption { + type = types.bool; + default = false; + example = true; + description = "enable UIM input method"; + }; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ pkgs.uim ]; + gtkPlugins = [ pkgs.uim ]; + qtPlugins = [ pkgs.uim ]; + environment.variables.GTK_IM_MODULE = "uim"; + environment.variables.QT_IM_MODULE = "uim"; + environment.variables.XMODIFIERS = "@im=uim"; + services.xserver.displayManager.sessionCommands = "uim-xim &"; + }; +} diff --git a/nixos/modules/programs/virtualbox.nix b/nixos/modules/programs/virtualbox.nix index e2dd76219eb..fec1a7b61f3 100644 --- a/nixos/modules/programs/virtualbox.nix +++ b/nixos/modules/programs/virtualbox.nix @@ -44,5 +44,5 @@ let virtualbox = config.boot.kernelPackages.virtualbox; in ''; }; - networking.interfaces.vboxnet0 = { ipAddress = "192.168.56.1"; prefixLength = 24; }; + networking.interfaces.vboxnet0.ip4 = [ { address = "192.168.56.1"; prefixLength = 24; } ]; } |