diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-08-22 13:47:37 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-08-22 18:22:22 +0000 |
commit | 1b9a13c4689af7e088eb7af5589f8c811282846a (patch) | |
tree | 3ed032953008280fb94ef894c869ff3e2a2f7865 /nixpkgs/nixos/modules/programs | |
parent | 4999a38db7c5de0ea9f514a12ecd4133cce647f3 (diff) | |
parent | 1412af4b2cfae71d447164097d960d426e9752c0 (diff) | |
download | nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.gz nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.bz2 nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.lz nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.xz nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.zst nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.zip |
Merge remote-tracking branch 'channels/nixos-unstable'
Diffstat (limited to 'nixpkgs/nixos/modules/programs')
-rw-r--r-- | nixpkgs/nixos/modules/programs/environment.nix | 5 | ||||
-rw-r--r-- | nixpkgs/nixos/modules/programs/fuse.nix | 37 |
2 files changed, 39 insertions, 3 deletions
diff --git a/nixpkgs/nixos/modules/programs/environment.nix b/nixpkgs/nixos/modules/programs/environment.nix index 3c6d356ef998..4d762314298d 100644 --- a/nixpkgs/nixos/modules/programs/environment.nix +++ b/nixpkgs/nixos/modules/programs/environment.nix @@ -23,9 +23,8 @@ in XCURSOR_PATH = [ "$HOME/.icons" ]; }; - environment.profiles = - [ "$HOME/.nix-profile" - "/nix/var/nix/profiles/default" + environment.profiles = mkAfter + [ "/nix/var/nix/profiles/default" "/run/current-system/sw" ]; diff --git a/nixpkgs/nixos/modules/programs/fuse.nix b/nixpkgs/nixos/modules/programs/fuse.nix new file mode 100644 index 000000000000..c15896efbb51 --- /dev/null +++ b/nixpkgs/nixos/modules/programs/fuse.nix @@ -0,0 +1,37 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.programs.fuse; +in { + meta.maintainers = with maintainers; [ primeos ]; + + options.programs.fuse = { + mountMax = mkOption { + # In the C code it's an "int" (i.e. signed and at least 16 bit), but + # negative numbers obviously make no sense: + type = types.ints.between 0 32767; # 2^15 - 1 + default = 1000; + description = '' + Set the maximum number of FUSE mounts allowed to non-root users. + ''; + }; + + userAllowOther = mkOption { + type = types.bool; + default = false; + description = '' + Allow non-root users to specify the allow_other or allow_root mount + options, see mount.fuse3(8). + ''; + }; + }; + + config = { + environment.etc."fuse.conf".text = '' + ${optionalString (!cfg.userAllowOther) "#"}user_allow_other + mount_max = ${toString cfg.mountMax} + ''; + }; +} |