-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
59 lines (49 loc) · 1.41 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
{
description = "OS as a code";
inputs = {
# Official NixOS package sources
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# Settings optimization for different hardware
hardware.url = "github:NixOS/nixos-hardware/master";
# User environment management
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# Secrets management
sops-nix = {
url = "github:mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Private secrets
secrets = {
url = "git+ssh://[email protected]/kamil-krawczyk/.secrets.git?ref=main&shallow=1";
flake = false;
};
};
outputs = { self, ... } @ inputs:
let
inherit (self) outputs;
systems = [ "x86_64-linux" ];
forEachSystem = pkgs:
inputs.nixpkgs.lib.genAttrs systems
(system: pkgs (import inputs.nixpkgs { inherit system; }));
mkSystem = config:
inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [ ./hosts/${config} ];
};
in
{
formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt);
# Host configuration
nixosConfigurations = {
# Private laptop
goku = mkSystem "goku";
# Work desktop
brolly = mkSystem "brolly";
# Work laptop
vegeta = mkSystem "vegeta";
};
};
}