-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathflake.nix
More file actions
150 lines (147 loc) · 4.23 KB
/
Copy pathflake.nix
File metadata and controls
150 lines (147 loc) · 4.23 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 = "My dotfiles managed with nix as a flake";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
tokyonight-nix.url = "github:mrjones2014/tokyonight.nix";
vpn-confinement.url = "github:Maroka-chan/VPN-Confinement";
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";
};
hytale-launcher = {
url = "github:JPyke3/hytale-launcher-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
jj-gh = {
url = "github:mrjones2014/jj-gh";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.follows = "treefmt-nix";
};
};
nix-auto-follow = {
url = "github:fzakaria/nix-auto-follow";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:nix-darwin/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
vicinae = {
url = "github:vicinaehq/vicinae";
inputs = {
nixpkgs.follows = "nixpkgs";
systems.follows = "flake-utils/systems";
};
};
zen-browser = {
url = "github:0xc000022070/zen-browser-flake/beta";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
};
outputs =
inputs@{
self,
nixpkgs,
flake-utils,
treefmt-nix,
nix-darwin,
home-manager,
agenix,
nix-auto-follow,
...
}:
let
myLib = import ./lib {
inherit nixpkgs;
inherit agenix;
inherit home-manager;
inherit nix-darwin;
inherit inputs;
};
inherit (myLib) mkHost;
inherit (myLib) mkDarwinHost;
in
{
nixosConfigurations = {
mikoshi = mkHost {
name = "mikoshi";
isServer = true;
homePath = ./home-manager/server.nix;
};
edgerunner = mkHost {
name = "edgerunner";
};
kabuki = mkHost {
name = "kabuki";
isThinkpad = true;
};
};
darwinConfigurations = {
corpo = mkDarwinHost {
name = "corpo";
isWorkMac = true;
};
aldecaldo = mkDarwinHost {
name = "aldecaldo";
};
};
}
// flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" ] (
system:
let
inherit (nixpkgs) lib;
pkgs = nixpkgs.legacyPackages.${system};
checksForConfigs =
configs: extract:
lib.attrsets.filterAttrs (_: p: p.system == system) (lib.attrsets.mapAttrs (_: extract) configs);
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
formatter = treefmtEval.config.build.wrapper;
in
{
packages.book = pkgs.callPackage ./docs { };
inherit formatter;
checks =
(checksForConfigs self.nixosConfigurations (c: c.config.system.build.toplevel))
// (checksForConfigs self.darwinConfigurations (c: c.system))
// {
formatting = treefmtEval.config.build.check self;
lint-nix = pkgs.callPackage ./checks/lint-nix.nix { inherit pkgs self; };
lint-lua = pkgs.callPackage ./checks/lint-lua.nix { inherit pkgs self; };
nix-flake-inputs = pkgs.callPackage ./checks/flake-inputs.nix {
inherit lib;
inherit (pkgs) stdenv;
nix-auto-follow = nix-auto-follow.packages.${system}.default;
};
};
devShells = {
default = pkgs.mkShell {
packages = [
formatter
pkgs.mdbook
nix-auto-follow.packages.${system}.default
];
};
ci = pkgs.mkShell {
packages = [
pkgs.nix-fast-build
nix-auto-follow.packages.${system}.default
];
};
};
}
);
}