-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
148 lines (145 loc) · 4.82 KB
/
flake.nix
File metadata and controls
148 lines (145 loc) · 4.82 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
{
description = "My system configuration";
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
# "http://wallfacer.curl-boga.ts.net:7080/main"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
# "main:2AjPdIsbKyoTGuw+4x2ZXMUT/353CXosW9pdbTQtjqw="
];
};
inputs = {
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-darwin = {
url = "github:nix-darwin/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-on-droid = {
url = "github:nix-community/nix-on-droid";
inputs.nixpkgs.follows = "nixpkgs";
};
osbm-nvim.url = "github:osbm/osbm-nvim";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
raspberry-pi-nix = {
url = "github:nix-community/raspberry-pi-nix";
};
# colmena = {
# url = "github:zhaofengli/colmena";
# inputs.nixpkgs.follows = "nixpkgs";
# };
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:nix-community/impermanence";
mobile-nixos = {
url = "github:mobile-nixos/mobile-nixos";
flake = false;
};
simple-nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
inputs.nixpkgs.follows = "nixpkgs";
};
jovian-nixos = {
url = "github:Jovian-Experiments/Jovian-NixOS";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
nix-on-droid,
nix-darwin,
treefmt-nix,
...
}@inputs:
let
inherit (self) outputs;
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems f;
makePkgs = system: import nixpkgs { inherit system; };
makeNixosConfig =
configName:
nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [ ./hosts/nixos/${configName}/configuration.nix ];
};
nixosConfigNames = builtins.attrNames (builtins.readDir ./hosts/nixos);
makeNixOnDroidConfig =
configName:
nix-on-droid.lib.nixOnDroidConfiguration {
extraSpecialArgs = { inherit inputs outputs; };
pkgs = import nixpkgs { system = "aarch64-linux"; };
modules = [ ./hosts/nixOnDroidHosts/${configName}/configuration.nix ];
};
nixOnDroidConfigNames = builtins.attrNames (builtins.readDir ./hosts/nixOnDroidHosts);
treefmtEval = forAllSystems (system: treefmt-nix.lib.evalModule (makePkgs system) ./treefmt.nix);
in
{
nixosConfigurations = nixpkgs.lib.genAttrs nixosConfigNames makeNixosConfig;
nixOnDroidConfigurations = nixpkgs.lib.genAttrs nixOnDroidConfigNames makeNixOnDroidConfig;
darwinConfigurations.prometheus = nix-darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [ ./hosts/darwinHosts/prometheus/configuration.nix ];
specialArgs = { inherit inputs outputs; };
};
lib = import ./lib { inherit (nixpkgs) lib; };
formatter = forAllSystems (system: treefmtEval.${system}.config.build.wrapper);
checks = forAllSystems (system: {
formatting = treefmtEval.${system}.config.build.check self;
});
nixosModules.default = ./modules/nixos;
homeManagerModules.default = ./modules/home-manager;
# packages = forAllSystems (
# system:
# let
# makeNixosConfigWithSystemOverride =
# configName:
# nixpkgs.lib.nixosSystem {
# specialArgs = { inherit inputs outputs; };
# modules = [
# ./hosts/nixos/${configName}/configuration.nix
# { nixpkgs.hostPlatform = nixpkgs.lib.mkForce system; }
# ];
# };
# dotfilesMachineNames = [
# "ymir"
# "pochita"
# "tartarus"
# "wallfacer"
# ];
# in
# builtins.listToAttrs (
# map (name: {
# name = "${name}-dotfiles";
# value = (makeNixosConfigWithSystemOverride name).config.home-manager.users.osbm.home-files;
# }) dotfilesMachineNames
# )
# );
};
}