-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
138 lines (138 loc) · 3.95 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
# Infrastructure config by ASCIIMoth
#
# To the extent possible under law, the person who associated CC0 with
# this work has waived all copyright and related or neighboring rights
# to it.
#
# You should have received a copy of the CC0 legalcode along with this
# work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
{
description = "Moth's NixOs configuration(s)";
inputs = {
stable.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
master.url = "github:NixOS/nixpkgs";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
home-manager,
stable,
master,
nur,
stylix,
sops-nix,
pre-commit-hooks,
...
} @ inputs: {
nixosConfigurations = {
# Moth`s PC (Thinkpad P1 G5 Laptop currently)
pcLexell = let
system = "x86_64-linux";
pkgs = import nixpkgs {inherit system;};
in
nixpkgs.lib.nixosSystem {
modules = [
./machines/pcLexell
home-manager.nixosModules.home-manager
nur.nixosModules.nur
stylix.nixosModules.stylix
sops-nix.nixosModules.sops
{
nixpkgs.overlays = [nur.overlay];
_module.args.master = import inputs.master {inherit (pkgs.stdenv.targetPlatform) system;};
_module.args.stable = import inputs.stable {inherit (pkgs.stdenv.targetPlatform) system;};
}
];
specialArgs = {
inherit inputs;
hostname = "pcLexell";
stateVersion = "23.11";
};
};
# Laptop used as VPN router
/*
istvaan = let
system = "x86_64-linux";
pkgs = import nixpkgs {inherit system;};
in
nixpkgs.lib.nixosSystem {
modules = [
./machines/istvaan
home-manager.nixosModules.home-manager
nur.nixosModules.nur
sops-nix.nixosModules.sops
{
nixpkgs.overlays = [nur.overlay];
_module.args.master = import inputs.master {inherit (pkgs.stdenv.targetPlatform) system;};
_module.args.stable = import inputs.stable {inherit (pkgs.stdenv.targetPlatform) system;};
}
];
specialArgs = {
inherit inputs;
hostname = "istvaan";
stateVersion = "23.11";
};
};
*/
};
# idk why I use two devShells for x86 and aarh instead of one crossplatform
# I just copy-paste this template from somewhere
devShells = {
x86_64-linux.default = with nixpkgs.legacyPackages.x86_64-linux;
mkShell {
inherit
(pre-commit-hooks.lib.x86_64-linux.run {
src = ./.;
hooks = {
alejandra.enable = true;
statix.enable = true;
};
})
shellHook
;
buildInputs = [
alejandra
statix
];
};
aarch64-linux.default = with nixpkgs.legacyPackages.aarch64-linux;
mkShell {
inherit
(pre-commit-hooks.lib.aarch64-linux.run {
src = ./.;
hooks = {
alejandra.enable = true;
statix.enable = true;
};
})
shellHook
;
buildInputs = [
alejandra
statix
];
};
};
};
}