-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
114 lines (96 loc) · 2.8 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
{
description = "hyprflake";
inputs = {
# websurfx.url = "github://github:neon-mmd/websurfx";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix.url = "github:numtide/treefmt-nix";
git-hooks.url = "github:cachix/git-hooks.nix";
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
home-manager,
flake-parts,
treefmt-nix,
nixos-hardware,
git-hooks,
...
} @ inputs: let
inherit (self) outputs;
stateVersion = "24.11";
helper = import ./lib {inherit inputs outputs stateVersion;};
in
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.treefmt-nix.flakeModule
# inputs.git-hooks.flakeModule
];
flake = {
nixosConfigurations = {
"msi-gp62" = helper.mkNixos {
hostname = "msi-gp62";
desktop = "hyprland";
hostPlatform = "x86_64-linux";
};
# - nix build .#nixosConfigurations.{iso-console|iso-gnome}.config.system.build.isoImage
"iso-hyprland" = helper.mkNixos {
hostname = "iso-hyprland";
desktop = "hyprland";
hostPlatform = "x86_64-linux";
};
};
homeConfigurations = {
"vii@msi-gp62" = helper.mkHome {
hostname = "msi-gp62";
};
};
};
systems = [
# systems for which you want to build the `perSystem` attributes
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem = {
pkgs,
config,
system,
...
}: let
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
pre-commit-run = git-hooks.lib.${system}.run {
src = ./.;
hooks = import ./pre-commit.nix;
};
in {
formatter = pkgs.alejandra;
# for `nix flake check`
checks = {
formatting = treefmtEval.config.build.check self;
pre-commit = pre-commit-run;
};
treefmt = import ./treefmt.nix {inherit pkgs;};
devShells.default = pkgs.mkShell {
buildInputs = [
# pkgs.agenix
pkgs.age
pkgs.ssh-to-age
pkgs.deploy-rs
];
shellHook = ''
bash -x 'echo YOU ARE IN SOPS MODE'
'';
};
};
};
}