-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
123 lines (108 loc) · 3.49 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 = "bjw-s Nix Flake";
inputs = {
# Nixpkgs and unstable
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# Flake-parts - Simplify Nix Flakes with the module system
#
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
# home-manager - home user+dotfile manager
# https://github.com/nix-community/home-manager
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# nix-darwin - nix modules for darwin (MacOS)
# https://github.com/LnL7/nix-darwin
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
# sops-nix - secrets with mozilla sops
# https://github.com/Mic92/sops-nix
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# VSCode community extensions
# https://github.com/nix-community/nix-vscode-extensions
nix-vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions";
inputs.nixpkgs.follows = "nixpkgs";
};
# Catppuccin - Soothing pastel theme for Nix
# https://github.com/catppuccin/nix
catppuccin = {
url = "github:catppuccin/nix/v1.0.2";
};
# nix-inspect - Interactive tui for inspecting nix configs
# https://github.com/bluskript/nix-inspect
nix-inspect = {
url = "github:bluskript/nix-inspect";
};
# Talhelper - A tool to help create Talos Kubernetes clusters
# https://github.com/budimanjojo/talhelper
talhelper = {
url = "github:budimanjojo/talhelper";
};
};
outputs = {
flake-parts,
...
} @inputs:
let
mkPkgsWithSystem =
system:
import inputs.nixpkgs {
inherit system;
overlays = builtins.attrValues (import ./overlays { inherit inputs; });
config.allowUnfree = true;
};
mkSystemLib = import ./lib/mkSystem.nix {inherit inputs mkPkgsWithSystem;};
in
flake-parts.lib.mkFlake {inherit inputs;} {
systems = [
"aarch64-darwin"
"x86_64-linux"
];
perSystem = {
system,
inputs',
pkgs,
...
}:
{
# override pkgs used by everything in `perSystem` to have my overlays
_module.args.pkgs = mkPkgsWithSystem system;
# accessible via `nix build .#<name>`
packages = import ./pkgs {inherit pkgs inputs;};
};
imports = [];
flake = {
nixosConfigurations = {
gladius = mkSystemLib.mkNixosSystem "x86_64-linux" "gladius";
};
darwinConfigurations = {
bernd-macbook = mkSystemLib.mkDarwinSystem "aarch64-darwin" "bernd-macbook";
infraworkz = mkSystemLib.mkDarwinSystem "aarch64-darwin" "infraworkz";
};
# Convenience output that aggregates the outputs for home, nixos.
# Also used in ci to build targets generally.
ciSystems = let
nixos =
inputs.nixpkgs.lib.genAttrs
(builtins.attrNames inputs.self.nixosConfigurations)
(attr: inputs.self.nixosConfigurations.${attr}.config.system.build.toplevel);
darwin =
inputs.nixpkgs.lib.genAttrs
(builtins.attrNames inputs.self.darwinConfigurations)
(attr: inputs.self.darwinConfigurations.${attr}.system);
in
nixos // darwin;
};
};
}