feat: finalize initial modules, some qol changes

This commit is contained in:
Leon Schwarzäugl 2025-04-15 17:59:20 +02:00
parent 27679d38fd
commit e8c405b3f1
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
45 changed files with 632 additions and 470 deletions

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,7 @@
detect-private-keys.enable = true; detect-private-keys.enable = true;
end-of-file-fixer.enable = true; end-of-file-fixer.enable = true;
fix-byte-order-marker.enable = true; fix-byte-order-marker.enable = true;
flake-checker.enable = true; flake-checker.enable = false;
forbid-new-submodules.enable = true; forbid-new-submodules.enable = true;
mixed-line-endings.enable = true; mixed-line-endings.enable = true;
nixpkgs-fmt.enable = true; nixpkgs-fmt.enable = true;

17
flake.lock generated
View file

@ -1006,6 +1006,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable24_11": {
"locked": {
"lastModified": 1744309437,
"narHash": "sha256-QZnNHM823am8apCqKSPdtnzPGTy2ZB4zIXOVoBp5+W0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f9ebe33a928b5d529c895202263a5ce46bdf12f7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1741600792, "lastModified": 1741600792,
@ -1375,6 +1391,7 @@
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_5",
"nixpkgs-stable": "nixpkgs-stable_2", "nixpkgs-stable": "nixpkgs-stable_2",
"nixpkgs-stable24_11": "nixpkgs-stable24_11",
"nswitch-rcm-nix": "nswitch-rcm-nix", "nswitch-rcm-nix": "nswitch-rcm-nix",
"nur": "nur", "nur": "nur",
"pre-commit-hooks": "pre-commit-hooks_2", "pre-commit-hooks": "pre-commit-hooks_2",

View file

@ -15,6 +15,7 @@
nixpkgs.url = "github:nixos/nixpkgs?rev=5f385baff93c728400d2c4ec8c9b0745b8f9e5b6"; nixpkgs.url = "github:nixos/nixpkgs?rev=5f385baff93c728400d2c4ec8c9b0745b8f9e5b6";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-stable24_11.url = "github:NixOS/nixpkgs/nixos-24.11";
systems.url = "github:nix-systems/default-linux"; systems.url = "github:nix-systems/default-linux";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";

View file

@ -86,7 +86,7 @@ in
isLinux = true; isLinux = true;
isBtrfs = false; isBtrfs = false;
flakePath = "/root/.dotfiles"; flakePath = "/root/.dotfiles";
server = { modules.server = {
forgejo = true; forgejo = true;
ankisync = true; ankisync = true;
}; };

View file

@ -26,6 +26,7 @@
swarsel-bootstrap swarsel-bootstrap
swarsel-displaypower swarsel-displaypower
swarselzellij swarselzellij
sshrm
rustdesk-vbc rustdesk-vbc
]; ];

View file

@ -140,7 +140,7 @@
id = 0; id = 0;
isDefault = true; isDefault = true;
settings = { settings = {
"browser.startup.homepage" = "https://outlook.office.com|https://satellite.vbc.ac.at|https://bitbucket.vbc.ac.at|https://github.com"; "browser.startup.homepage" = "https://lobste.rs";
}; };
} }
config.swarselsystems.firefox; config.swarselsystems.firefox;

View file

@ -42,6 +42,7 @@
fuse fuse
ventoy ventoy
poppler_utils poppler_utils
vdhcoapp
# nix # nix
alejandra alejandra
@ -98,7 +99,7 @@
# general utilities # general utilities
unrar unrar
samba # samba
cifs-utils cifs-utils
zbar # qr codes zbar # qr codes
readline readline

View file

@ -392,9 +392,7 @@
seat * hide_cursor 2000 seat * hide_cursor 2000
exec kanshi
exec_always kill -1 $(pidof kanshi) exec_always kill -1 $(pidof kanshi)
exec swayosd-server
bindswitch --locked lid:on exec kanshictl switch lidclosed bindswitch --locked lid:on exec kanshictl switch lidclosed
bindswitch --locked lid:off exec kanshictl switch lidopen bindswitch --locked lid:off exec kanshictl switch lidopen

View file

@ -73,40 +73,48 @@ in
} }
]; ];
initExtra = '' initExtra = ''
bindkey "^[[1;5D" backward-word my-forward-word() {
bindkey "^[[1;5C" forward-word local WORDCHARS=$WORDCHARS
WORDCHARS="''${WORDCHARS//:}"
WORDCHARS="''${WORDCHARS//\/}"
WORDCHARS="''${WORDCHARS//.}"
zle backward-word
}
zle -N my-forward-word
# ctrl + right
bindkey "^[[1;5C" my-forward-word
# shift + right
bindkey "^[[1;2D" forward-word
my-backward-word() {
local WORDCHARS=$WORDCHARS
WORDCHARS="''${WORDCHARS//:}"
WORDCHARS="''${WORDCHARS//\/}"
WORDCHARS="''${WORDCHARS//.}"
zle forward-word
}
zle -N my-backward-word
# ctrl + left
bindkey "^[[1;5D" -mybackward-word
# shift + left
bindkey "^[[1;2C" backward-word
my-backward-delete-word() { my-backward-delete-word() {
# Copy the global WORDCHARS variable to a local variable. That way any
# modifications are scoped to this function only
local WORDCHARS=$WORDCHARS local WORDCHARS=$WORDCHARS
# Use bash string manipulation to remove `:` so our delete will stop at it
WORDCHARS="''${WORDCHARS//:}" WORDCHARS="''${WORDCHARS//:}"
# Use bash string manipulation to remove `/` so our delete will stop at it
WORDCHARS="''${WORDCHARS//\/}" WORDCHARS="''${WORDCHARS//\/}"
# Use bash string manipulation to remove `.` so our delete will stop at it
WORDCHARS="''${WORDCHARS//.}" WORDCHARS="''${WORDCHARS//.}"
# zle <widget-name> will run an existing widget.
zle backward-delete-word zle backward-delete-word
} }
zle -N my-backward-delete-word zle -N my-backward-delete-word
# ctrl + del
bindkey '^H' my-backward-delete-word bindkey '^H' my-backward-delete-word
# This will be our `ctrl+alt+w` command # shift + del
my-backward-delete-whole-word() { bindkey '^?' backward-delete-word
# Copy the global WORDCHARS variable to a local variable. That way any
# modifications are scoped to this function only
local WORDCHARS=$WORDCHARS
# Use bash string manipulation to add `:` to WORDCHARS if it's not present
# already.
[[ ! $WORDCHARS == *":"* ]] && WORDCHARS="$WORDCHARS"":"
# zle <widget-name> will run that widget.
zle backward-delete-word
}
# `zle -N` will create a new widget that we can use on the command line
zle -N my-backward-delete-whole-word
# bind this new widget to `ctrl+alt+w`
bindkey '^W' my-backward-delete-whole-word
''; '';
}; };
}; };

View file

@ -7,6 +7,7 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
lutris lutris
wine wine
protonplus
winetricks winetricks
libudev-zero libudev-zero
dwarfs dwarfs

View file

@ -46,6 +46,7 @@ in
"dc" "dc"
"cl" "cl"
"ws" "ws"
"work"
]; ];
programs = { programs = {
@ -135,6 +136,15 @@ in
id = 3; id = 3;
} }
config.swarselsystems.firefox; config.swarselsystems.firefox;
work = lib.recursiveUpdate
{
inherit isDefault;
id = 4;
settings = {
"browser.startup.homepage" = "https://outlook.office.com|https://satellite.vbc.ac.at|https://bitbucket.vbc.ac.at|https://github.com";
};
}
config.swarselsystems.firefox;
}; };
}; };
@ -288,6 +298,12 @@ in
icon = "firefox"; icon = "firefox";
in in
{ {
firefox_work = {
name = "Firefox (work)";
genericName = "Firefox work";
exec = "firefox -p work";
inherit terminal categories icon;
};
firefox_dc = { firefox_dc = {
name = "Firefox (dc)"; name = "Firefox (dc)";
genericName = "Firefox dc"; genericName = "Firefox dc";

View file

@ -2,6 +2,13 @@
{ {
options.swarselsystems.modules.optional.gaming = lib.mkEnableOption "optional gaming settings"; options.swarselsystems.modules.optional.gaming = lib.mkEnableOption "optional gaming settings";
config = lib.mkIf config.swarselsystems.modules.optional.gaming { config = lib.mkIf config.swarselsystems.modules.optional.gaming {
programs.steam = {
enable = true;
package = pkgs.steam;
extraCompatPackages = [
pkgs.proton-ge-bin
];
};
specialisation = { specialisation = {
gaming.configuration = { gaming.configuration = {
networking = { networking = {
@ -20,13 +27,6 @@
}; };
}; };
programs.steam = {
enable = true;
package = pkgs.steam;
extraCompatPackages = [
pkgs.proton-ge-bin
];
};
hardware.xone.enable = true; hardware.xone.enable = true;

View file

@ -15,7 +15,12 @@
}; };
}; };
# run an older kernel to provide compatibility with windows vm # run an older kernel to provide compatibility with windows vm
boot.kernelPackages = lib.mkForce pkgs.linuxPackages; boot = {
kernelPackages = lib.mkForce pkgs.stable24_05.linuxPackages;
# kernelParams = [
# "amd_iommu=on"
# ];
};
}; };
}; };
}; };

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.server.ankisync = lib.mkEnableOption "enable ankisync on server"; options.swarselsystems.modules.server.ankisync = lib.mkEnableOption "enable ankisync on server";
config = lib.mkIf config.swarselsystems.server.ankisync { config = lib.mkIf config.swarselsystems.modules.server.ankisync {
networking.firewall.allowedTCPPorts = [ 22701 ]; networking.firewall.allowedTCPPorts = [ 22701 ];

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.server.emacs = lib.mkEnableOption "enable emacs server on server"; options.swarselsystems.modules.server.emacs = lib.mkEnableOption "enable emacs server on server";
config = lib.mkIf config.swarselsystems.server.emacs { config = lib.mkIf config.swarselsystems.modules.server.emacs {
networking.firewall.allowedTCPPorts = [ 9812 ]; networking.firewall.allowedTCPPorts = [ 9812 ];

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.server.forgejo = lib.mkEnableOption "enable forgejo on server"; options.swarselsystems.modules.server.forgejo = lib.mkEnableOption "enable forgejo on server";
config = lib.mkIf config.swarselsystems.server.forgejo { config = lib.mkIf config.swarselsystems.modules.server.forgejo {
networking.firewall.allowedTCPPorts = [ 3000 ]; networking.firewall.allowedTCPPorts = [ 3000 ];

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.server.freshrss = lib.mkEnableOption "enable freshrss on server"; options.swarselsystems.modules.server.freshrss = lib.mkEnableOption "enable freshrss on server";
config = lib.mkIf config.swarselsystems.server.freshrss { config = lib.mkIf config.swarselsystems.modules.server.freshrss {
users.users.freshrss = { users.users.freshrss = {
extraGroups = [ "users" ]; extraGroups = [ "users" ];

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.server.immich = lib.mkEnableOption "enable immich on server"; options.swarselsystems.modules.server.immich = lib.mkEnableOption "enable immich on server";
config = lib.mkIf config.swarselsystems.server.immich { config = lib.mkIf config.swarselsystems.modules.server.immich {
users.users.immich = { users.users.immich = {
extraGroups = [ "video" "render" "users" ]; extraGroups = [ "video" "render" "users" ];

View file

@ -1,7 +1,7 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
{ {
options.swarselsystems.server.jellyfin = lib.mkEnableOption "enable jellyfin on server"; options.swarselsystems.modules.server.jellyfin = lib.mkEnableOption "enable jellyfin on server";
config = lib.mkIf config.swarselsystems.server.jellyfin { config = lib.mkIf config.swarselsystems.modules.server.jellyfin {
users.users.jellyfin = { users.users.jellyfin = {
extraGroups = [ "video" "render" "users" ]; extraGroups = [ "video" "render" "users" ];
}; };

View file

@ -1,7 +1,7 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
{ {
options.swarselsystems.server.jenkins = lib.mkEnableOption "enable jenkins on server"; options.swarselsystems.modules.server.jenkins = lib.mkEnableOption "enable jenkins on server";
config = lib.mkIf config.swarselsystems.server.jenkins { config = lib.mkIf config.swarselsystems.modules.server.jenkins {
services.jenkins = { services.jenkins = {
enable = true; enable = true;

View file

@ -1,7 +1,7 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
{ {
options.swarselsystems.server.kavita = lib.mkEnableOption "enable kavita on server"; options.swarselsystems.modules.server.kavita = lib.mkEnableOption "enable kavita on server";
config = lib.mkIf config.swarselsystems.server.kavita { config = lib.mkIf config.swarselsystems.modules.server.kavita {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
calibre calibre
]; ];

View file

@ -11,8 +11,8 @@ let
''; '';
in in
{ {
options.swarselsystems.server.matrix = lib.mkEnableOption "enable matrix on server"; options.swarselsystems.modules.server.matrix = lib.mkEnableOption "enable matrix on server";
config = lib.mkIf config.swarselsystems.server.matrix { config = lib.mkIf config.swarselsystems.modules.server.matrix {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
matrix-synapse matrix-synapse
lottieconverter lottieconverter

View file

@ -1,7 +1,7 @@
{ self, lib, config, ... }: { self, lib, config, ... }:
{ {
options.swarselsystems.server.monitoring = lib.mkEnableOption "enable monitoring on server"; options.swarselsystems.modules.server.monitoring = lib.mkEnableOption "enable monitoring on server";
config = lib.mkIf config.swarselsystems.server.monitoring { config = lib.mkIf config.swarselsystems.modules.server.monitoring {
sops.secrets = { sops.secrets = {
grafanaadminpass = { grafanaadminpass = {
@ -127,7 +127,7 @@
sslVerify = false; sslVerify = false;
scrapeUri = "http://localhost/nginx_status"; scrapeUri = "http://localhost/nginx_status";
}; };
nextcloud = lib.mkIf config.swarselsystems.server.nextcloud { nextcloud = lib.mkIf config.swarselsystems.modules.server.nextcloud {
enable = true; enable = true;
port = 9205; port = 9205;
url = "https://stash.swarsel.win/ocs/v2.php/apps/serverinfo/api/v1/info"; url = "https://stash.swarsel.win/ocs/v2.php/apps/serverinfo/api/v1/info";

View file

@ -1,7 +1,7 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
{ {
options.swarselsystems.server.mpd = lib.mkEnableOption "enable mpd on server"; options.swarselsystems.modules.server.mpd = lib.mkEnableOption "enable mpd on server";
config = lib.mkIf config.swarselsystems.server.mpd { config = lib.mkIf config.swarselsystems.modules.server.mpd {
users = { users = {
groups = { groups = {
mpd = { }; mpd = { };

View file

@ -3,8 +3,8 @@ let
secretsDirectory = builtins.toString inputs.nix-secrets; secretsDirectory = builtins.toString inputs.nix-secrets;
in in
{ {
options.swarselsystems.server.navidrome = lib.mkEnableOption "enable navidrome on server"; options.swarselsystems.modules.server.navidrome = lib.mkEnableOption "enable navidrome on server";
config = lib.mkIf config.swarselsystems.server.navidrome { config = lib.mkIf config.swarselsystems.modules.server.navidrome {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
pciutils pciutils
alsa-utils alsa-utils

View file

@ -1,7 +1,7 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
{ {
options.swarselsystems.server.nextcloud = lib.mkEnableOption "enable nextcloud on server"; options.swarselsystems.modules.server.nextcloud = lib.mkEnableOption "enable nextcloud on server";
config = lib.mkIf config.swarselsystems.server.nextcloud { config = lib.mkIf config.swarselsystems.modules.server.nextcloud {
sops.secrets.nextcloudadminpass = { sops.secrets.nextcloudadminpass = {
owner = "nextcloud"; owner = "nextcloud";

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselsystems.server.nfs = lib.mkEnableOption "enable nfs on server"; options.swarselsystems.modules.server.nfs = lib.mkEnableOption "enable nfs on server";
config = lib.mkIf config.swarselsystems.server.nfs { config = lib.mkIf config.swarselsystems.modules.server.nfs {
services = { services = {
# add a user with sudo smbpasswd -a <user> # add a user with sudo smbpasswd -a <user>
samba = { samba = {

View file

@ -1,7 +1,7 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
{ {
options.swarselsystems.server.nginx = lib.mkEnableOption "enable nginx on server"; options.swarselsystems.modules.server.nginx = lib.mkEnableOption "enable nginx on server";
config = lib.mkIf config.swarselsystems.server.nginx { config = lib.mkIf config.swarselsystems.modules.server.nginx {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
lego lego
]; ];

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselsystems.server.packages = lib.mkEnableOption "enable packages on server"; options.swarselsystems.modules.server.packages = lib.mkEnableOption "enable packages on server";
config = lib.mkIf config.swarselsystems.server.packages { config = lib.mkIf config.swarselsystems.modules.server.packages {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
gnupg gnupg
nix-index nix-index

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.server.paperless = lib.mkEnableOption "enable paperless on server"; options.swarselsystems.modules.server.paperless = lib.mkEnableOption "enable paperless on server";
config = lib.mkIf config.swarselsystems.server.paperless { config = lib.mkIf config.swarselsystems.modules.server.paperless {
users.users.paperless = { users.users.paperless = {
extraGroups = [ "users" ]; extraGroups = [ "users" ];

View file

@ -1,6 +1,6 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
config = lib.mkIf (config?swarselsystems.server.mpd || config?swarselsystems.server.navidrome) { config = lib.mkIf (config?swarselsystems.modules.server.mpd || config?swarselsystems.modules.server.navidrome) {
security.rtkit.enable = true; # this is required for pipewire real-time access security.rtkit.enable = true; # this is required for pipewire real-time access

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.server.restic = lib.mkEnableOption "enable restic backups on server"; options.swarselsystems.modules.server.restic = lib.mkEnableOption "enable restic backups on server";
config = lib.mkIf config.swarselsystems.server.restic { config = lib.mkIf config.swarselsystems.modules.server.restic {
# TODO # TODO

View file

@ -4,13 +4,13 @@ let
in in
{ {
options.swarselsystems = { options.swarselsystems = {
server.general = lib.mkEnableOption "general setting on server"; modules.server.general = lib.mkEnableOption "general setting on server";
shellAliases = lib.mkOption { shellAliases = lib.mkOption {
type = lib.types.attrsOf lib.types.str; type = lib.types.attrsOf lib.types.str;
default = { }; default = { };
}; };
}; };
config = lib.mkIf config.swarselsystems.server.general { config = lib.mkIf config.swarselsystems.modules.server.general {
environment.shellAliases = lib.recursiveUpdate environment.shellAliases = lib.recursiveUpdate
{ {
npswitch = "cd ${flakePath}; git pull; sudo nixos-rebuild --flake .#$(hostname) switch; cd -;"; npswitch = "cd ${flakePath}; git pull; sudo nixos-rebuild --flake .#$(hostname) switch; cd -;";

View file

@ -1,7 +1,7 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
options.swarselsystems.server.sops = lib.mkEnableOption "enable sops on server"; options.swarselsystems.modules.server.sops = lib.mkEnableOption "enable sops on server";
config = lib.mkIf config.swarselsystems.server.sops { config = lib.mkIf config.swarselsystems.modules.server.sops {
sops = { sops = {
age.sshKeyPaths = lib.mkDefault [ "/etc/ssh/sops" ]; age.sshKeyPaths = lib.mkDefault [ "/etc/ssh/sops" ];
defaultSopsFile = lib.mkDefault "${config.swarselsystems.flakePath}/secrets/winters/secrets.yaml"; defaultSopsFile = lib.mkDefault "${config.swarselsystems.flakePath}/secrets/winters/secrets.yaml";

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.server.spotifyd = lib.mkEnableOption "enable spotifyd on server"; options.swarselsystems.modules.server.spotifyd = lib.mkEnableOption "enable spotifyd on server";
config = lib.mkIf config.swarselsystems.server.spotifyd { config = lib.mkIf config.swarselsystems.modules.server.spotifyd {
users.groups.spotifyd = { users.groups.spotifyd = {
gid = 65136; gid = 65136;
}; };

View file

@ -1,7 +1,7 @@
{ self, lib, config, ... }: { self, lib, config, ... }:
{ {
options.swarselsystems.server.ssh = lib.mkEnableOption "enable ssh on server"; options.swarselsystems.modules.server.ssh = lib.mkEnableOption "enable ssh on server";
config = lib.mkIf config.swarselsystems.server.ssh { config = lib.mkIf config.swarselsystems.modules.server.ssh {
services.openssh = { services.openssh = {
enable = true; enable = true;
}; };

View file

@ -4,8 +4,8 @@ let
workHostName = lib.swarselsystems.getSecret "${secretsDirectory}/work/worklaptop-hostname"; workHostName = lib.swarselsystems.getSecret "${secretsDirectory}/work/worklaptop-hostname";
in in
{ {
options.swarselsystems.server.syncthing = lib.mkEnableOption "enable syncthing on server"; options.swarselsystems.modules.server.syncthing = lib.mkEnableOption "enable syncthing on server";
config = lib.mkIf config.swarselsystems.server.syncthing { config = lib.mkIf config.swarselsystems.modules.server.syncthing {
users.users.syncthing = { users.users.syncthing = {
extraGroups = [ "users" ]; extraGroups = [ "users" ];

View file

@ -1,7 +1,7 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
{ {
options.swarselsystems.server.transmission = lib.mkEnableOption "enable transmission and friends on server"; options.swarselsystems.modules.server.transmission = lib.mkEnableOption "enable transmission and friends on server";
config = lib.mkIf config.swarselsystems.server.transmission { config = lib.mkIf config.swarselsystems.modules.server.transmission {
# this user/group section is probably unneeded # this user/group section is probably unneeded
users = { users = {

View file

@ -40,6 +40,13 @@ let
}; };
}; };
nixpkgs-stable24_05 = final: _: {
stable24_05 = import inputs.nixpkgs-stable {
inherit (final) system;
config.allowUnfree = true;
};
};
zjstatus = _: prev: { zjstatus = _: prev: {
zjstatus = inputs.zjstatus.packages.${prev.system}.default; zjstatus = inputs.zjstatus.packages.${prev.system}.default;
}; };
@ -52,6 +59,7 @@ in
(additions final prev) (additions final prev)
// (modifications final prev) // (modifications final prev)
// (nixpkgs-stable final prev) // (nixpkgs-stable final prev)
// (nixpkgs-stable24_05 final prev)
// (zjstatus final prev) // (zjstatus final prev)
// (inputs.vbc-nix.overlays.default final prev) // (inputs.vbc-nix.overlays.default final prev)
// (inputs.nur.overlays.default final prev) // (inputs.nur.overlays.default final prev)

6
pkgs/sshrm/default.nix Normal file
View file

@ -0,0 +1,6 @@
{ self, name, writeShellApplication, openssh }:
writeShellApplication {
inherit name;
runtimeInputs = [ openssh ];
text = builtins.readFile "${self}/scripts/${name}.sh";
}

View file

@ -12,29 +12,28 @@
storeOptimize = lib.mkDefault true; storeOptimize = lib.mkDefault true;
time = lib.mkDefault true; time = lib.mkDefault true;
users = lib.mkDefault true; users = lib.mkDefault true;
}; server = {
server = { general = lib.mkDefault true;
general = lib.mkDefault true; packages = lib.mkDefault true;
packages = lib.mkDefault true; sops = lib.mkDefault true;
sops = lib.mkDefault true; nfs = lib.mkDefault true;
nfs = lib.mkDefault true; nginx = lib.mkDefault true;
nginx = lib.mkDefault true; ssh = lib.mkDefault true;
ssh = lib.mkDefault true; kavita = lib.mkDefault true;
kavita = lib.mkDefault true; jellyfin = lib.mkDefault true;
jellyfin = lib.mkDefault true; navidrome = lib.mkDefault true;
navidrome = lib.mkDefault true; spotifyd = lib.mkDefault true;
spotifyd = lib.mkDefault true; mpd = lib.mkDefault true;
mpd = lib.mkDefault true; matrix = lib.mkDefault true;
matrix = lib.mkDefault true; nextcloud = lib.mkDefault true;
nextcloud = lib.mkDefault true; immich = lib.mkDefault true;
immich = lib.mkDefault true; paperless = lib.mkDefault true;
paperless = lib.mkDefault true; transmission = lib.mkDefault true;
transmission = lib.mkDefault true; syncthing = lib.mkDefault true;
syncthing = lib.mkDefault true; monitoring = lib.mkDefault true;
monitoring = lib.mkDefault true; emacs = lib.mkDefault true;
emacs = lib.mkDefault true; freshrss = lib.mkDefault true;
freshrss = lib.mkDefault true; };
}; };
}; };
}; };

View file

@ -12,16 +12,16 @@
storeOptimize = lib.mkDefault true; storeOptimize = lib.mkDefault true;
time = lib.mkDefault true; time = lib.mkDefault true;
users = lib.mkDefault true; users = lib.mkDefault true;
}; server = {
server = { general = lib.mkDefault true;
general = lib.mkDefault true; packages = lib.mkDefault true;
packages = lib.mkDefault true; sops = lib.mkDefault true;
sops = lib.mkDefault true; nfs = lib.mkDefault true;
nfs = lib.mkDefault true; nginx = lib.mkDefault true;
nginx = lib.mkDefault true; ssh = lib.mkDefault true;
ssh = lib.mkDefault true; forgejo = lib.mkDefault true;
forgejo = lib.mkDefault true; ankisync = lib.mkDefault true;
ankisync = lib.mkDefault true; };
}; };
}; };
}; };

View file

@ -30,30 +30,49 @@ bindurl ^http(s)?://lobste\.rs c hint -Jc [class="u-url"],[class="comments_label
bindurl ^http(s)?://www\.google\.com gi composite focusinput -l ; text.end_of_line bindurl ^http(s)?://www\.google\.com gi composite focusinput -l ; text.end_of_line
" Work " Work
command tab_or_tabopen jsb -p (async () => { let tabs = await browser.tabs.query({}); let tab = tabs.find(t => t.url.includes(JS_ARG)); if (tab) {browser.tabs.update(tab.id, { active: true });} else {tri.excmds.tabopen(JS_ARG);}})() command tab_or_tabopen jsb -p (async () => {
let tabs = await browser.tabs.query({});
let tab = tabs.find(t => t.url.includes(JS_ARG));
if (tab) {
browser.tabs.update(tab.id, { active: true });
} else {
tri.excmds.tabopen(JS_ARG);
}
})()
bind gwa tab_or_tabopen apic-impimba-1.m.imp.ac.at command tab_or_tabopen_local jsb -p (async () => {
bind gwA tab_or_tabopen artifactory.imp.ac.at const currentWindow = await browser.windows.getCurrent();
bind gwb tab_or_tabopen bitbucket.vbc.ac.at const tabs = await browser.tabs.query({ windowId: currentWindow.id });
bind gwc tab_or_tabopen vbc.atlassian.net/wiki const tab = tabs.find(t => t.url.includes(JS_ARG));
bind gwd tab_or_tabopen datadomain-impimba-2.imp.ac.at if (tab) {
bind gwe tab_or_tabopen exivity.vbc.ac.at browser.tabs.update(tab.id, { active: true });
bind gwg tab_or_tabopen github.com } else {
bind gwG tab_or_tabopen goc.egi.eu tri.excmds.tabopen(JS_ARG);
bind gwh tab_or_tabopen jupyterhub.vbc.ac.at }
bind gwH tab_or_tabopen test-jupyterhub.vbc.ac.at })()
bind gwj tab_or_tabopen jenkins.vbc.ac.at
bind gwJ tab_or_tabopen test-jenkins.vbc.ac.at bind gwa tab_or_tabopen_local apic-impimba-1.m.imp.ac.at
bind gwl tab_or_tabopen lucid.app bind gwA tab_or_tabopen_local artifactory.imp.ac.at
bind gwm tab_or_tabopen monitoring.vbc.ac.at/grafana bind gwb tab_or_tabopen_local bitbucket.vbc.ac.at
bind gwM tab_or_tabopen monitoring.vbc.ac.at/prometheus bind gwc tab_or_tabopen_local vbc.atlassian.net/wiki
bind gwn tab_or_tabopen netbox.vbc.ac.at bind gwd tab_or_tabopen_local datadomain-impimba-2.imp.ac.at
bind gwN tab_or_tabopen nap.imp.ac.at bind gwe tab_or_tabopen_local exivity.vbc.ac.at
bind gwo tab_or_tabopen outlook.office.com bind gwg tab_or_tabopen_local github.com
bind gws tab_or_tabopen satellite.vbc.ac.at bind gwG tab_or_tabopen_local goc.egi.eu
bind gwt tab_or_tabopen tower.vbc.ac.at bind gwh tab_or_tabopen_local jupyterhub.vbc.ac.at
bind gwv tab_or_tabopen vc-impimba-1.m.imp.ac.at/ui bind gwH tab_or_tabopen_local test-jupyterhub.vbc.ac.at
bind gwx tab_or_tabopen xclarity.vbc.ac.at bind gwj tab_or_tabopen_local jenkins.vbc.ac.at
bind gwJ tab_or_tabopen_local test-jenkins.vbc.ac.at
bind gwl tab_or_tabopen_local lucid.app
bind gwm tab_or_tabopen_local monitoring.vbc.ac.at/grafana
bind gwM tab_or_tabopen_local monitoring.vbc.ac.at/prometheus
bind gwn tab_or_tabopen_local netbox.vbc.ac.at
bind gwN tab_or_tabopen_local nap.imp.ac.at
bind gwo tab_or_tabopen_local outlook.office.com
bind gws tab_or_tabopen_local satellite.vbc.ac.at
bind gwt tab_or_tabopen_local tower.vbc.ac.at
bind gwv tab_or_tabopen_local vc-impimba-1.m.imp.ac.at/ui
bind gwx tab_or_tabopen_local xclarity.vbc.ac.at
" Search in page " Search in page
set findcase smart set findcase smart

11
scripts/sshrm.sh Normal file
View file

@ -0,0 +1,11 @@
HISTFILE="$HOME"/.histfile
last_ssh_cmd=$(grep -E "ssh " "$HISTFILE" | sed -E 's/^: [0-9]+:[0-9]+;//' | grep "^ssh " | tail -1)
host=$(echo "$last_ssh_cmd" | sed -E 's/.*ssh ([^@ ]+@)?([^ ]+).*/\2/')
if [[ -n $host ]]; then
echo "Removing SSH host key for: $host"
ssh-keygen -R "$host"
else
echo "No valid SSH command found in history."
fi