-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
123 lines (117 loc) · 3.27 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
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
{
description = "NixOS flake-based config by github.com/jbott";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-search-cli = {
url = "github:peterldowns/nix-search-cli";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
flake-utils,
home-manager,
nix-darwin,
nix-search-cli,
nixpkgs,
treefmt-nix,
} @ inputs: let
inherit (flake-utils.lib) eachDefaultSystem;
inherit (nix-darwin.lib) darwinSystem;
inherit (nixpkgs.lib) nixosSystem;
allowUnfreeModule = {nixpkgs.config.allowUnfree = true;};
currentSystemNameModule = name: {_module.args.currentSystemName = name;};
overlays = [
(import ./overlay)
(self: super: {
nix-search-cli = nix-search-cli.packages.${self.system}.default;
})
];
nixpkgsOverlaysModule = {
nixpkgs = {inherit overlays;};
};
allSystemsOutput = eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system overlays;};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./tools/treefmt.nix;
treefmt = treefmtEval.config.build.wrapper;
in {
formatter = treefmt;
checks = {
formatting = treefmtEval.config.build.check self;
};
packages = with pkgs; {
inherit deploy-nixos;
};
devShells = {
default = pkgs.mkShell {
buildInputs = with pkgs; [
deploy-nixos
nvd
treefmt
];
};
};
});
in
{
darwinConfigurations = {
jmbp = darwinSystem {
system = "aarch64-darwin";
modules = [
(currentSystemNameModule "jmbp")
nixpkgsOverlaysModule
home-manager.darwinModules.default
./common
./common/darwin
./home-manager
./machines/jmbp
];
specialArgs = {inherit inputs;};
};
};
nixosConfigurations = {
Only-Slightly-Bent = nixosSystem {
system = "x86_64-linux";
modules = [
(currentSystemNameModule "Only-Slightly-Bent")
nixpkgsOverlaysModule
home-manager.nixosModules.default
./common
./common/linux
./home-manager
./machines/Only-Slightly-Bent
];
specialArgs = {inherit inputs;};
};
Lapsed-Pacifist = nixosSystem {
system = "aarch64-linux";
modules = [
(currentSystemNameModule "Lapsed-Pacifist")
allowUnfreeModule
nixpkgsOverlaysModule
home-manager.nixosModules.default
./common
./common/linux
./home-manager
./machines/Lapsed-Pacifist
];
specialArgs = {inherit inputs;};
};
};
}
// allSystemsOutput;
}