This repository was archived by the owner on Feb 6, 2022. It is now read-only.
forked from djanatyn/ssbm-nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
88 lines (74 loc) · 2.77 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.09";
slippi-desktop.url = "github:project-slippi/slippi-desktop-app";
slippi-desktop.flake = false;
};
description = "Nix expressions for Super Smash Bros. Melee players.";
outputs = { self, nixpkgs, nix, slippi-desktop, ... }@inputs:
let
supportedSystems = [ "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in {
overlay = final: prev: import ./overlay.nix { inherit slippi-desktop final prev; };
apps = forAllSystems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in {
slippi-netplay = {
type = "app";
program = "${pkgs.slippi-netplay}/bin/slippi-netplay";
};
slippi-playback = {
type = "app";
program = "${pkgs.slippi-playback}/bin/slippi-playback";
};
});
packages = forAllSystems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in {
wiimms-iso-tools = pkgs.wiimms-iso-tools;
slippi-netplay = pkgs.slippi-netplay;
slippi-playback = pkgs.slippi-playback;
gecko = pkgs.gecko;
powerpc-eabi-assembling = pkgs.powerpc-eabi-assembling;
slippi-netplay-chat-edition = pkgs.slippi-netplay-chat-edition;
gcmtool = pkgs.gcmtool;
projectplus-sdcard = pkgs.projectplus-sdcard;
projectplus-config = pkgs.projectplus-config;
/* dat-texture-wizard = pkgs.dat-texture-wizard; */
});
nixosModule = { pkgs, config, ... }:
let
cfg = config.ssbm;
in with nixpkgs.lib; {
options = {
ssbm.overlay.enable = mkEnableOption "Activate the package overlay.";
ssbm.cache.enable = mkEnableOption "Turn on cache.";
ssbm.gcc.oc-kmod.enable = mkEnableOption "Turn on overclocking kernel module.";
ssbm.gcc.rules.enable = mkEnableOption "Turn on rules for your gamecube controller adapter.";
ssbm.gcc.rules.rules = mkOption {
default = readFile ./gcc.rules;
type = types.lines;
description = "To be appended to services.udev.extraRules if gcc.rules.enable is set.";
};
};
config = {
nixpkgs.overlays = [ (mkIf cfg.overlay.enable self.overlay) ];
services.udev.extraRules = mkIf cfg.gcc.rules.enable cfg.gcc.rules.rules;
boot.extraModulePackages = mkIf cfg.gcc.oc-kmod.enable [
pkgs.linuxPackages.gcadapter-oc-kmod
];
nix = mkIf cfg.cache.enable {
binaryCaches = [ "https://ssbm-nix.cachix.org" ];
binaryCachePublicKeys = [ "ssbm-nix.cachix.org-1:YN104LKAWaKQIecOphkftXgXlYZVK/IRHM1UD7WAIew=" ];
};
};
};
};
}