-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathflake.nix
More file actions
181 lines (176 loc) · 5.72 KB
/
flake.nix
File metadata and controls
181 lines (176 loc) · 5.72 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
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
{
description = "Ruixi-rebirth's NixOS Configuration";
outputs =
inputs@{ self, ... }:
let
selfPkgs = import ./pkgs;
in
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
debug = true;
systems = [ "x86_64-linux" ];
imports = [
./hosts
]
++ [
inputs.flake-root.flakeModule
inputs.treefmt-nix.flakeModule
];
flake = {
overlays.default = selfPkgs.overlay;
};
perSystem =
{
config,
pkgs,
system,
...
}:
{
# NOTE: These overlays apply to the Nix shell only. See `modules/nix.nix` for system overlays.
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
#inputs.foo.overlays.default
];
};
treefmt.config = {
inherit (config.flake-root) projectRootFile;
flakeCheck = true;
settings = {
global.excludes = [
"*.png"
"*.conf"
"*.rasi"
"*.fish"
"justfile"
"*.dae"
"*secrets.yaml"
];
};
package = pkgs.treefmt;
programs.nixfmt.enable = true;
programs.prettier.enable = true;
programs.shfmt.enable = true;
programs.stylua = {
enable = true;
settings = {
indent_type = "Spaces";
indent_width = 2;
};
};
};
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 = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
git
neovim
sbctl
just
jq
];
inputsFrom = [
config.flake-root.devShell
];
};
# run by `nix develop .#<name>`
# NOTE: Here are some of the steps I documented, see `https://github.com/Mic92/sops-nix` for more details
# ```
# mkdir -p ~/.config/sops/age
# age-keygen -o ~/.config/sops/age/keys.txt
# age-keygen -y ~/.config/sops/age/keys.txt
# sudo mkdir -p /var/lib/sops-nix
# sudo cp ~/.config/sops/age/keys.txt /var/lib/sops-nix/keys.txt
# nvim $FLAKE_ROOT/.sops.yaml
# mkdir $FLAKE_ROOT/secrets
# sops $FLAKE_ROOT/secrets/secrets.yaml
# ```
secret = pkgs.mkShell {
name = "secret";
nativeBuildInputs = with pkgs; [
sops
age
neovim
ssh-to-age
];
shellHook = ''
export $EDITOR=nvim
export PS1="\[\e[0;31m\](Secret)\$ \[\e[m\]"
'';
inputsFrom = [
config.flake-root.devShell
];
};
};
# used by the `nix fmt` command
formatter = config.treefmt.build.wrapper;
};
};
inputs = {
# update single input: `nix flake lock --update-input <name>`
# update all inputs: `nix flake update`
disko.url = "github:nix-community/disko";
emanote.url = "github:srid/emanote";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-root.url = "github:srid/flake-root";
flake-registry = {
url = "github:NixOS/flake-registry";
flake = false;
};
flameshot-git = {
url = "github:flameshot-org/flameshot";
flake = false;
};
daeuniverse.url = "github:daeuniverse/flake.nix";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprpicker.url = "github:hyprwm/hyprpicker";
impermanence.url = "github:nix-community/impermanence";
lanzaboote = {
#please read this doc -> https://nix-community.github.io/lanzaboote/
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
};
nixd.url = "github:nix-community/nixd";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
nvim-flake.url = "github:Ruixi-rebirth/nvim-flake";
nur.url = "github:nix-community/NUR";
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-wayland = {
url = "github:nix-community/nixpkgs-wayland";
inputs.nixpkgs.follows = "nixpkgs";
};
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
rust-overlay.url = "github:oxalica/rust-overlay";
sops-nix.url = "github:Mic92/sops-nix";
treefmt-nix.url = "github:numtide/treefmt-nix";
mygo.url = "github:Ruixi-rebirth/mygo";
cppup.url = "github:Ruixi-rebirth/cppup";
nixos-wsl.url = "github:nix-community/NixOS-WSL";
go-musicfox.url = "github:go-musicfox/go-musicfox";
};
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
"https://ruixi-rebirth.cachix.org"
"https://cache.nixos.org"
"https://nixpkgs-wayland.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"ruixi-rebirth.cachix.org-1:ypGqoIU9MfXwv/fE02ZGg8mutJqmcYHgLTR1DMoPGac="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
];
trusted-users = [
"root"
"@wheel"
];
};
}