add NordVPN

This commit is contained in:
Franek 2025-03-22 17:43:17 +01:00
parent 42751bf2f0
commit b3fd523e63
7 changed files with 201 additions and 141 deletions

View File

@ -1,59 +1,42 @@
{ mkDerivation,
lib,
stdenv,
fetchFromGitHub,
python3,
qtbase,
qttools,
wrapQtAppsHook,
git,
which,
}:
{ pkgs, stdenv, fetchFromGitHub }:
let
myPython = python3.withPackages (pkgs: with pkgs; [ pyqt5 pyqtwebengine pyusb crcmod pyserial ]);
in
mkDerivation rec {
pname = "ddt4all";
version = "1.0.0"; # Replace with the actual version if necessary
python = pkgs.python3.withPackages (pkgs: with pkgs; [ pyqt5 pyqtwebengine pyusb crcmod pyserial ]);
in stdenv.mkDerivation rec {
pname = "ddt4all";
version = "1.0.0";
src = fetchFromGitHub {
owner = "cedricp";
repo = "ddt4all";
rev = "master";
sha256 = "sha256-EX7cobgxM8/o4cRmfMMDSYG9X9Av6zmoWlSv1nzfl5o=";
};
src = fetchFromGitHub {
owner = "cedricp";
repo = "ddt4all";
rev = "master";
sha256 = "sha256-1D1fnnFWxBV6sZkfbBc7a/7DSZvZtXeEYM9fRsQ7Ag0=";
};
# If necessary, add patches to the source
# patches = [ ./some_patch.patch ];
nativeBuildInputs = [
python
pkgs.libsForQt5.qt5.wrapQtAppsHook
pkgs.libsForQt5.qt5.qttools
pkgs.which
];
nativeBuildInputs = [
myPython
wrapQtAppsHook # This is useful for Qt apps
qttools # Required for Qt applications
which # For locating binaries (e.g., python3)
];
propagatedBuildInputs = [
python
pkgs.libsForQt5.qt5.qtbase
pkgs.libsForQt5.qt5.qttools
];
propagatedBuildInputs = [
myPython
qtbase
qttools
];
configurePhase = ''
runHook preConfigure
wrapQtAppsHook
runHook postConfigure
'';
#makeFlags = [ "PREFIX=$(out)" ];
runScript = ''
# Set up environment for running the app
export LD_LIBRARY_PATH=${qtbase}/lib:${myPython}/lib:$LD_LIBRARY_PATH
buildPhase = "";
if [ ! -d ".venv" ]; then
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
else
source .venv/bin/activate
fi
# Run the application
python3 main.py
'';
installPhase = ''
mkdir -p $out/bin
cp -r * $out/
ln -s $out/main.py $out/bin/ddt4all
'';
}

39
derivations/nordvpn.nix Normal file
View File

@ -0,0 +1,39 @@
{ pkgs }:
pkgs.stdenv.mkDerivation rec {
pname = "nordvpn";
version = "3.16.1";
src = pkgs.fetchurl {
url = "https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/nordvpn_${version}_amd64.deb";
sha256 = "sha256-rj1QuCOztgVmReCn24HIEDAyLR7GlsUDJK0GZl+ERXM=";
};
nativeBuildInputs = with pkgs; [ libidn2 libxml2 autoPatchelfHook dpkg ];
unpackPhase = ''
dpkg -x $src unpacked
'';
installPhase = ''
mkdir -p $out/
sed -i 's;ExecStart=.*;;g' unpacked/usr/lib/systemd/system/nordvpnd.service
cp -r unpacked/* $out/
mv $out/usr/* $out/
mv $out/sbin/nordvpnd $out/bin/
rm -r $out/sbin
rm $out/var/lib/nordvpn/openvpn
ln -s ${pkgs.openvpn}/bin/openvpn $out/var/lib/nordvpn/openvpn
'';
meta = with pkgs.lib; {
description = "NordVPN: Best VPN service. Online security starts with a click";
downloadPage = "https://nordvpn.com/download/";
homepage = "https://nordvpn.com/";
license = licenses.unfree;
maintainers = with maintainers; [ juliosueiras ];
platforms = platforms.linux;
};
}

75
flake.lock generated
View File

@ -8,11 +8,11 @@
]
},
"locked": {
"lastModified": 1736677288,
"narHash": "sha256-Vj3WOLy6o6Zf44Rwg9eLqNRQPlVoDrQ89tsef3l3990=",
"lastModified": 1738087375,
"narHash": "sha256-GLyNtU9A2VN22jNRHZ2OXuFfTJLh8uEVVt+ftsKUX0c=",
"owner": "Aylur",
"repo": "ags",
"rev": "90db9b9fecc0f4228440d83107c6c745a35e7d77",
"rev": "a6a7a0adb17740f4c34a59902701870d46fbb6a4",
"type": "github"
},
"original": {
@ -44,16 +44,19 @@
"nixpkgs": "nixpkgs_2",
"ny": "ny",
"sf-arabic": "sf-arabic",
"sf-armenian": "sf-armenian",
"sf-compact": "sf-compact",
"sf-georgian": "sf-georgian",
"sf-hebrew": "sf-hebrew",
"sf-mono": "sf-mono",
"sf-pro": "sf-pro"
},
"locked": {
"lastModified": 1732029343,
"narHash": "sha256-sAOEhA/vfyAKggwyI3PNy2xeNzb/USZl4YNpeSzMRBI=",
"lastModified": 1740961576,
"narHash": "sha256-9L6d3owtajM72YvUOpK1zYle2nM0BpsuopbF9lm9lJs=",
"owner": "Lyndeno",
"repo": "apple-fonts.nix",
"rev": "714767021b57d0d30de35eb90e4b748fbbb9c99f",
"rev": "4df58996ed654f6ce9b71b41c1826484c6870739",
"type": "github"
},
"original": {
@ -70,11 +73,11 @@
]
},
"locked": {
"lastModified": 1735172721,
"narHash": "sha256-rtEAwGsHSppnkR3Qg3eRJ6Xh/F84IY9CrBBLzYabalY=",
"lastModified": 1737670815,
"narHash": "sha256-ZCxxshGN7XooabArcoGkYSNx5yVunqjKJi2aTv6cznI=",
"owner": "aylur",
"repo": "astal",
"rev": "6c84b64efc736e039a8a10774a4a1bf772c37aa2",
"rev": "127e9cdcbf173846a3c40ddc0abfbb038df48042",
"type": "github"
},
"original": {
@ -111,11 +114,11 @@
]
},
"locked": {
"lastModified": 1736373539,
"narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=",
"lastModified": 1739757849,
"narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "bd65bc3cde04c16755955630b344bc9e35272c56",
"rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe",
"type": "github"
},
"original": {
@ -143,11 +146,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1731319897,
"narHash": "sha256-PbABj4tnbWFMfBp6OcUK5iGy1QY+/Z96ZcLpooIbuEI=",
"lastModified": 1740828860,
"narHash": "sha256-cjbHI+zUzK5CPsQZqMhE3npTyYFt9tJ3+ohcfaOF/WM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "dc460ec76cbff0e66e269457d7b728432263166c",
"rev": "303bd8071377433a2d8f76e684ec773d70c5b642",
"type": "github"
},
"original": {
@ -159,11 +162,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1736549401,
"narHash": "sha256-ibkQrMHxF/7TqAYcQE+tOnIsSEzXmMegzyBWza6uHKM=",
"lastModified": 1741862977,
"narHash": "sha256-prZ0M8vE/ghRGGZcflvxCu40ObKaB+ikn74/xQoNrGQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1dab772dd4a68a7bba5d9460685547ff8e17d899",
"rev": "cdd2ef009676ac92b715ff26630164bb88fec4e0",
"type": "github"
},
"original": {
@ -207,6 +210,18 @@
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg"
}
},
"sf-armenian": {
"flake": false,
"locked": {
"narHash": "sha256-rRoDkbNMYkzOHZmQm96Zv80TZvRlAeoxkv4pMHP5nUg=",
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Armenian.dmg"
},
"original": {
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Armenian.dmg"
}
},
"sf-compact": {
"flake": false,
"locked": {
@ -219,6 +234,30 @@
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg"
}
},
"sf-georgian": {
"flake": false,
"locked": {
"narHash": "sha256-IevVNOC28IiR45YfI3PsZzXLMRxuB5u7UiE53Zn6tRU=",
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Georgian.dmg"
},
"original": {
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Georgian.dmg"
}
},
"sf-hebrew": {
"flake": false,
"locked": {
"narHash": "sha256-Dw84kYwMpCtKKKqm8cZcQ9TZ7GayU5MO7W0LJw0Rcwk=",
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Hebrew.dmg"
},
"original": {
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Hebrew.dmg"
}
},
"sf-mono": {
"flake": false,
"locked": {

26
flake.nix.bak Normal file
View File

@ -0,0 +1,26 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
apple-fonts.url = "github:Lyndeno/apple-fonts.nix";
apple-emoji.url = "github:oxcl/apple-emoji-nix";
ags = {
url = "github:Aylur/ags";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
fingerprint-sensor = {
url = "github:ahbnr/nixos-06cb-009a-fingerprint-sensor/24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, ... }: {
nixosConfigurations = import ./hosts { inherit self; };
};
}

View File

@ -24,14 +24,6 @@
];
services.gvfs.enable = true;
services.tlp = {
enable = true;
settings = {
START_CHARGE_THRESH_BAT0 = 40;
STOP_CHARGE_THRESH_BAT0 = 80;
};
};
services.geoclue2 = {
enableWifi = true;
geoProviderUrl = "https://api.beacondb.net/v1/geolocate";
@ -52,5 +44,4 @@
};
services.blueman.enable = true;
hardware.enableAllFirmware = true;
}

View File

@ -1,70 +1,51 @@
{ pkgs, inputs, ... }:
let
ddt4all = pkgs.stdenv.mkDerivation {
name = "ddt4all";
src = pkgs.fetchFromGitHub {
owner = "cedricp";
repo = "ddt4all";
rev = "master";
sha256 = "sha256-EX7cobgxM8/o4cRmfMMDSYG9X9Av6zmoWlSv1nzfl5o=";
};
nativeBuildInputs = [ pkgs.git ];
buildInputs = [ pkgs.stdenv.cc.cc.lib ];
{
imports = [
inputs.ags.homeManagerModules.default
];
home.packages = with pkgs; [
hyprland hyprlock hypridle hyprshot wl-clipboard cliphist swww
pywal pywalfox-native
installPhase = ''
mkdir -p $out/DDT4ALL
cp -r * $out/DDT4ALL
'';
};
in {
imports = [ inputs.ags.homeManagerModules.default ];
home = {
activation.ddt4all = pkgs.lib.mkAfter ''
if [ ! -d "$HOME/DDT4ALL" ]; then
cp -r ${ddt4all}/DDT4ALL $HOME/DDT4ALL
fi
'';
packages = with pkgs; [
hyprland hyprlock hypridle hyprshot wl-clipboard cliphist swww
pywal pywalfox-native
(python3.withPackages (py: with py; [
pywayland
]))
(python3.withPackages (py: with py; [
pywayland
]))
(pkgs.callPackage ../../derivations/nordvpn.nix {})
(pkgs.callPackage ../../derivations/ddt4all.nix {})
(birdtray.overrideAttrs (_: {
cmakeFlags = [ "-DOPT_THUNDERBIRD_CMDLINE=${thunderbird}/bin/thunderbird" ];
}))
(birdtray.overrideAttrs (_: {
cmakeFlags = [ "-DOPT_THUNDERBIRD_CMDLINE=${thunderbird}/bin/thunderbird" ];
}))
jq
bluez
dconf
starship
firefox-beta-bin
thunderbird-bin
youtube-music
fluffychat
libreoffice-qt6-fresh
gimp
vscodium git nodejs
fprintd
cups
fish
anydesk
fastfetch
greetd.greetd greetd.tuigreet
playerctl
adwaita-icon-theme
android-tools
filezilla
bitwarden-desktop
davinci-resolve
mpv
wget
sshfs
];
};
jq
bluez
dconf
starship
element-desktop
firefox-beta-bin
thunderbird-bin
youtube-music
libreoffice-qt6-fresh
gimp
vscodium git nodejs postgresql
fprintd
cups
fish
anydesk
fastfetch
greetd.greetd greetd.tuigreet
playerctl
adwaita-icon-theme
android-tools
filezilla
bitwarden-desktop
davinci-resolve
mpv
wget
sshfs
];
}

View File

@ -16,11 +16,12 @@
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-backgroundremoval
obs-source-clone
obs-pipewire-audio-capture
#advanced-scene-switcher
obs-tuna
obs-move-transition
droidcam-obs
waveform
wlrobs
];