diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-22 20:55:28 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-22 20:55:28 +0200 |
commit | 8d213e2b1c934f6861f76aad5eb7c11097fa97de (patch) | |
tree | 23f8a2d5692deaeffffa1ab5f098b2d24b9e2217 /nixops/modules/pub/default.nix | |
parent | a1a8649a2be768685eb04c246c114fce36b8096f (diff) | |
download | Nix-8d213e2b1c934f6861f76aad5eb7c11097fa97de.tar.gz Nix-8d213e2b1c934f6861f76aad5eb7c11097fa97de.tar.zst Nix-8d213e2b1c934f6861f76aad5eb7c11097fa97de.zip |
Move rest of the modules outside of nixops
Diffstat (limited to 'nixops/modules/pub/default.nix')
-rw-r--r-- | nixops/modules/pub/default.nix | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/nixops/modules/pub/default.nix b/nixops/modules/pub/default.nix deleted file mode 100644 index cdc68db..0000000 --- a/nixops/modules/pub/default.nix +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | { lib, pkgs, config, myconfig, ... }: | ||
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 | ''; | ||
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 | }); | ||
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 = [ | ||
45 | pkgs.purple-plugin-pack purple-hangouts | ||
46 | pkgs.purple-discord pkgs.purple-facebook | ||
47 | pkgs.telegram-purple | ||
48 | ]; }) | ||
49 | ]; | ||
50 | }; | ||
51 | }; | ||
52 | } | ||