-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
executable file
·106 lines (83 loc) · 3 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
{
nixConfig = {
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
nur.inputs.nixpkgs.follows = "nixpkgs";
nixos-hardware.url = "github:NixOS/nixos-hardware";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
nixos-wsl.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
catppuccin.url = "github:catppuccin/nix";
pre-commit-hooks.url = "github:cachix/git-hooks.nix";
# Additional applications
ghostty.url = "github:ghostty-org/ghostty";
ghostty.inputs.nixpkgs-unstable.follows = "nixpkgs";
vt-nvim.url = "github:vincent-thomas/nvim";
vt-nvim.inputs.nixpkgs.follows = "nixpkgs";
# Other stuff
vt-wallpapers.url = "github:vincent-thomas/wallpapers";
vt-wallpapers.flake = false;
};
outputs =
inputs@{ self, ... }:
let
inherit (inputs.nixpkgs) lib;
inherit (self) outputs;
utils = import ./utils.nix { inherit lib inputs outputs; };
vtLib = utils.genVTLib ./lib;
myStuff = vtLib.genFromPkgsDir {
dir = ./pkgs;
extraOverlays = [
inputs.nur.overlays.default
inputs.vt-nvim.overlays.default
];
};
forAllPkgs = vtLib.forAllPkgs { inherit (myStuff) overlays; };
treefmtEval = forAllPkgs (pkgs: inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
in
{
inherit (myStuff) packages;
nixosConfigurations = import ./hosts {
inherit inputs vtLib;
inherit (myStuff) overlays;
};
nixosModules.default = import ./modules/nixos { inherit vtLib; };
homeManagerModules.default = import ./modules/home { inherit vtLib; };
formatter = forAllPkgs (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
checks = vtLib.forAllSystems (system: {
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks.treefmt = {
enable = true;
package = outputs.formatter.${system};
};
};
});
devShells = forAllPkgs (pkgs: {
default = pkgs.mkShell {
NIX_CONFIG = "extra-experimental-features = nix-command flakes";
inherit (self.checks.${pkgs.system}.pre-commit-check) shellHook;
buildInputs = self.checks.${pkgs.system}.pre-commit-check.enabledPackages;
packages = with pkgs; [
just
sops
];
};
});
};
}