Compare commits
36 Commits
131629cb30
...
updated-in
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c253084d8 | ||
| 102509b9a8 | |||
| eaa4ee6d05 | |||
| 9659885079 | |||
| 50b575dcb3 | |||
| 165839be07 | |||
| ce99bb114b | |||
| 23629e0662 | |||
| 6954e75a5c | |||
| 539502cea0 | |||
| 00a7eee2af | |||
| e82132b86e | |||
| 503dca182e | |||
| 82f8064956 | |||
| 342d50d936 | |||
| dd76691f7d | |||
| 72cdef91d9 | |||
| 22c7cb451b | |||
| 9357981ff3 | |||
| eddb365ae5 | |||
| d01de7fc4a | |||
| a1ca9313b9 | |||
| 217ede0307 | |||
| 643478b724 | |||
| 13b8ccd087 | |||
| 7c3a97a90a | |||
| 40338d9b85 | |||
| 7f6f6281cc | |||
| 2d4acb5a49 | |||
|
|
905682cf17 | ||
| f5ec777e9b | |||
| 944bced757 | |||
| 5bd15927d5 | |||
| 9b05a008bb | |||
| 871ba5ea43 | |||
| 560e53f77b |
@@ -6,6 +6,7 @@
|
|||||||
# My system is fucked
|
# My system is fucked
|
||||||
gptfdisk
|
gptfdisk
|
||||||
parted
|
parted
|
||||||
|
grow-last-partition-and-filesystem
|
||||||
|
|
||||||
# Normal usage
|
# Normal usage
|
||||||
htop
|
htop
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
services.pulseaudio.enable = false;
|
|
||||||
|
|
||||||
security.rtkit.enable = true;
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
alsa = {
|
|
||||||
enable = true;
|
|
||||||
support32Bit = true;
|
|
||||||
};
|
|
||||||
pulse = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./audio.nix
|
|
||||||
./firmware.nix
|
|
||||||
./fonts.nix
|
|
||||||
./gnome.nix
|
|
||||||
./inputs.nix
|
|
||||||
./networking.nix
|
|
||||||
./polkit.nix
|
|
||||||
./power.nix
|
|
||||||
./printing.nix
|
|
||||||
./ssh.nix
|
|
||||||
./xserver.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
security.sudo.wheelNeedsPassword = true;
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
services.fwupd.enable = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
fonts.enableDefaultPackages = true;
|
|
||||||
fonts.packages = with pkgs; [
|
|
||||||
roboto
|
|
||||||
roboto-mono
|
|
||||||
noto-fonts
|
|
||||||
noto-fonts-emoji
|
|
||||||
comfortaa
|
|
||||||
] ++ (if pkgs ? "noto-fonts-cjk-sans" then [ pkgs.noto-fonts-cjk-sans ] else [ pkgs.noto-fonts-cjk ]);
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.gnome = {
|
|
||||||
localsearch.enable = false;
|
|
||||||
tinysparql.enable = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.gnome.excludePackages = with pkgs; [
|
|
||||||
baobab
|
|
||||||
epiphany
|
|
||||||
gnome-calendar
|
|
||||||
gnome-clocks
|
|
||||||
gnome-console
|
|
||||||
gnome-contacts
|
|
||||||
gnome-logs
|
|
||||||
gnome-maps
|
|
||||||
gnome-music
|
|
||||||
gnome-tour
|
|
||||||
gnome-photos
|
|
||||||
gnome-weather
|
|
||||||
gnome-connections
|
|
||||||
simple-scan
|
|
||||||
yelp
|
|
||||||
geary
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
evolution
|
|
||||||
gnome-terminal
|
|
||||||
gnome-tweaks
|
|
||||||
];
|
|
||||||
|
|
||||||
services.gnome.evolution-data-server.enable = true;
|
|
||||||
|
|
||||||
programs.dconf.profiles = {
|
|
||||||
user.databases = [
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
"org/gnome/desktop/calendar" = {
|
|
||||||
show-weekdate = true;
|
|
||||||
};
|
|
||||||
"org/gnome/desktop/interface" = {
|
|
||||||
enable-hot-corners = false;
|
|
||||||
show-battery-percentage = true;
|
|
||||||
};
|
|
||||||
"org/gnome/desktop/notifications" = {
|
|
||||||
show-in-lock-screen = false;
|
|
||||||
};
|
|
||||||
"org/gnome/desktop/sound" = {
|
|
||||||
event-sounds = false;
|
|
||||||
};
|
|
||||||
"org/gnome/gnome-system-monitor" = {
|
|
||||||
network-in-bits = true;
|
|
||||||
network-total-in-bits = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.dconf.profiles = {
|
|
||||||
user.databases = [
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
"org/gnome/desktop/peripherals/touchpad" = {
|
|
||||||
disable-while-typing = false;
|
|
||||||
edge-scrolling-enabled = false;
|
|
||||||
natural-scroll = true;
|
|
||||||
tap-to-click = true;
|
|
||||||
two-finger-scrolling-enabled = true;
|
|
||||||
};
|
|
||||||
"org/gnome/settings-daemon/plugins/media-keys" = {
|
|
||||||
custom-keybindings = [
|
|
||||||
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal/"
|
|
||||||
];
|
|
||||||
mic-mute = [ "<Control>Print" ];
|
|
||||||
};
|
|
||||||
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal" = {
|
|
||||||
name = "Terminal";
|
|
||||||
binding = "<Primary><Alt>t";
|
|
||||||
command = "gnome-terminal";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
gdm.databases = [
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
"org/gnome/desktop/peripherals/touchpad" = {
|
|
||||||
disable-while-typing = false;
|
|
||||||
edge-scrolling-enabled = false;
|
|
||||||
natural-scroll = true;
|
|
||||||
tap-to-click = true;
|
|
||||||
two-finger-scrolling-enabled = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
networking.networkmanager.settings = {
|
|
||||||
connectivity = {
|
|
||||||
uri = "http://ping.clerie.de/nm-check.txt";
|
|
||||||
};
|
|
||||||
global-dns = {
|
|
||||||
searches = "net.clerie.de";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
security.polkit.enable = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
{ lib, config, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
boot.resumeDevice = lib.optionalString ((lib.length config.swapDevices) > 0) (lib.head config.swapDevices).device;
|
|
||||||
services.logind = {
|
|
||||||
lidSwitch = "suspend-then-hibernate";
|
|
||||||
};
|
|
||||||
systemd.sleep.extraConfig = ''
|
|
||||||
HibernateDelaySec=30m
|
|
||||||
'';
|
|
||||||
|
|
||||||
services.upower = {
|
|
||||||
percentageLow = 20;
|
|
||||||
percentageCritical = 10;
|
|
||||||
percentageAction = 8;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.dconf.profiles = {
|
|
||||||
user.databases = [
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
"org/gnome/settings-daemon/plugins/power" = {
|
|
||||||
power-button-action = "hibernate";
|
|
||||||
power-saver-profile-on-low-battery = false;
|
|
||||||
sleep-inactive-ac-type = "nothing";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
gdm.databases = [
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
"org/gnome/settings-daemon/plugins/power" = {
|
|
||||||
power-button-action = "hibernate";
|
|
||||||
power-saver-profile-on-low-battery = false;
|
|
||||||
sleep-inactive-ac-type = "nothing";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.printing.enable = true;
|
|
||||||
services.avahi.enable = true;
|
|
||||||
services.avahi.nssmdns4 = true;
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
profiles.clerie.gpg-ssh.enable = true;
|
|
||||||
|
|
||||||
programs.gnupg.agent = {
|
|
||||||
pinentryPackage = pkgs.pinentry-gtk2;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Do not disable ssh-agent of gnome-keyring, because
|
|
||||||
# gnupg ssh-agent can't handle normal SSH keys properly
|
|
||||||
/*
|
|
||||||
# Disable ssh-agent of gnome-keyring
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(final: prev: {
|
|
||||||
gnome = prev.gnome // {
|
|
||||||
gnome-keyring = prev.runCommand "gnome-keyring-ssh-disabled-autostart" {} ''
|
|
||||||
mkdir -p $out
|
|
||||||
|
|
||||||
# Symlink all gnome-keyring binaries
|
|
||||||
${final.xorg.lndir}/bin/lndir -silent ${prev.gnome.gnome-keyring} $out
|
|
||||||
|
|
||||||
# Disable autostart for ssh
|
|
||||||
rm $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
|
|
||||||
cat ${prev.gnome.gnome-keyring}/etc/xdg/autostart/gnome-keyring-ssh.desktop > $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
|
|
||||||
echo "Hidden=true" >> $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.xserver.enable = true;
|
|
||||||
services.displayManager.gdm.enable = true;
|
|
||||||
services.desktopManager.gnome.enable = true;
|
|
||||||
|
|
||||||
services.xserver.excludePackages = with pkgs; [
|
|
||||||
xterm
|
|
||||||
];
|
|
||||||
}
|
|
||||||
65
flake.lock
generated
65
flake.lock
generated
@@ -269,11 +269,11 @@
|
|||||||
"nixpkgs": "nixpkgs_3"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750779764,
|
"lastModified": 1751801455,
|
||||||
"narHash": "sha256-JTvJf12NfmiJg+k8zPAvvJIHWA8lzL5SBssQxkwZTwE=",
|
"narHash": "sha256-hUJqtS88SbNQQSEJAPFyY2vLMh8yA8rQ6jbul50p64M=",
|
||||||
"ref": "lix-2.93",
|
"ref": "lix-2.93",
|
||||||
"rev": "175d4c80943403f352ad3ce9ee9a93475a154b91",
|
"rev": "b940aca430a7ca41f70bdb320659dd62026fe0e9",
|
||||||
"revCount": 4259,
|
"revCount": 4261,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.lix.systems/lix-project/hydra.git"
|
"url": "https://git.lix.systems/lix-project/hydra.git"
|
||||||
},
|
},
|
||||||
@@ -301,11 +301,11 @@
|
|||||||
"pre-commit-hooks": "pre-commit-hooks"
|
"pre-commit-hooks": "pre-commit-hooks"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750762203,
|
"lastModified": 1751235704,
|
||||||
"narHash": "sha256-LmQhjQ7c+AOkwhvR9GFgJOy8oHW35MoQRELtrwyVnPw=",
|
"narHash": "sha256-Jzm3KPZ2gL+0Nl3Mw/2E0B3vqDDi1Xt5+9VCXghUDZ8=",
|
||||||
"ref": "release-2.93",
|
"ref": "release-2.93",
|
||||||
"rev": "38b358ce27203f972faa2973cf44ba80c758f46e",
|
"rev": "f3a7bbe5f8d1a8504ddb6362d50106904523e440",
|
||||||
"revCount": 17866,
|
"revCount": 17874,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.lix.systems/lix-project/lix"
|
"url": "https://git.lix.systems/lix-project/lix"
|
||||||
},
|
},
|
||||||
@@ -327,11 +327,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750776670,
|
"lastModified": 1753282722,
|
||||||
"narHash": "sha256-EfA5K5EZAnspmraJrXQlziffVpaT+QDBiE6yKmuaNNQ=",
|
"narHash": "sha256-KYMUrTV7H/RR5/HRnjV5R3rRIuBXMemyJzTLi50NFTs=",
|
||||||
"ref": "release-2.93",
|
"ref": "release-2.93",
|
||||||
"rev": "c3c78a32273e89d28367d8605a4c880f0b6607e3",
|
"rev": "46a9e8fcfe4be72b4c7c8082ee11d2c42da1e873",
|
||||||
"revCount": 146,
|
"revCount": 149,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.lix.systems/lix-project/nixos-module.git"
|
"url": "https://git.lix.systems/lix-project/nixos-module.git"
|
||||||
},
|
},
|
||||||
@@ -353,11 +353,11 @@
|
|||||||
"pre-commit-hooks": "pre-commit-hooks_2"
|
"pre-commit-hooks": "pre-commit-hooks_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750762203,
|
"lastModified": 1753306924,
|
||||||
"narHash": "sha256-LmQhjQ7c+AOkwhvR9GFgJOy8oHW35MoQRELtrwyVnPw=",
|
"narHash": "sha256-jLCEW0FvjFhC+c4RHzH+xbkSOxrnpFHnhjOw6sudhx0=",
|
||||||
"ref": "release-2.93",
|
"ref": "release-2.93",
|
||||||
"rev": "38b358ce27203f972faa2973cf44ba80c758f46e",
|
"rev": "1a4393d0aac31aba21f5737ede1b171e11336d77",
|
||||||
"revCount": 17866,
|
"revCount": 17884,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.lix.systems/lix-project/lix.git"
|
"url": "https://git.lix.systems/lix-project/lix.git"
|
||||||
},
|
},
|
||||||
@@ -404,6 +404,26 @@
|
|||||||
"url": "https://git.clerie.de/clerie/mitel_ommclient2.git"
|
"url": "https://git.clerie.de/clerie/mitel_ommclient2.git"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mu5001tool": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1757627777,
|
||||||
|
"narHash": "sha256-NGUqHQ+/BaUhjgSYQauTihTtNyhhnQRMJ8t7ZSPNpmk=",
|
||||||
|
"ref": "refs/heads/main",
|
||||||
|
"rev": "b7b0f0d5191433bca1377f7d818b800627a83fda",
|
||||||
|
"revCount": 9,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.clerie.de/clerie/mu5001tool.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.clerie.de/clerie/mu5001tool.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nix2container": {
|
"nix2container": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -614,11 +634,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750622754,
|
"lastModified": 1751582995,
|
||||||
"narHash": "sha256-kMhs+YzV4vPGfuTpD3mwzibWUE6jotw5Al2wczI0Pv8=",
|
"narHash": "sha256-u7ubvtxdTnFPpV27AHpgoKn7qHuE7sgWgza/1oj5nzA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c7ab75210cb8cb16ddd8f290755d9558edde7ee1",
|
"rev": "7a732ed41ca0dd64b4b71b563ab9805a80a7d693",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -646,11 +666,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750776420,
|
"lastModified": 1758690382,
|
||||||
"narHash": "sha256-/CG+w0o0oJ5itVklOoLbdn2dGB0wbZVOoDm4np6w09A=",
|
"narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "30a61f056ac492e3b7cdcb69c1e6abdcf00e39cf",
|
"rev": "e643668fd71b949c53f8626614b21ff71a07379d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -743,6 +763,7 @@
|
|||||||
"hydra": "hydra",
|
"hydra": "hydra",
|
||||||
"lix": "lix_2",
|
"lix": "lix_2",
|
||||||
"lix-module": "lix-module",
|
"lix-module": "lix-module",
|
||||||
|
"mu5001tool": "mu5001tool",
|
||||||
"nixos-exporter": "nixos-exporter",
|
"nixos-exporter": "nixos-exporter",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs_5",
|
"nixpkgs": "nixpkgs_5",
|
||||||
|
|||||||
@@ -40,6 +40,10 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
fieldpoc.url = "git+https://git.clerie.de/clerie/fieldpoc.git";
|
fieldpoc.url = "git+https://git.clerie.de/clerie/fieldpoc.git";
|
||||||
|
mu5001tool = {
|
||||||
|
url = "git+https://git.clerie.de/clerie/mu5001tool.git";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
nixos-exporter = {
|
nixos-exporter = {
|
||||||
url = "git+https://git.clerie.de/clerie/nixos-exporter.git";
|
url = "git+https://git.clerie.de/clerie/nixos-exporter.git";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ let
|
|||||||
in {
|
in {
|
||||||
inherit (self)
|
inherit (self)
|
||||||
packages;
|
packages;
|
||||||
|
extraTrackedPackages = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system:
|
||||||
|
nixpkgs.lib.genAttrs [
|
||||||
|
"hydra"
|
||||||
|
"lix"
|
||||||
|
] (name: self.nixpkgs."${system}"."${name}")
|
||||||
|
);
|
||||||
nixosConfigurations = buildHosts self.nixosConfigurations;
|
nixosConfigurations = buildHosts self.nixosConfigurations;
|
||||||
iso = self.nixosConfigurations._iso.config.system.build.isoImage;
|
iso = self.nixosConfigurations._iso.config.system.build.isoImage;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
, chaosevents
|
, chaosevents
|
||||||
, harmonia
|
, harmonia
|
||||||
, hydra
|
, hydra
|
||||||
|
, mu5001tool
|
||||||
, nurausstieg
|
, nurausstieg
|
||||||
, rainbowrss
|
, rainbowrss
|
||||||
, scan-to-gpg
|
, scan-to-gpg
|
||||||
@@ -25,6 +26,8 @@ final: prev: {
|
|||||||
harmonia;
|
harmonia;
|
||||||
inherit (hydra.packages.${final.system})
|
inherit (hydra.packages.${final.system})
|
||||||
hydra;
|
hydra;
|
||||||
|
inherit (mu5001tool.packages.${final.system})
|
||||||
|
mu5001tool;
|
||||||
inherit (nurausstieg.packages.${final.system})
|
inherit (nurausstieg.packages.${final.system})
|
||||||
nurausstieg;
|
nurausstieg;
|
||||||
inherit (rainbowrss.packages.${final.system})
|
inherit (rainbowrss.packages.${final.system})
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
||||||
|
./grafana.nix
|
||||||
|
./mu5001tool.nix
|
||||||
|
./prometheus.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
profiles.clerie.network-fallback-dhcp.enable = true;
|
profiles.clerie.network-fallback-dhcp.enable = true;
|
||||||
@@ -18,6 +22,16 @@
|
|||||||
terminal_output serial
|
terminal_output serial
|
||||||
";
|
";
|
||||||
|
|
||||||
|
sops.secrets.monitoring-htpasswd = {
|
||||||
|
owner = "nginx";
|
||||||
|
group = "nginx";
|
||||||
|
};
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
|
||||||
profiles.clerie.wg-clerie = {
|
profiles.clerie.wg-clerie = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ipv6s = [ "2a01:4f8:c0c:15f1::8108/128" ];
|
ipv6s = [ "2a01:4f8:c0c:15f1::8108/128" ];
|
||||||
|
|||||||
45
hosts/astatine/grafana.nix
Normal file
45
hosts/astatine/grafana.nix
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
services.grafana = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
domain = "grafana.astatine.net.clerie.de";
|
||||||
|
root_url = "https://grafana.astatine.net.clerie.de";
|
||||||
|
http_port = 3001;
|
||||||
|
http_addr = "::1";
|
||||||
|
};
|
||||||
|
"auth.anonymous" = {
|
||||||
|
enabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
provision = {
|
||||||
|
enable = true;
|
||||||
|
datasources.settings.datasources = [
|
||||||
|
{
|
||||||
|
type = "prometheus";
|
||||||
|
name = "Prometheus";
|
||||||
|
url = "http://[::1]:9090";
|
||||||
|
isDefault = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
virtualHosts = {
|
||||||
|
"grafana.astatine.net.clerie.de" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
basicAuthFile = config.sops.secrets.monitoring-htpasswd.path;
|
||||||
|
locations."/".proxyPass = "http://[::1]:3001/";
|
||||||
|
locations."= /api/live/ws" = {
|
||||||
|
proxyPass = "http://[::1]:3001";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
18
hosts/astatine/mu5001tool.nix
Normal file
18
hosts/astatine/mu5001tool.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
systemd.services."mu5001tool" = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
DynamicUser = true;
|
||||||
|
LoadCredential = "zte-hypermobile-5g-password:${config.sops.secrets."zte-hypermobile-5g-password".path}";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = "15s";
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
${lib.getExe pkgs.mu5001tool} --password-file ''${CREDENTIALS_DIRECTORY}/zte-hypermobile-5g-password prometheus-exporter --listen-port 9242
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
46
hosts/astatine/prometheus.nix
Normal file
46
hosts/astatine/prometheus.nix
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.prometheus = {
|
||||||
|
enable = true;
|
||||||
|
enableReload = true;
|
||||||
|
listenAddress = "[::1]";
|
||||||
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "prometheus";
|
||||||
|
scrape_interval = "20s";
|
||||||
|
scheme = "http";
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = [
|
||||||
|
"[::1]:9090"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
job_name = "mu5001tool";
|
||||||
|
scrape_interval = "20s";
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = [
|
||||||
|
"[::1]:9242"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
virtualHosts = {
|
||||||
|
"prometheus.astatine.net.clerie.de" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
basicAuthFile = config.sops.secrets.monitoring-htpasswd.path;
|
||||||
|
locations."/".proxyPass = "http://[::1]:9090/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
{
|
{
|
||||||
"wg-clerie": "ENC[AES256_GCM,data:DbchcO6GTmSFyoHrRAkfu2flaKYrQHPk+rIerekYO4Cto9sqaWLgaSigpS8=,iv:no1xNRVqsKzAN6ssYA0Ir+utOM9tg8OBUT9PY2v0HPA=,tag:lZj1wEPFWHaf52N7YHEQKQ==,type:str]",
|
"wg-clerie": "ENC[AES256_GCM,data:DbchcO6GTmSFyoHrRAkfu2flaKYrQHPk+rIerekYO4Cto9sqaWLgaSigpS8=,iv:no1xNRVqsKzAN6ssYA0Ir+utOM9tg8OBUT9PY2v0HPA=,tag:lZj1wEPFWHaf52N7YHEQKQ==,type:str]",
|
||||||
"wg-monitoring": "ENC[AES256_GCM,data:dTKKeieaGvECkHUpATLorhOgr9Re5CAH25y1WTcSqJZDsvnwD4CBbqMv2QQ=,iv:u1n1wyAW5aNcVYfGN8BmrEhIhtA3EfRDBNu65IdBZMI=,tag:RJYgOpel9uy6dC72MmqS5A==,type:str]",
|
"wg-monitoring": "ENC[AES256_GCM,data:dTKKeieaGvECkHUpATLorhOgr9Re5CAH25y1WTcSqJZDsvnwD4CBbqMv2QQ=,iv:u1n1wyAW5aNcVYfGN8BmrEhIhtA3EfRDBNu65IdBZMI=,tag:RJYgOpel9uy6dC72MmqS5A==,type:str]",
|
||||||
|
"monitoring-htpasswd": "ENC[AES256_GCM,data:0uQ+Gwedi9kTaOzrwVzkNkS9qL0Dwmph1leK2sj/TndfSn3yaq7ur7ZHoPjWUl5Oy1poxU2rIUxWHajYC0n3yHv2AuGT,iv:FyH4MHcgW5iHkAsahNFtshnqqPOMlukg8aYfhcN9onw=,tag:q3BsnyKLrKYi/xDP6GmSkA==,type:str]",
|
||||||
|
"zte-hypermobile-5g-password": "ENC[AES256_GCM,data:lqxQICmWYwMejn8=,iv:TPYOs/cL/ETw7Ee0+YG/+Fhd7ASi0kr4rDLEiste+2Y=,tag:6O6AXIHkIjPm7hJVC4Y/1g==,type:str]",
|
||||||
"sops": {
|
"sops": {
|
||||||
"kms": null,
|
|
||||||
"gcp_kms": null,
|
|
||||||
"azure_kv": null,
|
|
||||||
"hc_vault": null,
|
|
||||||
"age": [
|
"age": [
|
||||||
{
|
{
|
||||||
"recipient": "age1fffvnazdv3ys9ww8v4g832hv5nkvnk6d728syerzvpgskfmfkq8q00whpv",
|
"recipient": "age1fffvnazdv3ys9ww8v4g832hv5nkvnk6d728syerzvpgskfmfkq8q00whpv",
|
||||||
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBMQUF5dkRwdXRmUkJ1SXN5\nLzdOVkhWYUJGdFd4Qklsa1BXeVZlTGx0eDE0ClZmYWNLMEVzaVVXWGkwQUt5ZHF5\nS1c5OU9PWjBTelM5R2phNFdVNncxUUkKLS0tIDlwSXFyZWNVT1dtdGU5dVFSRHNE\nUUpJZHJZRTd6TnBUU2dCWW90UTRVb0UKCWrHWmQTNhez16wgEKj4EQA4+UBRmGQn\n+NHSjBCMBmmTdHb05nENYVK515Z0T/60+9N3VlNyHWS9IgC3mZRUBg==\n-----END AGE ENCRYPTED FILE-----\n"
|
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBMQUF5dkRwdXRmUkJ1SXN5\nLzdOVkhWYUJGdFd4Qklsa1BXeVZlTGx0eDE0ClZmYWNLMEVzaVVXWGkwQUt5ZHF5\nS1c5OU9PWjBTelM5R2phNFdVNncxUUkKLS0tIDlwSXFyZWNVT1dtdGU5dVFSRHNE\nUUpJZHJZRTd6TnBUU2dCWW90UTRVb0UKCWrHWmQTNhez16wgEKj4EQA4+UBRmGQn\n+NHSjBCMBmmTdHb05nENYVK515Z0T/60+9N3VlNyHWS9IgC3mZRUBg==\n-----END AGE ENCRYPTED FILE-----\n"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lastmodified": "2024-04-21T16:03:13Z",
|
"lastmodified": "2025-09-08T21:03:41Z",
|
||||||
"mac": "ENC[AES256_GCM,data:fA8fhOZbX30TYgwZXB7sQDNmck0JRDyAnEXf5nCYtli/Qvs78fTs4DdC08VOpOni8uAVARkFsGSo6Fjo/MpTSDVA8VNYZig/we/bWF+LQlEMCmiqwOI1R6eQ3GPxcRXltlO2aPPlT9BpLwIVZjGGjIsmjpVE8xjkCbLUUqj+UxY=,iv:fHLyw96QLVRrAQky2kR7TDDxf8CNXDV9lVQ5RETzJEI=,tag:y+cG9u3d6vCUmPyNMDRWpA==,type:str]",
|
"mac": "ENC[AES256_GCM,data:ztS/Z6mn8hFAPsks2evJRJFocw/3oz22O2HeSEkY7Mu+bfNvClsJuvuTbnDadB0IwKiLDFWRMGs/UPFmNP6J/euro4cFHDWXopdXg7eDFGDoJDKIg4fBUtofdXIqWvDoQ9LeZNvc5Z4EEQYhs3LwFnAU0x15acwIIxr5TB9l8g8=,iv:WVjavmcrEs2CyYTfoTTP44c9TqFubUdE+PBN2jRPR+s=,tag:fBXzU69Q9MwD3o/Nyu5OZA==,type:str]",
|
||||||
"pgp": [
|
"pgp": [
|
||||||
{
|
{
|
||||||
"created_at": "2024-04-21T16:02:41Z",
|
"created_at": "2024-04-21T16:02:41Z",
|
||||||
@@ -24,4 +22,4 @@
|
|||||||
"unencrypted_suffix": "_unencrypted",
|
"unencrypted_suffix": "_unencrypted",
|
||||||
"version": "3.8.1"
|
"version": "3.8.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,7 +237,7 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
clerie.system-auto-upgrade = {
|
services.bijwerken = {
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
clerie.system-auto-upgrade = {
|
services.bijwerken = {
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
startAt = "*-*-* 06:22:00";
|
startAt = "*-*-* 06:22:00";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
clerie.system-auto-upgrade = {
|
services.bijwerken = {
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
startAt = "*-*-* 07:22:00";
|
startAt = "*-*-* 07:22:00";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -161,7 +161,7 @@
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
clerie.system-auto-upgrade = {
|
services.bijwerken = {
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
|
||||||
clerie.system-auto-upgrade = {
|
services.bijwerken = {
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,6 @@
|
|||||||
[
|
[
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
||||||
../../configuration/desktop
|
|
||||||
|
|
||||||
./android.nix
|
./android.nix
|
||||||
./backup.nix
|
./backup.nix
|
||||||
./etesync-dav.nix
|
./etesync-dav.nix
|
||||||
@@ -15,6 +13,8 @@
|
|||||||
./programs.nix
|
./programs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
profiles.clerie.desktop.enable = true;
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|||||||
@@ -11,13 +11,16 @@
|
|||||||
signal-desktop
|
signal-desktop
|
||||||
dino
|
dino
|
||||||
fractal
|
fractal
|
||||||
|
tuba
|
||||||
|
flare-signal
|
||||||
|
|
||||||
tio
|
tio
|
||||||
xournalpp
|
xournalpp
|
||||||
onlyoffice-bin
|
libreoffice
|
||||||
|
|
||||||
krita
|
krita
|
||||||
inkscape
|
inkscape
|
||||||
|
dune3d
|
||||||
|
|
||||||
wireshark
|
wireshark
|
||||||
tcpdump
|
tcpdump
|
||||||
|
|||||||
77
hosts/monitoring-3/dashboards/home.json
Normal file
77
hosts/monitoring-3/dashboards/home.json
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
{
|
||||||
|
"annotations": {
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"builtIn": 1,
|
||||||
|
"datasource": {
|
||||||
|
"type": "datasource",
|
||||||
|
"uid": "grafana"
|
||||||
|
},
|
||||||
|
"enable": true,
|
||||||
|
"hide": true,
|
||||||
|
"iconColor": "rgba(0, 211, 255, 1)",
|
||||||
|
"name": "Annotations & Alerts",
|
||||||
|
"target": {
|
||||||
|
"limit": 100,
|
||||||
|
"matchAny": false,
|
||||||
|
"tags": [],
|
||||||
|
"type": "dashboard"
|
||||||
|
},
|
||||||
|
"type": "dashboard"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"editable": true,
|
||||||
|
"fiscalYearStartMonth": 0,
|
||||||
|
"graphTooltip": 0,
|
||||||
|
"id": 10,
|
||||||
|
"links": [],
|
||||||
|
"panels": [
|
||||||
|
{
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 11,
|
||||||
|
"w": 24,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"id": 2,
|
||||||
|
"options": {
|
||||||
|
"includeVars": false,
|
||||||
|
"keepTime": false,
|
||||||
|
"maxItems": 10,
|
||||||
|
"query": "",
|
||||||
|
"showFolderNames": true,
|
||||||
|
"showHeadings": false,
|
||||||
|
"showRecentlyViewed": false,
|
||||||
|
"showSearch": true,
|
||||||
|
"showStarred": false,
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"pluginVersion": "12.0.2+security-01",
|
||||||
|
"title": "Dashboards",
|
||||||
|
"type": "dashlist"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preload": false,
|
||||||
|
"refresh": "",
|
||||||
|
"schemaVersion": 41,
|
||||||
|
"tags": [],
|
||||||
|
"templating": {
|
||||||
|
"list": []
|
||||||
|
},
|
||||||
|
"time": {
|
||||||
|
"from": "now-6h",
|
||||||
|
"to": "now"
|
||||||
|
},
|
||||||
|
"timepicker": {
|
||||||
|
"hidden": true
|
||||||
|
},
|
||||||
|
"timezone": "browser",
|
||||||
|
"title": "Home",
|
||||||
|
"uid": "OqTN9p2nz",
|
||||||
|
"version": 1
|
||||||
|
}
|
||||||
355
hosts/monitoring-3/dashboards/nginx-exporter.json
Normal file
355
hosts/monitoring-3/dashboards/nginx-exporter.json
Normal file
@@ -0,0 +1,355 @@
|
|||||||
|
{
|
||||||
|
"annotations": {
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"builtIn": 1,
|
||||||
|
"datasource": {
|
||||||
|
"type": "grafana",
|
||||||
|
"uid": "-- Grafana --"
|
||||||
|
},
|
||||||
|
"enable": true,
|
||||||
|
"hide": true,
|
||||||
|
"iconColor": "rgba(0, 211, 255, 1)",
|
||||||
|
"name": "Annotations & Alerts",
|
||||||
|
"type": "dashboard"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"editable": true,
|
||||||
|
"fiscalYearStartMonth": 0,
|
||||||
|
"graphTooltip": 0,
|
||||||
|
"id": 16,
|
||||||
|
"links": [],
|
||||||
|
"panels": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "PBFA97CFB590B2093"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "palette-classic"
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"axisBorderShow": false,
|
||||||
|
"axisCenteredZero": false,
|
||||||
|
"axisColorMode": "text",
|
||||||
|
"axisLabel": "",
|
||||||
|
"axisPlacement": "auto",
|
||||||
|
"barAlignment": 0,
|
||||||
|
"barWidthFactor": 0.6,
|
||||||
|
"drawStyle": "line",
|
||||||
|
"fillOpacity": 0,
|
||||||
|
"gradientMode": "none",
|
||||||
|
"hideFrom": {
|
||||||
|
"legend": false,
|
||||||
|
"tooltip": false,
|
||||||
|
"viz": false
|
||||||
|
},
|
||||||
|
"insertNulls": false,
|
||||||
|
"lineInterpolation": "linear",
|
||||||
|
"lineWidth": 1,
|
||||||
|
"pointSize": 5,
|
||||||
|
"scaleDistribution": {
|
||||||
|
"type": "linear"
|
||||||
|
},
|
||||||
|
"showPoints": "auto",
|
||||||
|
"spanNulls": false,
|
||||||
|
"stacking": {
|
||||||
|
"group": "A",
|
||||||
|
"mode": "none"
|
||||||
|
},
|
||||||
|
"thresholdsStyle": {
|
||||||
|
"mode": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mappings": [],
|
||||||
|
"thresholds": {
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "green"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"unit": "reqps"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 10,
|
||||||
|
"w": 12,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"id": 1,
|
||||||
|
"options": {
|
||||||
|
"legend": {
|
||||||
|
"calcs": [],
|
||||||
|
"displayMode": "list",
|
||||||
|
"placement": "bottom",
|
||||||
|
"showLegend": true
|
||||||
|
},
|
||||||
|
"tooltip": {
|
||||||
|
"hideZeros": false,
|
||||||
|
"mode": "single",
|
||||||
|
"sort": "none"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pluginVersion": "12.0.2+security-01",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "${DS_PROMETHEUS}"
|
||||||
|
},
|
||||||
|
"disableTextWrap": false,
|
||||||
|
"editorMode": "builder",
|
||||||
|
"expr": "sum by(server_name) (rate(nginxlog_http_response_count_total{server_name=~\"$server_name\"}[5m]))",
|
||||||
|
"fullMetaSearch": false,
|
||||||
|
"includeNullMetadata": true,
|
||||||
|
"legendFormat": "__auto",
|
||||||
|
"range": true,
|
||||||
|
"refId": "A",
|
||||||
|
"useBackend": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Total requests",
|
||||||
|
"type": "timeseries"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "PBFA97CFB590B2093"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "palette-classic"
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"axisBorderShow": false,
|
||||||
|
"axisCenteredZero": false,
|
||||||
|
"axisColorMode": "text",
|
||||||
|
"axisLabel": "",
|
||||||
|
"axisPlacement": "auto",
|
||||||
|
"barAlignment": 0,
|
||||||
|
"barWidthFactor": 0.6,
|
||||||
|
"drawStyle": "line",
|
||||||
|
"fillOpacity": 0,
|
||||||
|
"gradientMode": "none",
|
||||||
|
"hideFrom": {
|
||||||
|
"legend": false,
|
||||||
|
"tooltip": false,
|
||||||
|
"viz": false
|
||||||
|
},
|
||||||
|
"insertNulls": false,
|
||||||
|
"lineInterpolation": "linear",
|
||||||
|
"lineWidth": 1,
|
||||||
|
"pointSize": 5,
|
||||||
|
"scaleDistribution": {
|
||||||
|
"type": "linear"
|
||||||
|
},
|
||||||
|
"showPoints": "auto",
|
||||||
|
"spanNulls": false,
|
||||||
|
"stacking": {
|
||||||
|
"group": "A",
|
||||||
|
"mode": "none"
|
||||||
|
},
|
||||||
|
"thresholdsStyle": {
|
||||||
|
"mode": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mappings": [],
|
||||||
|
"thresholds": {
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "green"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"unit": "reqps"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 10,
|
||||||
|
"w": 12,
|
||||||
|
"x": 12,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"id": 2,
|
||||||
|
"options": {
|
||||||
|
"legend": {
|
||||||
|
"calcs": [],
|
||||||
|
"displayMode": "list",
|
||||||
|
"placement": "bottom",
|
||||||
|
"showLegend": true
|
||||||
|
},
|
||||||
|
"tooltip": {
|
||||||
|
"hideZeros": false,
|
||||||
|
"mode": "single",
|
||||||
|
"sort": "none"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pluginVersion": "12.0.2+security-01",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "${DS_PROMETHEUS}"
|
||||||
|
},
|
||||||
|
"disableTextWrap": false,
|
||||||
|
"editorMode": "builder",
|
||||||
|
"expr": "sum by(server_name, method) (rate(nginxlog_http_response_count_total{server_name=~\"$server_name\"}[5m]))",
|
||||||
|
"fullMetaSearch": false,
|
||||||
|
"includeNullMetadata": true,
|
||||||
|
"legendFormat": "{{server_name}}: {{method}}",
|
||||||
|
"range": true,
|
||||||
|
"refId": "A",
|
||||||
|
"useBackend": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Status codes",
|
||||||
|
"type": "timeseries"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "PBFA97CFB590B2093"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "palette-classic"
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"axisBorderShow": false,
|
||||||
|
"axisCenteredZero": false,
|
||||||
|
"axisColorMode": "text",
|
||||||
|
"axisLabel": "",
|
||||||
|
"axisPlacement": "auto",
|
||||||
|
"barAlignment": 0,
|
||||||
|
"barWidthFactor": 0.6,
|
||||||
|
"drawStyle": "line",
|
||||||
|
"fillOpacity": 0,
|
||||||
|
"gradientMode": "none",
|
||||||
|
"hideFrom": {
|
||||||
|
"legend": false,
|
||||||
|
"tooltip": false,
|
||||||
|
"viz": false
|
||||||
|
},
|
||||||
|
"insertNulls": false,
|
||||||
|
"lineInterpolation": "linear",
|
||||||
|
"lineWidth": 1,
|
||||||
|
"pointSize": 5,
|
||||||
|
"scaleDistribution": {
|
||||||
|
"type": "linear"
|
||||||
|
},
|
||||||
|
"showPoints": "auto",
|
||||||
|
"spanNulls": false,
|
||||||
|
"stacking": {
|
||||||
|
"group": "A",
|
||||||
|
"mode": "none"
|
||||||
|
},
|
||||||
|
"thresholdsStyle": {
|
||||||
|
"mode": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mappings": [],
|
||||||
|
"thresholds": {
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "green"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"unit": "reqps"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 10,
|
||||||
|
"w": 12,
|
||||||
|
"x": 0,
|
||||||
|
"y": 10
|
||||||
|
},
|
||||||
|
"id": 3,
|
||||||
|
"options": {
|
||||||
|
"legend": {
|
||||||
|
"calcs": [],
|
||||||
|
"displayMode": "list",
|
||||||
|
"placement": "bottom",
|
||||||
|
"showLegend": true
|
||||||
|
},
|
||||||
|
"tooltip": {
|
||||||
|
"hideZeros": false,
|
||||||
|
"mode": "single",
|
||||||
|
"sort": "none"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pluginVersion": "12.0.2+security-01",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "${DS_PROMETHEUS}"
|
||||||
|
},
|
||||||
|
"disableTextWrap": false,
|
||||||
|
"editorMode": "builder",
|
||||||
|
"expr": "sum by(server_name, status) (rate(nginxlog_http_response_count_total{server_name=~\"$server_name\"}[5m]))",
|
||||||
|
"fullMetaSearch": false,
|
||||||
|
"includeNullMetadata": true,
|
||||||
|
"legendFormat": "{{server_name}}: HTTP {{status}}",
|
||||||
|
"range": true,
|
||||||
|
"refId": "A",
|
||||||
|
"useBackend": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Response codes",
|
||||||
|
"type": "timeseries"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preload": false,
|
||||||
|
"refresh": "30s",
|
||||||
|
"schemaVersion": 41,
|
||||||
|
"tags": [],
|
||||||
|
"templating": {
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"current": {
|
||||||
|
"text": "All",
|
||||||
|
"value": [
|
||||||
|
"$__all"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"definition": "label_values(nginxlog_http_response_count_total,server_name)",
|
||||||
|
"includeAll": true,
|
||||||
|
"label": "vHost",
|
||||||
|
"multi": true,
|
||||||
|
"name": "server_name",
|
||||||
|
"options": [],
|
||||||
|
"query": {
|
||||||
|
"qryType": 1,
|
||||||
|
"query": "label_values(nginxlog_http_response_count_total,server_name)",
|
||||||
|
"refId": "PrometheusVariableQueryEditor-VariableQuery"
|
||||||
|
},
|
||||||
|
"refresh": 1,
|
||||||
|
"regex": "",
|
||||||
|
"type": "query"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"time": {
|
||||||
|
"from": "now-3h",
|
||||||
|
"to": "now"
|
||||||
|
},
|
||||||
|
"timepicker": {},
|
||||||
|
"timezone": "browser",
|
||||||
|
"title": "Nginx Exporter",
|
||||||
|
"uid": "b042a880-3cb0-4dd3-ae48-4745a58af698",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
135
hosts/monitoring-3/dashboards/nixos-status.json
Normal file
135
hosts/monitoring-3/dashboards/nixos-status.json
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
{
|
||||||
|
"annotations": {
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"builtIn": 1,
|
||||||
|
"datasource": {
|
||||||
|
"type": "grafana",
|
||||||
|
"uid": "-- Grafana --"
|
||||||
|
},
|
||||||
|
"enable": true,
|
||||||
|
"hide": true,
|
||||||
|
"iconColor": "rgba(0, 211, 255, 1)",
|
||||||
|
"name": "Annotations & Alerts",
|
||||||
|
"target": {
|
||||||
|
"limit": 100,
|
||||||
|
"matchAny": false,
|
||||||
|
"tags": [],
|
||||||
|
"type": "dashboard"
|
||||||
|
},
|
||||||
|
"type": "dashboard"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"editable": true,
|
||||||
|
"fiscalYearStartMonth": 0,
|
||||||
|
"graphTooltip": 0,
|
||||||
|
"id": 15,
|
||||||
|
"links": [],
|
||||||
|
"panels": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "PBFA97CFB590B2093"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "continuous-RdYlGr"
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"axisPlacement": "auto",
|
||||||
|
"fillOpacity": 70,
|
||||||
|
"hideFrom": {
|
||||||
|
"legend": false,
|
||||||
|
"tooltip": false,
|
||||||
|
"viz": false
|
||||||
|
},
|
||||||
|
"insertNulls": false,
|
||||||
|
"lineWidth": 0,
|
||||||
|
"spanNulls": false
|
||||||
|
},
|
||||||
|
"mappings": [
|
||||||
|
{
|
||||||
|
"options": {
|
||||||
|
"0": {
|
||||||
|
"index": 1,
|
||||||
|
"text": "mismatch"
|
||||||
|
},
|
||||||
|
"1": {
|
||||||
|
"index": 0,
|
||||||
|
"text": "sync"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"thresholds": {
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "red"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 23,
|
||||||
|
"w": 24,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"id": 2,
|
||||||
|
"options": {
|
||||||
|
"alignValue": "left",
|
||||||
|
"legend": {
|
||||||
|
"displayMode": "list",
|
||||||
|
"placement": "bottom",
|
||||||
|
"showLegend": true
|
||||||
|
},
|
||||||
|
"mergeValues": true,
|
||||||
|
"rowHeight": 0.9,
|
||||||
|
"showValue": "auto",
|
||||||
|
"tooltip": {
|
||||||
|
"hideZeros": false,
|
||||||
|
"mode": "single",
|
||||||
|
"sort": "none"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pluginVersion": "12.0.2+security-01",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "PBFA97CFB590B2093"
|
||||||
|
},
|
||||||
|
"editorMode": "builder",
|
||||||
|
"expr": "nixos_current_system_is_sync",
|
||||||
|
"legendFormat": "{{instance}}",
|
||||||
|
"range": true,
|
||||||
|
"refId": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Config is Sync",
|
||||||
|
"type": "state-timeline"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preload": false,
|
||||||
|
"refresh": "5m",
|
||||||
|
"schemaVersion": 41,
|
||||||
|
"tags": [],
|
||||||
|
"templating": {
|
||||||
|
"list": []
|
||||||
|
},
|
||||||
|
"time": {
|
||||||
|
"from": "now-7d",
|
||||||
|
"to": "now"
|
||||||
|
},
|
||||||
|
"timepicker": {},
|
||||||
|
"timezone": "",
|
||||||
|
"title": "NixOS Status",
|
||||||
|
"uid": "W4j3nz1Vz",
|
||||||
|
"version": 3
|
||||||
|
}
|
||||||
211
hosts/monitoring-3/dashboards/smokeping.json
Normal file
211
hosts/monitoring-3/dashboards/smokeping.json
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
{
|
||||||
|
"annotations": {
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"builtIn": 1,
|
||||||
|
"datasource": {
|
||||||
|
"type": "datasource",
|
||||||
|
"uid": "grafana"
|
||||||
|
},
|
||||||
|
"enable": true,
|
||||||
|
"hide": true,
|
||||||
|
"iconColor": "rgba(0, 211, 255, 1)",
|
||||||
|
"name": "Annotations & Alerts",
|
||||||
|
"target": {
|
||||||
|
"limit": 100,
|
||||||
|
"matchAny": false,
|
||||||
|
"tags": [],
|
||||||
|
"type": "dashboard"
|
||||||
|
},
|
||||||
|
"type": "dashboard"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"editable": true,
|
||||||
|
"fiscalYearStartMonth": 0,
|
||||||
|
"graphTooltip": 0,
|
||||||
|
"id": 11,
|
||||||
|
"links": [],
|
||||||
|
"panels": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "PBFA97CFB590B2093"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "palette-classic"
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"axisBorderShow": false,
|
||||||
|
"axisCenteredZero": false,
|
||||||
|
"axisColorMode": "text",
|
||||||
|
"axisLabel": "",
|
||||||
|
"axisPlacement": "auto",
|
||||||
|
"barAlignment": 0,
|
||||||
|
"barWidthFactor": 0.6,
|
||||||
|
"drawStyle": "line",
|
||||||
|
"fillOpacity": 0,
|
||||||
|
"gradientMode": "none",
|
||||||
|
"hideFrom": {
|
||||||
|
"legend": false,
|
||||||
|
"tooltip": false,
|
||||||
|
"viz": false
|
||||||
|
},
|
||||||
|
"insertNulls": false,
|
||||||
|
"lineInterpolation": "linear",
|
||||||
|
"lineWidth": 1,
|
||||||
|
"pointSize": 5,
|
||||||
|
"scaleDistribution": {
|
||||||
|
"type": "linear"
|
||||||
|
},
|
||||||
|
"showPoints": "auto",
|
||||||
|
"spanNulls": false,
|
||||||
|
"stacking": {
|
||||||
|
"group": "A",
|
||||||
|
"mode": "none"
|
||||||
|
},
|
||||||
|
"thresholdsStyle": {
|
||||||
|
"mode": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mappings": [],
|
||||||
|
"thresholds": {
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "green"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "red",
|
||||||
|
"value": 80
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"unit": "s"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 22,
|
||||||
|
"w": 24,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"id": 2,
|
||||||
|
"options": {
|
||||||
|
"legend": {
|
||||||
|
"calcs": [],
|
||||||
|
"displayMode": "list",
|
||||||
|
"placement": "bottom",
|
||||||
|
"showLegend": true
|
||||||
|
},
|
||||||
|
"tooltip": {
|
||||||
|
"hideZeros": false,
|
||||||
|
"mode": "single",
|
||||||
|
"sort": "none"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pluginVersion": "12.0.2+security-01",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "PBFA97CFB590B2093"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"exemplar": true,
|
||||||
|
"expr": "probe_icmp_duration_seconds{job=\"blackbox_icmp6\", target=~\"$target\", instance=~\"$instance\", phase=\"rtt\"} > 0 ",
|
||||||
|
"interval": "",
|
||||||
|
"legendFormat": "IPv6 {{target}} ({{instance}})",
|
||||||
|
"range": true,
|
||||||
|
"refId": "A"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "PBFA97CFB590B2093"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"exemplar": true,
|
||||||
|
"expr": "probe_icmp_duration_seconds{job=\"blackbox_icmp4\", target=~\"$target\", instance=~\"$instance\", phase=\"rtt\"} > 0",
|
||||||
|
"hide": false,
|
||||||
|
"interval": "",
|
||||||
|
"legendFormat": "IPv4 {{target}} ({{instance}})",
|
||||||
|
"range": true,
|
||||||
|
"refId": "B"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Smokeping",
|
||||||
|
"type": "timeseries"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preload": false,
|
||||||
|
"refresh": "",
|
||||||
|
"schemaVersion": 41,
|
||||||
|
"tags": [],
|
||||||
|
"templating": {
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"current": {
|
||||||
|
"text": "All",
|
||||||
|
"value": "$__all"
|
||||||
|
},
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "PBFA97CFB590B2093"
|
||||||
|
},
|
||||||
|
"definition": "label_values(probe_icmp_duration_seconds{phase=\"rtt\"}, target)",
|
||||||
|
"includeAll": true,
|
||||||
|
"label": "Target:",
|
||||||
|
"multi": true,
|
||||||
|
"name": "target",
|
||||||
|
"options": [],
|
||||||
|
"query": {
|
||||||
|
"query": "label_values(probe_icmp_duration_seconds{phase=\"rtt\"}, target)",
|
||||||
|
"refId": "StandardVariableQuery"
|
||||||
|
},
|
||||||
|
"refresh": 1,
|
||||||
|
"regex": "",
|
||||||
|
"type": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"current": {
|
||||||
|
"text": [
|
||||||
|
"All"
|
||||||
|
],
|
||||||
|
"value": [
|
||||||
|
"$__all"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "PBFA97CFB590B2093"
|
||||||
|
},
|
||||||
|
"definition": "label_values(probe_icmp_duration_seconds{phase=\"rtt\"}, instance)",
|
||||||
|
"includeAll": true,
|
||||||
|
"label": "Instance:",
|
||||||
|
"multi": true,
|
||||||
|
"name": "instance",
|
||||||
|
"options": [],
|
||||||
|
"query": {
|
||||||
|
"query": "label_values(probe_icmp_duration_seconds{phase=\"rtt\"}, instance)",
|
||||||
|
"refId": "StandardVariableQuery"
|
||||||
|
},
|
||||||
|
"refresh": 1,
|
||||||
|
"regex": "",
|
||||||
|
"type": "query"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"time": {
|
||||||
|
"from": "now-30m",
|
||||||
|
"to": "now"
|
||||||
|
},
|
||||||
|
"timepicker": {},
|
||||||
|
"timezone": "",
|
||||||
|
"title": "Smokeping",
|
||||||
|
"uid": "IytTVZL7z",
|
||||||
|
"version": 9
|
||||||
|
}
|
||||||
@@ -52,6 +52,12 @@ let
|
|||||||
attrByPath ["clerie" "monitoring" "blackbox"] false host.config)
|
attrByPath ["clerie" "monitoring" "blackbox"] false host.config)
|
||||||
monitoringHosts);
|
monitoringHosts);
|
||||||
|
|
||||||
|
nginxlogMonitoringTargets = mapAttrsToList (name: host:
|
||||||
|
"${host.config.networking.hostName}.mon.clerie.de:9117")
|
||||||
|
(filterAttrs (name: host:
|
||||||
|
attrByPath ["services" "prometheus" "exporters" "nginxlog" "enable"] false host.config)
|
||||||
|
monitoringHosts);
|
||||||
|
|
||||||
eachWithEachOther = (f: x: y: lib.lists.flatten (lib.lists.forEach x (a: lib.lists.forEach y (b: f a b))));
|
eachWithEachOther = (f: x: y: lib.lists.flatten (lib.lists.forEach x (a: lib.lists.forEach y (b: f a b))));
|
||||||
|
|
||||||
in {
|
in {
|
||||||
@@ -104,6 +110,21 @@ in {
|
|||||||
relabelAddressToInstance
|
relabelAddressToInstance
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
job_name = "alertmanager";
|
||||||
|
scrape_interval = "20s";
|
||||||
|
scheme = "http";
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = [
|
||||||
|
"monitoring-3.mon.clerie.de:9093"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
relabel_configs = [
|
||||||
|
relabelAddressToInstance
|
||||||
|
];
|
||||||
|
}
|
||||||
{
|
{
|
||||||
job_name = "node-exporter";
|
job_name = "node-exporter";
|
||||||
scrape_interval = "20s";
|
scrape_interval = "20s";
|
||||||
@@ -521,12 +542,24 @@ in {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
job_name = "nginxlog-exporter";
|
||||||
|
scrape_interval = "20s";
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = nginxlogMonitoringTargets;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
relabel_configs = [
|
||||||
|
relabelAddressToInstance
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
alertmanagers = [
|
alertmanagers = [
|
||||||
{
|
{
|
||||||
static_configs = [ {
|
static_configs = [ {
|
||||||
targets = [
|
targets = [
|
||||||
"[::1]:9093"
|
"monitoring-3.mon.clerie.de:9093"
|
||||||
];
|
];
|
||||||
} ];
|
} ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,9 +89,24 @@ groups:
|
|||||||
description: "GPG with fingerprint {{ $labels.fingerprint }} is expiring in less then six weeks"
|
description: "GPG with fingerprint {{ $labels.fingerprint }} is expiring in less then six weeks"
|
||||||
- alert: NadjaTopIPv4ProxyBroken
|
- alert: NadjaTopIPv4ProxyBroken
|
||||||
expr: probe_success{job="blackbox_local_http6", target="blog.nadja.top"} != on (target) probe_success{job="blackbox_local_http4", target="blog.nadja.top"}
|
expr: probe_success{job="blackbox_local_http6", target="blog.nadja.top"} != on (target) probe_success{job="blackbox_local_http4", target="blog.nadja.top"}
|
||||||
for: 5m
|
for: 15m
|
||||||
labels:
|
labels:
|
||||||
severity: critical
|
severity: critical
|
||||||
annotations:
|
annotations:
|
||||||
summary: "blog.nadja.top unreachable via IPv4"
|
summary: "blog.nadja.top unreachable via IPv4"
|
||||||
description: "blog.nadja.top unreachable IPv4, but reachable via IPv6"
|
description: "blog.nadja.top unreachable IPv4, but reachable via IPv6"
|
||||||
|
- alert: AlertmanagerNotificationRequestsFailed
|
||||||
|
expr: rate(alertmanager_notification_requests_failed_total[5m]) > 0
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
annotations:
|
||||||
|
summary: "Too many notification requests failed"
|
||||||
|
description: "Too many notification requests to Alertmanager integration {{ $labels.integration }} failed"
|
||||||
|
- alert: FemSocialDown
|
||||||
|
expr: min(probe_success{target="fem.social", job=~"blackbox_local_http.*"}) == 0
|
||||||
|
for: 5m
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
annotations:
|
||||||
|
summary: "fem.social unavailable via HTTP"
|
||||||
|
description: "fem.social is not fully reachable via HTTP"
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
networking.firewall.allowedUDPPorts = [];
|
networking.firewall.allowedUDPPorts = [];
|
||||||
|
|
||||||
clerie.system-auto-upgrade = {
|
services.bijwerken = {
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
networking.firewall.allowedUDPPorts = [];
|
networking.firewall.allowedUDPPorts = [];
|
||||||
|
|
||||||
clerie.system-auto-upgrade = {
|
services.bijwerken = {
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
clerie.system-auto-upgrade = {
|
services.bijwerken = {
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,28 @@ with lib;
|
|||||||
};
|
};
|
||||||
users.groups.data-em = {};
|
users.groups.data-em = {};
|
||||||
|
|
||||||
|
users.users.data-em-mp3 = {
|
||||||
|
group = "data-em-mp3";
|
||||||
|
home = "/data/em-mp3";
|
||||||
|
useDefaultShell = true;
|
||||||
|
isSystemUser = true;
|
||||||
|
};
|
||||||
|
users.groups.data-em-mp3 = {};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d /data/em - data-em data-em - -"
|
"d /data/em - data-em data-em - -"
|
||||||
|
"d /data/em-mp3 - data-em-mp3 data-em-mp3 - -"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
systemd.services.convert-flac-dir-to-mp3 = {
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = "${lib.getExe pkgs.convert-flac-dir-to-mp3} /data/em /data/em-mp3";
|
||||||
|
StateDirectory = "convert-flac-dir-to-mp3";
|
||||||
|
WorkingDirectory = "/var/lib/convert-flac-dir-to-mp3";
|
||||||
|
User = "data-em-mp3";
|
||||||
|
Group = "data-em-mp3";
|
||||||
|
};
|
||||||
|
startAt = "*-*-* 03:47:00";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,17 +53,23 @@ in {
|
|||||||
"mixcloud.clerie.de" = {
|
"mixcloud.clerie.de" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
basicAuthFile = config.sops.secrets.mixcloud-htpasswd.path;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
alias = "/data/mixcloud/";
|
alias = "/data/mixcloud/";
|
||||||
basicAuthFile = config.sops.secrets.mixcloud-htpasswd.path;
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
autoindex on;
|
autoindex on;
|
||||||
autoindex_exact_size off;
|
autoindex_exact_size off;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
locations."/api/" = {
|
||||||
|
alias = "/data/mixcloud/";
|
||||||
|
extraConfig = ''
|
||||||
|
autoindex on;
|
||||||
|
autoindex_format json;
|
||||||
|
'';
|
||||||
|
};
|
||||||
locations."/media/" = {
|
locations."/media/" = {
|
||||||
alias = "/data/media/";
|
alias = "/data/media/";
|
||||||
basicAuthFile = config.sops.secrets.mixcloud-htpasswd.path;
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
autoindex on;
|
autoindex on;
|
||||||
autoindex_exact_size off;
|
autoindex_exact_size off;
|
||||||
|
|||||||
195
hosts/web-2/blocked-prefixes.txt
Normal file
195
hosts/web-2/blocked-prefixes.txt
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
ip6tables -I nixos-fw -s 2400:3200::/48 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 2400:3200:baba::/48 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 2400:b200:4100::/46 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 2401:8680:4100::/48 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 2401:b180:4100::/48 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 2404:2280:1000::/36 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 2404:2280:2000::/35 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 2404:2280:4000::/36 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 2408:4000:1000::/48 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 2408:4009:500::/48 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4000::/31 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4002::/32 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4004::/31 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4006::/48 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4006:1000::/43 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4006:1020::/44 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4007::/32 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4009::/32 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:400b::/32 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:400c::/30 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4011::/32 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4012::/48 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4013::/32 -j nixos-fw-refuse
|
||||||
|
ip6tables -I nixos-fw -s 240b:4014::/32 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 5.181.224.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.208.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.209.0.0/19 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.209.36.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.209.40.0/21 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.209.48.0/20 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.209.64.0/18 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.209.128.0/17 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.210.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.212.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.213.0.0/17 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.213.128.0/19 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.213.160.0/21 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.213.176.0/20 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.213.192.0/18 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.214.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.216.0.0/14 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.220.64.0/18 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.220.128.0/17 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.221.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 8.222.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 14.1.112.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.91.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.1.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.2.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.4.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.7.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.8.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.17.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.19.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.20.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.24.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.27.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.28.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.32.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.40.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.52.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.56.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.58.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.66.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.68.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.72.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.78.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.80.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.84.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.86.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.88.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.96.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.100.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.102.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.104.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.96.106.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.98.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.100.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.102.0.0/17 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.103.0.0/17 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.104.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 43.108.0.0/17 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 45.196.28.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 45.199.179.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.52.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.56.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.74.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.76.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.77.0.0/20 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.77.16.0/21 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.77.24.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.77.32.0/19 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.77.64.0/19 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.77.96.0/20 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.77.128.0/17 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.78.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.79.0.0/17 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.79.128.0/19 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.79.192.0/18 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.80.0.0/14 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.84.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.86.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.87.0.0/17 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.87.128.0/18 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.87.192.0/19 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.87.224.0/21 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.87.232.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.88.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.89.0.0/18 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.89.72.0/21 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.89.80.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.89.84.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.89.88.0/21 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.89.96.0/20 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.89.122.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.89.124.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.89.128.0/17 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.90.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.235.0.0/21 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.235.8.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.235.12.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.235.16.0/20 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.236.0.0/14 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.240.0.0/14 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.244.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.32.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.66.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.68.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.72.0/21 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.80.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.82.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.84.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.88.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.92.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.96.0/20 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.120.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.122.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.124.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.128.0/20 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.144.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.150.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.152.0/21 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.160.0/19 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.246.192.0/21 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.250.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.252.0.0/15 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 47.254.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 59.82.136.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 103.81.186.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 110.76.21.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 110.76.23.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 116.251.64.0/18 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 139.95.0.0/20 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 139.95.16.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 139.95.64.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 140.205.1.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 140.205.122.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 147.139.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 149.129.0.0/20 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 149.129.16.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 149.129.32.0/19 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 149.129.64.0/18 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 149.129.192.0/18 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 156.227.20.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 156.236.12.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 156.236.17.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 156.240.76.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 156.245.1.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 161.117.0.0/16 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.24.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.29.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.30.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.32.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.64.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.66.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.68.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.72.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.76.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.80.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.84.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.86.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.88.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.90.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.92.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.104.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.136.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 170.33.138.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 185.78.106.0/23 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 198.11.128.0/18 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 202.144.199.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 203.107.64.0/22 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 203.107.68.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 205.204.96.0/19 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 223.5.5.0/24 -j nixos-fw-refuse
|
||||||
|
iptables -I nixos-fw -s 223.6.6.0/24 -j nixos-fw-refuse
|
||||||
@@ -53,9 +53,6 @@
|
|||||||
'';
|
'';
|
||||||
return = "200 ''";
|
return = "200 ''";
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
|
||||||
access_log /var/log/nginx/clerie.de.log combined_anon;
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,8 @@
|
|||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
|
||||||
|
networking.firewall.extraCommands = builtins.readFile ./blocked-prefixes.txt;
|
||||||
|
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.postgresql_16;
|
package = pkgs.postgresql_16;
|
||||||
|
|||||||
@@ -83,9 +83,6 @@
|
|||||||
proxyPass = "http://[::1]:3000";
|
proxyPass = "http://[::1]:3000";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
|
||||||
access_log /var/log/nginx/git.clerie.de.log combined_anon;
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,9 +53,6 @@
|
|||||||
types { } default_type "text/html; charset=utf-8";
|
types { } default_type "text/html; charset=utf-8";
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
|
||||||
access_log /var/log/nginx/ip.clerie.de.log vcombined_anon;
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
"ip4.clerie.de" = {
|
"ip4.clerie.de" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
@@ -67,9 +64,6 @@
|
|||||||
add_header Access-Control-Allow-Origin *;
|
add_header Access-Control-Allow-Origin *;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
|
||||||
access_log /var/log/nginx/ip.clerie.de.log vcombined_anon;
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
"ip6.clerie.de" = {
|
"ip6.clerie.de" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
@@ -81,9 +75,6 @@
|
|||||||
add_header Access-Control-Allow-Origin *;
|
add_header Access-Control-Allow-Origin *;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
|
||||||
access_log /var/log/nginx/ip.clerie.de.log vcombined_anon;
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
root = pkgs.fetchgit {
|
root = pkgs.fetchgit {
|
||||||
url = "https://git.clerie.de/clerie/legal.clerie.de.git";
|
url = "https://git.clerie.de/clerie/legal.clerie.de.git";
|
||||||
rev = "c6900226e3107a2e370a32759d83db472ab5450d";
|
rev = "b271b9729f4545c340ce9d16ecbca136031da409";
|
||||||
sha256 = "sha256-lOjbHqYc/85rjotwQ5Oj+MSWnDIfLx2w5mpiJkChbXU=";
|
sha256 = "sha256-uw69o7LxK+JF1AojSyusU1urshBc63Bgva5lRBgQdKc=";
|
||||||
};
|
};
|
||||||
locations."/impressum" = {
|
locations."/impressum" = {
|
||||||
return = ''301 https://legal.clerie.de/#impressum'';
|
return = ''301 https://legal.clerie.de/#impressum'';
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
[
|
[
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
||||||
../../configuration/desktop
|
|
||||||
|
|
||||||
./initrd.nix
|
./initrd.nix
|
||||||
./programs.nix
|
./programs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
profiles.clerie.desktop.enable = true;
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.clerie.system-auto-upgrade;
|
cfg = config.services.bijwerken;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
clerie.system-auto-upgrade = {
|
services.bijwerken = {
|
||||||
enable = mkEnableOption "clerie system upgrade";
|
enable = mkEnableOption "Automatic system upgrades";
|
||||||
autoUpgrade = mkOption {
|
autoUpgrade = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
@@ -20,10 +20,15 @@ in
|
|||||||
default = null;
|
default = null;
|
||||||
description = "Systemd time string for starting the unit";
|
description = "Systemd time string for starting the unit";
|
||||||
};
|
};
|
||||||
|
nodeExporterTextfilePath = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "Path to node exporter textfile for putting metrics";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.services.clerie-system-auto-upgrade = {
|
systemd.services.bijwerken-system-upgrade = {
|
||||||
requires = [ "network-online.target" ];
|
requires = [ "network-online.target" ];
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
|
|
||||||
@@ -33,10 +38,10 @@ in
|
|||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = pkgs.clerie-system-upgrade + "/bin/clerie-system-upgrade --no-confirm${optionalString (config.clerie.monitoring.enable) " --node-exporter-metrics-path /var/lib/prometheus-node-exporter/textfiles/clerie-system-upgrade.prom"}";
|
ExecStart = (getExe pkgs.bijwerken-system-upgrade) + " --no-confirm${optionalString (cfg.nodeExporterTextfilePath != null) " --node-exporter-metrics-path ${cfg.nodeExporterTextfilePath}"}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
systemd.timers.clerie-system-auto-upgrade = mkIf cfg.autoUpgrade {
|
systemd.timers.bijwerken-system-upgrade = mkIf cfg.autoUpgrade {
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnCalendar = if cfg.startAt == null then "*-*-* 05:37:00" else cfg.startAt;
|
OnCalendar = if cfg.startAt == null then "*-*-* 05:37:00" else cfg.startAt;
|
||||||
@@ -46,7 +51,7 @@ in
|
|||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
};
|
};
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
clerie-system-upgrade
|
bijwerken-system-upgrade
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -5,9 +5,9 @@
|
|||||||
./policyrouting
|
./policyrouting
|
||||||
./akne
|
./akne
|
||||||
./backup
|
./backup
|
||||||
|
./bijwerken
|
||||||
./clerie-firewall
|
./clerie-firewall
|
||||||
./clerie-gc-dir
|
./clerie-gc-dir
|
||||||
./clerie-system-upgrade
|
|
||||||
./dhcpcd-prefixdelegation
|
./dhcpcd-prefixdelegation
|
||||||
./minecraft-server
|
./minecraft-server
|
||||||
./monitoring
|
./monitoring
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ in
|
|||||||
|
|
||||||
systemd.services."prometheus-node-exporter".serviceConfig.RestrictAddressFamilies = [ "AF_NETLINK" ];
|
systemd.services."prometheus-node-exporter".serviceConfig.RestrictAddressFamilies = [ "AF_NETLINK" ];
|
||||||
|
|
||||||
|
services.bijwerken.nodeExporterTextfilePath = "/var/lib/prometheus-node-exporter/textfiles/bijwerken-system-upgrade.prom";
|
||||||
|
|
||||||
services.prometheus.exporters.bird = mkIf cfg.bird {
|
services.prometheus.exporters.bird = mkIf cfg.bird {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
@@ -102,6 +104,33 @@ in
|
|||||||
listen = "[::]:9152";
|
listen = "[::]:9152";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.prometheus.exporters.nginxlog = mkIf config.services.nginx.enable {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
namespaces = [
|
||||||
|
{
|
||||||
|
name = "nginxlog";
|
||||||
|
format = ''$host: $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$server_name" rt="$request_time" uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"'';
|
||||||
|
source = {
|
||||||
|
files = [
|
||||||
|
"/var/log/nginx/access.log"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
relabel_configs = [
|
||||||
|
{
|
||||||
|
target_label = "server_name";
|
||||||
|
from = "server_name";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services."prometheus-nginxlog-exporter".serviceConfig = {
|
||||||
|
SupplementaryGroups = "nginx";
|
||||||
|
};
|
||||||
|
|
||||||
networking.firewall.interfaces."wg-monitoring".allowedTCPPorts = [
|
networking.firewall.interfaces."wg-monitoring".allowedTCPPorts = [
|
||||||
9100 # node-exporter
|
9100 # node-exporter
|
||||||
9152 # nixos-exporter
|
9152 # nixos-exporter
|
||||||
@@ -109,6 +138,8 @@ in
|
|||||||
9324 # bird-exporter
|
9324 # bird-exporter
|
||||||
] else []) ++ (if cfg.blackbox then [
|
] else []) ++ (if cfg.blackbox then [
|
||||||
9115 # blackbox-exporter
|
9115 # blackbox-exporter
|
||||||
|
] else []) ++ (if config.services.prometheus.exporters.nginxlog.enable then [
|
||||||
|
config.services.prometheus.exporters.nginxlog.port
|
||||||
] else []);
|
] else []);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
5
pkgs/bijwerken-poke/bijwerken-poke.sh
Executable file
5
pkgs/bijwerken-poke/bijwerken-poke.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
TARGETS="$(nix --extra-experimental-features "nix-command flakes" eval --raw ".#nixosConfigurations" --apply "nixosConfigurations: builtins.concatStringsSep \"\\n\" (builtins.attrValues (builtins.mapAttrs (name: host: host.config.networking.fqdn) nixosConfigurations))")"
|
||||||
|
|
||||||
|
pssh -h <(echo "${TARGETS}") -i -- sudo systemctl start bijwerken-system-upgrade.service --no-block
|
||||||
10
pkgs/bijwerken-poke/default.nix
Normal file
10
pkgs/bijwerken-poke/default.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "bijwerken-poke";
|
||||||
|
text = builtins.readFile ./bijwerken-poke.sh;
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
pssh
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ if [[ -z $NO_CONFIRM ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Download ${STORE_PATH}"
|
echo "Download ${STORE_PATH}"
|
||||||
nix copy --from "https://nix-cache.clerie.de" "${STORE_PATH}"
|
nix copy --to daemon "${STORE_PATH}"
|
||||||
|
|
||||||
echo "Add to system profile"
|
echo "Add to system profile"
|
||||||
nix-env -p "/nix/var/nix/profiles/system" --set "${STORE_PATH}"
|
nix-env -p "/nix/var/nix/profiles/system" --set "${STORE_PATH}"
|
||||||
@@ -50,7 +50,7 @@ echo "Set as boot target"
|
|||||||
|
|
||||||
if [[ -n "$NODE_EXPORTER_METRICS_PATH" ]]; then
|
if [[ -n "$NODE_EXPORTER_METRICS_PATH" ]]; then
|
||||||
echo "Write monitoring check data"
|
echo "Write monitoring check data"
|
||||||
echo "clerie_system_upgrade_last_check $(date +%s)" > "$NODE_EXPORTER_METRICS_PATH"
|
echo "bijwerken_system_upgrade_last_check $(date +%s)" > "$NODE_EXPORTER_METRICS_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BOOTED_SYSTEM_KERNEL="$(readlink /run/booted-system/{initrd,kernel,kernel-modules})"
|
BOOTED_SYSTEM_KERNEL="$(readlink /run/booted-system/{initrd,kernel,kernel-modules})"
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
pkgs.writeShellApplication {
|
pkgs.writeShellApplication {
|
||||||
name = "clerie-system-upgrade";
|
name = "bijwerken-system-upgrade";
|
||||||
text = builtins.readFile ./clerie-system-upgrade.sh;
|
text = builtins.readFile ./bijwerken-system-upgrade.sh;
|
||||||
runtimeInputs = with pkgs; [
|
runtimeInputs = with pkgs; [
|
||||||
curl
|
curl
|
||||||
jq
|
jq
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
python3,
|
python3,
|
||||||
writeTextFile,
|
makeWrapper,
|
||||||
|
runCommand,
|
||||||
lib,
|
lib,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@@ -9,6 +10,7 @@
|
|||||||
text,
|
text,
|
||||||
runtimePackages ? ps: [],
|
runtimePackages ? ps: [],
|
||||||
pythonPackage ? python3,
|
pythonPackage ? python3,
|
||||||
|
runtimeInputs ? [],
|
||||||
meta ? {},
|
meta ? {},
|
||||||
passthru ? {},
|
passthru ? {},
|
||||||
derivationArgs ? {},
|
derivationArgs ? {},
|
||||||
@@ -18,13 +20,17 @@ let
|
|||||||
|
|
||||||
pythonWithPackages = pythonPackage.withPackages runtimePackages;
|
pythonWithPackages = pythonPackage.withPackages runtimePackages;
|
||||||
|
|
||||||
in writeTextFile {
|
in runCommand name ({
|
||||||
inherit
|
passAsFile = [ "text" ] ++ (derivationArgs.passAsFile or []);
|
||||||
name
|
|
||||||
meta
|
meta = {
|
||||||
passthru
|
mainProgram = name;
|
||||||
derivationArgs
|
} // meta // (derivationArgs.meta or {});
|
||||||
;
|
|
||||||
|
passthru = passthru // (derivationArgs.passthru or {});
|
||||||
|
|
||||||
|
nativeBuildInputs = [ makeWrapper ] ++ (derivationArgs.nativeBuildInputs or []);
|
||||||
|
|
||||||
executable = true;
|
executable = true;
|
||||||
destination = "/bin/${name}";
|
destination = "/bin/${name}";
|
||||||
allowSubstitutes = true;
|
allowSubstitutes = true;
|
||||||
@@ -34,4 +40,17 @@ in writeTextFile {
|
|||||||
|
|
||||||
${text}
|
${text}
|
||||||
'';
|
'';
|
||||||
}
|
} // (
|
||||||
|
builtins.removeAttrs derivationArgs [ "passAsFile" "meta" "passthru" "nativeBuildInputs" ]
|
||||||
|
))
|
||||||
|
''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
|
||||||
|
target=$out/bin/${lib.escapeShellArg name}
|
||||||
|
|
||||||
|
cp "$textPath" "$target"
|
||||||
|
|
||||||
|
chmod +x "$target"
|
||||||
|
|
||||||
|
wrapProgram "$target" --prefix PATH : "${lib.makeBinPath runtimeInputs}"
|
||||||
|
''
|
||||||
|
|||||||
109
pkgs/convert-flac-dir-to-mp3/convert-flac-dir-to-mp3.py
Normal file
109
pkgs/convert-flac-dir-to-mp3/convert-flac-dir-to-mp3.py
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
from pathlib import Path
|
||||||
|
from progress.bar import Bar
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
def files_and_dirs_for_directory(path):
|
||||||
|
filepaths = []
|
||||||
|
dirpaths = []
|
||||||
|
|
||||||
|
for dirpath, dirnames, filenames in path.walk():
|
||||||
|
dirpaths.append(dirpath)
|
||||||
|
|
||||||
|
for filename in filenames:
|
||||||
|
filepath = dirpath / filename
|
||||||
|
filepaths.append(filepath)
|
||||||
|
|
||||||
|
return set(filepaths), set(dirpaths)
|
||||||
|
|
||||||
|
def make_paths_relative(paths, relative_to_path):
|
||||||
|
return set(path.relative_to(relative_to_path) for path in paths)
|
||||||
|
|
||||||
|
def replace_suffix(path, suffix):
|
||||||
|
return path.with_name(path.stem + suffix)
|
||||||
|
|
||||||
|
def convert_filepath(path):
|
||||||
|
if path.suffix == ".flac":
|
||||||
|
return replace_suffix(path, ".mp3")
|
||||||
|
|
||||||
|
return path
|
||||||
|
|
||||||
|
def ffmpeg_flac_to_mp3(in_path, out_path):
|
||||||
|
print("")
|
||||||
|
subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "warning", "-stats", "-i", in_path, "-ab", "320k", "-map_metadata", "0", "-id3v2_version", "3", out_path], check=True)
|
||||||
|
print("")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(prog="convert-flac-dir-to-mp3")
|
||||||
|
parser.add_argument("from_dir", type=Path)
|
||||||
|
parser.add_argument("to_dir", type=Path)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
from_path = args.from_dir.absolute()
|
||||||
|
to_path = args.to_dir.absolute()
|
||||||
|
|
||||||
|
if not from_path.exists():
|
||||||
|
raise Exception("from_path does not exist")
|
||||||
|
|
||||||
|
if not to_path.exists():
|
||||||
|
raise Exception("to_path does not exist")
|
||||||
|
|
||||||
|
if not from_path.is_dir():
|
||||||
|
raise Exception("from_path is not a directory")
|
||||||
|
|
||||||
|
if not to_path.is_dir():
|
||||||
|
raise Exception("to_path is not a directory")
|
||||||
|
|
||||||
|
print(f"Converting {from_path} to {to_path}…")
|
||||||
|
|
||||||
|
from_filepaths, from_dirpaths = files_and_dirs_for_directory(from_path)
|
||||||
|
to_filepaths, to_dirpaths = files_and_dirs_for_directory(to_path)
|
||||||
|
|
||||||
|
|
||||||
|
relative_from_filepaths = make_paths_relative(from_filepaths, from_path)
|
||||||
|
relative_to_filepaths = make_paths_relative(to_filepaths, to_path)
|
||||||
|
|
||||||
|
converted_from_filepaths = set(convert_filepath(filepath) for filepath in relative_from_filepaths)
|
||||||
|
|
||||||
|
filepaths_missing_in_to_path = converted_from_filepaths - relative_to_filepaths
|
||||||
|
|
||||||
|
|
||||||
|
relative_from_dirpaths = make_paths_relative(from_dirpaths, from_path)
|
||||||
|
relative_to_dirpaths = make_paths_relative(to_dirpaths, to_path)
|
||||||
|
|
||||||
|
dirpaths_missing_in_to_path = relative_from_dirpaths - relative_to_dirpaths
|
||||||
|
|
||||||
|
print(f"Missing {len(filepaths_missing_in_to_path)} files and {len(dirpaths_missing_in_to_path)} directories")
|
||||||
|
|
||||||
|
if len(dirpaths_missing_in_to_path) > 0:
|
||||||
|
for dirpath in Bar("Creating directories").iter(dirpaths_missing_in_to_path):
|
||||||
|
(to_path / dirpath).mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
if len(filepaths_missing_in_to_path) > 0:
|
||||||
|
for filepath in Bar("Creating files").iter(filepaths_missing_in_to_path):
|
||||||
|
if filepath in relative_from_filepaths:
|
||||||
|
# Just copy the file
|
||||||
|
shutil.copy(from_path / filepath, to_path / filepath)
|
||||||
|
elif filepath.suffix == ".mp3" and replace_suffix(filepath, ".flac") in relative_from_filepaths:
|
||||||
|
# Convert from flac
|
||||||
|
print("")
|
||||||
|
print(f"Converting {to_path / filepath}…")
|
||||||
|
|
||||||
|
# Tempfile for ffmpeg
|
||||||
|
tmpfilepath = filepath.with_name(".~" + filepath.name)
|
||||||
|
(to_path / tmpfilepath).unlink(missing_ok=True)
|
||||||
|
|
||||||
|
print(f"Using tempfile for ffmpeg {to_path / tmpfilepath}…")
|
||||||
|
|
||||||
|
# Convert
|
||||||
|
ffmpeg_flac_to_mp3(from_path / replace_suffix(filepath, ".flac"), to_path / tmpfilepath)
|
||||||
|
|
||||||
|
# Rename tempfile
|
||||||
|
(to_path / tmpfilepath).rename(to_path / filepath)
|
||||||
|
else:
|
||||||
|
raise Exception("Unable to figure out how to get {to_path / filepath} from {from_path}")
|
||||||
8
pkgs/convert-flac-dir-to-mp3/default.nix
Normal file
8
pkgs/convert-flac-dir-to-mp3/default.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
pkgs.clerie-build-support.writePythonScript {
|
||||||
|
name = "convert-flac-dir-to-mp3";
|
||||||
|
runtimePackages = ps: with ps; [ progress ];
|
||||||
|
runtimeInputs = [ pkgs.ffmpeg-headless ];
|
||||||
|
text = builtins.readFile ./convert-flac-dir-to-mp3.py;
|
||||||
|
}
|
||||||
16
pkgs/curl-timings/curl-timings.sh
Executable file
16
pkgs/curl-timings/curl-timings.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
curl -w "Request to %{url}
|
||||||
|
|
||||||
|
time_namelookup: %{time_namelookup}s
|
||||||
|
time_connect: %{time_connect}s
|
||||||
|
time_appconnect: %{time_appconnect}s
|
||||||
|
time_pretransfer: %{time_pretransfer}s
|
||||||
|
time_starttransfer: %{time_starttransfer}s
|
||||||
|
time_posttransfer: %{time_posttransfer}s
|
||||||
|
time_queue: %{time_queue}s
|
||||||
|
time_redirect: %{time_redirect}s
|
||||||
|
time_starttransfer: %{time_starttransfer}s
|
||||||
|
|
||||||
|
time_total: %{time_total}s
|
||||||
|
" -o /dev/null -s "$@"
|
||||||
12
pkgs/curl-timings/default.nix
Normal file
12
pkgs/curl-timings/default.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
curl,
|
||||||
|
writeShellApplication,
|
||||||
|
}:
|
||||||
|
|
||||||
|
writeShellApplication {
|
||||||
|
name = "curl-timings";
|
||||||
|
text = builtins.readFile ./curl-timings.sh;
|
||||||
|
runtimeInputs = [
|
||||||
|
curl
|
||||||
|
];
|
||||||
|
}
|
||||||
7
pkgs/generate-blocked-prefixes/default.nix
Normal file
7
pkgs/generate-blocked-prefixes/default.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
pkgs.clerie-build-support.writePythonScript {
|
||||||
|
name = "generate-blocked-prefixes";
|
||||||
|
runtimePackages = ps: with ps; [ requests ];
|
||||||
|
text = builtins.readFile ./generate-blocked-prefixes.py;
|
||||||
|
}
|
||||||
39
pkgs/generate-blocked-prefixes/generate-blocked-prefixes.py
Executable file
39
pkgs/generate-blocked-prefixes/generate-blocked-prefixes.py
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import ipaddress
|
||||||
|
import requests
|
||||||
|
|
||||||
|
blocked_asns = [
|
||||||
|
"45102", # Alibaba (US) Technology Co., Ltd.
|
||||||
|
]
|
||||||
|
|
||||||
|
r = requests.get('https://bgp.tools/table.txt', stream=True, headers={
|
||||||
|
"User-Agent": "https://git.clerie.de/clerie/nixfiles",
|
||||||
|
})
|
||||||
|
|
||||||
|
selected_ipv6_prefixes = []
|
||||||
|
selected_ipv4_prefixes = []
|
||||||
|
|
||||||
|
for line in r.iter_lines(decode_unicode=True):
|
||||||
|
prefix_string, asn_string = line.split()
|
||||||
|
|
||||||
|
if asn_string in blocked_asns:
|
||||||
|
prefix = ipaddress.ip_network(prefix_string)
|
||||||
|
|
||||||
|
if prefix.version == 6:
|
||||||
|
selected_ipv6_prefixes.append(prefix)
|
||||||
|
else:
|
||||||
|
selected_ipv4_prefixes.append(prefix)
|
||||||
|
|
||||||
|
selected_ipv6_prefixes = list(ipaddress.collapse_addresses(selected_ipv6_prefixes))
|
||||||
|
selected_ipv4_prefixes = list(ipaddress.collapse_addresses(selected_ipv4_prefixes))
|
||||||
|
|
||||||
|
selected_ipv6_prefixes.sort()
|
||||||
|
selected_ipv4_prefixes.sort()
|
||||||
|
|
||||||
|
with open("hosts/web-2/blocked-prefixes.txt", "w") as blocked_ips_file:
|
||||||
|
for ipv6_prefix in selected_ipv6_prefixes:
|
||||||
|
blocked_ips_file.write(f"ip6tables -I nixos-fw -s {ipv6_prefix} -j nixos-fw-refuse\n")
|
||||||
|
|
||||||
|
for ipv4_prefix in selected_ipv4_prefixes:
|
||||||
|
blocked_ips_file.write(f"iptables -I nixos-fw -s {ipv4_prefix} -j nixos-fw-refuse\n")
|
||||||
19
pkgs/grow-last-partition-and-filesystem/default.nix
Normal file
19
pkgs/grow-last-partition-and-filesystem/default.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
e2fsprogs,
|
||||||
|
gptfdisk,
|
||||||
|
jq,
|
||||||
|
parted,
|
||||||
|
writeShellApplication,
|
||||||
|
}:
|
||||||
|
|
||||||
|
writeShellApplication {
|
||||||
|
name = "grow-last-partition-and-filesystem";
|
||||||
|
text = builtins.readFile ./grow-last-partition-and-filesystem.sh;
|
||||||
|
runtimeInputs = [
|
||||||
|
e2fsprogs
|
||||||
|
gptfdisk
|
||||||
|
jq
|
||||||
|
parted
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [[ $# -ne 1 ]]; then
|
||||||
|
echo "Pass device to grow as first argument:"
|
||||||
|
echo "grow-last-partition-and-filesystem DEVICE"
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DEVICE="$1"
|
||||||
|
|
||||||
|
echo "Move GTP backup header to end of disk"
|
||||||
|
sgdisk "${DEVICE}" --move-second-header
|
||||||
|
|
||||||
|
PARTITIONDATA="$(parted --script --json --fix "${DEVICE}" print)"
|
||||||
|
PARTNUMBER="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .number')"
|
||||||
|
PARTNAME="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .name')"
|
||||||
|
|
||||||
|
echo "Growing partition ${DEVICE}${PARTNUMBER} (${PARTNAME})"
|
||||||
|
echo
|
||||||
|
|
||||||
|
parted "${DEVICE}" resizepart "${PARTNUMBER}" 100%
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Resizing filesystem"
|
||||||
|
echo
|
||||||
|
|
||||||
|
resize2fs "${DEVICE}${PARTNUMBER}"
|
||||||
|
|
||||||
|
echo "Done."
|
||||||
@@ -1,27 +1,33 @@
|
|||||||
final: prev: {
|
final: prev: {
|
||||||
|
bijwerken-poke = final.callPackage ./bijwerken-poke {};
|
||||||
|
bijwerken-system-upgrade = final.callPackage ./bijwerken-system-upgrade {};
|
||||||
clerie-backup = final.callPackage ./clerie-backup {};
|
clerie-backup = final.callPackage ./clerie-backup {};
|
||||||
clerie-cleanup-branches = final.callPackage ./clerie-update-nixfiles/clerie-cleanup-branches.nix {};
|
clerie-cleanup-branches = final.callPackage ./clerie-update-nixfiles/clerie-cleanup-branches.nix {};
|
||||||
clerie-keys = final.callPackage ./clerie-keys {};
|
clerie-keys = final.callPackage ./clerie-keys {};
|
||||||
clerie-ssh-known-hosts = final.callPackage ./clerie-ssh-known-hosts {};
|
clerie-ssh-known-hosts = final.callPackage ./clerie-ssh-known-hosts {};
|
||||||
clerie-system-remote-install = final.callPackage ./clerie-system-remote-install {};
|
clerie-system-remote-install = final.callPackage ./clerie-system-remote-install {};
|
||||||
clerie-system-upgrade = final.callPackage ./clerie-system-upgrade/clerie-system-upgrade.nix {};
|
|
||||||
clerie-merge-nixfiles-update = final.callPackage ./clerie-update-nixfiles/clerie-merge-nixfiles-update.nix {};
|
clerie-merge-nixfiles-update = final.callPackage ./clerie-update-nixfiles/clerie-merge-nixfiles-update.nix {};
|
||||||
clerie-sops = final.callPackage ./clerie-sops/clerie-sops.nix {};
|
clerie-sops = final.callPackage ./clerie-sops/clerie-sops.nix {};
|
||||||
clerie-sops-config = final.callPackage ./clerie-sops/clerie-sops-config.nix {};
|
clerie-sops-config = final.callPackage ./clerie-sops/clerie-sops-config.nix {};
|
||||||
clerie-sops-edit = final.callPackage ./clerie-sops/clerie-sops-edit.nix {};
|
clerie-sops-edit = final.callPackage ./clerie-sops/clerie-sops-edit.nix {};
|
||||||
clerie-update-nixfiles = final.callPackage ./clerie-update-nixfiles/clerie-update-nixfiles.nix {};
|
clerie-update-nixfiles = final.callPackage ./clerie-update-nixfiles/clerie-update-nixfiles.nix {};
|
||||||
chromium-incognito = final.callPackage ./chromium-incognito {};
|
chromium-incognito = final.callPackage ./chromium-incognito {};
|
||||||
|
convert-flac-dir-to-mp3 = final.callPackage ./convert-flac-dir-to-mp3 {};
|
||||||
|
curl-timings = final.callPackage ./curl-timings {};
|
||||||
factorio-launcher = final.callPackage ./factorio-launcher {};
|
factorio-launcher = final.callPackage ./factorio-launcher {};
|
||||||
feeds-dir = final.callPackage ./feeds-dir {};
|
feeds-dir = final.callPackage ./feeds-dir {};
|
||||||
|
generate-blocked-prefixes = final.callPackage ./generate-blocked-prefixes {};
|
||||||
git-checkout-github-pr = final.callPackage ./git-checkout-github-pr {};
|
git-checkout-github-pr = final.callPackage ./git-checkout-github-pr {};
|
||||||
git-diff-word = final.callPackage ./git-diff-word {};
|
git-diff-word = final.callPackage ./git-diff-word {};
|
||||||
git-pp = final.callPackage ./git-pp {};
|
git-pp = final.callPackage ./git-pp {};
|
||||||
git-show-link = final.callPackage ./git-show-link {};
|
git-show-link = final.callPackage ./git-show-link {};
|
||||||
|
grow-last-partition-and-filesystem = final.callPackage ./grow-last-partition-and-filesystem {};
|
||||||
nix-remove-result-links = final.callPackage ./nix-remove-result-links {};
|
nix-remove-result-links = final.callPackage ./nix-remove-result-links {};
|
||||||
nixfiles-auto-install = final.callPackage ./nixfiles/nixfiles-auto-install.nix {};
|
nixfiles-auto-install = final.callPackage ./nixfiles/nixfiles-auto-install.nix {};
|
||||||
nixfiles-generate-config = final.callPackage ./nixfiles/nixfiles-generate-config.nix {};
|
nixfiles-generate-config = final.callPackage ./nixfiles/nixfiles-generate-config.nix {};
|
||||||
nixfiles-generate-backup-secrets = final.callPackage ./nixfiles/nixfiles-generate-backup-secrets.nix {};
|
nixfiles-generate-backup-secrets = final.callPackage ./nixfiles/nixfiles-generate-backup-secrets.nix {};
|
||||||
nixfiles-update-ssh-host-keys = final.callPackage ./nixfiles/nixfiles-update-ssh-host-keys.nix {};
|
nixfiles-update-ssh-host-keys = final.callPackage ./nixfiles/nixfiles-update-ssh-host-keys.nix {};
|
||||||
|
pipewire-all-bluetooth = final.callPackage ./pipewire-all-bluetooth {};
|
||||||
print-afra = final.callPackage ./print-afra {};
|
print-afra = final.callPackage ./print-afra {};
|
||||||
run-with-docker-group = final.callPackage ./run-with-docker-group {};
|
run-with-docker-group = final.callPackage ./run-with-docker-group {};
|
||||||
ssh-gpg = final.callPackage ./ssh-gpg {};
|
ssh-gpg = final.callPackage ./ssh-gpg {};
|
||||||
|
|||||||
29
pkgs/pipewire-all-bluetooth/all-bluetooth.conf
Normal file
29
pkgs/pipewire-all-bluetooth/all-bluetooth.conf
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
context.modules = [
|
||||||
|
{ name = libpipewire-module-combine-stream
|
||||||
|
args = {
|
||||||
|
combine.mode = sink
|
||||||
|
node.name = "all-bluetooth"
|
||||||
|
node.description = "All Bluetooth devices"
|
||||||
|
combine.latency-compensate = false
|
||||||
|
combine.props = {
|
||||||
|
audio.position = [ FL FR ]
|
||||||
|
}
|
||||||
|
stream.props = {
|
||||||
|
}
|
||||||
|
stream.rules = [
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{
|
||||||
|
node.name = "~bluez_output.*"
|
||||||
|
media.class = "Audio/Sink"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
actions = {
|
||||||
|
create-stream = {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
9
pkgs/pipewire-all-bluetooth/default.nix
Normal file
9
pkgs/pipewire-all-bluetooth/default.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
runCommand,
|
||||||
|
... }:
|
||||||
|
|
||||||
|
runCommand "pipewire-all-bluetooth" {} ''
|
||||||
|
mkdir -p $out/share/pipewire/pipewire.conf.d
|
||||||
|
|
||||||
|
cp ${./all-bluetooth.conf} $out/share/pipewire/pipewire.conf.d/all-bluetooth.conf
|
||||||
|
''
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
flask,
|
flask,
|
||||||
requests,
|
requests,
|
||||||
python,
|
python,
|
||||||
|
setuptools,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@@ -19,6 +20,10 @@ let
|
|||||||
in buildPythonPackage rec {
|
in buildPythonPackage rec {
|
||||||
inherit src pname version;
|
inherit src pname version;
|
||||||
|
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
build-system = [ setuptools ];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
flask
|
flask
|
||||||
requests
|
requests
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ in {
|
|||||||
|
|
||||||
clerie.nixfiles.enable = true;
|
clerie.nixfiles.enable = true;
|
||||||
|
|
||||||
clerie.system-auto-upgrade.enable = true;
|
services.bijwerken.enable = true;
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
trusted-users = [ "@wheel" "@guests" ];
|
trusted-users = [ "@wheel" ];
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
# Keep buildtime dependencies
|
# Keep buildtime dependencies
|
||||||
keep-outputs = true;
|
keep-outputs = true;
|
||||||
|
|||||||
@@ -40,7 +40,12 @@ in {
|
|||||||
log_format vcombined_anon '$host: $remote_addr_anon - $remote_user [$time_local] '
|
log_format vcombined_anon '$host: $remote_addr_anon - $remote_user [$time_local] '
|
||||||
'"$request" $status $body_bytes_sent '
|
'"$request" $status $body_bytes_sent '
|
||||||
'"$http_referer" "$http_user_agent"';
|
'"$http_referer" "$http_user_agent"';
|
||||||
access_log /var/log/nginx/access.log vcombined_anon;
|
log_format vcombined_anon_monitoring '$host: $remote_addr_anon - $remote_user [$time_local] '
|
||||||
|
'"$request" $status $body_bytes_sent '
|
||||||
|
'"$http_referer" "$http_user_agent" '
|
||||||
|
'"$server_name" '
|
||||||
|
'rt="$request_time" uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
|
||||||
|
access_log /var/log/nginx/access.log vcombined_anon_monitoring;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
virtualHosts = mkIf cfg.httpDefaultVirtualHost {
|
virtualHosts = mkIf cfg.httpDefaultVirtualHost {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
./common-nix
|
./common-nix
|
||||||
./common-webserver
|
./common-webserver
|
||||||
./cybercluster-vm
|
./cybercluster-vm
|
||||||
|
./desktop
|
||||||
./dn42-router
|
./dn42-router
|
||||||
./fem-net
|
./fem-net
|
||||||
./firefox
|
./firefox
|
||||||
|
|||||||
31
profiles/desktop/audio.nix
Normal file
31
profiles/desktop/audio.nix
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
services.pulseaudio.enable = false;
|
||||||
|
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa = {
|
||||||
|
enable = true;
|
||||||
|
support32Bit = true;
|
||||||
|
};
|
||||||
|
pulse = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
configPackages = [
|
||||||
|
pkgs.pipewire-all-bluetooth
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
helvum # pipewire routing gui
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
30
profiles/desktop/default.nix
Normal file
30
profiles/desktop/default.nix
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
options.profiles.clerie.desktop = {
|
||||||
|
enable = mkEnableOption "clerie Desktop Config";
|
||||||
|
};
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./audio.nix
|
||||||
|
./firmware.nix
|
||||||
|
./fonts.nix
|
||||||
|
./gnome.nix
|
||||||
|
./inputs.nix
|
||||||
|
./networking.nix
|
||||||
|
./polkit.nix
|
||||||
|
./power.nix
|
||||||
|
./printing.nix
|
||||||
|
./ssh.nix
|
||||||
|
./xserver.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
security.sudo.wheelNeedsPassword = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
13
profiles/desktop/firmware.nix
Normal file
13
profiles/desktop/firmware.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
services.fwupd.enable = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
20
profiles/desktop/fonts.nix
Normal file
20
profiles/desktop/fonts.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
fonts.enableDefaultPackages = true;
|
||||||
|
fonts.packages = with pkgs; [
|
||||||
|
roboto
|
||||||
|
roboto-mono
|
||||||
|
noto-fonts
|
||||||
|
noto-fonts-emoji
|
||||||
|
comfortaa
|
||||||
|
] ++ (if pkgs ? "noto-fonts-cjk-sans" then [ pkgs.noto-fonts-cjk-sans ] else [ pkgs.noto-fonts-cjk ]);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
69
profiles/desktop/gnome.nix
Normal file
69
profiles/desktop/gnome.nix
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
services.gnome = {
|
||||||
|
localsearch.enable = false;
|
||||||
|
tinysparql.enable = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.gnome.excludePackages = with pkgs; [
|
||||||
|
baobab
|
||||||
|
epiphany
|
||||||
|
gnome-calendar
|
||||||
|
gnome-clocks
|
||||||
|
gnome-console
|
||||||
|
gnome-contacts
|
||||||
|
gnome-logs
|
||||||
|
gnome-maps
|
||||||
|
gnome-music
|
||||||
|
gnome-tour
|
||||||
|
gnome-photos
|
||||||
|
gnome-weather
|
||||||
|
gnome-connections
|
||||||
|
simple-scan
|
||||||
|
yelp
|
||||||
|
geary
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
evolution
|
||||||
|
gnome-terminal
|
||||||
|
gnome-tweaks
|
||||||
|
];
|
||||||
|
|
||||||
|
services.gnome.evolution-data-server.enable = true;
|
||||||
|
|
||||||
|
programs.dconf.profiles = {
|
||||||
|
user.databases = [
|
||||||
|
{
|
||||||
|
settings = {
|
||||||
|
"org/gnome/desktop/calendar" = {
|
||||||
|
show-weekdate = true;
|
||||||
|
};
|
||||||
|
"org/gnome/desktop/interface" = {
|
||||||
|
enable-hot-corners = false;
|
||||||
|
show-battery-percentage = true;
|
||||||
|
};
|
||||||
|
"org/gnome/desktop/notifications" = {
|
||||||
|
show-in-lock-screen = false;
|
||||||
|
};
|
||||||
|
"org/gnome/desktop/sound" = {
|
||||||
|
event-sounds = false;
|
||||||
|
};
|
||||||
|
"org/gnome/gnome-system-monitor" = {
|
||||||
|
network-in-bits = true;
|
||||||
|
network-total-in-bits = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
51
profiles/desktop/inputs.nix
Normal file
51
profiles/desktop/inputs.nix
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
programs.dconf.profiles = {
|
||||||
|
user.databases = [
|
||||||
|
{
|
||||||
|
settings = {
|
||||||
|
"org/gnome/desktop/peripherals/touchpad" = {
|
||||||
|
disable-while-typing = false;
|
||||||
|
edge-scrolling-enabled = false;
|
||||||
|
natural-scroll = true;
|
||||||
|
tap-to-click = true;
|
||||||
|
two-finger-scrolling-enabled = true;
|
||||||
|
};
|
||||||
|
"org/gnome/settings-daemon/plugins/media-keys" = {
|
||||||
|
custom-keybindings = [
|
||||||
|
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal/"
|
||||||
|
];
|
||||||
|
mic-mute = [ "<Control>Print" ];
|
||||||
|
};
|
||||||
|
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal" = {
|
||||||
|
name = "Terminal";
|
||||||
|
binding = "<Primary><Alt>t";
|
||||||
|
command = "gnome-terminal";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
gdm.databases = [
|
||||||
|
{
|
||||||
|
settings = {
|
||||||
|
"org/gnome/desktop/peripherals/touchpad" = {
|
||||||
|
disable-while-typing = false;
|
||||||
|
edge-scrolling-enabled = false;
|
||||||
|
natural-scroll = true;
|
||||||
|
tap-to-click = true;
|
||||||
|
two-finger-scrolling-enabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
20
profiles/desktop/networking.nix
Normal file
20
profiles/desktop/networking.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
networking.networkmanager.settings = {
|
||||||
|
connectivity = {
|
||||||
|
uri = "http://ping.clerie.de/nm-check.txt";
|
||||||
|
};
|
||||||
|
global-dns = {
|
||||||
|
searches = "net.clerie.de";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
13
profiles/desktop/polkit.nix
Normal file
13
profiles/desktop/polkit.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
security.polkit.enable = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
50
profiles/desktop/power.nix
Normal file
50
profiles/desktop/power.nix
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
boot.resumeDevice = lib.optionalString ((lib.length config.swapDevices) > 0) (lib.head config.swapDevices).device;
|
||||||
|
services.logind = {
|
||||||
|
lidSwitch = "suspend-then-hibernate";
|
||||||
|
};
|
||||||
|
systemd.sleep.extraConfig = ''
|
||||||
|
HibernateDelaySec=30m
|
||||||
|
'';
|
||||||
|
|
||||||
|
services.upower = {
|
||||||
|
percentageLow = 20;
|
||||||
|
percentageCritical = 10;
|
||||||
|
percentageAction = 8;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.dconf.profiles = {
|
||||||
|
user.databases = [
|
||||||
|
{
|
||||||
|
settings = {
|
||||||
|
"org/gnome/settings-daemon/plugins/power" = {
|
||||||
|
power-button-action = "hibernate";
|
||||||
|
power-saver-profile-on-low-battery = false;
|
||||||
|
sleep-inactive-ac-type = "nothing";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
gdm.databases = [
|
||||||
|
{
|
||||||
|
settings = {
|
||||||
|
"org/gnome/settings-daemon/plugins/power" = {
|
||||||
|
power-button-action = "hibernate";
|
||||||
|
power-saver-profile-on-low-battery = false;
|
||||||
|
sleep-inactive-ac-type = "nothing";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
14
profiles/desktop/printing.nix
Normal file
14
profiles/desktop/printing.nix
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
services.printing.enable = true;
|
||||||
|
services.avahi.enable = true;
|
||||||
|
services.avahi.nssmdns4 = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
39
profiles/desktop/ssh.nix
Normal file
39
profiles/desktop/ssh.nix
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
profiles.clerie.gpg-ssh.enable = true;
|
||||||
|
|
||||||
|
programs.gnupg.agent = {
|
||||||
|
pinentryPackage = pkgs.pinentry-gtk2;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Do not disable ssh-agent of gnome-keyring, because
|
||||||
|
# gnupg ssh-agent can't handle normal SSH keys properly
|
||||||
|
/*
|
||||||
|
# Disable ssh-agent of gnome-keyring
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
gnome = prev.gnome // {
|
||||||
|
gnome-keyring = prev.runCommand "gnome-keyring-ssh-disabled-autostart" {} ''
|
||||||
|
mkdir -p $out
|
||||||
|
|
||||||
|
# Symlink all gnome-keyring binaries
|
||||||
|
${final.xorg.lndir}/bin/lndir -silent ${prev.gnome.gnome-keyring} $out
|
||||||
|
|
||||||
|
# Disable autostart for ssh
|
||||||
|
rm $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
|
||||||
|
cat ${prev.gnome.gnome-keyring}/etc/xdg/autostart/gnome-keyring-ssh.desktop > $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
|
||||||
|
echo "Hidden=true" >> $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
*/
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
18
profiles/desktop/xserver.nix
Normal file
18
profiles/desktop/xserver.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf config.profiles.clerie.desktop.enable {
|
||||||
|
|
||||||
|
services.xserver.enable = true;
|
||||||
|
services.displayManager.gdm.enable = true;
|
||||||
|
services.desktopManager.gnome.enable = true;
|
||||||
|
|
||||||
|
services.xserver.excludePackages = with pkgs; [
|
||||||
|
xterm
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user