-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
116 lines (113 loc) · 3.39 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
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
flake-compat.url = "github:edolstra/flake-compat";
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 = "git+https://github.com/hyprwm/hyprland?submodules=1";
# inputs.nixpkgs.follows = "nixpkgs";
# inputs.systems.follows = "systems";
# };
# hyprspace = {
# url = "github:kzdkm/hyprspace";
# inputs.hyprland.follows = "hyprland";
# };
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
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";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
inputs.flake-compat.follows = "flake-compat";
};
};
outputs =
inputs@{
self,
nixpkgs,
systems,
treefmt-nix,
...
}:
let
system = "x86_64-linux";
user = "david";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
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
;
};
};
}