Compare commits
10 commits
146ca3b9ad
...
400d2ad28f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
400d2ad28f | ||
|
|
45cc3df817 | ||
|
|
664594c064 | ||
|
|
488bd8911b | ||
|
|
1495d308dd | ||
|
|
f07a1852b5 | ||
|
|
7386b347d5 | ||
|
|
e6f0dd7f01 | ||
|
|
15c1b109a8 | ||
|
|
d758248ea0 |
29 changed files with 375 additions and 200 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
./mpv.nix
|
./mpv.nix
|
||||||
./neovim.nix
|
./neovim.nix
|
||||||
./nixcord.nix
|
./nixcord.nix
|
||||||
|
./kodi.nix
|
||||||
./other.nix
|
./other.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5
home/programs/kodi.nix
Normal file
5
home/programs/kodi.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
home.packages = [
|
||||||
|
(pkgs.kodi-wayland.withPackages (exts: [exts.inputstream-adaptive exts.inputstreamhelper]))
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -41,11 +41,12 @@
|
||||||
providers.wl-copy.enable = true;
|
providers.wl-copy.enable = true;
|
||||||
registers = "unnamedplus";
|
registers = "unnamedplus";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
options.shiftwidth = 2;
|
||||||
binds = {
|
binds = {
|
||||||
whichKey.enable = true;
|
whichKey.enable = true;
|
||||||
cheatsheet.enable = true;
|
cheatsheet.enable = true;
|
||||||
};
|
};
|
||||||
options.shiftwidth = 2;
|
|
||||||
languages = {
|
languages = {
|
||||||
enableFormat = true; #You can also manually overwrite each language.
|
enableFormat = true; #You can also manually overwrite each language.
|
||||||
enableTreesitter = true;
|
enableTreesitter = true;
|
||||||
|
|
@ -120,7 +121,16 @@
|
||||||
colorizer.enable = true;
|
colorizer.enable = true;
|
||||||
smartcolumn. enable = true;
|
smartcolumn. enable = true;
|
||||||
};
|
};
|
||||||
utility.vim-wakatime.enable = true;
|
utility = {
|
||||||
|
vim-wakatime.enable = true;
|
||||||
|
motion.leap = {
|
||||||
|
enable = true;
|
||||||
|
mappings = {
|
||||||
|
leapForwardTo = "f";
|
||||||
|
leapBackwardTo = "F";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
visuals = {
|
visuals = {
|
||||||
nvim-web-devicons.enable = true;
|
nvim-web-devicons.enable = true;
|
||||||
nvim-cursorline.enable = true;
|
nvim-cursorline.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,12 @@
|
||||||
imports = [
|
imports = [
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./fish.nix
|
./fish.nix
|
||||||
|
./git.nix
|
||||||
./other.nix
|
./other.nix
|
||||||
./repl
|
./repl
|
||||||
./starship.nix
|
./starship.nix
|
||||||
|
./transfer.nix
|
||||||
./yazi.nix
|
./yazi.nix
|
||||||
./zoxide.nix
|
./zoxide.nix
|
||||||
./transfer.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
home/shell/git.nix
Normal file
11
home/shell/git.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
git = {
|
||||||
|
enable = true;
|
||||||
|
userEmail = "jurnwubben@gmail.com";
|
||||||
|
userName = "Jurn Wubben";
|
||||||
|
extraConfig.push.autoSetupRemote = true;
|
||||||
|
};
|
||||||
|
git-credential-oauth = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
}: {
|
}: {
|
||||||
home.packages =
|
home.packages =
|
||||||
[
|
[
|
||||||
pkgs.gh
|
|
||||||
pkgs.ripgrep
|
pkgs.ripgrep
|
||||||
pkgs.p7zip
|
pkgs.p7zip
|
||||||
pkgs.usbutils
|
pkgs.usbutils
|
||||||
|
|
@ -23,7 +22,7 @@
|
||||||
++ lib.optionals osConfig.niksos.bluetooth [
|
++ lib.optionals osConfig.niksos.bluetooth [
|
||||||
pkgs.ear2ctl
|
pkgs.ear2ctl
|
||||||
]
|
]
|
||||||
++ lib.optionals osConfig.niksos.portable [
|
++ lib.optionals osConfig.niksos.portable.enable [
|
||||||
inputs.somcli.defaultPackage.${pkgs.system}
|
inputs.somcli.defaultPackage.${pkgs.system}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 MiB After Width: | Height: | Size: 11 MiB |
|
|
@ -115,8 +115,9 @@ in {
|
||||||
"Super, s, exec, ${torzu}"
|
"Super, s, exec, ${torzu}"
|
||||||
"Super, d, exec, ${dolphin}"
|
"Super, d, exec, ${dolphin}"
|
||||||
])
|
])
|
||||||
++ lib.optionals portable [
|
++ lib.optionals portable.enable [
|
||||||
"$m Shift, S, exec, ${somcli}"
|
"$m Shift, S, exec, ${somcli}"
|
||||||
|
", XF86AudioMedia, exec, powermode toggle"
|
||||||
];
|
];
|
||||||
|
|
||||||
bindl = [
|
bindl = [
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,12 @@ in {
|
||||||
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
|
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
|
||||||
"NIXOS_OZONE_WL,1"
|
"NIXOS_OZONE_WL,1"
|
||||||
];
|
];
|
||||||
exec-once = [
|
exec-once =
|
||||||
"${uwsm} finalize"
|
[
|
||||||
"${hyprlock}" # Lock screen
|
"${uwsm} finalize"
|
||||||
];
|
"${hyprlock}" # Lock screen
|
||||||
|
]
|
||||||
|
++ lib.optional osConfig.niksos.portable.enable "powermode sync";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,46 +1,57 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
uwsm = lib.getExe pkgs.uwsm;
|
|
||||||
foot = lib.getExe pkgs.foot;
|
|
||||||
in {
|
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./virt.nix
|
./virt.nix
|
||||||
|
./wluma.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.printing = {
|
||||||
|
enable = true;
|
||||||
|
startWhenNeeded = true;
|
||||||
|
};
|
||||||
|
hardware.printers = {
|
||||||
|
ensureDefaultPrinter = "Broeder";
|
||||||
|
ensurePrinters = [
|
||||||
|
{
|
||||||
|
deviceUri = "ipp://192.168.1.33/ipp";
|
||||||
|
location = "home";
|
||||||
|
name = "Broeder";
|
||||||
|
model = "everywhere";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# programs.evolution.enable = true; # FIXME: move to appropiate place.
|
||||||
niksos = {
|
niksos = {
|
||||||
|
joycond = false; #NOTE: enable when game night lol
|
||||||
fingerprint = true;
|
fingerprint = true;
|
||||||
bluetooth = true;
|
bluetooth = true;
|
||||||
portable = true;
|
portable = {
|
||||||
|
enable = true;
|
||||||
|
hyprland = {
|
||||||
|
powerSaver = ''
|
||||||
|
hyprctl keyword monitor eDP-1,2880x1920@60,0x0,1.5,vrr,1
|
||||||
|
'';
|
||||||
|
performance = ''
|
||||||
|
hyprctl keyword monitor eDP-1,2880x1920@120,0x0,1.5,vrr,1
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
neovim = true;
|
neovim = true;
|
||||||
games = true;
|
games = true;
|
||||||
desktop = {
|
desktop = {
|
||||||
enable = true;
|
enable = true;
|
||||||
hyprland = true;
|
hyprland = true;
|
||||||
kde = false;
|
kde = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
home-manager.users.jsw.wayland.windowManager.hyprland.settings.monitor = ["eDP-1,2880x1920@120,0x0,1.5,vrr,1"];
|
home-manager.users.jsw.wayland.windowManager.hyprland.settings.monitor = ["eDP-1,2880x1920@120,0x0,1.5,vrr,1"];
|
||||||
|
|
||||||
services = {
|
services.udev.extraRules = ''
|
||||||
usbmuxd.enable = true;
|
# Ethernet expansion card support
|
||||||
joycond.enable = true;
|
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20"
|
||||||
udev.extraRules = ''
|
'';
|
||||||
# Ethernet expansion card support
|
|
||||||
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20"
|
|
||||||
'';
|
|
||||||
logind.extraConfig = ''
|
|
||||||
# don’t shutdown when power button is short-pressed
|
|
||||||
HandlePowerKey=ignore
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
hardware.sensor.iio.enable = true; # brightness sensor
|
|
||||||
|
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
# There seems to be an issue with panel self-refresh (PSR) that
|
# There seems to be an issue with panel self-refresh (PSR) that
|
||||||
# causes hangs for users.
|
# causes hangs for users.
|
||||||
|
|
|
||||||
31
hosts/laptop/wluma.nix
Normal file
31
hosts/laptop/wluma.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
hardware.sensor.iio.enable = true; # brightness sensor
|
||||||
|
home-manager.users.jsw.services.wluma = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
als.iio = {
|
||||||
|
path = "/sys/bus/iio/devices";
|
||||||
|
thresholds = {
|
||||||
|
"0" = "night";
|
||||||
|
"10" = "dark";
|
||||||
|
"100" = "normal";
|
||||||
|
"20" = "dim";
|
||||||
|
"200" = "bright";
|
||||||
|
"500" = "outdoors";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
output.backlight = [
|
||||||
|
{
|
||||||
|
capturer = "none";
|
||||||
|
name = "eDP-1";
|
||||||
|
path = "/sys/class/backlight/amdgpu_bl1";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
capturer = "none";
|
||||||
|
name = "keyboard";
|
||||||
|
path = "/sys/bus/platform/devices/cros-keyboard-leds.5.auto/leds/chromeos::kbd_backlight";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -23,7 +23,13 @@
|
||||||
nvidia = false;
|
nvidia = false;
|
||||||
};
|
};
|
||||||
neovim = false;
|
neovim = false;
|
||||||
portable = false;
|
portable = {
|
||||||
|
enable = false;
|
||||||
|
hyprland = {
|
||||||
|
powerSaver = "";
|
||||||
|
performance = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
server = false;
|
server = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
{config, ...}: {
|
{config, ...}: let
|
||||||
|
serviceUser = x: config.systemd.services.${x}.serviceConfig.User;
|
||||||
|
in {
|
||||||
age.secrets = {
|
age.secrets = {
|
||||||
transferSh = {
|
transferSh = {
|
||||||
file = ./transfer-sh.age;
|
file = ./transfer-sh.age;
|
||||||
|
|
@ -8,7 +10,7 @@
|
||||||
file = ./dcbot.age;
|
file = ./dcbot.age;
|
||||||
owner =
|
owner =
|
||||||
if config.niksos.server
|
if config.niksos.server
|
||||||
then "dcbot" # "dcbot" doesn't exist on e.g laptop.
|
then serviceUser "dcbot" # "dcbot" doesn't exist on e.g laptop.
|
||||||
else "root";
|
else "root";
|
||||||
};
|
};
|
||||||
password.file = ./password.age;
|
password.file = ./password.age;
|
||||||
|
|
@ -21,10 +23,10 @@
|
||||||
};
|
};
|
||||||
cloudflare-acme.file = ./cloudflare-acme.age;
|
cloudflare-acme.file = ./cloudflare-acme.age;
|
||||||
mail-admin = {
|
mail-admin = {
|
||||||
owner =
|
# owner = #FIXME: revert when stopped using docker for stalwart.
|
||||||
if config.niksos.server
|
# if config.niksos.server
|
||||||
then "stalwart-mail"
|
# then serviceUser "stalwart-mail"
|
||||||
else "root";
|
# else "root";
|
||||||
file = ./mail-admin.age;
|
file = ./mail-admin.age;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -2,14 +2,12 @@
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
cfg = config.niksos.desktop.enable && config.niksos.desktop.hyprland;
|
config = lib.mkIf config.niksos.desktop.enable {
|
||||||
in {
|
|
||||||
config = lib.mkIf cfg {
|
|
||||||
# greetd display manager
|
# greetd display manager
|
||||||
services.greetd = let
|
services.greetd = let
|
||||||
session = {
|
session = {
|
||||||
command = "${lib.getExe config.programs.uwsm.package} start hyprland-uwsm.desktop";
|
command = lib.mkDefault "${lib.getExe config.programs.uwsm.package} start hyprland-uwsm.desktop";
|
||||||
user = "jsw";
|
user = "jsw";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
@ -22,6 +20,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.uwsm.enable = true;
|
programs.uwsm.enable = config.niksos.desktop.hyprland;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,28 +6,23 @@
|
||||||
}: let
|
}: let
|
||||||
cfg = config.niksos.desktop.enable && config.niksos.desktop.kde;
|
cfg = config.niksos.desktop.enable && config.niksos.desktop.kde;
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf cfg {
|
specialisation.de.configuration = lib.mkIf cfg {
|
||||||
niksos.desktop.hyprland = lib.mkForce false;
|
niksos.desktop.hyprland = lib.mkForce false;
|
||||||
specialisation.de.configuration = {
|
services = {
|
||||||
services = {
|
greetd = let
|
||||||
greetd = let
|
session.command = "${pkgs.kdePackages.plasma-workspace}/bin/startplasma-wayland";
|
||||||
session = {
|
in {
|
||||||
command = "${pkgs.kdePackages.plasma-workspace}/bin/startplasma-wayland";
|
enable = true;
|
||||||
user = "jsw";
|
settings = {
|
||||||
};
|
terminal.vt = 1;
|
||||||
in {
|
default_session = session;
|
||||||
enable = true;
|
initial_session = session;
|
||||||
settings = {
|
|
||||||
terminal.vt = 1;
|
|
||||||
default_session = session;
|
|
||||||
initial_session = session;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
desktopManager.plasma6.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.jsw.stylix.autoEnable = false;
|
desktopManager.plasma6.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home-manager.users.jsw.stylix.autoEnable = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,10 @@
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./bluetooth.nix
|
./bluetooth.nix
|
||||||
./graphics.nix
|
|
||||||
./fingerprint.nix
|
./fingerprint.nix
|
||||||
./fwupd.nix
|
./fwupd.nix
|
||||||
|
./graphics.nix
|
||||||
|
./joycond.nix
|
||||||
|
./power.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,16 @@
|
||||||
in {
|
in {
|
||||||
options.niksos.fingerprint = mkEnableOption "fingerprint support.";
|
options.niksos.fingerprint = mkEnableOption "fingerprint support.";
|
||||||
config = mkIf fingerprint {
|
config = mkIf fingerprint {
|
||||||
services.fprintd.enable = true;
|
services = {
|
||||||
|
fprintd.enable = true;
|
||||||
|
logind.extraConfig = mkIf desktop.hyprland ''
|
||||||
|
# don’t shutdown when power button is short-pressed
|
||||||
|
HandlePowerKey=ignore
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
home-manager.users.jsw.wayland.windowManager.hyprland.settings = mkIf desktop.hyprland {
|
home-manager.users.jsw.wayland.windowManager.hyprland.settings = mkIf desktop.hyprland {
|
||||||
bind = mkIf fingerprint [
|
bind = [
|
||||||
", XF86PowerOff, exec, ${uwsm} app -- pgrep fprintd-verify && exit 0 || ${foot} -a 'foot-fprintd' sh -c 'fprintd-verify && systemctl sleep'"
|
", XF86PowerOff, exec, ${uwsm} app -- pgrep fprintd-verify && exit 0 || ${foot} -a 'foot-fprintd' sh -c 'fprintd-verify && systemctl sleep'"
|
||||||
];
|
];
|
||||||
windowrule = [
|
windowrule = [
|
||||||
|
|
|
||||||
12
system/hardware/joycond.nix
Normal file
12
system/hardware/joycond.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
options.niksos.joycond = lib.mkEnableOption "support for nintendo switch controllers.";
|
||||||
|
|
||||||
|
config.services = lib.mkIf config.niksos.joycond {
|
||||||
|
usbmuxd.enable = true;
|
||||||
|
joycond.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
87
system/hardware/power.nix
Normal file
87
system/hardware/power.nix
Normal file
|
|
@ -0,0 +1,87 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (config) niksos;
|
||||||
|
cfg = niksos.portable;
|
||||||
|
in {
|
||||||
|
options.niksos.portable = {
|
||||||
|
enable = lib.mkEnableOption "battery optimisers";
|
||||||
|
hyprland = let
|
||||||
|
gen = mode:
|
||||||
|
lib.mkOption {
|
||||||
|
default = "";
|
||||||
|
description = "Shell commands to run when switching to ${mode} mode.";
|
||||||
|
type = lib.types.lines;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
powerSaver = gen "power-saver";
|
||||||
|
performance = gen "performance";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
services = lib.mkIf cfg.enable {
|
||||||
|
logind = {
|
||||||
|
powerKey = "suspend-then-hibernate";
|
||||||
|
powerKeyLongPress = "poweroff";
|
||||||
|
};
|
||||||
|
upower.enable = true;
|
||||||
|
power-profiles-daemon.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = lib.mkIf niksos.desktop.hyprland [
|
||||||
|
(pkgs.writeScriptBin "powermode" ''
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
function sync() {
|
||||||
|
if [ "$(powerprofilesctl get)" = "power-saver" ]; then
|
||||||
|
hyprctl --batch "\
|
||||||
|
keyword animations:enabled 0;\
|
||||||
|
keyword decoration:shadow:enabled 0;\
|
||||||
|
keyword decoration:blur:enabled 0;\
|
||||||
|
keyword general:gaps_in 0;\
|
||||||
|
keyword general:gaps_out 0;\
|
||||||
|
keyword general:border_size 1;\
|
||||||
|
keyword decoration:rounding 0"
|
||||||
|
|
||||||
|
${cfg.hyprland.powerSaver}
|
||||||
|
else
|
||||||
|
${cfg.hyprland.performance}
|
||||||
|
hyprctl reload
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
function toggle() {
|
||||||
|
if [ "$(powerprofilesctl get)" = "power-saver" ]; then
|
||||||
|
powerprofilesctl set performance
|
||||||
|
else
|
||||||
|
powerprofilesctl set power-saver
|
||||||
|
fi
|
||||||
|
|
||||||
|
sync
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo "Usage: $0 {toggle|sync}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
toggle)
|
||||||
|
toggle
|
||||||
|
;;
|
||||||
|
sync)
|
||||||
|
sync
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid option: $1"
|
||||||
|
echo "Usage: $0 {toggle|sync}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
substituters = [
|
substituters = [
|
||||||
# high priority since it's almost always used
|
# high priority since it's almost always used
|
||||||
"https://cache.nixos.org?priority=10"
|
"https://cache.nixos.org?priority=10"
|
||||||
"https://cache.garnix.io"
|
# "https://cache.garnix.io"
|
||||||
|
|
||||||
# "https://anyrun.cachix.org"
|
# "https://anyrun.cachix.org"
|
||||||
# "https://fufexan.cachix.org"
|
# "https://fufexan.cachix.org"
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||||
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= "
|
# "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= "
|
||||||
|
|
||||||
# "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
# "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
||||||
# "fufexan.cachix.org-1:LwCDjCJNJQf5XD2BV+yamQIMZfcKWR9ISIFy5curUsY="
|
# "fufexan.cachix.org-1:LwCDjCJNJQf5XD2BV+yamQIMZfcKWR9ISIFy5curUsY="
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{lib, ...}: {
|
{lib, ...}: {
|
||||||
imports = [./caddy.nix ./transfer-sh.nix ./seafile.nix ./bot.nix ./immich.nix ./matrix.nix ./mail.nix];
|
imports = [./caddy.nix ./index ./seafile.nix ./bot.nix ./immich.nix ./matrix.nix ./mail.nix];
|
||||||
options.niksos.server = lib.mkEnableOption "server servcies (such as caddy)."; #TODO: per service option.
|
options.niksos.server = lib.mkEnableOption "server servcies (such as caddy)."; #TODO: per service option.
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
system/server/index/default.nix
Normal file
14
system/server/index/default.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
services.caddy.virtualHosts."jsw.tf" = lib.mkIf config.niksos.server {
|
||||||
|
extraConfig = ''
|
||||||
|
header Content-Type text/html
|
||||||
|
respond <<HTML
|
||||||
|
${builtins.readFile ./index.html}
|
||||||
|
HTML 200
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
86
system/server/index/index.html
Normal file
86
system/server/index/index.html
Normal file
|
|
@ -0,0 +1,86 @@
|
||||||
|
<!-- Yes. As you might see, this site is AI generated. Don't feel like writing anything proper until I start making something proper.-->
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Under Construction</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
color: #333;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
text-align: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 3em;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
color: #ff5722;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fence {
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
font-size: 1.2em;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
max-width: 600px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #fff;
|
||||||
|
background-color: #007bff;
|
||||||
|
padding: 8px 15px;
|
||||||
|
border-radius: 5px;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
background-color: #0056b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 20px;
|
||||||
|
font-size: 0.9em;
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact {
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
.contact > p {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 1em;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.emoji {
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1 class="fence">🚧🚧 This Site is Under Construction 🚧🚧</h1>
|
||||||
|
<p>Hello! I'm <b>jsw</b>, a frontend web developer with experience in <b>Svelte + TS</b>, <b>Nix(OS)</b> and currently learning <b>Rust</b>. This site is still under development, so please bear with me. In the meantime, feel free to reach out via email or explore my projects on GitHub.</p>
|
||||||
|
<div class="contact">
|
||||||
|
<p class="emoji">📧 <a href="mailto:info@jsw.tf">info@jsw.tf</a></p>
|
||||||
|
<p class="emoji">🐙 <a href="https://github.com/jsw08" target="_blank">GitHub</a></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
© 2025 @jsw08. Source visible.
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -1,93 +1,29 @@
|
||||||
{config, ...}: {
|
{
|
||||||
services.stalwart-mail = {
|
config,
|
||||||
enable = true;
|
lib,
|
||||||
openFirewall = false; # Don't want to open port 8080, will leave that for caddy.
|
...
|
||||||
credentials = {
|
}: {
|
||||||
user_admin_password = config.age.secrets.mail-admin.path;
|
#FIXME: revert when stopped using docker for stalwart. https://github.com/NixOS/nixpkgs/issues/416091 (look at older commits for previous code.)
|
||||||
};
|
|
||||||
settings = {
|
|
||||||
authentication = {
|
|
||||||
fallback-admin = {
|
|
||||||
secret = "%{file:/run/credentials/stalwart-mail.service/user_admin_password}%";
|
|
||||||
user = "admin";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
server = {
|
|
||||||
tracer."log" = {
|
|
||||||
ansi = false;
|
|
||||||
enable = true;
|
|
||||||
level = "info";
|
|
||||||
path = "./stalwart/logs";
|
|
||||||
prefix = "stalwart.log";
|
|
||||||
rotate = "daily";
|
|
||||||
type = "log";
|
|
||||||
};
|
|
||||||
listener = {
|
|
||||||
http = {
|
|
||||||
bind = "127.0.0.1:9003";
|
|
||||||
protocol = "http";
|
|
||||||
};
|
|
||||||
imaptls = {
|
|
||||||
bind = "[::]:993";
|
|
||||||
protocol = "imap";
|
|
||||||
tls.implicit = true;
|
|
||||||
};
|
|
||||||
smtp = {
|
|
||||||
bind = "[::]:25";
|
|
||||||
protocol = "smtp";
|
|
||||||
};
|
|
||||||
submissions = {
|
|
||||||
bind = "[::]:465";
|
|
||||||
protocol = "smtp";
|
|
||||||
tls.implicit = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
hostname = "mx1.jsw.tf";
|
config = lib.mkIf config.niksos.server {
|
||||||
lookup.default = {
|
virtualisation.oci-containers.containers.stalwart = {
|
||||||
hostname = "mx1.jsw.tf";
|
image = "docker.io/stalwartlabs/stalwart:latest";
|
||||||
domain = "jsw.tf";
|
labels = {
|
||||||
|
"io.containers.autoupdate" = "registry";
|
||||||
};
|
};
|
||||||
acme."letsencrypt" = {
|
ports = ["25:25" "465:465" "993:993" "9003:8080"];
|
||||||
directory = "https://acme-v02.api.letsencrypt.org/directory";
|
volumes = [
|
||||||
challenge = "tls-alpn-01";
|
"/opt/stalwart:/opt/stalwart"
|
||||||
contact = ["jurnwubben@gmail.com"];
|
|
||||||
domains = ["jsw.tf" "mx1.jsw.tf"];
|
|
||||||
cache = "%{BASE_PATH}%/etc/acme";
|
|
||||||
renew-before = "30d";
|
|
||||||
};
|
|
||||||
directory."imap".lookup.domains = ["jsw.tf"];
|
|
||||||
# directory."in-memory" = {
|
|
||||||
# type = "memory";
|
|
||||||
# principals = [
|
|
||||||
# {
|
|
||||||
# class = "individual";
|
|
||||||
# name = "User 1";
|
|
||||||
# secret = "%{file:/etc/stalwart/mail-pw1}%";
|
|
||||||
# email = [""];
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
|
||||||
993
|
|
||||||
25
|
|
||||||
465
|
|
||||||
];
|
|
||||||
|
|
||||||
services.caddy.virtualHosts = {
|
|
||||||
"webadmin.jsw.tf" = {
|
|
||||||
extraConfig = ''
|
|
||||||
reverse_proxy http://127.0.0.1:9003
|
|
||||||
'';
|
|
||||||
serverAliases = [
|
|
||||||
"mta-sts.jsw.tf"
|
|
||||||
"autoconfig.jsw.tf"
|
|
||||||
"autodiscover.jsw.tf"
|
|
||||||
"mail.jsw.tf"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
993
|
||||||
|
25
|
||||||
|
465
|
||||||
|
];
|
||||||
|
|
||||||
|
services.caddy.virtualHosts."mail.jsw.tf".extraConfig = ''
|
||||||
|
reverse_proxy http://127.0.0.1:9003
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
{config, ...}: {
|
|
||||||
services.transfer-sh = {
|
|
||||||
enable = config.niksos.server;
|
|
||||||
settings = {
|
|
||||||
PURGE_DAYS = 7;
|
|
||||||
MAX_UPLOAD_SIZE = 4 * 1000 * 1000; # 4gb
|
|
||||||
# CORS_DOMAINS = "transfer.jsw.tf"; #FIXME: open it to the world wide web.
|
|
||||||
BASEDIR = "/var/lib/transfer.sh";
|
|
||||||
LISTENER = ":9000";
|
|
||||||
HTTP_AUTH_USER = "jsw";
|
|
||||||
EMAIL_CONTACT = "jurnwubben@gmail.com";
|
|
||||||
};
|
|
||||||
secretFile = config.age.secrets.transferSh.path;
|
|
||||||
};
|
|
||||||
systemd.services.transfer-sh.serviceConfig = {
|
|
||||||
StateDirectory = "transfer.sh";
|
|
||||||
StateDirectoryMode = "0750";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.caddy.virtualHosts."share.jsw.tf" = {
|
|
||||||
extraConfig = ''
|
|
||||||
reverse_proxy :9000
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
./tailscale.nix
|
./tailscale.nix
|
||||||
./avahi.nix
|
./avahi.nix
|
||||||
./kanata.nix
|
./kanata.nix
|
||||||
./power.nix
|
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
options.niksos.portable = lib.mkEnableOption "battery optimisers";
|
|
||||||
config.services = lib.mkIf config.niksos.portable {
|
|
||||||
logind = {
|
|
||||||
powerKey = "suspend-then-hibernate";
|
|
||||||
powerKeyLongPress = "poweroff";
|
|
||||||
};
|
|
||||||
upower.enable = true;
|
|
||||||
power-profiles-daemon.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{config, ...}: {
|
{config, ...}: {
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = !config.niksos.portable;
|
openFirewall = !config.niksos.portable.enable;
|
||||||
settings.UseDns = true;
|
settings.UseDns = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue