-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
82 lines (63 loc) · 2.89 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
{
description = "A template that shows all standard flake outputs";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
inputs.c-hello.url = "github:NixOS/templates?dir=c-hello";
inputs.c-hello.inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-web-server.url = "github:NixOS/templates?dir=rust-web-server";
inputs.rust-web-server.inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-bundle.url = "github:NixOS/bundlers";
inputs.nix-bundle.inputs.nixpkgs.follows = "nixpkgs";
# Work-in-progress: refer to parent/sibling flakes in the same repository
# inputs.c-hello.url = "path:../c-hello";
outputs = all@{ self, c-hello, rust-web-server, nixpkgs, nix-bundle, ... }: {
# Utilized by `nix flake check`
checks.x86_64-linux.test = c-hello.checks.x86_64-linux.test;
# Utilized by `nix build .`
defaultPackage.x86_64-linux = c-hello.defaultPackage.x86_64-linux;
# Utilized by `nix build`
packages.x86_64-linux.hello = c-hello.packages.x86_64-linux.hello;
# Utilized by `nix run .#<name>`
apps.x86_64-linux.hello = {
type = "app";
program = c-hello.packages.x86_64-linux.hello;
};
# Utilized by `nix bundle -- .#<name>` (should be a .drv input, not program path?)
bundlers.x86_64-linux.example = nix-bundle.bundlers.x86_64-linux.toArx;
# Utilized by `nix bundle -- .#<name>`
defaultBundler.x86_64-linux = self.bundlers.x86_64-linux.example;
# Utilized by `nix run . -- <args?>`
defaultApp.x86_64-linux = self.apps.x86_64-linux.hello;
# Utilized for nixpkgs packages, also utilized by `nix build .#<name>`
legacyPackages.x86_64-linux.hello = c-hello.defaultPackage.x86_64-linux;
# Default overlay, for use in dependent flakes
overlay = final: prev: { };
# # Same idea as overlay but a list or attrset of them.
overlays = { exampleOverlay = self.overlay; };
# Default module, for use in dependent flakes. Deprecated, use nixosModules.default instead.
nixosModule = { config, ... }: { options = {}; config = {}; };
# Same idea as nixosModule but a list or attrset of them.
nixosModules = { exampleModule = self.nixosModule; };
# Used with `nixos-rebuild --flake .#<hostname>`
# nixosConfigurations."<hostname>".config.system.build.toplevel must be a derivation
nixosConfigurations.example = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
({...}: {
fileSystems."/" = {
device = "/dev/sda1";
fsType = "ext4";
};
boot.loader.grub.device = "/dev/sda";
})] ;
};
# Utilized by Hydra build jobs
hydraJobs.example.x86_64-linux = self.defaultPackage.x86_64-linux;
# Utilized by `nix flake init -t <flake>`
defaultTemplate = {
path = c-hello;
description = "template description";
};
# Utilized by `nix flake init -t <flake>#<name>`
templates.example = self.defaultTemplate;
};
}