forked from nix-community/robotnix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
88 lines (76 loc) · 2.38 KB
/
Copy pathflake.nix
File metadata and controls
88 lines (76 loc) · 2.38 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
description = "Build Android (AOSP) using Nix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
androidPkgs.url = "github:tadfisher/android-nixpkgs/stable";
flake-compat.url = "github:nix-community/flake-compat";
nixpkgs-nixfmt-old.url = "github:NixOS/nixpkgs/c7ab75210cb8cb16ddd8f290755d9558edde7ee1";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
androidPkgs,
flake-compat,
...
}@inputs:
let
pkgs = import ./pkgs/default.nix { inherit inputs; };
treefmtModule = inputs.treefmt-nix.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs = {
nixfmt = {
enable = true;
package = inputs.nixpkgs-nixfmt-old.legacyPackages.x86_64-linux.nixfmt-rfc-style;
};
shfmt.enable = true;
shellcheck.enable = true;
ruff-format.enable = true;
ruff-check.enable = true;
rustfmt.enable = true;
};
};
in
rec {
# robotnixSystem evaluates a robotnix configuration
lib.robotnixSystem =
configuration:
import ./default.nix {
inherit configuration pkgs;
};
templates.default = {
path = ./template;
description = "A basic robotnix configuration flake";
};
nixosModule = import ./nixos; # Contains all robotnix nixos modules
nixosModules.attestation-server = import ./nixos/attestation-server/module.nix;
packages.x86_64-linux = {
manual = (import ./docs { inherit pkgs; }).manual;
gitRepo = pkgs.gitRepo;
};
devShells.x86_64-linux = rec {
default = pkgs.callPackage ./develop.nix { };
repo2nix = pkgs.mkShell {
name = "repo2nix";
nativeBuildInputs = with pkgs; [
cargo
rustc
pkg-config
openssl
(callPackage ./pkgs/fetchgit/nix-prefetch-git.nix { })
];
};
};
examples = nixpkgs.lib.genAttrs [ "lineageos" "grapheneos" ] (
name: lib.robotnixSystem (./. + "/template/${name}.nix")
);
formatter.x86_64-linux = treefmtModule.config.build.wrapper;
checks.x86_64-linux = {
formatting = treefmtModule.config.build.check self;
};
};
}