-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
150 lines (141 loc) · 4.13 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
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 = "Nix system configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
stehessel = {
url = "github:stehessel/nix-overlay";
inputs = {
flake-parts.follows = "flake-parts";
nixpkgs.follows = "nixpkgs";
};
};
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs = {
flake-parts.follows = "flake-parts";
nixpkgs.follows = "nixpkgs";
rust-overlay.follows = "rust";
};
};
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
rust = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
nixpkgs,
flake-parts,
...
}: let
overlays = {
stehessel-overlay = inputs.stehessel.overlays.default;
rust-overlay = inputs.rust.overlays.default;
# k9s-overlay = _: prev: {
# k9s = prev.k9s.overrideAttrs (_: {
# doCheck = false;
# });
# };
# python-overlay = _: prev: rec {
# python3 = prev.python3.override {
# packageOverrides = _: prev: {
# pytest-httpserver = prev.pytest-httpserver.overridePythonAttrs (_: {
# doCheck = false;
# });
# };
# };
# python3Packages = python3.pkgs;
# };
};
nixpkgsConfig = {
config.allowUnfree = true;
overlays = inputs.nixpkgs.lib.attrValues overlays;
};
flakeRegistry = {
nix.registry.nixpkgs.flake = inputs.nixpkgs;
nix.registry.stehessel.flake = self;
};
in
flake-parts.lib.mkFlake {inherit inputs;}
({withSystem, ...}: {
systems = inputs.nixpkgs.lib.systems.flakeExposed;
imports = [
inputs.pre-commit-hooks.flakeModule
];
perSystem = {
config,
pkgs,
...
}: {
devShells.default = pkgs.mkShell {
inputsFrom = [
config.pre-commit.devShell
];
};
pre-commit.settings.imports = [./nix/pre-commit.nix];
};
flake = {
nixosConfigurations.thinkpad = withSystem "x86_64-linux" (
_:
inputs.nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = {
inherit inputs nixpkgsConfig;
pkgs-stable = import inputs.nixpkgs-stable {inherit system;};
};
modules = [
{nixpkgs = nixpkgsConfig;}
inputs.lanzaboote.nixosModules.lanzaboote
./systems/thinkpad
flakeRegistry
{programs.hyprland.enable = true;}
inputs.nix-index-database.nixosModules.nix-index
inputs.home-manager.nixosModules.home-manager
];
}
);
darwinConfigurations.shesselm-mac = withSystem "x86_64-darwin" (
_:
inputs.darwin.lib.darwinSystem rec {
system = "x86_64-darwin";
specialArgs = {
inherit inputs nixpkgsConfig;
pkgs-stable = import inputs.nixpkgs-stable {inherit system;};
};
modules = [
{nixpkgs = nixpkgsConfig;}
./systems/darwin
flakeRegistry
inputs.nix-index-database.darwinModules.nix-index
inputs.home-manager.darwinModules.home-manager
];
}
);
};
});
}