-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
60 lines (53 loc) · 1.64 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
{
description = "My NixOS and home-manager configurations";
inputs = {
# most flake inputs are indirectly referenced,
# so they're fetched from the local registry;
# deduplication;
disko.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nix.inputs.flake-compat.follows = "flake-compat";
nix.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
# avoid recursive inputs rendering;
nix-registry.flake = false;
secrets.flake = false;
};
outputs = inputs @ {
disko,
flake-compat,
flake-parts,
home-manager,
impermanence,
nix,
nixos-hardware,
nixpkgs,
sops-nix,
systems,
treefmt-nix,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [treefmt-nix.flakeModule];
flake = {lib, ...}: {
homeConfigurations = import ./home-manager {inherit inputs lib;};
nixosConfigurations = import ./nixos/hosts {inherit inputs lib;};
nixosModules = import ./modules/nixos {inherit lib;};
};
perSystem.treefmt.config = {
# programs.alejandra.enable = true;
programs.nixfmt.enable = true;
programs.prettier.enable = true;
projectRootFile = "flake.nix";
settings.formatter = {
prettier.includes = ["*.lock"];
nixfmt.excludes = ["flake.nix"];
# TODO: use alejandra for flake.nix;
};
};
systems = import systems;
};
}