-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
150 lines (130 loc) · 4.01 KB
/
flake.nix
File metadata and controls
150 lines (130 loc) · 4.01 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
{
description = "Géza's NixOs flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
wrapper-modules = {
url = "github:BirdeeHub/nix-wrapper-modules";
inputs.nixpkgs.follows = "nixpkgs";
};
niri-nix = {
url = "git+https://codeberg.org/BANanaD3V/niri-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
goose-shell = {
url = "git+https://codeberg.org/DynamicGoose/goose-shell";
inputs.nixpkgs.follows = "nixpkgs";
};
mobile-nixos = {
url = "github:mwlaboratories/mobile-nixos/sdm845-bleeding-edge"; # TODO: use upstream in the future
flake = false;
};
};
outputs =
{
self,
nixpkgs,
...
}@inputs:
let
lib = import ./lib {
inherit self inputs lib;
};
in
{
nixosConfigurations = lib.genHosts {
desktop-gezaa = {
username = "gezaa";
userDescription = "Géza Ahsendorf";
};
fw-gezaa = {
username = "gezaa";
userDescription = "Géza Ahsendorf";
};
tp-gezaa = {
username = "gezaa";
userDescription = "Géza Ahsendorf";
};
hp-gezaa = {
username = "gezaa";
userDescription = "Géza Ahsendorf";
};
dl-gezaa = {
username = "gezaa";
userDescription = "Géza Ahsendorf";
};
# mobile-nixos for oneplus-enchilada
mobile-gezaa = {
system = "aarch64-linux";
# modules differ from normal desktop
includeModules = [
(import "${inputs.mobile-nixos}/lib/configuration.nix" { device = "oneplus-enchilada"; })
"${self}/mobile.nix"
"${self}/hosts/mobile-gezaa"
];
username = "gezaa";
userDescription = "Géza Ahsendorf";
};
usb-gezaa = {
username = "gezaa";
userDescription = "Géza Ahsendorf";
};
};
# Development shells in ./shells
devShells = lib.eachSystem (
system:
let
pkgs = lib.pkgsFor.${system};
in
import ./shells { inherit pkgs; }
);
# Easily run as VM with `nix run`
apps = lib.eachSystem (system: rec {
default = usb-gezaa;
desktop-gezaa = lib.mkVMApp "desktop-gezaa";
fw-gezaa = lib.mkVMApp "fw-gezaa";
tp-gezaa = lib.mkVMApp "tp-gezaa";
hp-gezaa = lib.mkVMApp "hp-gezaa";
dl-gezaa = lib.mkVMApp "dl-gezaa";
mobile-gezaa = lib.mkVMApp "mobile-gezaa";
usb-gezaa = lib.mkVMApp "usb-gezaa";
# generate option documentation using https://github.com/Thunderbottom/nix-options-doc
gen-docs = {
type = "app";
program = "${lib.pkgsFor.${system}.writeShellScript "gen-docs"
"nix run github:Thunderbottom/nix-options-doc -- -p ${self} -o options.md"
}";
};
});
# build mobile images
packages = lib.eachSystem (
system:
let
pkgs = lib.pkgsFor.${system};
in
{
mobile-images = {
all = self.nixosConfigurations.mobile-gezaa.config.mobile.outputs.android.android-fastboot-images;
boot = self.nixosConfigurations.mobile-gezaa.config.mobile.outputs.android.android-bootimg;
system = self.nixosConfigurations.mobile-gezaa.config.mobile.outputs.generatedFilesystems.rootfs;
};
pkgs = pkgs.lib.packagesFromDirectoryRecursive {
callPackage = pkgs.callPackage;
directory = ./pkgs;
};
wrappers =
let
pkgs-with-wrappers = pkgs.lib.mergeAttrs pkgs {
inputs = inputs;
system = system;
};
in
pkgs.lib.packagesFromDirectoryRecursive {
callPackage = pkgs.lib.callPackageWith pkgs-with-wrappers;
directory = ./wrappers;
};
}
);
# Library functions for external use
lib = lib;
};
}