Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 618f9aa52c4b
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9464df56a0a4
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on May 12, 2017

  1. Copy the full SHA
    f46b3a0 View commit details

Commits on May 17, 2017

  1. Merge pull request #25712 from 4z3/per-user-pkgs

    users-groups module: add per-user packages
    Mic92 authored May 17, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    globin Robin Gloster
    Copy the full SHA
    9464df5 View commit details
Showing with 23 additions and 0 deletions.
  1. +23 −0 nixos/modules/config/users-groups.nix
23 changes: 23 additions & 0 deletions nixos/modules/config/users-groups.nix
Original file line number Diff line number Diff line change
@@ -244,6 +244,17 @@ let
'';
};

packages = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "[ pkgs.firefox pkgs.thunderbird ]";
description = ''
The set of packages that should be made availabe to the user.
This is in contrast to <option>environment.systemPackages</option>,
which adds packages to all users.
'';
};

};

config = mkMerge
@@ -568,5 +579,17 @@ in {
imports =
[ (mkAliasOptionModule [ "users" "extraUsers" ] [ "users" "users" ])
(mkAliasOptionModule [ "users" "extraGroups" ] [ "users" "groups" ])
{
environment = {
etc = mapAttrs' (name: { packages, ... }: {
name = "per-user-pkgs/${name}";
value.source = pkgs.symlinkJoin {
name = "per-user-pkgs.${name}";
paths = packages;
};
}) (filterAttrs (_: { packages, ... }: packages != []) cfg.users);
profiles = ["/etc/per-user-pkgs/$LOGNAME"];
};
}
];
}