-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02ba545
commit 4458bc6
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
description = "Easily zwift on linux"; | ||
|
||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
|
||
outputs = | ||
{ nixpkgs, self }: | ||
let | ||
pkgs = nixpkgs.legacyPackages.x86_64-linux; | ||
in | ||
{ | ||
nixosModules = { | ||
zwift = | ||
{ config, lib, ... }: | ||
{ | ||
options.programs.zwift.enable = lib.mkEnableOption "zwift on linux"; | ||
|
||
config = lib.mkIf config.programs.zwift.enable { | ||
virtualisation.podman.enable = true; | ||
environment.systemPackages = [ self.packages.x86_64-linux.zwift ]; | ||
}; | ||
}; | ||
default = self.nixosModules.zwift; | ||
}; | ||
|
||
packages.x86_64-linux = { | ||
zwift = pkgs.stdenv.mkDerivation rec { | ||
pname = "zwift"; | ||
version = "0-unstable"; | ||
|
||
src = ./.; | ||
|
||
nativeBuildInputs = [ pkgs.copyDesktopItems ]; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
install -Dm755 zwift.sh -T $out/bin/${pname} | ||
install -Dm644 $src/assets/hicolor/scalable/apps/Zwift\ Logogram.svg \ | ||
-T $out/share/icons/hicolor/scalable/apps/zwift.svg | ||
runHook postInstall | ||
''; | ||
|
||
desktopItems = [ "assets/Zwift.desktop" ]; | ||
}; | ||
default = self.packages.x86_64-linux.zwift; | ||
}; | ||
}; | ||
} |