-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
82 lines (73 loc) · 2.56 KB
/
flake.nix
File metadata and controls
82 lines (73 loc) · 2.56 KB
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
{
description = "suddenlyGiovanni's dotfiles - nix-darwin system configuration and development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
mac-app-util.url = "github:hraban/mac-app-util";
onepassword-shell-plugins.url = "github:1Password/shell-plugins";
# Dendritic infrastructure (ADR-007)
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
import-tree.url = "github:vic/import-tree";
};
outputs = inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["aarch64-darwin"];
imports =
[
inputs.flake-parts.flakeModules.modules
./modules/options.nix
./modules/hosts.nix
./modules/host-assembly.nix
]
++ (inputs.import-tree ./modules/features).imports;
# Per-system outputs (formatter, devShells, checks)
perSystem = {pkgs, ...}: {
# Formatter for `nix fmt`
formatter = pkgs.alejandra;
# CI-ready checks — `nix flake check` runs all of these
checks = {
formatting = pkgs.runCommand "check-formatting" {} ''
cd ${./.}
${pkgs.alejandra}/bin/alejandra --check . 2>&1
touch $out
'';
lint = pkgs.runCommand "check-lint" {} ''
cd ${./.}
${pkgs.statix}/bin/statix check .
touch $out
'';
deadcode = pkgs.runCommand "check-deadcode" {} ''
cd ${./.}
${pkgs.deadnix}/bin/deadnix --fail .
touch $out
'';
};
# Development shell for working on these dotfiles
# Activated automatically via direnv (use flake)
devShells.default = pkgs.mkShell {
name = "dotfiles-dev";
packages = with pkgs; [
# Nix tools
nixd # Nix language server
nil # Alternative Nix LSP
alejandra # Nix formatter
statix # Nix linter
deadnix # Find dead code in Nix
# Utilities
just # Task runner
nvd # Nix package version diff tool
];
shellHook = ''
echo "dotfiles development shell"
echo ""
just --list
'';
};
};
};
}