reformating
This commit is contained in:
parent
d426069e99
commit
35ce763bbf
15 changed files with 312 additions and 329 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
loader.timeout = 0;
|
loader.timeout = 0;
|
||||||
};
|
};
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
cryptsetup
|
||||||
ddrescue
|
ddrescue
|
||||||
efibootmgr
|
efibootmgr
|
||||||
hdparm
|
hdparm
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
};
|
};
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
_7zz
|
_7zz
|
||||||
cryptsetup
|
|
||||||
file
|
file
|
||||||
gptfdisk
|
gptfdisk
|
||||||
jq
|
jq
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
binutils
|
binutils
|
||||||
binwalk
|
binwalk
|
||||||
exfat
|
exfat
|
||||||
nixfmt-tree
|
|
||||||
qemu
|
qemu
|
||||||
qrencode
|
qrencode
|
||||||
];
|
];
|
||||||
|
|
@ -67,12 +66,7 @@
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
tuned.enable = true;
|
tuned.enable = true;
|
||||||
upower = {
|
upower.enable = true;
|
||||||
allowRiskyCriticalPowerAction = true;
|
|
||||||
criticalPowerAction = "Suspend";
|
|
||||||
enable = true;
|
|
||||||
percentageCritical = 10;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
sops = {
|
sops = {
|
||||||
secrets = {
|
secrets = {
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,10 @@
|
||||||
kernelParams = [ "ttm.pages_limit=3014656" ];
|
kernelParams = [ "ttm.pages_limit=3014656" ];
|
||||||
};
|
};
|
||||||
fileSystems."/boot".device = "/dev/disk/by-uuid/2610-A769";
|
fileSystems."/boot".device = "/dev/disk/by-uuid/2610-A769";
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
swapDevices = [
|
swapDevices = [
|
||||||
{
|
{
|
||||||
device = "/var/lib/swapfile";
|
device = "/var/lib/swapfile";
|
||||||
size = 15 * 1024;
|
size = 15360;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,8 +94,7 @@
|
||||||
cd ${config.boot.kernelPackages.kernel.modules}/lib/modules/*/kernel/drivers/net/ethernet
|
cd ${config.boot.kernelPackages.kernel.modules}/lib/modules/*/kernel/drivers/net/ethernet
|
||||||
find -type f | sed 's/^.*\/\([^.]*\).*$/ "\1"/' | sort
|
find -type f | sed 's/^.*\/\([^.]*\).*$/ "\1"/' | sort
|
||||||
printf ' ];\n}\n') > /etc/nixos/bootable/ethernet.nix
|
printf ' ];\n}\n') > /etc/nixos/bootable/ethernet.nix
|
||||||
nixos-install --flake "/etc/nixos#nixos-bootpxe" \
|
nixos-install --flake "/etc/nixos#nixos-bootpxe" --no-root-passwd --root /srv/pxe/nixos
|
||||||
--no-channel-copy --no-root-passwd --root /srv/pxe/nixos
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
38
flake.nix
38
flake.nix
|
|
@ -19,12 +19,9 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree;
|
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree;
|
||||||
nixosConfigurations = {
|
nixosConfigurations =
|
||||||
nixos-bootdrive = nixpkgs.lib.nixosSystem { modules = [ ./bootable/drive.nix ]; };
|
let
|
||||||
nixos-bootpxe = nixpkgs.lib.nixosSystem { modules = [ ./bootable/pxe.nix ]; };
|
hostMods = users: [
|
||||||
nixos-desktop = nixpkgs.lib.nixosSystem {
|
|
||||||
modules = [
|
|
||||||
./desktop/configuration.nix
|
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
home-manager = {
|
home-manager = {
|
||||||
|
|
@ -32,29 +29,22 @@
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
users = {
|
users = {
|
||||||
bogale = ./home/bogale.nix;
|
|
||||||
root = ./home/root.nix;
|
root = ./home/root.nix;
|
||||||
};
|
}
|
||||||
|
// users;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
];
|
];
|
||||||
|
makeSystem = modules: nixpkgs.lib.nixosSystem { inherit modules; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
nixos-bootdrive = makeSystem [ ./bootable/drive.nix ];
|
||||||
|
nixos-bootpxe = makeSystem [ ./bootable/pxe.nix ];
|
||||||
|
nixos-desktop = makeSystem (
|
||||||
|
[ ./desktop/configuration.nix ] ++ hostMods { bogale = ./home/bogale.nix; }
|
||||||
|
);
|
||||||
|
nixos-server = makeSystem ([ ./server/configuration.nix ] ++ hostMods { });
|
||||||
};
|
};
|
||||||
nixos-server = nixpkgs.lib.nixosSystem {
|
|
||||||
modules = [
|
|
||||||
./server/configuration.nix
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager = {
|
|
||||||
extraSpecialArgs = { inherit inputs; };
|
|
||||||
useGlobalPkgs = true;
|
|
||||||
useUserPackages = true;
|
|
||||||
users.root = ./home/root.nix;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
sops-nix.nixosModules.sops
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
dconf.settings."org/gnome/desktop/interface".gtk-enable-primary-paste = true;
|
dconf.settings."org/gnome/desktop/interface".gtk-enable-primary-paste = true;
|
||||||
gtk = {
|
gtk = {
|
||||||
colorScheme = "dark";
|
colorScheme = "dark";
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
homeDirectory = "/home/bogale";
|
homeDirectory = "/home/bogale";
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
alacritty
|
alacritty
|
||||||
bibata-cursors
|
|
||||||
bluez
|
bluez
|
||||||
ffmpeg-headless
|
ffmpeg-headless
|
||||||
heroic
|
heroic
|
||||||
|
|
@ -38,14 +37,11 @@
|
||||||
};
|
};
|
||||||
imports = [ ./common.nix ];
|
imports = [ ./common.nix ];
|
||||||
programs = {
|
programs = {
|
||||||
bash = {
|
bash.initExtra = ''
|
||||||
initExtra = ''
|
session() {
|
||||||
session() {
|
sudo machinectl shell root@
|
||||||
sudo machinectl shell root@
|
}
|
||||||
}
|
'';
|
||||||
'';
|
|
||||||
sessionVariables.TTS_MODEL = "ggml-org/Qwen3-TTS-12Hz-1.7B-Base-GGUF";
|
|
||||||
};
|
|
||||||
noctalia = {
|
noctalia = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = ./mods/noctalia.toml;
|
settings = ./mods/noctalia.toml;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
home = {
|
home = {
|
||||||
packages = [
|
packages = with pkgs; [
|
||||||
pkgs.ncdu
|
ncdu
|
||||||
pkgs.yt-dlp
|
yt-dlp
|
||||||
];
|
];
|
||||||
stateVersion = "26.11";
|
stateVersion = "26.11";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,74 +1,74 @@
|
||||||
binds {
|
binds {
|
||||||
Alt+Print { screenshot-window; };
|
Alt+Print { screenshot-window; };
|
||||||
Ctrl+Print { screenshot-screen; };
|
Ctrl+Print { screenshot-screen; };
|
||||||
Mod+Ctrl+H { focus-monitor-left; };
|
Mod+Ctrl+H { focus-monitor-left; };
|
||||||
Mod+Ctrl+J { focus-monitor-down; };
|
Mod+Ctrl+J { focus-monitor-down; };
|
||||||
Mod+Ctrl+K { focus-monitor-up; };
|
Mod+Ctrl+K { focus-monitor-up; };
|
||||||
Mod+Ctrl+L { focus-monitor-right; };
|
Mod+Ctrl+L { focus-monitor-right; };
|
||||||
Mod+Ctrl+Shift+H { move-column-to-monitor-left; };
|
Mod+Ctrl+Shift+H { move-column-to-monitor-left; };
|
||||||
Mod+Ctrl+Shift+J { move-column-to-monitor-down; };
|
Mod+Ctrl+Shift+J { move-column-to-monitor-down; };
|
||||||
Mod+Ctrl+Shift+K { move-column-to-monitor-up; };
|
Mod+Ctrl+Shift+K { move-column-to-monitor-up; };
|
||||||
Mod+Ctrl+Shift+L { move-column-to-monitor-right; };
|
Mod+Ctrl+Shift+L { move-column-to-monitor-right; };
|
||||||
Mod+D { spawn-sh "noctalia msg panel-toggle launcher"; };
|
Mod+D { spawn-sh "noctalia msg panel-toggle launcher"; };
|
||||||
Mod+E { spawn-sh "noctalia msg panel-toggle session"; };
|
Mod+E { spawn-sh "noctalia msg panel-toggle session"; };
|
||||||
Mod+F { maximize-column; };
|
Mod+F { maximize-column; };
|
||||||
Mod+H { focus-column-left; };
|
Mod+H { focus-column-left; };
|
||||||
Mod+J { focus-window-or-workspace-down; };
|
Mod+J { focus-window-or-workspace-down; };
|
||||||
Mod+K { focus-window-or-workspace-up; };
|
Mod+K { focus-window-or-workspace-up; };
|
||||||
Mod+L { focus-column-right; };
|
Mod+L { focus-column-right; };
|
||||||
Mod+O { toggle-overview; };
|
Mod+O { toggle-overview; };
|
||||||
Mod+Q { close-window; };
|
Mod+Q { close-window; };
|
||||||
Mod+S { spawn-sh "noctalia msg panel-toggle control-center"; };
|
Mod+S { spawn-sh "noctalia msg panel-toggle control-center"; };
|
||||||
Mod+Shift+F { fullscreen-window; };
|
Mod+Shift+F { fullscreen-window; };
|
||||||
Mod+Shift+H { move-column-left; };
|
Mod+Shift+H { move-column-left; };
|
||||||
Mod+Shift+J { move-window-down-or-to-workspace-down; };
|
Mod+Shift+J { move-window-down-or-to-workspace-down; };
|
||||||
Mod+Shift+K { move-window-up-or-to-workspace-up; };
|
Mod+Shift+K { move-window-up-or-to-workspace-up; };
|
||||||
Mod+Shift+L { move-column-right; };
|
Mod+Shift+L { move-column-right; };
|
||||||
Mod+Shift+P { power-off-monitors; };
|
Mod+Shift+S { spawn-sh "noctalia msg settings-open"; };
|
||||||
Mod+Shift+S { spawn-sh "noctalia msg settings-open"; };
|
Mod+T { spawn "alacritty"; };
|
||||||
Mod+T { spawn "alacritty"; };
|
Print { screenshot; };
|
||||||
Print { screenshot; };
|
Shift+XF86AudioLowerVolume { spawn-sh "noctalia msg mic-volume-down"; };
|
||||||
Shift+XF86AudioLowerVolume { spawn-sh "noctalia msg mic-volume-down"; };
|
Shift+XF86AudioMute { spawn-sh "noctalia msg mic-mute"; };
|
||||||
Shift+XF86AudioMute { spawn-sh "noctalia msg mic-mute"; };
|
Shift+XF86AudioRaiseVolume { spawn-sh "noctalia msg mic-volume-up"; };
|
||||||
Shift+XF86AudioRaiseVolume { spawn-sh "noctalia msg mic-volume-up"; };
|
XF86AudioLowerVolume { spawn-sh "noctalia msg volume-down"; };
|
||||||
XF86AudioLowerVolume { spawn-sh "noctalia msg volume-down"; };
|
XF86AudioMute { spawn-sh "noctalia msg volume-mute"; };
|
||||||
XF86AudioMute { spawn-sh "noctalia msg volume-mute"; };
|
XF86AudioRaiseVolume { spawn-sh "noctalia msg volume-up"; };
|
||||||
XF86AudioRaiseVolume { spawn-sh "noctalia msg volume-up"; };
|
XF86MonBrightnessDown { spawn-sh "noctalia msg brightness-down"; };
|
||||||
XF86MonBrightnessDown { spawn-sh "noctalia msg brightness-down"; };
|
XF86MonBrightnessUp { spawn-sh "noctalia msg brightness-up"; };
|
||||||
XF86MonBrightnessUp { spawn-sh "noctalia msg brightness-up"; };
|
|
||||||
};
|
};
|
||||||
cursor {
|
cursor {
|
||||||
xcursor-size 24;
|
xcursor-size 24;
|
||||||
xcursor-theme "Bibata-Modern-Amber";
|
xcursor-theme "Bibata-Modern-Amber";
|
||||||
};
|
};
|
||||||
gestures { hot-corners { off; }; };
|
gestures { hot-corners { off; }; };
|
||||||
hotkey-overlay { skip-at-startup; };
|
hotkey-overlay { skip-at-startup; };
|
||||||
include "./noctalia.kdl";
|
include "./noctalia.kdl";
|
||||||
input {
|
input {
|
||||||
keyboard {
|
keyboard {
|
||||||
numlock;
|
numlock;
|
||||||
xkb {
|
xkb {
|
||||||
layout "us,ru";
|
layout "us,ru";
|
||||||
options "grp:alt_shift_toggle";
|
options "grp:alt_shift_toggle";
|
||||||
};
|
|
||||||
};
|
|
||||||
touchpad {
|
|
||||||
dwt;
|
|
||||||
natural-scroll;
|
|
||||||
tap;
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
touchpad {
|
||||||
|
dwt;
|
||||||
|
natural-scroll;
|
||||||
|
tap;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
layout {
|
layout {
|
||||||
center-focused-column "always";
|
center-focused-column "always";
|
||||||
default-column-width { proportion 0.8; };
|
default-column-width { proportion 0.8; };
|
||||||
};
|
};
|
||||||
screenshot-path "~/Multimedia/Screenshots/%Y-%m-%d_%H-%M-%S.png";
|
screenshot-path "~/Multimedia/Screenshots/%Y-%m-%d_%H-%M-%S.png";
|
||||||
window-rule {
|
window-rule {
|
||||||
clip-to-geometry true;
|
clip-to-geometry true;
|
||||||
geometry-corner-radius 8;
|
geometry-corner-radius 8;
|
||||||
open-floating false;
|
open-floating false;
|
||||||
};
|
};
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="mpv";
|
match app-id="Waydroid";
|
||||||
open-fullscreen true;
|
match app-id="mpv";
|
||||||
|
open-fullscreen true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
[bar]
|
[bar]
|
||||||
order = [ "default" ]
|
order = [ "default" ]
|
||||||
[bar.default]
|
[bar.default]
|
||||||
center = [ "workspaces" ]
|
center = [ "workspaces" ]
|
||||||
enabled = true
|
enabled = true
|
||||||
end = [ "tray", "keyboard_layout", "battery", "notifications" ]
|
end = [ "tray", "keyboard_layout", "battery", "notifications" ]
|
||||||
margin_ends = 0
|
margin_ends = 0
|
||||||
start = [ "date", "clock", "sysmon" ]
|
start = [ "date", "clock", "sysmon" ]
|
||||||
widget_spacing = 12
|
widget_spacing = 12
|
||||||
[bar.default.dead_zone.actions]
|
[bar.default.dead_zone.actions]
|
||||||
right = "none"
|
right = "none"
|
||||||
[[control_center.shortcuts]]
|
[[control_center.shortcuts]]
|
||||||
type = "wifi"
|
type = "wifi"
|
||||||
[[control_center.shortcuts]]
|
[[control_center.shortcuts]]
|
||||||
|
|
@ -16,21 +16,21 @@ type = "bluetooth"
|
||||||
[[control_center.shortcuts]]
|
[[control_center.shortcuts]]
|
||||||
type = "caffeine"
|
type = "caffeine"
|
||||||
[[control_center.shortcuts]]
|
[[control_center.shortcuts]]
|
||||||
type = "notification"
|
type = "system"
|
||||||
[[control_center.shortcuts]]
|
[[control_center.shortcuts]]
|
||||||
type = "power_profile"
|
type = "power_profile"
|
||||||
[[control_center.shortcuts]]
|
[[control_center.shortcuts]]
|
||||||
type = "weather"
|
type = "screen_time"
|
||||||
[idle]
|
[idle]
|
||||||
behavior_order = [ "screen-off", "lock" ]
|
behavior_order = [ "screen-off", "lock" ]
|
||||||
[idle.behavior.screen-off]
|
[idle.behavior.screen-off]
|
||||||
action = "screen_off"
|
action = "screen_off"
|
||||||
enabled = true
|
enabled = true
|
||||||
timeout = 300.0
|
timeout = 300.0
|
||||||
[idle.behavior.lock]
|
[idle.behavior.lock]
|
||||||
action = "lock"
|
action = "lock"
|
||||||
enabled = true
|
enabled = true
|
||||||
timeout = 450.0
|
timeout = 450.0
|
||||||
[location]
|
[location]
|
||||||
address = "Chita"
|
address = "Chita"
|
||||||
[notification]
|
[notification]
|
||||||
|
|
@ -50,45 +50,45 @@ wifi = false
|
||||||
clipboard_enabled = false
|
clipboard_enabled = false
|
||||||
launch_apps_as_systemd_services = true
|
launch_apps_as_systemd_services = true
|
||||||
screen_time_enabled = true
|
screen_time_enabled = true
|
||||||
[shell.greeter_sync]
|
[shell.greeter_sync]
|
||||||
auto_sync = true
|
auto_sync = true
|
||||||
[shell.screen_corners]
|
[shell.screen_corners]
|
||||||
enabled = true
|
enabled = true
|
||||||
[[shell.session.actions]]
|
[[shell.session.actions]]
|
||||||
action = "lock"
|
action = "lock"
|
||||||
countdown_seconds = 0.0
|
countdown_seconds = 0.0
|
||||||
enabled = true
|
enabled = true
|
||||||
shortcut = "1"
|
shortcut = "1"
|
||||||
variant = "default"
|
variant = "default"
|
||||||
[[shell.session.actions]]
|
[[shell.session.actions]]
|
||||||
action = "command"
|
action = "command"
|
||||||
command = "systemctl suspend-then-hibernate"
|
command = "systemctl suspend-then-hibernate"
|
||||||
countdown_seconds = 0.0
|
countdown_seconds = 0.0
|
||||||
enabled = true
|
enabled = true
|
||||||
glyph = "suspend"
|
glyph = "suspend"
|
||||||
label = "Сон"
|
label = "Сон"
|
||||||
shortcut = "2"
|
shortcut = "2"
|
||||||
variant = "default"
|
variant = "default"
|
||||||
[[shell.session.actions]]
|
[[shell.session.actions]]
|
||||||
action = "reboot"
|
action = "reboot"
|
||||||
countdown_seconds = 0.0
|
countdown_seconds = 0.0
|
||||||
enabled = true
|
enabled = true
|
||||||
shortcut = "3"
|
shortcut = "3"
|
||||||
variant = "default"
|
variant = "default"
|
||||||
[[shell.session.actions]]
|
[[shell.session.actions]]
|
||||||
action = "shutdown"
|
action = "shutdown"
|
||||||
countdown_seconds = 0.0
|
countdown_seconds = 0.0
|
||||||
enabled = true
|
enabled = true
|
||||||
shortcut = "4"
|
shortcut = "4"
|
||||||
variant = "default"
|
variant = "default"
|
||||||
[theme]
|
[theme]
|
||||||
builtin = "Tokyo-Night"
|
builtin = "Tokyo-Night"
|
||||||
[theme.templates]
|
[theme.templates]
|
||||||
builtin_ids = [ "alacritty", "gtk3", "gtk4", "niri" ]
|
builtin_ids = [ "alacritty", "gtk3", "gtk4", "niri" ]
|
||||||
[wallpaper]
|
[wallpaper]
|
||||||
directory = "/home/bogale/Multimedia/Wallpapers"
|
directory = "/home/bogale/Multimedia/Wallpapers"
|
||||||
transition_on_startup = true
|
transition_on_startup = true
|
||||||
[wallpaper.default]
|
[wallpaper.default]
|
||||||
path = "/home/bogale/Multimedia/Wallpapers/main.jpg"
|
path = "/home/bogale/Multimedia/Wallpapers/main.jpg"
|
||||||
[weather]
|
[weather]
|
||||||
refresh_minutes = 10
|
refresh_minutes = 10
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
awg-gen() {
|
awg-gen() {
|
||||||
PRIVATE=$(awg genkey)
|
PRIVATE=$(awg genkey)
|
||||||
echo "private: $PRIVATE"
|
|
||||||
printf "public: "
|
printf "public: "
|
||||||
echo $PRIVATE | awg pubkey
|
echo $PRIVATE | awg pubkey
|
||||||
|
echo "private: $PRIVATE"
|
||||||
printf "preshared: "
|
printf "preshared: "
|
||||||
awg genpsk
|
awg genpsk
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
{ config, pkgs, ... }: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
boot = {
|
boot = {
|
||||||
extraModulePackages = [ config.boot.kernelPackages.amneziawg ];
|
extraModulePackages = [ config.boot.kernelPackages.amneziawg ];
|
||||||
kernelModules = [ "amneziawg" ];
|
kernelModules = [ "amneziawg" ];
|
||||||
|
|
@ -10,6 +16,7 @@
|
||||||
sops
|
sops
|
||||||
];
|
];
|
||||||
fileSystems."/".device = "/dev/mapper/root";
|
fileSystems."/".device = "/dev/mapper/root";
|
||||||
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
imports = [
|
imports = [
|
||||||
../common.nix
|
../common.nix
|
||||||
./fs.nix
|
./fs.nix
|
||||||
|
|
|
||||||
|
|
@ -16,5 +16,4 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
fileSystems."/boot".device = "/dev/disk/by-uuid/86F4-A8F1";
|
fileSystems."/boot".device = "/dev/disk/by-uuid/86F4-A8F1";
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
80
server/mods/services.nix
Normal file
80
server/mods/services.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
{ config, pkgs, ... }: {
|
||||||
|
services = {
|
||||||
|
forgejo = {
|
||||||
|
database.type = "postgres";
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
mailer = {
|
||||||
|
ENABLED = true;
|
||||||
|
FROM = "Forgejo <forgejo@bogaledev.ru>";
|
||||||
|
SMTP_ADDR = "localhost";
|
||||||
|
SMTP_PORT = 25;
|
||||||
|
};
|
||||||
|
server = {
|
||||||
|
HTTP_ADDR = "/run/forgejo/forgejo.sock";
|
||||||
|
PROTOCOL = "http+unix";
|
||||||
|
ROOT_URL = "https://bogaledev.ru/git/";
|
||||||
|
SSH_PORT = 32831;
|
||||||
|
};
|
||||||
|
service = {
|
||||||
|
ENABLE_CAPTCHA = true;
|
||||||
|
REGISTER_EMAIL_CONFIRM = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
grafana = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
database = {
|
||||||
|
host = "/run/postgresql";
|
||||||
|
type = "postgres";
|
||||||
|
user = "grafana";
|
||||||
|
};
|
||||||
|
security.secret_key = "$__file{${config.sops.secrets.grafana-key.path}}";
|
||||||
|
server = {
|
||||||
|
enable_gzip = true;
|
||||||
|
protocol = "socket";
|
||||||
|
root_url = "https://bogaledev.ru/grafana";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
nextcloud = {
|
||||||
|
config.dbtype = "pgsql";
|
||||||
|
database.createLocally = true;
|
||||||
|
enable = true;
|
||||||
|
hostName = "nextcloud-local";
|
||||||
|
maxUploadSize = "4G";
|
||||||
|
poolSettings = config.services.phpfpm.pools.php.settings;
|
||||||
|
settings = {
|
||||||
|
overwritewebroot = "/nextcloud";
|
||||||
|
trusted_domains = [
|
||||||
|
"bogaledev.ru"
|
||||||
|
"wl.bogaledev.ru"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
vaultwarden = {
|
||||||
|
config = {
|
||||||
|
DOMAIN = "https://bogaledev.ru/vaultwarden/";
|
||||||
|
EMERGENCY_ACCESS_ALLOWED = false;
|
||||||
|
PASSWORD_HINTS_ALLOWED = false;
|
||||||
|
ROCKET_PORT = 46151;
|
||||||
|
SIGNUPS_ALLOWED = false;
|
||||||
|
TRASH_AUTO_DELETE_DAYS = 90;
|
||||||
|
};
|
||||||
|
configurePostgres = true;
|
||||||
|
dbBackend = "postgresql";
|
||||||
|
enable = true;
|
||||||
|
environmentFile = config.sops.secrets.vaultwarden-env.path;
|
||||||
|
package = pkgs.vaultwarden-postgresql;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
sops.secrets = {
|
||||||
|
grafana-key = {
|
||||||
|
group = "grafana";
|
||||||
|
mode = "0440";
|
||||||
|
restartUnits = [ "grafana.service" ];
|
||||||
|
};
|
||||||
|
vaultwarden-env.restartUnits = [ "vaultwarden.service" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,179 +1,98 @@
|
||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, ... }: {
|
||||||
services =
|
services = {
|
||||||
let
|
nginx = {
|
||||||
phpSettings = {
|
clientMaxBodySize = "4G";
|
||||||
|
enable = true;
|
||||||
|
recommendedBrotliSettings = true;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
virtualHosts = {
|
||||||
|
nextcloud-local.listen = [
|
||||||
|
{
|
||||||
|
addr = "localhost";
|
||||||
|
port = 45837;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
main =
|
||||||
|
let
|
||||||
|
localNetworks = ''
|
||||||
|
allow 10.0.0.0/16;
|
||||||
|
allow fc00::/64;
|
||||||
|
deny all;
|
||||||
|
'';
|
||||||
|
phpPool = ''
|
||||||
|
index index.php index.html;
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_pass unix:${config.services.phpfpm.pools.php.socket};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
default = true;
|
||||||
|
extraConfig = ''
|
||||||
|
add_header Alt-Svc 'h3=":443"; ma=2592000' always;
|
||||||
|
add_header X-Content-Type-Options 'nosniff' always;
|
||||||
|
'';
|
||||||
|
forceSSL = true;
|
||||||
|
locations = {
|
||||||
|
"/".extraConfig = phpPool;
|
||||||
|
"/git/".proxyPass = "http://unix:/run/forgejo/forgejo.sock:/";
|
||||||
|
"/grafana/".proxyPass = "http://unix:/run/grafana/grafana.sock:/";
|
||||||
|
"/local/".extraConfig = "${phpPool} ${localNetworks}";
|
||||||
|
"/nextcloud/".proxyPass = "http://localhost:45837/";
|
||||||
|
"/vaultwarden/" = {
|
||||||
|
extraConfig = localNetworks;
|
||||||
|
proxyPass = "http://localhost:46151";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
quic = true;
|
||||||
|
root = "/srv/http";
|
||||||
|
useACMEHost = "bogaledev.ru";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
phpfpm.pools.php = {
|
||||||
|
group = "php";
|
||||||
|
settings = {
|
||||||
"listen.group" = "nginx";
|
"listen.group" = "nginx";
|
||||||
"listen.owner" = "nginx";
|
"listen.owner" = "nginx";
|
||||||
"pm" = "ondemand";
|
"pm" = "ondemand";
|
||||||
"pm.max_children" = 4;
|
"pm.max_children" = 4;
|
||||||
};
|
};
|
||||||
sslCertDir = config.security.acme.certs."bogaledev.ru".directory;
|
user = "php";
|
||||||
in
|
};
|
||||||
{
|
postgresql = {
|
||||||
forgejo = {
|
enable = true;
|
||||||
database.type = "postgres";
|
ensureDatabases = [
|
||||||
enable = true;
|
"grafana"
|
||||||
settings = {
|
"php"
|
||||||
mailer = {
|
];
|
||||||
ENABLED = true;
|
ensureUsers =
|
||||||
FROM = "Forgejo <forgejo@bogaledev.ru>";
|
let
|
||||||
SMTP_ADDR = "localhost";
|
user = name: {
|
||||||
SMTP_PORT = 25;
|
ensureDBOwnership = true;
|
||||||
|
inherit name;
|
||||||
};
|
};
|
||||||
server = {
|
in
|
||||||
HTTP_ADDR = "/run/forgejo/forgejo.sock";
|
map user [
|
||||||
PROTOCOL = "http+unix";
|
|
||||||
ROOT_URL = "https://bogaledev.ru/git/";
|
|
||||||
SSH_PORT = 32831;
|
|
||||||
};
|
|
||||||
service = {
|
|
||||||
ENABLE_CAPTCHA = true;
|
|
||||||
REGISTER_EMAIL_CONFIRM = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
grafana = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
database = {
|
|
||||||
host = "/run/postgresql";
|
|
||||||
type = "postgres";
|
|
||||||
user = "grafana";
|
|
||||||
};
|
|
||||||
security.secret_key = "$__file{${config.sops.secrets.grafana-key.path}}";
|
|
||||||
server = {
|
|
||||||
enable_gzip = true;
|
|
||||||
protocol = "socket";
|
|
||||||
root_url = "https://bogaledev.ru/grafana";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
nextcloud = {
|
|
||||||
config.dbtype = "pgsql";
|
|
||||||
database.createLocally = true;
|
|
||||||
enable = true;
|
|
||||||
hostName = "nextcloud-local";
|
|
||||||
maxUploadSize = "4G";
|
|
||||||
poolSettings = phpSettings;
|
|
||||||
settings = {
|
|
||||||
overwritewebroot = "/nextcloud";
|
|
||||||
trusted_domains = [
|
|
||||||
"bogaledev.ru"
|
|
||||||
"wl.bogaledev.ru"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
nginx = {
|
|
||||||
clientMaxBodySize = "4G";
|
|
||||||
enable = true;
|
|
||||||
recommendedBrotliSettings = true;
|
|
||||||
recommendedGzipSettings = true;
|
|
||||||
recommendedOptimisation = true;
|
|
||||||
recommendedProxySettings = true;
|
|
||||||
recommendedTlsSettings = true;
|
|
||||||
virtualHosts = {
|
|
||||||
nextcloud-local.listen = [
|
|
||||||
{
|
|
||||||
addr = "localhost";
|
|
||||||
port = 45837;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
main =
|
|
||||||
let
|
|
||||||
localNetworks = ''
|
|
||||||
allow 10.0.0.0/16;
|
|
||||||
allow fc00::/64;
|
|
||||||
deny all;
|
|
||||||
'';
|
|
||||||
phpPool = ''
|
|
||||||
index index.php index.html;
|
|
||||||
location ~ \.php$ {
|
|
||||||
fastcgi_pass unix:${config.services.phpfpm.pools.php.socket};
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
default = true;
|
|
||||||
extraConfig = ''
|
|
||||||
add_header Alt-Svc 'h3=":443"; ma=2592000' always;
|
|
||||||
add_header X-Content-Type-Options 'nosniff' always;
|
|
||||||
'';
|
|
||||||
forceSSL = true;
|
|
||||||
locations = {
|
|
||||||
"/".extraConfig = phpPool;
|
|
||||||
"/git/".proxyPass = "http://unix:/run/forgejo/forgejo.sock:/";
|
|
||||||
"/grafana/".proxyPass = "http://unix:/run/grafana/grafana.sock:/";
|
|
||||||
"/local/".extraConfig = "${phpPool} ${localNetworks}";
|
|
||||||
"/nextcloud/".proxyPass = "http://localhost:45837/";
|
|
||||||
"/vaultwarden/" = {
|
|
||||||
extraConfig = localNetworks;
|
|
||||||
proxyPass = "http://localhost:46151";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
quic = true;
|
|
||||||
root = "/srv/http";
|
|
||||||
useACMEHost = "bogaledev.ru";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
phpfpm.pools.php = {
|
|
||||||
group = "php";
|
|
||||||
settings = phpSettings;
|
|
||||||
user = "php";
|
|
||||||
};
|
|
||||||
postgresql = {
|
|
||||||
enable = true;
|
|
||||||
ensureDatabases = [
|
|
||||||
"grafana"
|
"grafana"
|
||||||
"php"
|
"php"
|
||||||
];
|
];
|
||||||
ensureUsers =
|
|
||||||
let
|
|
||||||
user = name: {
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
inherit name;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
map user [
|
|
||||||
"grafana"
|
|
||||||
"php"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
postgresqlBackup = {
|
|
||||||
compression = "none";
|
|
||||||
databases = [
|
|
||||||
"forgejo"
|
|
||||||
"grafana"
|
|
||||||
"nextcloud"
|
|
||||||
"php"
|
|
||||||
"vaultwarden"
|
|
||||||
];
|
|
||||||
enable = true;
|
|
||||||
startAt = "16:00";
|
|
||||||
};
|
|
||||||
vaultwarden = {
|
|
||||||
config = {
|
|
||||||
DOMAIN = "https://bogaledev.ru/vaultwarden/";
|
|
||||||
EMERGENCY_ACCESS_ALLOWED = false;
|
|
||||||
PASSWORD_HINTS_ALLOWED = false;
|
|
||||||
ROCKET_PORT = 46151;
|
|
||||||
SIGNUPS_ALLOWED = false;
|
|
||||||
TRASH_AUTO_DELETE_DAYS = 90;
|
|
||||||
};
|
|
||||||
configurePostgres = true;
|
|
||||||
dbBackend = "postgresql";
|
|
||||||
enable = true;
|
|
||||||
environmentFile = config.sops.secrets.vaultwarden-env.path;
|
|
||||||
package = pkgs.vaultwarden-postgresql;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
sops.secrets = {
|
postgresqlBackup = {
|
||||||
grafana-key = {
|
compression = "none";
|
||||||
group = "grafana";
|
databases = [
|
||||||
mode = "0440";
|
"forgejo"
|
||||||
restartUnits = [ "grafana.service" ];
|
"grafana"
|
||||||
|
"nextcloud"
|
||||||
|
"php"
|
||||||
|
"vaultwarden"
|
||||||
|
];
|
||||||
|
enable = true;
|
||||||
|
startAt = "16:00";
|
||||||
};
|
};
|
||||||
vaultwarden-env.restartUnits = [ "vaultwarden.service" ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue