-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
flake.nix
48 lines (40 loc) · 1.29 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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;
};
};
}