-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
94 lines (80 loc) · 2.29 KB
/
flake.nix
File metadata and controls
94 lines (80 loc) · 2.29 KB
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
{
description = "Raf's NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim/nixos-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko/v1.13.0";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
inputs.darwin.follows = ""; # saves resources on linux
};
nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
nixpkgs,
nixpkgs-unstable,
home-manager,
disko,
agenix,
nixos-mailserver,
...
}@inputs:
let
lib = nixpkgs.lib.extend (
final: _prev:
import ./lib ({
inherit inputs;
lib = final;
})
);
dependencyModules = [
home-manager.nixosModules.home-manager
disko.nixosModules.disko
agenix.nixosModules.default
nixos-mailserver.nixosModule
];
userConfig = {
username = "raf";
name = "Raf";
hashedPassword = lib.mkDefault "$y$j9T$22ptNC3YRhTx7OgmwpMuU0$EQUgjVjGlRkfwYnwFp0x/Dnn1yjW1XH3vocdBnNCPyB";
};
system = "x86_64-linux";
in
{
nixosConfigurations = lib.rso.mkHosts ./hosts {
extraArgs = hostname: {
# pkgs is already a default arg passed to NixOS modules, but we also
# want to have a pkgs-unstable equivalent
pkgs-unstable = import nixpkgs-unstable { inherit system; };
profiles = lib.rso.mkProfiles ./profiles;
secrets = lib.rso.mkSecrets ./secrets hostname;
};
extraModules =
dependencyModules
++ (lib.rso.mkModules ./modules)
++ [
{ rso.me = userConfig; }
];
};
formatter = {
${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
};
};
}