doc: update NixOS installation instructions

This commit is contained in:
Kevin Yue committed 2026-06-20 22:11:06 +08:00
1 parent fe55d11fc4
commit ae4cbedd3b
1 file changed
+16 -20
+16 -20
View File
@@ -214,7 +214,7 @@ This repository includes a flake for NixOS integration.
#### Installation Steps #### Installation Steps
1. Add the flake to your `flake.nix`: Add the flake input and package to your `flake.nix`:
```nix ```nix
{ {
@@ -223,32 +223,28 @@ This repository includes a flake for NixOS integration.
globalprotect-openconnect.url = "github:yuezk/GlobalProtect-openconnect"; globalprotect-openconnect.url = "github:yuezk/GlobalProtect-openconnect";
}; };
outputs = { nixpkgs, ... }@inputs: { outputs = { self, nixpkgs, globalprotect-openconnect, ... }:
nixosConfigurations.<your-host> = nixpkgs.lib.nixosSystem { let
specialArgs = { inherit inputs; }; system = "x86_64-linux"; # or "aarch64-linux" for ARM64
hostname = "<your-host>";
in {
nixosConfigurations.${hostname} = nixpkgs.lib.nixosSystem {
inherit system;
modules = [ modules = [
./configuration.nix ./configuration.nix
];
};
};
}
```
2. Add the package to your `configuration.nix`:
```nix
{ pkgs, inputs, ... }:
{ {
# ... other configurations environment.systemPackages = [
environment.systemPackages = with pkgs; [ globalprotect-openconnect.packages.${system}.default
# ... other packages
inputs.globalprotect-openconnect.packages.${pkgs.stdenv.hostPlatform.system}.default
]; ];
} }
];
};
};
}
``` ```
3. Apply the changes: Apply:
```bash ```bash
sudo nixos-rebuild switch sudo nixos-rebuild switch