-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
123 lines (121 loc) · 4.1 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 = "Radosław Szamszur NixOS configurations";
nixConfig = {
bash-prompt = ''\n\[\033[1;32m\][nix-develop:\w]\$\[\033[0m\] '';
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"rszamszur-nixos.cachix.org-1:OOpiY87os0SYfYVQmLzxTvvn2sEoeOkKzaeguQCZVyQ="
];
extra-substituters = [
"https://nix-community.cachix.org"
"https://rszamszur-nixos.cachix.org"
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
fastapi-mvc.url = "github:fastapi-mvc/fastapi-mvc";
rcu.url = "github:rszamszur/pkg-rcu";
b3.url = "github:rszamszur/b3-flake";
};
outputs = { self, nixpkgs, home-manager, sops-nix, flake-parts, fastapi-mvc, rcu, b3 }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.flake-parts.flakeModules.easyOverlay
./shells/flake-module.nix
./pkgs/flake-module.nix
./images/flake-module.nix
];
systems = [ "x86_64-linux" "aarch64-linux" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
packages = {
fastapi-mvc = fastapi-mvc.packages.${system}.default;
rcu = rcu.packages.${system}.rcu;
b3 = b3.packages.${system}.default;
};
overlayAttrs = {
inherit (config.packages) fastapi-mvc rcu b3;
};
};
flake = {
templates = {
default = {
path = ./templates/default;
description = ''
A minimal flake using flake-parts.
'';
};
poetry2nix = {
path = ./templates/poetry2nix;
description = ''
Base flake for Python projects using poetry2nix.
'';
};
};
overlays = {
poetry2nix = import ./overlays/poetry2nix.nix;
};
nixosConfigurations = {
fenrir = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
nixpkgs.overlays = [ self.overlays.default ];
}
./hosts/fenrir/hardware-configuration.nix
./hosts/fenrir/configuration.nix
inputs.home-manager.nixosModules.home-manager
];
};
draugr = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
nixpkgs.overlays = [ self.overlays.default ];
}
./hosts/draugr/hardware-configuration.nix
./hosts/draugr/configuration.nix
inputs.home-manager.nixosModules.home-manager
];
};
tyr = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
nixpkgs.overlays = [ self.overlays.default ];
}
./hosts/tyr/hardware-configuration.nix
./hosts/tyr/configuration.nix
inputs.home-manager.nixosModules.home-manager
inputs.sops-nix.nixosModules.sops
];
};
installation-iso = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
self.nixosModules.cache
({ pkgs, ... }: {
environment.systemPackages = [ pkgs.git ];
my.cache.enable = true;
})
];
};
};
nixosModules = builtins.listToAttrs (map
(module: {
name = builtins.replaceStrings [ ".nix" ] [ "" ] (builtins.baseNameOf module);
value = module;
})
(import ./modules { lib = inputs.nixpkgs.lib; }).imports);
};
};
}