]>
Commit | Line | Data |
---|---|---|
5ccc61bb IB |
1 | { lib, pkgs, config, myconfig, mylibs, ... }: |
2 | { | |
3 | options = { | |
4 | services.pub.enable = lib.mkOption { | |
5 | type = lib.types.bool; | |
6 | default = false; | |
7 | description = '' | |
8 | Whether to enable pub user. | |
9 | ''; | |
10 | }; | |
11 | }; | |
12 | ||
13 | config = lib.mkIf config.services.pub.enable { | |
14 | users.users.pub = let | |
15 | restrict = pkgs.runCommand "restrict" { | |
16 | file = ./restrict; | |
17 | buildInputs = [ pkgs.makeWrapper ]; | |
18 | } '' | |
19 | mkdir -p $out/bin | |
20 | cp $file $out/bin/restrict | |
21 | chmod a+x $out/bin/restrict | |
22 | patchShebangs $out/bin/restrict | |
23 | wrapProgram $out/bin/restrict \ | |
24 | --prefix PATH : ${lib.makeBinPath [ pkgs.bubblewrap pkgs.rrsync ]} \ | |
25 | --set TMUX_RESTRICT ${./tmux.restrict.conf} | |
26 | ''; | |
1be1a523 IB |
27 | purple-hangouts = pkgs.purple-hangouts.overrideAttrs(old: { |
28 | installPhase = '' | |
29 | install -Dm755 -t $out/lib/purple-2/ libhangouts.so | |
30 | for size in 16 22 24 48; do | |
31 | install -TDm644 hangouts$size.png $out/share/pixmaps/pidgin/protocols/$size/hangouts.png | |
32 | done | |
33 | ''; | |
34 | }); | |
5ccc61bb IB |
35 | in { |
36 | createHome = true; | |
37 | description = "Restricted shell user"; | |
38 | home = "/var/lib/pub"; | |
39 | uid = myconfig.env.users.pub.uid; | |
40 | useDefaultShell = true; | |
41 | packages = [ | |
42 | restrict | |
43 | pkgs.tmux | |
44 | (pkgs.pidgin.override { plugins = [ | |
1be1a523 | 45 | pkgs.purple-plugin-pack purple-hangouts |
5ccc61bb IB |
46 | pkgs.purple-discord pkgs.purple-facebook |
47 | pkgs.telegram-purple | |
48 | ]; }) | |
49 | ]; | |
50 | }; | |
51 | }; | |
52 | } |