Skip to content

Commit 09034ac

Browse files
enesoztrkbrianmcgillion
authored andcommitted
VPN: wireguard-gui service and app rework
* Reorganizing files * removing wireguard-gui-launcher package * bumping new version of wireguard-gui app Signed-off-by: Enes Öztürk <enes.ozturk@unikie.com>
1 parent 4decd4d commit 09034ac

File tree

18 files changed

+292
-269
lines changed

18 files changed

+292
-269
lines changed

flake.lock

Lines changed: 53 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,13 @@
154154
};
155155

156156
wireguard-gui = {
157-
url = "github:tiiuae/wireguard-gui";
158-
inputs.nixpkgs.follows = "nixpkgs";
157+
url = "github:enesoztrk/wireguard-gui/56b92f8d4d8cf006e53d9fa5373709b00663a45e";
158+
inputs = {
159+
nixpkgs.follows = "nixpkgs";
160+
flake-utils.follows = "flake-utils";
161+
crane.follows = "givc/crane";
162+
};
163+
159164
};
160165

161166
ci-test-automation = {

modules/common/services/wireguard-gui-vm-conf.nix

Lines changed: 0 additions & 117 deletions
This file was deleted.

modules/common/services/wireguard-gui.nix

Lines changed: 0 additions & 55 deletions
This file was deleted.

modules/microvm/appvm.nix

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let
2121
inherit (configHost.ghaf.virtualization.microvm-host) sharedVmDirectory;
2222

2323
makeVm =
24-
{ vm, vmIndex }: # TODO the vmIndex is not used. but it is passed when calling makeVm
24+
{ vm }:
2525
let
2626
vmName = "${vm.name}-vm";
2727
# A list of applications for the GIVC service
@@ -346,11 +346,7 @@ in
346346
useTunneling = lib.mkEnableOption "Use Pulseaudio tunneling";
347347
};
348348
vtpm.enable = lib.mkEnableOption "vTPM support in the virtual machine";
349-
# FIXME: Temporary solution to keep order of virtual machines, otherwise hosts file points to wrong vms.
350-
vmIndex = mkOption {
351-
type = types.int;
352-
internal = true;
353-
};
349+
354350
};
355351
}
356352
);
@@ -415,7 +411,7 @@ in
415411
microvm.vms =
416412
let
417413
vms' = lib.attrsets.mapAttrsToList (name: vm: { inherit name; } // vm) vms;
418-
vms'' = lib.imap0 (vmIndex: vm: { "${vm.name}-vm" = makeVm { inherit vmIndex vm; }; }) vms';
414+
vms'' = map (vm: { "${vm.name}-vm" = makeVm { inherit vm; }; }) vms';
419415
in
420416
lib.foldr lib.recursiveUpdate { } vms'';
421417

modules/microvm/sysvms/guivm.nix

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ let
3636
path = "${pkgs.givc-cli}/bin/givc-cli ${config.ghaf.givc.cliArgs} start app --vm ${vm} ${app.givcName}";
3737
inherit (app) icon;
3838
}) virtualApps;
39+
3940
# Launchers for all desktop, non-virtualized applications that run in the GUIVM
4041
guivmLaunchers = map (app: {
4142
inherit (app) name;
@@ -200,16 +201,6 @@ let
200201
};
201202
};
202203

203-
environment.etc."ctrl-panel/wireguard-gui-vms.txt" =
204-
let
205-
vmstxt = lib.concatStringsSep "\n" config.ghaf.services.wireguard-gui.vms;
206-
in
207-
{
208-
text = ''
209-
${vmstxt}
210-
'';
211-
};
212-
213204
environment = {
214205
systemPackages =
215206
(rmDesktopEntries [

modules/reference/appvms/business.nix

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,15 @@
132132
icon = "losslesscut";
133133
command = "losslesscut --enable-features=UseOzonePlatform --ozone-platform=wayland";
134134
}
135-
];
135+
]
136+
++ (lib.optionals config.ghaf.reference.services.wireguard-gui [
137+
{
138+
name = "Wireguard BusinessVM";
139+
description = "WireGuard VPN configuration tool";
140+
icon = "airvpn";
141+
command = "wireguard-gui-launcher";
142+
}
143+
]);
136144
extraModules = [
137145

138146
{
@@ -148,6 +156,7 @@
148156
imports = [
149157
../services/pac/pac.nix
150158
../services/firewall/firewall.nix
159+
../services/wireguard-gui/wireguard-gui.nix
151160
];
152161

153162
# Enable Proxy Auto-Configuration service for the browser
@@ -160,6 +169,10 @@
160169

161170
# Enable firewall and allow access to TII VPN
162171
firewall.enable = true;
172+
173+
# Enable WireGuard GUI
174+
wireguard-gui.enable = config.ghaf.reference.services.wireguard-gui;
175+
163176
};
164177
}
165178
];

0 commit comments

Comments
 (0)