reformating

This commit is contained in:
bogale 2026-11-21 16:57:39 +09:00
commit 35ce763bbf
15 changed files with 312 additions and 329 deletions

View file

@ -4,6 +4,7 @@
loader.timeout = 0;
};
environment.systemPackages = with pkgs; [
cryptsetup
ddrescue
efibootmgr
hdparm

View file

@ -22,7 +22,6 @@
};
environment.systemPackages = with pkgs; [
_7zz
cryptsetup
file
gptfdisk
jq

View file

@ -11,7 +11,6 @@
binutils
binwalk
exfat
nixfmt-tree
qemu
qrencode
];
@ -67,12 +66,7 @@
pulse.enable = true;
};
tuned.enable = true;
upower = {
allowRiskyCriticalPowerAction = true;
criticalPowerAction = "Suspend";
enable = true;
percentageCritical = 10;
};
upower.enable = true;
};
sops = {
secrets = {

View file

@ -14,11 +14,10 @@
kernelParams = [ "ttm.pages_limit=3014656" ];
};
fileSystems."/boot".device = "/dev/disk/by-uuid/2610-A769";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
swapDevices = [
{
device = "/var/lib/swapfile";
size = 15 * 1024;
size = 15360;
}
];
}

View file

@ -94,8 +94,7 @@
cd ${config.boot.kernelPackages.kernel.modules}/lib/modules/*/kernel/drivers/net/ethernet
find -type f | sed 's/^.*\/\([^.]*\).*$/ "\1"/' | sort
printf ' ];\n}\n') > /etc/nixos/bootable/ethernet.nix
nixos-install --flake "/etc/nixos#nixos-bootpxe" \
--no-channel-copy --no-root-passwd --root /srv/pxe/nixos
nixos-install --flake "/etc/nixos#nixos-bootpxe" --no-root-passwd --root /srv/pxe/nixos
'';
};
};

View file

@ -19,12 +19,9 @@
}:
{
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree;
nixosConfigurations = {
nixos-bootdrive = nixpkgs.lib.nixosSystem { modules = [ ./bootable/drive.nix ]; };
nixos-bootpxe = nixpkgs.lib.nixosSystem { modules = [ ./bootable/pxe.nix ]; };
nixos-desktop = nixpkgs.lib.nixosSystem {
modules = [
./desktop/configuration.nix
nixosConfigurations =
let
hostMods = users: [
home-manager.nixosModules.home-manager
{
home-manager = {
@ -32,29 +29,22 @@
useGlobalPkgs = true;
useUserPackages = true;
users = {
bogale = ./home/bogale.nix;
root = ./home/root.nix;
};
}
// users;
};
}
sops-nix.nixosModules.sops
];
};
nixos-server = nixpkgs.lib.nixosSystem {
modules = [
./server/configuration.nix
home-manager.nixosModules.home-manager
makeSystem = modules: nixpkgs.lib.nixosSystem { inherit modules; };
in
{
home-manager = {
extraSpecialArgs = { inherit inputs; };
useGlobalPkgs = true;
useUserPackages = true;
users.root = ./home/root.nix;
};
}
sops-nix.nixosModules.sops
];
};
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 { });
};
};
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: {
{ pkgs, ... }: {
dconf.settings."org/gnome/desktop/interface".gtk-enable-primary-paste = true;
gtk = {
colorScheme = "dark";
@ -8,7 +8,6 @@
homeDirectory = "/home/bogale";
packages = with pkgs; [
alacritty
bibata-cursors
bluez
ffmpeg-headless
heroic
@ -38,14 +37,11 @@
};
imports = [ ./common.nix ];
programs = {
bash = {
initExtra = ''
bash.initExtra = ''
session() {
sudo machinectl shell root@
}
'';
sessionVariables.TTS_MODEL = "ggml-org/Qwen3-TTS-12Hz-1.7B-Base-GGUF";
};
noctalia = {
enable = true;
settings = ./mods/noctalia.toml;

View file

@ -1,8 +1,8 @@
{ config, pkgs, ... }: {
{ pkgs, ... }: {
home = {
packages = [
pkgs.ncdu
pkgs.yt-dlp
packages = with pkgs; [
ncdu
yt-dlp
];
stateVersion = "26.11";
};

View file

@ -24,7 +24,6 @@ binds {
Mod+Shift+J { move-window-down-or-to-workspace-down; };
Mod+Shift+K { move-window-up-or-to-workspace-up; };
Mod+Shift+L { move-column-right; };
Mod+Shift+P { power-off-monitors; };
Mod+Shift+S { spawn-sh "noctalia msg settings-open"; };
Mod+T { spawn "alacritty"; };
Print { screenshot; };
@ -69,6 +68,7 @@ window-rule {
open-floating false;
};
window-rule {
match app-id="Waydroid";
match app-id="mpv";
open-fullscreen true;
};

View file

@ -16,11 +16,11 @@ type = "bluetooth"
[[control_center.shortcuts]]
type = "caffeine"
[[control_center.shortcuts]]
type = "notification"
type = "system"
[[control_center.shortcuts]]
type = "power_profile"
[[control_center.shortcuts]]
type = "weather"
type = "screen_time"
[idle]
behavior_order = [ "screen-off", "lock" ]
[idle.behavior.screen-off]

View file

@ -9,9 +9,9 @@
initExtra = ''
awg-gen() {
PRIVATE=$(awg genkey)
echo "private: $PRIVATE"
printf "public: "
echo $PRIVATE | awg pubkey
echo "private: $PRIVATE"
printf "preshared: "
awg genpsk
}

View file

@ -1,4 +1,10 @@
{ config, pkgs, ... }: {
{
config,
lib,
pkgs,
...
}:
{
boot = {
extraModulePackages = [ config.boot.kernelPackages.amneziawg ];
kernelModules = [ "amneziawg" ];
@ -10,6 +16,7 @@
sops
];
fileSystems."/".device = "/dev/mapper/root";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
imports = [
../common.nix
./fs.nix

View file

@ -16,5 +16,4 @@
];
};
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
View 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" ];
};
}

View file

@ -1,68 +1,5 @@
{ config, pkgs, ... }: {
services =
let
phpSettings = {
"listen.group" = "nginx";
"listen.owner" = "nginx";
"pm" = "ondemand";
"pm.max_children" = 4;
};
sslCertDir = config.security.acme.certs."bogaledev.ru".directory;
in
{
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 = phpSettings;
settings = {
overwritewebroot = "/nextcloud";
trusted_domains = [
"bogaledev.ru"
"wl.bogaledev.ru"
];
};
};
services = {
nginx = {
clientMaxBodySize = "4G";
enable = true;
@ -119,7 +56,12 @@
};
phpfpm.pools.php = {
group = "php";
settings = phpSettings;
settings = {
"listen.group" = "nginx";
"listen.owner" = "nginx";
"pm" = "ondemand";
"pm.max_children" = 4;
};
user = "php";
};
postgresql = {
@ -152,28 +94,5 @@
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 = {
grafana-key = {
group = "grafana";
mode = "0440";
restartUnits = [ "grafana.service" ];
};
vaultwarden-env.restartUnits = [ "vaultwarden.service" ];
};
}