-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
135 lines (123 loc) · 4.39 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
{
description = "Rin's computer configuration";
inputs = {
### Nixpkgs ###
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Pin 特定频道
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-d209.url = "github:nixos/nixpkgs/d209d800b7df2d4b05ea1266b14a47cba5da129b";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
### Nixpkgs ###
# NUR Package
nur.url = github:nix-community/NUR;
# sandbox NixPak
nixpak = {
url = "github:nixpak/nixpak";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpak-pkgs.url = "github:nixpak/pkgs";
# Flatpak
flatpak.url = "github:gmodena/nix-flatpak?ref=v0.4.1";
# pretty theme
catppuccin.url = "github:catppuccin/nix";
# lanzaboote for Secure boot
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.2";
# Optional but recommended to limit the size of your system closure.
inputs.nixpkgs.follows = "nixpkgs";
};
# RinsRepo = {
# url = "github:MiRinChan/MaybeSomeNixPackages";
# inputs.nixpkgs.follows = "nixpkgs";
# };
solaar = {
url = "https://flakehub.com/f/Svenum/Solaar-Flake/*.tar.gz"; # For latest stable version
#url = "https://flakehub.com/f/Svenum/Solaar-Flake/0.1.1.tar.gz"; # uncomment line for solaar version 1.1.13
#url = "github:Svenum/Solaar-Flake/main"; # Uncomment line for latest unstable version
inputs.nixpkgs.follows = "nixpkgs";
};
# C:/Users/
home-manager = {
url = "github:nix-community/home-manager/master";
# url = "github:nix-community/home-manager/release-24.05";
# The `follows` keyword in inputs is used for inheritance.
# Here, `inputs.nixpkgs` of home-manager is kept consistent with
# the `inputs.nixpkgs` of the current flake,
# to avoid problems caused by different versions of nixpkgs.
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
nixpkgs-stable,
nixpkgs-d209,
nixpak,
nixpak-pkgs,
flatpak,
alejandra,
catppuccin,
home-manager,
solaar,
nur,
lanzaboote,
...
} @ inputs: let
inherit (self) outputs;
# 支持的系统架构
systems = [
"x86_64-linux"
# "aarch64-linux"
];
# 这是一个通过调用您传递给它的函数来生成属性的函数,每个系统作为参数
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
# 定制的包
# 可用 'nix build', 'nix shell' 等
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# nix 文件的格式化程序,可通过 'nix fmt'
# 除了 “alejandra” 之外的其他选项包括“nixpkgs-fmt”
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# 定制的包和修改, 导出为 overlays
overlays = import ./overlays {inherit inputs;};
# Reusable nixos modules you might want to export
# 您可能想要导出的可重复使用的 nixos 模块
# 这些通常是您要上传到 nixpkgs 的内容
nixosModules = import ./modules/nixos;
# 您可能想要导出可重复使用的 home-manager 模块
# 这些通常是您要上传到 home-manager 的内容
homeManagerModules = import ./modules/home-manager;
# NixOS 配置入口点
# 可用 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
# 主机名
rins = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
};
modules = [
flatpak.nixosModules.nix-flatpak
# > 主要 NixOS 配置文件 <
./System32/configuration.nix
home-manager.nixosModules.home-manager # home manager
catppuccin.nixosModules.catppuccin
nur.modules.nixos.default
lanzaboote.nixosModules.lanzaboote
solaar.nixosModules.default
{
home-manager.useUserPackages = true;
home-manager.users.mirin = import ./Users/home.nix;
home-manager.backupFileExtension = "backup";
home-manager.extraSpecialArgs = {
inherit inputs outputs;
};
home-manager.extraSpecialArgs.flake-inputs = inputs;
home-manager.extraSpecialArgs.catppuccin = catppuccin;
}
];
};
};
};
}