aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-02 13:04:37 +0000
committerFuwn <[email protected]>2024-10-02 13:38:02 +0000
commitb98ca4721e37fb3d45e9a092984b84a3b662c401 (patch)
tree46db64d6ea99e5b1b80776b391cb1fd7c2a4b626
parentdocs(readme): update fields (diff)
downloadpia.nix-b98ca4721e37fb3d45e9a092984b84a3b662c401.tar.xz
pia.nix-b98ca4721e37fb3d45e9a092984b84a3b662c401.zip
feat(flake.nix): multi-system nixos module
-rw-r--r--flake.lock34
-rw-r--r--flake.nix15
2 files changed, 45 insertions, 4 deletions
diff --git a/flake.lock b/flake.lock
index cce64f9..ec27125 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,5 +1,23 @@
{
"nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1726560853,
+ "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
"nixpkgs": {
"locked": {
"lastModified": 1727672256,
@@ -18,8 +36,24 @@
},
"root": {
"inputs": {
+ "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
}
},
"root": "root",
diff --git a/flake.nix b/flake.nix
index 882908c..0eca50d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,9 +1,16 @@
{
- inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
+ inputs = {
+ flake-utils.url = "github:numtide/flake-utils";
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
+ };
outputs =
- { nixpkgs, self }:
{
+ flake-utils,
+ nixpkgs,
+ self,
+ }:
+ flake-utils.lib.eachDefaultSystem (system: {
nixosModules.default =
{ config, ... }:
{
@@ -29,7 +36,7 @@
config = nixpkgs.lib.mkIf config.services.pia.enable {
services.openvpn.servers =
let
- resources = nixpkgs.legacyPackages.x86_64-linux.fetchzip {
+ resources = nixpkgs.legacyPackages.${system}.fetchzip {
name = "pia-vpn-config";
url = "https://www.privateinternetaccess.com/openvpn/openvpn.zip";
sha256 = "ZA8RS6eIjMVQfBt+9hYyhaq8LByy5oJaO9Ed+x8KtW8=";
@@ -68,5 +75,5 @@
);
};
};
- };
+ });
}