-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
123 lines (100 loc) · 3.2 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
{
description = "My Nix configuration";
nixConfig = {
extra-substituters = [
"https://hyprland.cachix.org"
"https://nix-gaming.cachix.org"
"https://cuda-maintainers.cachix.org"
];
extra-trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:nix-community/impermanence";
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.2";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-colors.url = "github:misterio77/nix-colors";
nix-gaming = {
url = "github:fufexan/nix-gaming";
inputs.nixpkgs.follows = "nixpkgs";
};
firefox-onebar = {
url = "git+https://codeberg.org/Freeplay/Firefox-Onebar";
flake = false;
};
desktop-flake = {
url = "github:stephenreynolds/desktop-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
nvim-config = {
url = "github:stephenreynolds/nvim";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser.url = "github:0xc000022070/zen-browser-flake";
};
outputs = inputs@{ self, nixpkgs, ... }:
let
inherit (self) outputs;
inherit (lib.my) mapModules mapModulesRec mapHosts;
system = "x86_64-linux";
mkPkgs = pkgs: extraOverlays:
import pkgs {
inherit system;
config.allowUnfree = true;
overlays = extraOverlays ++ (builtins.attrValues self.overlays);
};
pkgs = mkPkgs nixpkgs [ self.overlays.default ];
lib = nixpkgs.lib.extend (final: prev: {
my = import ./lib {
inherit pkgs inputs outputs;
lib = final;
};
});
in
{
overlays = (mapModules ./overlays import) // {
default = final: prev: { my = self.packages.${system}; };
};
packages."${system}" = mapModules ./pkgs (p: pkgs.callPackage p { });
templates = lib.pipe ./templates [
builtins.readDir
(builtins.mapAttrs (name: _: {
description = name;
path = ./templates/${name};
}))
];
nixosModules = { flake = import ./.; } // mapModulesRec ./modules import;
nixosConfigurations = mapHosts ./hosts { };
devShells."${system}".default = import ./shell.nix { inherit pkgs; };
formatter."${system}" = pkgs.nixfmt;
checks."${system}" =
let
inherit (lib) getExe;
mkCheck = linter:
pkgs.runCommand "lint" { } ''
cd ${self}
${linter} 2>&1
touch $out
'';
in
{ statix = mkCheck "${getExe pkgs.statix} check ${self}"; };
};
}