From 275cc237e807a842f8099c74bf1a6371df7a0611 Mon Sep 17 00:00:00 2001 From: illustris Date: Sat, 25 Feb 2023 02:43:33 +0530 Subject: [PATCH] use vpnpass from flake --- configuration.nix | 2 +- flake.lock | 21 +++++++++++++++++++++ flake.nix | 7 ++++++- scripts/vpnpass | 15 --------------- 4 files changed, 28 insertions(+), 17 deletions(-) delete mode 100755 scripts/vpnpass diff --git a/configuration.nix b/configuration.nix index 5e56c59..d252c20 100644 --- a/configuration.nix +++ b/configuration.nix @@ -39,6 +39,7 @@ fatrace file gdb git gnumake htop + illustris.vpnpass iotop iperf jq killall @@ -59,7 +60,6 @@ youtube-dl (pass.withExtensions (exts: [ exts.pass-otp ])) ((pkgs.callPackage ./packages/passcol) { }) - (writeScriptBin "vpnpass" (builtins.readFile ./scripts/vpnpass)) ]; }; diff --git a/flake.lock b/flake.lock index 080c0e8..c1110de 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,26 @@ "type": "github" } }, + "illustris": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1677273080, + "narHash": "sha256-0xvYx6GlbvZhIm/IL7iJD7tKCU77dYbdulq3Af8nHpQ=", + "owner": "illustris", + "repo": "flake", + "rev": "f7035476ecfae1af3a1ea38b2171256ac15cfa76", + "type": "github" + }, + "original": { + "owner": "illustris", + "repo": "flake", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1676300157, @@ -40,6 +60,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "illustris": "illustris", "nixpkgs": "nixpkgs" } }, diff --git a/flake.nix b/flake.nix index 6712fdb..a4fe23b 100644 --- a/flake.nix +++ b/flake.nix @@ -7,9 +7,13 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + illustris = { + url = "github:illustris/flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, home-manager, ... }: { + outputs = { self, nixpkgs, home-manager, illustris, ... }: { nixosConfigurations = { desktop = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; @@ -18,6 +22,7 @@ home-manager.nixosModule {nix.registry.np.flake = nixpkgs;} {environment.etc.flake.source = self;} + {nixpkgs.overlays = [ illustris.overlays.default ];} ]; }; }; diff --git a/scripts/vpnpass b/scripts/vpnpass deleted file mode 100755 index b4d4ccb..0000000 --- a/scripts/vpnpass +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env expect -set conf [lindex $argv 0]; -set user [lindex $argv 1]; -set pass_pw [lindex $argv 2]; -set pass_otp [lindex $argv 3]; -spawn sudo openvpn --config $conf -expect "Enter Auth Username:" -send "$user\n" -expect "Enter Auth Password:" -set pw [exec pass "$pass_pw"] -send "$pw\n" -expect "Enter Google Authenticator Code" -set otp [exec pass otp "$pass_otp"] -send "$otp\n" -interact