-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
139 lines (117 loc) · 3.38 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
{
description = "kanwren's NixOS configurations and other Nix tools";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
catppuccin.url = "github:catppuccin/nix";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk = {
url = "github:nmattia/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self
, nixpkgs
, lix-module
, home-manager
, nix-darwin
, nixos-hardware
, nixos-generators
, catppuccin
, fenix
, naersk
}@inputs:
let
defaultSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = f:
nixpkgs.lib.genAttrs
defaultSystems
(system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in
f pkgs);
in
{
nixosConfigurations = {
hecate = import ./hosts/hecate/host.nix {
inherit self nixpkgs lix-module home-manager nixos-hardware catppuccin;
};
};
darwinConfigurations = {
caspar = import ./hosts/caspar/host.nix {
inherit self nixpkgs lix-module nix-darwin home-manager catppuccin;
};
};
# Nixpkgs overlays
overlays = {
default = nixpkgs.lib.composeManyExtensions [
fenix.overlays.default
naersk.overlay
(final: prev: import ./pkgs { pkgs = final; })
];
installers = final: prev: final.callPackages ./installers { inherit nixos-generators; };
} // import ./overlays;
packages = forAllSystems (pkgs: {
inherit (pkgs)
catppuccin-twemoji-hearts
envtpl
frum
generate-heart-emoji
jj-helpers
lipsum
slides-full
tfenv
wd-fish;
});
nixosModules = import ./modules;
darwinModules = import ./darwin-modules;
hmModules = import ./hm-modules;
# custom templates
templates = import ./templates;
devShells = forAllSystems (pkgs: {
default = pkgs.mkShellNoCC {
packages = [
pkgs.just
# formatting
pkgs.lefthook
self.formatter.${pkgs.system}
];
};
});
formatter = forAllSystems (pkgs: pkgs.nixpkgs-fmt);
checks = forAllSystems (pkgs: {
check-format = pkgs.runCommand "check-format" { buildInputs = [ self.formatter.${pkgs.system} ]; } ''
nixpkgs-fmt --check ${./.}
touch "$out"
'';
});
};
nixConfig = {
extra-substituters = [ "https://kanwren.cachix.org" ];
extra-trusted-public-keys = [ "kanwren.cachix.org-1:uMS7ZtVOdof/PU46BAyehmNDD/P6qCGhYEvYP7X8YfE=" ];
};
}