This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathflake.nix
167 lines (161 loc) · 5.46 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
{
description = "My Personal NixOS Configuration";
nixConfig = { };
outputs = inputs @ { self, nixpkgs, flake-parts, ... }:
let
user = "ruixi";
domain = "ruixi2fp.top";
selfPkgs = import ./pkgs;
in
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
imports = [
inputs.flake-root.flakeModule
inputs.mission-control.flakeModule
inputs.treefmt-nix.flakeModule
];
perSystem = { config, inputs', pkgs, system, lib, ... }:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.default
];
};
in
{
treefmt.config = {
inherit (config.flake-root) projectRootFile;
package = pkgs.treefmt;
programs.nixpkgs-fmt.enable = true;
programs.prettier.enable = true;
programs.taplo.enable = true;
programs.stylua.enable = true;
programs.beautysh = {
enable = true;
indent_size = 4;
};
};
mission-control.scripts = {
Install = {
description = "After partitioning, formal installation of nixos";
exec = "sh ./scripts/install.sh";
category = "Tools";
};
update = {
description = "Update flake inputs what you want,Please check ./scripts/flake-update.sh";
exec = "sh ./scripts/flake-update.sh";
category = "Tools";
};
rebuild = {
description = "Switch to new profile";
exec = "sh ./scripts/rebuild.sh";
category = "Tools";
};
deploy = {
description = "Remote deployment or local deployment";
exec = "sh ./scripts/deploy.sh";
category = "Tools";
};
fmt = {
description = "Format the source tree";
exec = config.treefmt.build.wrapper;
category = "Tools";
};
blog = {
description = "Debug my blog";
exec = ''
git submodule update --init --recursive
cd "$FLAKE_ROOT"/blog
git checkout master
emanote -L ./.
'';
category = "Tools";
};
disko = {
description = "Pre-install,automatically partition and mount";
exec = "sh ./scripts/disko.sh";
category = "Tools";
};
};
devShells = {
#run by `nix devlop` or `nix-shell`(legacy)
#Temporarily enable experimental features, run by`nix develop --extra-experimental-features nix-command --extra-experimental-features flakes`
# default = import ./shell.nix { inherit pkgs; };
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
git
neovim
sbctl
];
inputsFrom = [
config.flake-root.devShell
config.mission-control.devShell
];
};
#run by `nix develop .#<name>`
secret = with pkgs; mkShell {
name = "secret";
nativeBuildInputs = [
sops
age
ssh-to-age
ssh-to-pgp
];
shellHook = ''
export PS1="\e[0;31m(Secret)\$ \e[m"
'';
};
};
};
flake = {
overlays.default = selfPkgs.overlay;
nixosConfigurations = (
import ./hosts {
system = "x86_64-linux";
inherit nixpkgs self inputs user;
}
);
};
};
inputs =
{
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
rust-overlay.url = "github:oxalica/rust-overlay";
nil.url = "github:oxalica/nil";
impermanence.url = "github:nix-community/impermanence";
nur.url = "github:nix-community/NUR";
hyprpicker.url = "github:hyprwm/hyprpicker";
hypr-contrib.url = "github:hyprwm/contrib";
flake-parts.url = "github:hercules-ci/flake-parts";
sops-nix.url = "github:Mic92/sops-nix";
picom.url = "github:yaocccc/picom";
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-root.url = "github:srid/flake-root";
mission-control.url = "github:Platonic-Systems/mission-control";
treefmt-nix.url = "github:numtide/treefmt-nix";
emacs-overlay.url = "github:nix-community/emacs-overlay";
lanzaboote = {
#please read this doc -> https://github.com/nix-community/lanzaboote/blob/master/docs/QUICK_START.md
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
};
disko.url = "github:nix-community/disko";
emanote.url = "github:srid/emanote";
joshuto.url = "github:kamiyaa/joshuto";
go-musicfox.url = "github:go-musicfox/go-musicfox";
nixd.url = "github:nix-community/nixd";
flake-compat = {
url = "github:inclyc/flake-compat";
flake = false;
};
};
}