-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
135 lines (132 loc) · 4.13 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
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
flake-compat.url = "github:edolstra/flake-compat";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.flake-compat.follows = "flake-compat";
inputs.gitignore.follows = "gitignore";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "github:hyprwm/hyprland";
# Do not override Hyprland’s nixpkgs input unless you know what you are doing.
# Doing so will make the cache useless, since you’re building from a different Nixpkgs commit.
# inputs.nixpkgs.follows = "nixpkgs";
# inputs.systems.follows = "systems";
inputs.pre-commit-hooks.follows = "git-hooks";
};
iio-hyprland = {
url = "github:JeanSchoeller/iio-hyprland";
inputs.nixpkgs.follows = "hyprland/nixpkgs";
inputs.systems.follows = "hyprland/systems";
};
hyprgrass = {
url = "github:horriblename/hyprgrass";
inputs.hyprland.follows = "hyprland";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
url = "github:nix-community/nur";
inputs.nixpkgs.follows = "nixpkgs";
inputs.treefmt-nix.follows = "treefmt-nix";
inputs.flake-parts.follows = "flake-parts";
};
search = {
url = "github:nuschtos/search";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
inputs.flake-compat.follows = "flake-compat";
inputs.devshell.follows = "devshell";
inputs.treefmt-nix.follows = "treefmt-nix";
inputs.git-hooks.follows = "git-hooks";
inputs.nuschtosSearch.follows = "search";
inputs.flake-parts.follows = "flake-parts";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
base16 = {
url = "github:SenchoPens/base16.nix?ref=refs/pull/19/head";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-utils.follows = "flake-utils";
inputs.systems.follows = "systems";
inputs.base16.follows = "base16";
};
ucodenix = {
url = "github:e-tho/ucodenix";
};
};
outputs =
inputs@{
self,
nixpkgs,
systems,
treefmt-nix,
...
}:
let
system = "x86_64-linux";
user = "david";
pkgs = import nixpkgs {
inherit system;
};
inherit (nixpkgs) lib;
# Small tool to iterate over each systems
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
# Eval the treefmt modules from ./treefmt.nix
treefmtEval = eachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
in
{
# for `nix fmt`
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
# for `nix flake check`
checks = eachSystem (pkgs: {
formatting = treefmtEval.${pkgs.system}.config.build.check self;
});
nixosConfigurations = import ./hosts {
inherit
lib
inputs
pkgs
user
system
;
};
};
}