-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
65 lines (56 loc) · 1.68 KB
/
flake.nix
File metadata and controls
65 lines (56 loc) · 1.68 KB
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
{
description = "RAGS - raf's (fork of) AGS ";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
# «https://github.com/nix-systems/nix-systems»
systems.url = "github:nix-systems/default-linux";
};
outputs = {
nixpkgs,
systems,
self,
}: let
genSystems = nixpkgs.lib.genAttrs (import systems);
pkgsForEach = nixpkgs.legacyPackages;
in {
homeManagerModules = {
ags = import ./nix/hm-module.nix self;
default = self.homeManagerModules.ags;
};
packages = genSystems (system: let
inherit (pkgsForEach.${system}) callPackage;
# Version + short revision from the flake to identify exact revision
# RAGS was built from.
rev = self.shortRev or self.dirtyShortRev or "dirty";
version = (builtins.replaceStrings ["\n"] [""] (builtins.readFile ./version)) + "-${rev}";
in {
ags = callPackage ./nix/package.nix {inherit version;};
default = self.packages.${system}.ags;
agsNoTypes = self.packages.${system}.ags.override {buildTypes = false;};
});
devShells = genSystems (system: let
pkgs = pkgsForEach.${system};
in {
default = pkgs.mkShell {
name = "ags";
inputsFrom = [self.packages.${system}.agsNoTypes];
packages = [pkgs.nodejs-slim];
};
});
formatter = genSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in
pkgs.writeShellApplication {
name = "nix3-fmt-wrapper";
runtimeInputs = [
pkgs.alejandra
pkgs.fd
];
text = ''
fd "$@" -t f -e nix -x alejandra -q '{}'
'';
}
);
};
}