-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathflake.nix
123 lines (120 loc) · 4.3 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{
description = "Nix Flake to simplify running Star Citizen";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
umu = {
url = "git+https://github.com/LovingMelody/umu-launcher/?dir=packaging\/nix&submodules=1&";
# Unreleased changed to umu in nixpkgs, we won't override it
# inputs.nixpkgs.follows = "nixpkgs";
};
nix-gaming = {
url = "github:fufexan/nix-gaming";
inputs.nixpkgs.follows = "nixpkgs";
inputs.umu.follows = "umu";
};
nix-github-actions = {
url = "github:nix-community/nix-github-actions";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
systems.url = "github:nix-systems/default";
};
outputs =
inputs@{ flake-parts, self, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
./modules
./overlays.nix
inputs.flake-parts.flakeModules.easyOverlay
inputs.treefmt-nix.flakeModule
];
systems = [ "x86_64-linux" ];
flake = {
githubActions = inputs.nix-github-actions.lib.mkGithubMatrix {
checks =
(inputs.nixpkgs.lib.getAttrs [ "x86_64-linux" ] self.checks)
// (inputs.nixpkgs.lib.getAttrs [ "x86_64-linux" ] self.packages);
};
};
perSystem =
{
config,
system,
pkgs,
...
}:
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
overlayAttrs = config.packages;
packages =
let
inherit (inputs.nixpkgs.lib) optional warn;
in
{
xwayland-patched = pkgs.xwayland.overrideAttrs (p: {
patches =
(p.patches or [ ])
++ optional (
!builtins.elem ./patches/ge-xwayland-pointer-warp-fix.patch (p.patches or [ ])
) ./patches/ge-xwayland-pointer-warp-fix.patch;
});
star-citizen-helper = pkgs.callPackage ./pkgs/star-citizen-helper { };
inherit (inputs.umu.packages.${system}) umu-launcher;
dxvk-gplasync = warn "This package will be removed in a future update and is now just an alias for dxvk" pkgs.dxvk;
star-citizen = inputs.nix-gaming.packages.${system}.star-citizen.override {
umu = self.packages.${system}.umu-launcher;
};
star-citizen-umu = self.packages.${system}.star-citizen.override { useUmu = true; };
lug-helper =
let
pkg = pkgs.callPackage ./pkgs/lug-helper { };
in
# We only use the local lug-helper if nixpkgs doesn't have it
# And if the nixpkgs version isnt older than local
if (builtins.hasAttr "lug-helper" pkgs) then
if (inputs.nixpkgs.lib.strings.versionOlder pkgs.lug-helper.version pkg.version) then
pkg
else
pkgs.lug-helper
else
pkg;
inherit (inputs.nix-gaming.packages.${system}) winetricks-git;
};
treefmt = {
# Project root
projectRootFile = "flake.nix";
# Terraform formatter
programs = {
yamlfmt.enable = true;
nixfmt.enable = true;
deno.enable = true;
deadnix = {
enable = true;
# Can break callPackage if this is set to false
no-lambda-pattern-names = true;
};
statix.enable = true;
rustfmt.enable = true;
beautysh.enable = true;
};
settings.formatter = {
deadnix.excludes = [ "npins/default.nix" ];
nixfmt.excludes = [ "npins/default.nix" ];
deno.excludes = [ "npins/default.nix" ];
statix.excludes = [ "npins/default.nix" ];
yamlfmt.excludes = [ "npins/sources.json" ];
};
};
};
};
}