-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
102 lines (91 loc) · 2.7 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
{
description = "My Dotfiles";
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
"https://hyprland.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
};
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nvf.url = "github:notashelf/nvf";
pre-commit-hooks.url = "github:cachix/git-hooks.nix";
hyprland.url = "github:hyprwm/Hyprland";
zen-browser.url = "github:0xc000022070/zen-browser-flake";
};
outputs = inputs @ {
self,
nixpkgs,
...
}: let
system = "x86_64-linux";
username = "thamenato";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
mkReadFolder = dir: let
fileList = builtins.readDir dir;
mkFileAttr = name: type:
if type == "regular"
then "${dir}/${name}"
else null;
in
pkgs.lib.filterAttrs (_name: value: value != null) (pkgs.lib.mapAttrs mkFileAttr fileList);
mkHome = {hostName}: (inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
zen-browser = inputs.zen-browser.packages."${system}".default;
backgrounds = mkReadFolder ./misc/backgrounds;
};
modules = [
inputs.nvf.homeManagerModules.default
./home-manager
./hosts/${hostName}
];
});
in {
checks = {
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
check-added-large-files.enable = true;
check-yaml.enable = true;
deadnix.enable = true;
detect-private-keys.enable = true;
end-of-file-fixer.enable = true;
alejandra.enable = true;
trim-trailing-whitespace.enable = true;
};
};
};
devShell."${system}" = pkgs.mkShell {
inherit (self.checks.pre-commit-check) shellHook;
buildInputs = self.checks.pre-commit-check.enabledPackages;
packages = with pkgs; [
# tools
just
yq
nixpkgs-fmt
sops
# language server
yaml-language-server
nil
];
};
homeConfigurations = {
"${username}@zoth-ommog" = mkHome {hostName = "zoth-ommog";};
"${username}@kassogtha" = mkHome {hostName = "kassogtha";};
"${username}@ythogtha" = mkHome {hostName = "ythogtha";};
"${username}@thales-precision-5490" = mkHome {hostName = "thales-precision-5490";};
};
};
}