dev.fron.io rc / 9834b29
nixos: merge 7fb53a24e416142e into subtree Tony Olagbaiye 2 months ago
3 changed file(s) with 35 addition(s) and 101 deletion(s). Raw diff Collapse all Expand all
55 ../../profiles/misc/restartssh.nix
66 ../../profiles/security/sudo.nix
77 ../../profiles/networking/wireguard
8 ../../profiles/networking/ipfs
9 ../../profiles/networking/tor
8 #../../profiles/networking/ipfs
9 #../../profiles/networking/tor
1010 ../../profiles/networking/traefik
1111 ../../profiles/networking/mdns.nix
12 ../../profiles/services/minecraft
12 #../../profiles/services/minecraft
1313 ../../profiles/services/syncthing
1414 ../../users/root.nix
1515 ../../users/bao.nix
11
22 let
33 wanInterface = "eno1";
4 vlanInterface = idx: "fo${toString idx}";
4 #vlanInterface = idx: "fo${toString idx}";
55 in {
66 imports = [
77 ../../containers/sandbox.nix # 10. 1.0.x
4242 hosts.ipv6.r-zeta
4343 ];
4444 };
45 networking.vlans.${vlanInterface 1} = {
46 id = 0;
47 interface = wanInterface;
48 };
49 networking.interfaces.${vlanInterface 1} = {
50 ipv4.addresses = [
51 hosts.ipv4.zeta-alt
52 ];
53 };
45 #networking.vlans.${vlanInterface 1} = {
46 # id = 0;
47 # interface = wanInterface;
48 #};
49 #networking.interfaces.${vlanInterface 1} = {
50 # ipv4.addresses = [
51 # hosts.ipv4.zeta-alt
52 # ];
53 #};
5454
5555 networking.nat.enable = true;
5656 networking.nat.internalInterfaces = ["ve-+"];
133133 };
134134 };
135135
136 networking.wireguard.interfaces.wg0 = {
137 postSetup = let
138 wanInterface = vlanInterface 1;
139 ipnat = "${pkgs.iptables}/bin/iptables -w -t nat";
140 proto = proto: "-p ${proto} -m ${proto}";
141 icmp-echo = "--icmp-type 8";
142 from-failover = "-d ${hosts.ipv4.zeta-alt.address}";
143 to-delta = "--to-destination ${hosts.wireguard.ipv4.delta}";
144 lanInterface = "wg0";
145 in ''
146 # Enable packet forwarding to/from the target for established/related connections
147 #iptables -A FORWARD -i ${wanInterface} -o ${lanInterface} -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
148 #iptables -A FORWARD -i ${lanInterface} -o ${wanInterface} -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
136 #networking.wireguard.interfaces.wg0 = {
137 # postSetup = let
138 # wanInterface = vlanInterface 1;
139 # ipnat = "${pkgs.iptables}/bin/iptables -w -t nat";
140 # proto = proto: "-p ${proto} -m ${proto}";
141 # icmp-echo = "--icmp-type 8";
142 # from-failover = "-d ${hosts.ipv4.zeta-alt.address}";
143 # to-delta = "--to-destination ${hosts.wireguard.ipv4.delta}";
144 # lanInterface = "wg0";
145 # in ''
146 # # Enable packet forwarding to/from the target for established/related connections
147 # #iptables -A FORWARD -i ${wanInterface} -o ${lanInterface} -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
148 # #iptables -A FORWARD -i ${lanInterface} -o ${wanInterface} -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
149149
150 # Enable masquerade on the target
151 #${ipnat} -A nixos-nat-post -o ${lanInterface} -s ${hosts.wireguard.ipv4.delta} -j MASQUERADE
150 # # Enable masquerade on the target
151 # #${ipnat} -A nixos-nat-post -o ${lanInterface} -s ${hosts.wireguard.ipv4.delta} -j MASQUERADE
152152
153 # Forward from source to target
154 #${ipnat} -A nixos-nat-pre -i ${wanInterface} ${proto "tcp" } ${from-failover} -j DNAT ${to-delta}
153 # # Forward from source to target
154 # #${ipnat} -A nixos-nat-pre -i ${wanInterface} ${proto "tcp" } ${from-failover} -j DNAT ${to-delta}
155155
156 # Hmm.
157 #${ipnat} -A nixos-nat-pre -i ${wanInterface} ${proto "icmp"} ${from-failover} -j DNAT ${to-delta} ${icmp-echo}
158 #${ipnat} -A nixos-nat-pre -i ${wanInterface} ${proto "udp" } ${from-failover} -j DNAT ${to-delta}
159 '';
160 };
156 # # Hmm.
157 # #${ipnat} -A nixos-nat-pre -i ${wanInterface} ${proto "icmp"} ${from-failover} -j DNAT ${to-delta} ${icmp-echo}
158 # #${ipnat} -A nixos-nat-pre -i ${wanInterface} ${proto "udp" } ${from-failover} -j DNAT ${to-delta}
159 # '';
160 #};
161161
162162 networking.defaultGateway = hosts.ipv4.r-zeta.address;
163163 networking.nameservers = [ "9.9.9.9" ];
+0
-66
nixos/overlays/giara.nix less more
0 inputs@{ giara, pr99188, ... }: final: prev: {
1 giara = final.callPackage (
2 { lib
3 , fetchFromGitLab
4 , meson
5 , gobject-introspection
6 , pkg-config
7 , ninja
8 , python3
9 , wrapGAppsHook
10 , gtk3
11 , gdk-pixbuf
12 , webkitgtk
13 , gtksourceview4
14 , libhandy
15 , glib-networking
16 }:
17
18 python3.pkgs.buildPythonApplication rec {
19 pname = "giara";
20 version = "0.2";
21
22 format = "other";
23
24 src = inputs.giara;
25
26 nativeBuildInputs = [
27 meson
28 gobject-introspection
29 pkg-config
30 ninja
31 wrapGAppsHook
32 ];
33
34 buildInputs = [
35 gtk3
36 gdk-pixbuf
37 webkitgtk
38 gtksourceview4
39 libhandy
40 glib-networking
41 ];
42
43 pythonPath = with python3.pkgs; [
44 pygobject3
45 pycairo
46 dateutil
47 praw
48 pillow
49 mistune
50 beautifulsoup4
51 ];
52
53 # Fix setup-hooks https://github.com/NixOS/nixpkgs/issues/56943
54 strictDeps = false;
55
56 meta = with lib; {
57 description = "A Reddit app, built with Python, GTK and Handy. Created with mobile Linux in mind.";
58 maintainers = with maintainers; [ atemu ];
59 homepage = "https://gitlab.gnome.org/World/giara";
60 license = licenses.gpl3Plus;
61 platforms = platforms.linux;
62 };
63 }
64 ) {};
65 }