-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathflake.nix
More file actions
60 lines (55 loc) · 1.73 KB
/
flake.nix
File metadata and controls
60 lines (55 loc) · 1.73 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
# Nix Flake exporting an attribute to build the thesis in a Nix derivation.
# Also exporting a dev shell to get the relevant tooling to build the
# thesis traditionally on the shell.
#
# Make sure to configure your `nix` with:
# `experimental-features = flakes nix-command`
# in order to be able to use flakes.
#
# Feel free to ping "@phip1611" for maintenance guidance and questions.
{
description = "TUD OS LaTex Template";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs =
{ self, ... }@inputs:
let
# Systems definition for dev shells and exported packages,
# independent of the NixOS configurations and modules defined here. We
# just use "every system" here to not restrict any user. However, it
# likely happens that certain packages don't build for/under certain
# systems.
systems = inputs.nixpkgs.lib.systems.flakeExposed;
forAllSystems =
function:
inputs.nixpkgs.lib.genAttrs systems (system: function inputs.nixpkgs.legacyPackages.${system});
in
{
devShells.default = forAllSystems (
pkgs:
pkgs.mkShell {
inputsFrom = [ self.packages.${pkgs.system}.thesis ];
packages = with pkgs; [
nixfmt-rfc-style
];
}
);
# for `nix fmt .`
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
packages =
forAllSystems (
pkgs:
let
texToolchain = pkgs.callPackage ./nix/tex-toolchain.nix { };
thesis = pkgs.callPackage ./nix/thesis.nix {
tex = texToolchain;
};
in
{
default = thesis;
inherit thesis;
}
);
};
}