-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
144 lines (130 loc) · 3.93 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
136
137
138
139
140
141
142
143
144
{
description = "DoctorDalek1963's NixOS flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
# nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nur = {
url = "github:nix-community/nur";
inputs.nixpkgs.follows = "nixpkgs";
};
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-2.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:nix-community/impermanence";
nixos-hardware.url = "github:NixOS/nixos-hardware";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Personal projects for home server
tic-tac-toe = {
url = "github:DoctorDalek1963/tic-tac-toe";
inputs.nixpkgs.follows = "nixpkgs";
};
winter-wonderlights = {
url = "github:DoctorDalek1963/winter-wonderlights";
inputs.nixpkgs.follows = "nixpkgs";
};
wordle = {
url = "github:DoctorDalek1963/wordle";
inputs.nixpkgs.follows = "nixpkgs";
};
# home-manager stuff
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
lintrans.url = "github:DoctorDalek1963/lintrans";
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim-config = {
url = "github:DoctorDalek1963/nixvim-config";
inputs.nixpkgs.follows = "nixpkgs"; # Only while nixvim-config uses stable nixpkgs
};
xremap = {
url = "github:xremap/nix-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
flake-parts,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
flake.nixosConfigurations = import ./defs.nix {
inherit
self
nixpkgs
inputs
;
};
imports = [
inputs.pre-commit-hooks.flakeModule
];
systems = ["x86_64-linux" "aarch64-linux"];
perSystem = {
config,
system,
...
}: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
nativeBuildInputs =
(with pkgs; [
# Secrets
age
sops
# Build ISO with justfile
just
fd
nix-output-monitor
jq
cachix
])
++ [inputs.disko.packages."${system}".disko];
shellHook = ''
${config.pre-commit.installationScript}
'';
};
# See https://flake.parts/options/pre-commit-hooks-nix and
# https://github.com/cachix/git-hooks.nix/blob/master/modules/hooks.nix
# for all the available hooks and options
pre-commit = {
# This repo contains some large images and patch files with
# necessary whitespace "errors", so we don't want to run the
# pre-commit hooks on every file when checking the flake
check.enable = false;
settings.hooks = {
check-added-large-files.enable = true;
check-merge-conflicts.enable = true;
check-toml.enable = true;
check-vcs-permalinks.enable = true;
check-yaml.enable = true;
end-of-file-fixer.enable = true;
trim-trailing-whitespace = {
enable = true;
excludes = [''.+\.patch$''];
};
alejandra.enable = true;
deadnix.enable = true;
statix.enable = true;
};
};
};
};
}