stockholm/krebs/3modules/per-user.nix

39 lines
691 B
Nix
Raw Normal View History

2015-11-06 20:29:49 +00:00
{ config, lib, pkgs, ... }:
2016-02-14 15:43:44 +00:00
with config.krebs.lib;
2015-11-06 20:29:49 +00:00
let
2015-11-06 20:37:58 +00:00
cfg = config.krebs.per-user;
2015-11-06 20:29:49 +00:00
out = {
2015-11-06 20:37:58 +00:00
options.krebs.per-user = api;
2015-11-06 20:29:49 +00:00
config = imp;
};
api = mkOption {
type = with types; attrsOf (submodule {
options = {
packages = mkOption {
type = listOf path;
default = [];
};
};
});
default = {};
};
imp = {
environment = {
etc = flip mapAttrs' cfg (name: { packages, ... }: {
name = "per-user/${name}";
value.source = pkgs.symlinkJoin {
name = "per-user.${name}";
paths = packages;
};
2015-11-06 20:29:49 +00:00
});
profiles = ["/etc/per-user/$LOGNAME"];
};
};
in out