refactor: [WIP] add hm and server profiles

This commit is contained in:
Leon Schwarzäugl 2025-04-03 00:20:26 +02:00
parent bd95ef4c9b
commit 9034735f84
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
38 changed files with 2559 additions and 2178 deletions

File diff suppressed because it is too large Load diff

View file

@ -6,6 +6,7 @@ let
isBtrfs = true; isBtrfs = true;
isLinux = true; isLinux = true;
sharescreen = "eDP-2"; sharescreen = "eDP-2";
profiles.personal = true;
}; };
in in
{ {
@ -28,6 +29,7 @@ in
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
{ {
home-manager.users."${primaryUser}".imports = [ home-manager.users."${primaryUser}".imports = [
"${self}/profiles/home"
"${modulesPath}/home/optional/gaming.nix" "${modulesPath}/home/optional/gaming.nix"
"${modulesPath}/home/optional/work.nix" "${modulesPath}/home/optional/work.nix"
]; ];
@ -91,7 +93,6 @@ in
swarselsystems = lib.recursiveUpdate swarselsystems = lib.recursiveUpdate
{ {
profiles.personal = true;
wallpaper = self + /wallpaper/lenovowp.png; wallpaper = self + /wallpaper/lenovowp.png;
hasBluetooth = true; hasBluetooth = true;
hasFingerprint = true; hasFingerprint = true;
@ -101,132 +102,135 @@ in
} }
sharedOptions; sharedOptions;
home-manager.users."${primaryUser}".swarselsystems = lib.recursiveUpdate home-manager.users."${primaryUser}" = {
{ home.stateVersion = lib.mkForce "23.05";
isLaptop = true; swarselsystems = lib.recursiveUpdate
isNixos = true; {
isSecondaryGpu = true; isLaptop = true;
SecondaryGpuCard = "pci-0000_03_00_0"; isNixos = true;
cpuCount = 16; isSecondaryGpu = true;
temperatureHwmon = { SecondaryGpuCard = "pci-0000_03_00_0";
isAbsolutePath = true; cpuCount = 16;
path = "/sys/devices/virtual/thermal/thermal_zone0/"; temperatureHwmon = {
input-filename = "temp4_input"; isAbsolutePath = true;
}; path = "/sys/devices/virtual/thermal/thermal_zone0/";
startup = [ input-filename = "temp4_input";
{ command = "nextcloud --background"; }
{ command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
{ command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
{ command = "ANKI_WAYLAND=1 anki"; }
{ command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
{ command = "nm-applet"; }
{ command = "teams-for-linux"; }
{ command = "1password"; }
{ command = "feishin"; }
];
lowResolution = "1280x800";
highResolution = "2560x1600";
monitors = {
main = {
name = "BOE 0x0BC9 Unknown";
mode = "2560x1600"; # TEMPLATE
scale = "1";
position = "2560,0";
workspace = "15:L";
output = "eDP-2";
}; };
homedesktop = { startup = [
name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320"; { command = "nextcloud --background"; }
mode = "2560x1440"; { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
scale = "1"; { command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
position = "0,0"; { command = "ANKI_WAYLAND=1 anki"; }
workspace = "1:"; { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
output = "DP-11"; { command = "nm-applet"; }
{ command = "teams-for-linux"; }
{ command = "1password"; }
{ command = "feishin"; }
];
lowResolution = "1280x800";
highResolution = "2560x1600";
monitors = {
main = {
name = "BOE 0x0BC9 Unknown";
mode = "2560x1600"; # TEMPLATE
scale = "1";
position = "2560,0";
workspace = "15:L";
output = "eDP-2";
};
homedesktop = {
name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
mode = "2560x1440";
scale = "1";
position = "0,0";
workspace = "1:";
output = "DP-11";
};
work_back_middle = {
name = "LG Electronics LG Ultra HD 0x000305A6";
mode = "2560x1440";
scale = "1";
position = "5120,0";
workspace = "1:";
output = "DP-10";
};
work_front_left = {
name = "LG Electronics LG Ultra HD 0x0007AB45";
mode = "3840x2160";
scale = "1";
position = "5120,0";
workspace = "1:";
output = "DP-7";
};
work_back_right = {
name = "HP Inc. HP Z32 CN41212T55";
mode = "3840x2160";
scale = "1";
position = "5120,0";
workspace = "1:";
output = "DP-3";
};
work_middle_middle_main = {
name = "HP Inc. HP 732pk CNC4080YL5";
mode = "3840x2160";
scale = "1";
position = "-1280,0";
workspace = "11:M";
output = "DP-8";
};
work_middle_middle_side = {
name = "Hewlett Packard HP Z24i CN44250RDT";
mode = "1920x1200";
transform = "270";
scale = "1";
position = "-2480,0";
workspace = "12:S";
output = "DP-9";
};
work_seminary = {
name = "Applied Creative Technology Transmitter QUATTRO201811";
mode = "1280x720";
scale = "1";
position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse
workspace = "14:T";
output = "DP-4";
};
}; };
work_back_middle = { inputs = {
name = "LG Electronics LG Ultra HD 0x000305A6"; "12972:18:Framework_Laptop_16_Keyboard_Module_-_ANSI_Keyboard" = {
mode = "2560x1440"; xkb_layout = "us";
scale = "1"; xkb_variant = "altgr-intl";
position = "5120,0"; };
workspace = "1:"; "1133:45081:MX_Master_2S_Keyboard" = {
output = "DP-10"; xkb_layout = "us";
xkb_variant = "altgr-intl";
};
# "2362:628:PIXA3854:00_093A:0274_Touchpad" = {
# dwt = "enabled";
# tap = "enabled";
# natural_scroll = "enabled";
# middle_emulation = "enabled";
# drag_lock = "disabled";
# };
"1133:50504:Logitech_USB_Receiver" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
"1133:45944:MX_KEYS_S" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
}; };
work_front_left = { keybindings = {
name = "LG Electronics LG Ultra HD 0x0007AB45"; "Mod4+Ctrl+Shift+p" = "exec screenshare";
mode = "3840x2160";
scale = "1";
position = "5120,0";
workspace = "1:";
output = "DP-7";
}; };
work_back_right = { shellAliases = {
name = "HP Inc. HP Z32 CN41212T55"; ans2-15_3-9 = ". ~/.venvs/ansible39_2_15_0/bin/activate";
mode = "3840x2160"; ans3-9 = ". ~/.venvs/ansible39/bin/activate";
scale = "1"; ans = ". ~/.venvs/ansible/bin/activate";
position = "5120,0"; ans2-15 = ". ~/.venvs/ansible2.15.0/bin/activate";
workspace = "1:";
output = "DP-3";
}; };
work_middle_middle_main = { }
name = "HP Inc. HP 732pk CNC4080YL5"; sharedOptions;
mode = "3840x2160"; };
scale = "1";
position = "-1280,0";
workspace = "11:M";
output = "DP-8";
};
work_middle_middle_side = {
name = "Hewlett Packard HP Z24i CN44250RDT";
mode = "1920x1200";
transform = "270";
scale = "1";
position = "-2480,0";
workspace = "12:S";
output = "DP-9";
};
work_seminary = {
name = "Applied Creative Technology Transmitter QUATTRO201811";
mode = "1280x720";
scale = "1";
position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse
workspace = "14:T";
output = "DP-4";
};
};
inputs = {
"12972:18:Framework_Laptop_16_Keyboard_Module_-_ANSI_Keyboard" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
"1133:45081:MX_Master_2S_Keyboard" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
# "2362:628:PIXA3854:00_093A:0274_Touchpad" = {
# dwt = "enabled";
# tap = "enabled";
# natural_scroll = "enabled";
# middle_emulation = "enabled";
# drag_lock = "disabled";
# };
"1133:50504:Logitech_USB_Receiver" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
"1133:45944:MX_KEYS_S" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
};
keybindings = {
"Mod4+Ctrl+Shift+p" = "exec screenshare";
};
shellAliases = {
ans2-15_3-9 = ". ~/.venvs/ansible39_2_15_0/bin/activate";
ans3-9 = ". ~/.venvs/ansible39/bin/activate";
ans = ". ~/.venvs/ansible/bin/activate";
ans2-15 = ". ~/.venvs/ansible2.15.0/bin/activate";
};
}
sharedOptions;
} }

View file

@ -1,30 +1,33 @@
{ config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
home.packages = with pkgs; lib.mkIf (!config.swarselsystems.isPublic) [ options.swarselsystems.modules.ownpackages = lib.mkEnableOption "own packages settings";
pass-fuzzel config = lib.mkIf config.swarselsystems.modules.ownpackages {
cura5 home.packages = with pkgs; lib.mkIf (!config.swarselsystems.isPublic) [
cdw pass-fuzzel
cdb cura5
bak cdw
timer cdb
e bak
swarselcheck timer
waybarupdate e
opacitytoggle swarselcheck
fs-diff waybarupdate
github-notifications opacitytoggle
hm-specialisation fs-diff
t2ts github-notifications
ts2t hm-specialisation
vershell t2ts
eontimer ts2t
project vershell
fhs eontimer
swarsel-bootstrap project
swarsel-displaypower fhs
swarselzellij swarsel-bootstrap
swarsel-displaypower
swarselzellij
rustdesk-vbc rustdesk-vbc
]; ];
};
} }

View file

@ -1,91 +1,94 @@
_: { lib, config, ... }:
{ {
xdg.desktopEntries = { options.swarselsystems.modules.desktop = lib.mkEnableOption "desktop settings";
config = lib.mkIf config.swarselsystems.modules.desktop {
xdg.desktopEntries = {
cura = {
name = "Ultimaker Cura";
genericName = "Cura";
exec = "cura";
terminal = false;
categories = [ "Application" ];
};
rustdesk-vbc = {
name = "Rustdesk VBC";
genericName = "rustdesk-vbc";
exec = "rustdesk-vbc";
terminal = false;
categories = [ "Application" ];
};
anki = {
name = "Anki Flashcards";
genericName = "Anki";
exec = "anki";
terminal = false;
categories = [ "Application" ];
};
element = {
name = "Element Matrix Client";
genericName = "Element";
exec = "element-desktop -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds";
terminal = false;
categories = [ "Application" ];
};
emacsclient-newframe = {
name = "Emacs (Client, New Frame)";
genericName = "Emacs (Client, New Frame)";
exec = "emacsclient -r %u";
icon = "emacs";
terminal = false;
categories = [ "Development" "TextEditor" ];
};
cura = {
name = "Ultimaker Cura";
genericName = "Cura";
exec = "cura";
terminal = false;
categories = [ "Application" ];
}; };
rustdesk-vbc = { xdg.mimeApps = {
name = "Rustdesk VBC";
genericName = "rustdesk-vbc";
exec = "rustdesk-vbc";
terminal = false;
categories = [ "Application" ];
};
anki = { enable = true;
name = "Anki Flashcards"; defaultApplications = {
genericName = "Anki"; "x-scheme-handler/http" = [ "firefox.desktop" ];
exec = "anki"; "x-scheme-handler/https" = [ "firefox.desktop" ];
terminal = false; "x-scheme-handler/chrome" = [ "firefox.desktop" ];
categories = [ "Application" ]; "text/plain" = [ "emacsclient.desktop" ];
}; "text/csv" = [ "emacsclient.desktop" ];
"text/html" = [ "firefox.desktop" ];
element = { "application/x-extension-htm" = [ "firefox.desktop" ];
name = "Element Matrix Client"; "application/x-extension-html" = [ "firefox.desktop" ];
genericName = "Element"; "application/x-extension-shtml" = [ "firefox.desktop" ];
exec = "element-desktop -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; "application/xhtml+xml" = [ "firefox.desktop" ];
terminal = false; "application/x-extension-xhtml" = [ "firefox.desktop" ];
categories = [ "Application" ]; "application/x-extension-xht" = [ "firefox.desktop" ];
}; "image/png" = [ "imv.desktop" ];
"image/jpeg" = [ "imv.desktop" ];
emacsclient-newframe = { "image/gif" = [ "imv.desktop" ];
name = "Emacs (Client, New Frame)"; "image/svg" = [ "imv.desktop" ];
genericName = "Emacs (Client, New Frame)"; "image/webp" = [ "firefox.desktop" ];
exec = "emacsclient -r %u"; "image/vnd.adobe.photoshop" = [ "gimp.desktop" ];
icon = "emacs"; "image/vnd.dxf" = [ "org.inkscape.Inkscape.desktop" ];
terminal = false; "audio/flac" = [ "mpv.desktop" ];
categories = [ "Development" "TextEditor" ]; "audio/mp3" = [ "mpv.desktop" ];
}; "audio/ogg" = [ "mpv.desktop" ];
"audio/wav" = [ "mpv.desktop" ];
}; "video/mp4" = [ "umpv.desktop" ];
"video/mkv" = [ "umpv.desktop" ];
xdg.mimeApps = { "video/flv" = [ "umpv.desktop" ];
"video/3gp" = [ "umpv.desktop" ];
enable = true; "application/pdf" = [ "org.gnome.Evince.desktop" ];
defaultApplications = { "application/metalink+xml" = [ "emacsclient.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ]; "application/sql" = [ "emacsclient.desktop" ];
"x-scheme-handler/https" = [ "firefox.desktop" ]; "application/vnd.ms-powerpoint" = [ "impress.desktop" ];
"x-scheme-handler/chrome" = [ "firefox.desktop" ]; "application/msword" = [ "writer.desktop" ];
"text/plain" = [ "emacsclient.desktop" ]; "application/vnd.ms-excel" = [ "calc.desktop" ];
"text/csv" = [ "emacsclient.desktop" ]; };
"text/html" = [ "firefox.desktop" ]; associations = {
"application/x-extension-htm" = [ "firefox.desktop" ]; added = {
"application/x-extension-html" = [ "firefox.desktop" ]; "application/x-zerosize" = [ "emacsclient.desktop" ];
"application/x-extension-shtml" = [ "firefox.desktop" ]; };
"application/xhtml+xml" = [ "firefox.desktop" ];
"application/x-extension-xhtml" = [ "firefox.desktop" ];
"application/x-extension-xht" = [ "firefox.desktop" ];
"image/png" = [ "imv.desktop" ];
"image/jpeg" = [ "imv.desktop" ];
"image/gif" = [ "imv.desktop" ];
"image/svg" = [ "imv.desktop" ];
"image/webp" = [ "firefox.desktop" ];
"image/vnd.adobe.photoshop" = [ "gimp.desktop" ];
"image/vnd.dxf" = [ "org.inkscape.Inkscape.desktop" ];
"audio/flac" = [ "mpv.desktop" ];
"audio/mp3" = [ "mpv.desktop" ];
"audio/ogg" = [ "mpv.desktop" ];
"audio/wav" = [ "mpv.desktop" ];
"video/mp4" = [ "umpv.desktop" ];
"video/mkv" = [ "umpv.desktop" ];
"video/flv" = [ "umpv.desktop" ];
"video/3gp" = [ "umpv.desktop" ];
"application/pdf" = [ "org.gnome.Evince.desktop" ];
"application/metalink+xml" = [ "emacsclient.desktop" ];
"application/sql" = [ "emacsclient.desktop" ];
"application/vnd.ms-powerpoint" = [ "impress.desktop" ];
"application/msword" = [ "writer.desktop" ];
"application/vnd.ms-excel" = [ "calc.desktop" ];
};
associations = {
added = {
"application/x-zerosize" = [ "emacsclient.desktop" ];
}; };
}; };
}; };

View file

@ -1,8 +1,11 @@
_: { lib, config, ... }:
{ {
programs.direnv = { options.swarselsystems.modules.direnv = lib.mkEnableOption "direnv settings";
enable = true; config = lib.mkIf config.swarselsystems.modules.direnv {
silent = true; programs.direnv = {
nix-direnv.enable = true; enable = true;
silent = true;
nix-direnv.enable = true;
};
}; };
} }

View file

@ -3,75 +3,77 @@ let
inherit (config.swarselsystems) homeDir isPublic; inherit (config.swarselsystems) homeDir isPublic;
in in
{ {
options.swarselsystems.modules.emacs = lib.mkEnableOption "emacs settings";
config = lib.mkIf config.swarselsystems.modules.emacs {
# needed for elfeed
sops.secrets.fever = lib.mkIf (!isPublic) { path = "${homeDir}/.emacs.d/.fever"; };
# needed for elfeed # enable emacs overlay for bleeding edge features
sops.secrets.fever = lib.mkIf (!isPublic) { path = "${homeDir}/.emacs.d/.fever"; }; # also read init.el file and install use-package packages
programs.emacs = {
enable = true;
package = pkgs.emacsWithPackagesFromUsePackage {
config = self + /programs/emacs/init.el;
package = pkgs.emacs-git-pgtk;
alwaysEnsure = true;
alwaysTangle = true;
extraEmacsPackages = epkgs: [
epkgs.mu4e
epkgs.use-package
epkgs.lsp-bridge
epkgs.doom-themes
epkgs.vterm
epkgs.treesit-grammars.with-all-grammars
# enable emacs overlay for bleeding edge features # build the rest of the packages myself
# also read init.el file and install use-package packages # org-calfw is severely outdated on MELPA and throws many warnings on emacs startup
programs.emacs = { # build the package from the haji-ali fork, which is well-maintained
enable = true;
package = pkgs.emacsWithPackagesFromUsePackage {
config = self + /programs/emacs/init.el;
package = pkgs.emacs-git-pgtk;
alwaysEnsure = true;
alwaysTangle = true;
extraEmacsPackages = epkgs: [
epkgs.mu4e
epkgs.use-package
epkgs.lsp-bridge
epkgs.doom-themes
epkgs.vterm
epkgs.treesit-grammars.with-all-grammars
# build the rest of the packages myself (epkgs.trivialBuild rec {
# org-calfw is severely outdated on MELPA and throws many warnings on emacs startup pname = "eglot-booster";
# build the package from the haji-ali fork, which is well-maintained version = "main-29-10-2024";
(epkgs.trivialBuild rec { src = pkgs.fetchFromGitHub {
pname = "eglot-booster"; owner = "jdtsmith";
version = "main-29-10-2024"; repo = "eglot-booster";
rev = "e6daa6bcaf4aceee29c8a5a949b43eb1b89900ed";
hash = "sha256-PLfaXELkdX5NZcSmR1s/kgmU16ODF8bn56nfTh9g6bs=";
};
src = pkgs.fetchFromGitHub { packageRequires = [ epkgs.jsonrpc epkgs.eglot ];
owner = "jdtsmith"; })
repo = "eglot-booster"; (epkgs.trivialBuild rec {
rev = "e6daa6bcaf4aceee29c8a5a949b43eb1b89900ed"; pname = "calfw";
hash = "sha256-PLfaXELkdX5NZcSmR1s/kgmU16ODF8bn56nfTh9g6bs="; version = "1.0.0-20231002";
}; src = pkgs.fetchFromGitHub {
owner = "haji-ali";
repo = "emacs-calfw";
rev = "bc99afee611690f85f0cd0bd33300f3385ddd3d3";
hash = "sha256-0xMII1KJhTBgQ57tXJks0ZFYMXIanrOl9XyqVmu7a7Y=";
};
packageRequires = [ epkgs.howm ];
})
packageRequires = [ epkgs.jsonrpc epkgs.eglot ]; (epkgs.trivialBuild rec {
}) pname = "fast-scroll";
(epkgs.trivialBuild rec { version = "1.0.0-20191016";
pname = "calfw"; src = pkgs.fetchFromGitHub {
version = "1.0.0-20231002"; owner = "ahungry";
src = pkgs.fetchFromGitHub { repo = "fast-scroll";
owner = "haji-ali"; rev = "3f6ca0d5556fe9795b74714304564f2295dcfa24";
repo = "emacs-calfw"; hash = "sha256-w1wmJW7YwXyjvXJOWdN2+k+QmhXr4IflES/c2bCX3CI=";
rev = "bc99afee611690f85f0cd0bd33300f3385ddd3d3"; };
hash = "sha256-0xMII1KJhTBgQ57tXJks0ZFYMXIanrOl9XyqVmu7a7Y="; packageRequires = [ ];
}; })
packageRequires = [ epkgs.howm ];
})
(epkgs.trivialBuild rec { ];
pname = "fast-scroll"; };
version = "1.0.0-20191016"; };
src = pkgs.fetchFromGitHub {
owner = "ahungry";
repo = "fast-scroll";
rev = "3f6ca0d5556fe9795b74714304564f2295dcfa24";
hash = "sha256-w1wmJW7YwXyjvXJOWdN2+k+QmhXr4IflES/c2bCX3CI=";
};
packageRequires = [ ];
})
]; services.emacs = {
enable = true;
socketActivation.enable = false;
startWithUserSession = "graphical";
}; };
}; };
services.emacs = {
enable = true;
socketActivation.enable = false;
startWithUserSession = "graphical";
};
} }

View file

@ -9,18 +9,21 @@ let
allMailAddresses = lib.swarselsystems.getSecret "${secretsDirectory}/mail/list"; allMailAddresses = lib.swarselsystems.getSecret "${secretsDirectory}/mail/list";
in in
{ {
home.sessionVariables = { options.swarselsystems.modules.env = lib.mkEnableOption "env settings";
EDITOR = "e -w"; config = lib.mkIf config.swarselsystems.modules.env {
DISPLAY = ":0"; home.sessionVariables = {
SWARSEL_LO_RES = config.swarselsystems.lowResolution; EDITOR = "e -w";
SWARSEL_HI_RES = config.swarselsystems.highResolution; DISPLAY = ":0";
}; SWARSEL_LO_RES = config.swarselsystems.lowResolution;
systemd.user.sessionVariables = { SWARSEL_HI_RES = config.swarselsystems.highResolution;
SWARSEL_LEON_MAIL = leonMail; };
SWARSEL_NAUTILUS_MAIL = nautilusMail; systemd.user.sessionVariables = {
SWARSEL_MRSWARSEL_MAIL = mrswarselMail; SWARSEL_LEON_MAIL = leonMail;
SWARSEL_SWARSEL_MAIL = swarselMail; SWARSEL_NAUTILUS_MAIL = nautilusMail;
SWARSEL_FULLNAME = fullName; SWARSEL_MRSWARSEL_MAIL = mrswarselMail;
SWARSEL_MAIL_ALL = allMailAddresses; SWARSEL_SWARSEL_MAIL = swarselMail;
SWARSEL_FULLNAME = fullName;
SWARSEL_MAIL_ALL = allMailAddresses;
};
}; };
} }

View file

@ -1,12 +1,15 @@
_: { lib, config, ... }:
{ {
programs.eza = { options.swarselsystems.modules.eza = lib.mkEnableOption "eza settings";
enable = true; config = lib.mkIf config.swarselsystems.modules.eza {
icons = "auto"; programs.eza = {
git = true; enable = true;
extraOptions = [ icons = "auto";
"-l" git = true;
"--group-directories-first" extraOptions = [
]; "-l"
"--group-directories-first"
];
};
}; };
} }

View file

@ -1,147 +1,150 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
programs.firefox = { options.swarselsystems.modules.firefox = lib.mkEnableOption "firefox settings";
enable = true; config = lib.mkIf config.swarselsystems.modules.firefox {
package = pkgs.firefox; # uses overrides programs.firefox = {
policies = { enable = true;
# CaptivePortal = false; package = pkgs.firefox; # uses overrides
AppAutoUpdate = false; policies = {
BackgroundAppUpdate = false; # CaptivePortal = false;
DisableBuiltinPDFViewer = true; AppAutoUpdate = false;
DisableFirefoxStudies = true; BackgroundAppUpdate = false;
DisablePocket = true; DisableBuiltinPDFViewer = true;
DisableFirefoxScreenshots = true; DisableFirefoxStudies = true;
DisableTelemetry = true; DisablePocket = true;
DisableFirefoxAccounts = false; DisableFirefoxScreenshots = true;
DisableProfileImport = true; DisableTelemetry = true;
DisableProfileRefresh = true; DisableFirefoxAccounts = false;
DisplayBookmarksToolbar = "always"; DisableProfileImport = true;
DontCheckDefaultBrowser = true; DisableProfileRefresh = true;
NoDefaultBookmarks = true; DisplayBookmarksToolbar = "always";
OfferToSaveLogins = false; DontCheckDefaultBrowser = true;
OfferToSaveLoginsDefault = false; NoDefaultBookmarks = true;
PasswordManagerEnabled = false; OfferToSaveLogins = false;
DisableMasterPasswordCreation = true; OfferToSaveLoginsDefault = false;
ExtensionUpdate = false; PasswordManagerEnabled = false;
EnableTrackingProtection = { DisableMasterPasswordCreation = true;
Value = true; ExtensionUpdate = false;
Locked = true; EnableTrackingProtection = {
Cryptomining = true; Value = true;
Fingerprinting = true; Locked = true;
EmailTracking = true; Cryptomining = true;
# Exceptions = ["https://example.com"] Fingerprinting = true;
}; EmailTracking = true;
PDFjs = { # Exceptions = ["https://example.com"]
Enabled = false;
EnablePermissions = false;
};
Handlers = {
mimeTypes."application/pdf".action = "saveToDisk";
};
extensions = {
pdf = {
action = "useHelperApp";
ask = true;
handlers = [
{
name = "GNOME Document Viewer";
path = "${pkgs.evince}/bin/evince";
}
];
}; };
}; PDFjs = {
FirefoxHome = { Enabled = false;
Search = true; EnablePermissions = false;
TopSites = true; };
SponsoredTopSites = false; Handlers = {
Highlights = true; mimeTypes."application/pdf".action = "saveToDisk";
Pocket = false; };
SponsoredPocket = false; extensions = {
Snippets = false; pdf = {
Locked = true; action = "useHelperApp";
}; ask = true;
FirefoxSuggest = { handlers = [
WebSuggestions = false; {
SponsoredSuggestions = false; name = "GNOME Document Viewer";
ImproveSuggest = false; path = "${pkgs.evince}/bin/evince";
Locked = true; }
};
SanitizeOnShutdown = {
Cache = true;
Cookies = false;
Downloads = true;
FormData = true;
History = false;
Sessions = false;
SiteSettings = false;
OfflineApps = true;
Locked = true;
};
SearchEngines = {
PreventInstalls = true;
Remove = [
"Bing" # Fuck you
];
};
UserMessaging = {
ExtensionRecommendations = false; # Dont recommend extensions while the user is visiting web pages
FeatureRecommendations = false; # Dont recommend browser features
Locked = true; # Prevent the user from changing user messaging preferences
MoreFromMozilla = false; # Dont show the “More from Mozilla” section in Preferences
SkipOnboarding = true; # Dont show onboarding messages on the new tab page
UrlbarInterventions = false; # Dont offer suggestions in the URL bar
WhatsNew = false; # Remove the “Whats New” icon and menuitem
};
ExtensionSettings = {
"3rdparty".Extensions = {
# https://github.com/gorhill/uBlock/blob/master/platform/common/managed_storage.json
"uBlock0@raymondhill.net".adminSettings = {
userSettings = rec {
uiTheme = "dark";
uiAccentCustom = true;
uiAccentCustom0 = "#0C8084";
cloudStorageEnabled = lib.mkForce false;
importedLists = [
"https://filters.adtidy.org/extension/ublock/filters/3.txt"
"https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt"
];
externalLists = lib.concatStringsSep "\n" importedLists;
};
selectedFilterLists = [
"CZE-0"
"adguard-generic"
"adguard-annoyance"
"adguard-social"
"adguard-spyware-url"
"easylist"
"easyprivacy"
"https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt"
"plowe-0"
"ublock-abuse"
"ublock-badware"
"ublock-filters"
"ublock-privacy"
"ublock-quick-fixes"
"ublock-unbreak"
"urlhaus-1"
]; ];
}; };
}; };
FirefoxHome = {
Search = true;
TopSites = true;
SponsoredTopSites = false;
Highlights = true;
Pocket = false;
SponsoredPocket = false;
Snippets = false;
Locked = true;
};
FirefoxSuggest = {
WebSuggestions = false;
SponsoredSuggestions = false;
ImproveSuggest = false;
Locked = true;
};
SanitizeOnShutdown = {
Cache = true;
Cookies = false;
Downloads = true;
FormData = true;
History = false;
Sessions = false;
SiteSettings = false;
OfflineApps = true;
Locked = true;
};
SearchEngines = {
PreventInstalls = true;
Remove = [
"Bing" # Fuck you
];
};
UserMessaging = {
ExtensionRecommendations = false; # Dont recommend extensions while the user is visiting web pages
FeatureRecommendations = false; # Dont recommend browser features
Locked = true; # Prevent the user from changing user messaging preferences
MoreFromMozilla = false; # Dont show the “More from Mozilla” section in Preferences
SkipOnboarding = true; # Dont show onboarding messages on the new tab page
UrlbarInterventions = false; # Dont offer suggestions in the URL bar
WhatsNew = false; # Remove the “Whats New” icon and menuitem
};
ExtensionSettings = {
"3rdparty".Extensions = {
# https://github.com/gorhill/uBlock/blob/master/platform/common/managed_storage.json
"uBlock0@raymondhill.net".adminSettings = {
userSettings = rec {
uiTheme = "dark";
uiAccentCustom = true;
uiAccentCustom0 = "#0C8084";
cloudStorageEnabled = lib.mkForce false;
importedLists = [
"https://filters.adtidy.org/extension/ublock/filters/3.txt"
"https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt"
];
externalLists = lib.concatStringsSep "\n" importedLists;
};
selectedFilterLists = [
"CZE-0"
"adguard-generic"
"adguard-annoyance"
"adguard-social"
"adguard-spyware-url"
"easylist"
"easyprivacy"
"https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt"
"plowe-0"
"ublock-abuse"
"ublock-badware"
"ublock-filters"
"ublock-privacy"
"ublock-quick-fixes"
"ublock-unbreak"
"urlhaus-1"
];
};
};
};
}; };
}; profiles = {
default = lib.recursiveUpdate
profiles = { {
default = lib.recursiveUpdate id = 0;
{ isDefault = true;
id = 0; settings = {
isDefault = true; "browser.startup.homepage" = "https://outlook.office.com|https://satellite.vbc.ac.at|https://bitbucket.vbc.ac.at|https://github.com";
settings = { };
"browser.startup.homepage" = "https://outlook.office.com|https://satellite.vbc.ac.at|https://bitbucket.vbc.ac.at|https://github.com"; }
}; config.swarselsystems.firefox;
} };
config.swarselsystems.firefox;
}; };
}; };
} }

View file

@ -1,14 +1,17 @@
_: { lib, config, ... }:
{ {
programs.fuzzel = { options.swarselsystems.modules.fuzzel = lib.mkEnableOption "fuzzel settings";
enable = true; config = lib.mkIf config.swarselsystems.modules.fuzzel {
settings = { programs.fuzzel = {
main = { enable = true;
layer = "overlay"; settings = {
lines = "10"; main = {
width = "40"; layer = "overlay";
lines = "10";
width = "40";
};
border.radius = "0";
}; };
border.radius = "0";
}; };
}; };
} }

View file

@ -1,44 +1,47 @@
{ lib, nix-secrets, ... }: { lib, config, nix-secrets, ... }:
let let
secretsDirectory = builtins.toString nix-secrets; secretsDirectory = builtins.toString nix-secrets;
leonMail = lib.swarselsystems.getSecret "${secretsDirectory}/mail/leon"; leonMail = lib.swarselsystems.getSecret "${secretsDirectory}/mail/leon";
fullName = lib.swarselsystems.getSecret "${secretsDirectory}/info/fullname"; fullName = lib.swarselsystems.getSecret "${secretsDirectory}/info/fullname";
in in
{ {
programs.git = { options.swarselsystems.modules.git = lib.mkEnableOption "git settings";
enable = true; config = lib.mkIf config.swarselsystems.modules.git {
aliases = { programs.git = {
a = "add"; enable = true;
c = "commit"; aliases = {
cl = "clone"; a = "add";
co = "checkout"; c = "commit";
b = "branch"; cl = "clone";
i = "init"; co = "checkout";
m = "merge"; b = "branch";
s = "status"; i = "init";
r = "restore"; m = "merge";
p = "pull"; s = "status";
pp = "push"; r = "restore";
}; p = "pull";
signing = { pp = "push";
key = "0x76FD3810215AE097"; };
signByDefault = true; signing = {
}; key = "0x76FD3810215AE097";
userEmail = lib.mkDefault leonMail; signByDefault = true;
userName = fullName; };
difftastic.enable = true; userEmail = lib.mkDefault leonMail;
lfs.enable = true; userName = fullName;
includes = [ difftastic.enable = true;
{ lfs.enable = true;
contents = { includes = [
github = { {
user = "Swarsel"; contents = {
github = {
user = "Swarsel";
};
commit = {
template = "~/.gitmessage";
};
}; };
commit = { }
template = "~/.gitmessage"; ];
}; };
};
}
];
}; };
} }

View file

@ -1,6 +1,9 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
services.gnome-keyring = lib.mkIf (!config.swarselsystems.isNixos) { options.swarselsystems.modules.gnome-keyring = lib.mkEnableOption "gnome keyring settings";
enable = true; config = lib.mkIf config.swarselsystems.modules.gnome-keyring {
services.gnome-keyring = lib.mkIf (!config.swarselsystems.isNixos) {
enable = true;
};
}; };
} }

View file

@ -1,12 +1,15 @@
_: { lib, config, ... }:
{ {
programs.kitty = { options.swarselsystems.modules.kitty = lib.mkEnableOption "kitty settings";
enable = true; config = lib.mkIf config.swarselsystems.modules.kitty {
keybindings = { }; programs.kitty = {
settings = { enable = true;
scrollback_lines = 10000; keybindings = { };
enable_audio_bell = false; settings = {
notify_on_cmd_finish = "always 20"; scrollback_lines = 10000;
enable_audio_bell = false;
notify_on_cmd_finish = "always 20";
};
}; };
}; };
} }

View file

@ -8,137 +8,140 @@ let
fullName = lib.swarselsystems.getSecret "${secretsDirectory}/info/fullname"; fullName = lib.swarselsystems.getSecret "${secretsDirectory}/info/fullname";
in in
{ {
programs = { options.swarselsystems.modules.mail = lib.mkEnableOption "mail settings";
mbsync = { config = lib.mkIf config.swarselsystems.modules.mail {
enable = true; programs = {
mbsync = {
enable = true;
};
msmtp = {
enable = true;
};
mu = {
enable = true;
};
}; };
msmtp = {
enable = true;
};
mu = {
enable = true;
};
};
services.mbsync = { services.mbsync = {
enable = true; enable = true;
}; };
# this is needed so that mbsync can use the passwords from sops # this is needed so that mbsync can use the passwords from sops
systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ]; systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ];
accounts = lib.mkIf (!config.swarselsystems.isPublic) { accounts = lib.mkIf (!config.swarselsystems.isPublic) {
email = { email = {
maildirBasePath = "Mail"; maildirBasePath = "Mail";
accounts = { accounts = {
leon = { leon = {
primary = true; primary = true;
address = leonMail; address = leonMail;
userName = leonMail; userName = leonMail;
realName = fullName; realName = fullName;
passwordCommand = "cat ${config.sops.secrets.leon.path}"; passwordCommand = "cat ${config.sops.secrets.leon.path}";
gpg = { gpg = {
key = "0x76FD3810215AE097"; key = "0x76FD3810215AE097";
signByDefault = true; signByDefault = true;
};
imap.host = "imap.gmail.com";
smtp.host = "smtp.gmail.com";
mu.enable = true;
msmtp = {
enable = true;
};
mbsync = {
enable = true;
create = "maildir";
expunge = "both";
patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ];
extraConfig = {
channel = {
Sync = "All";
};
account = {
Timeout = 120;
PipelineDepth = 1;
};
}; };
}; imap.host = "imap.gmail.com";
}; smtp.host = "smtp.gmail.com";
mu.enable = true;
swarsel = { msmtp = {
address = swarselMail;
userName = "8227dc594dd515ce232eda1471cb9a19";
realName = fullName;
passwordCommand = "cat ${config.sops.secrets.swarselmail.path}";
smtp = {
host = "in-v3.mailjet.com";
port = 587;
tls = {
enable = true; enable = true;
useStartTls = true;
}; };
}; mbsync = {
mu.enable = false; enable = true;
msmtp = { create = "maildir";
enable = true; expunge = "both";
}; patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ];
mbsync = { extraConfig = {
enable = false; channel = {
}; Sync = "All";
}; };
account = {
nautilus = { Timeout = 120;
primary = false; PipelineDepth = 1;
address = nautilusMail; };
userName = nautilusMail;
realName = "Nautilus";
passwordCommand = "cat ${config.sops.secrets.nautilus.path}";
imap.host = "imap.gmail.com";
smtp.host = "smtp.gmail.com";
msmtp.enable = true;
mu.enable = true;
mbsync = {
enable = true;
create = "maildir";
expunge = "both";
patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ];
extraConfig = {
channel = {
Sync = "All";
};
account = {
Timeout = 120;
PipelineDepth = 1;
}; };
}; };
}; };
};
mrswarsel = { swarsel = {
primary = false; address = swarselMail;
address = mrswarselMail; userName = "8227dc594dd515ce232eda1471cb9a19";
userName = mrswarselMail; realName = fullName;
realName = "Swarsel"; passwordCommand = "cat ${config.sops.secrets.swarselmail.path}";
passwordCommand = "cat ${config.sops.secrets.mrswarsel.path}"; smtp = {
imap.host = "imap.gmail.com"; host = "in-v3.mailjet.com";
smtp.host = "smtp.gmail.com"; port = 587;
msmtp.enable = true; tls = {
mu.enable = true; enable = true;
mbsync = { useStartTls = true;
enable = true;
create = "maildir";
expunge = "both";
patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ];
extraConfig = {
channel = {
Sync = "All";
}; };
account = { };
Timeout = 120; mu.enable = false;
PipelineDepth = 1; msmtp = {
enable = true;
};
mbsync = {
enable = false;
};
};
nautilus = {
primary = false;
address = nautilusMail;
userName = nautilusMail;
realName = "Nautilus";
passwordCommand = "cat ${config.sops.secrets.nautilus.path}";
imap.host = "imap.gmail.com";
smtp.host = "smtp.gmail.com";
msmtp.enable = true;
mu.enable = true;
mbsync = {
enable = true;
create = "maildir";
expunge = "both";
patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ];
extraConfig = {
channel = {
Sync = "All";
};
account = {
Timeout = 120;
PipelineDepth = 1;
};
}; };
}; };
}; };
};
mrswarsel = {
primary = false;
address = mrswarselMail;
userName = mrswarselMail;
realName = "Swarsel";
passwordCommand = "cat ${config.sops.secrets.mrswarsel.path}";
imap.host = "imap.gmail.com";
smtp.host = "smtp.gmail.com";
msmtp.enable = true;
mu.enable = true;
mbsync = {
enable = true;
create = "maildir";
expunge = "both";
patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ];
extraConfig = {
channel = {
Sync = "All";
};
account = {
Timeout = 120;
PipelineDepth = 1;
};
};
};
};
};
}; };
}; };
}; };

View file

@ -1,21 +1,24 @@
{ self, pkgs, ... }: { self, lib, config, pkgs, ... }:
{ {
programs.nix-index = options.swarselsystems.modules.nix-index = lib.mkEnableOption "nix-index settings";
let config = lib.mkIf config.swarselsystems.modules.nix-index {
commandNotFound = pkgs.runCommandLocal "command-not-found.sh" { } '' programs.nix-index =
mkdir -p $out/etc/profile.d let
substitute ${self + /scripts/command-not-found.sh} \ commandNotFound = pkgs.runCommandLocal "command-not-found.sh" { } ''
$out/etc/profile.d/command-not-found.sh \ mkdir -p $out/etc/profile.d
--replace-fail @nix-locate@ ${pkgs.nix-index}/bin/nix-locate \ substitute ${self + /scripts/command-not-found.sh} \
--replace-fail @tput@ ${pkgs.ncurses}/bin/tput $out/etc/profile.d/command-not-found.sh \
''; --replace-fail @nix-locate@ ${pkgs.nix-index}/bin/nix-locate \
in --replace-fail @tput@ ${pkgs.ncurses}/bin/tput
'';
in
{ {
enable = true; enable = true;
package = pkgs.symlinkJoin { package = pkgs.symlinkJoin {
name = "nix-index"; name = "nix-index";
paths = [ commandNotFound ]; paths = [ commandNotFound ];
};
}; };
}; };
} }

View file

@ -1,13 +1,14 @@
{ lib, config, nixgl, ... }: { lib, config, nixgl, ... }:
{ {
options.swarselsystems = { options.swarselsystems = {
modules.nixgl = lib.mkEnableOption "nixgl settings";
isSecondaryGpu = lib.mkEnableOption "device has a secondary GPU"; isSecondaryGpu = lib.mkEnableOption "device has a secondary GPU";
SecondaryGpuCard = lib.mkOption { SecondaryGpuCard = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = ""; default = "";
}; };
}; };
config = { config = lib.mkIf config.swarselsystems.modules.nixgl {
nixGL = lib.mkIf (!config.swarselsystems.isNixos) { nixGL = lib.mkIf (!config.swarselsystems.isNixos) {
inherit (nixgl) packages; inherit (nixgl) packages;
defaultWrapper = lib.mkDefault "mesa"; defaultWrapper = lib.mkDefault "mesa";

View file

@ -1,179 +1,182 @@
{ pkgs, ... }: { lib, config, pkgs, ... }:
{ {
home.packages = with pkgs; [ options.swarselsystems.modules.packages = lib.mkEnableOption "packages settings";
config = lib.mkIf config.swarselsystems.modules.packages {
home.packages = with pkgs; [
# audio stuff # audio stuff
spek # spectrum analyzer spek # spectrum analyzer
losslessaudiochecker losslessaudiochecker
ffmpeg_7-full ffmpeg_7-full
flac flac
mediainfo mediainfo
picard-tools picard-tools
audacity audacity
sox sox
stable.feishin stable.feishin
calibre calibre
# printing # printing
cups cups
simple-scan simple-scan
# dict # dict
(aspellWithDicts (dicts: with dicts; [ de en en-computers en-science ])) (aspellWithDicts (dicts: with dicts; [ de en en-computers en-science ]))
# browser # browser
vieb vieb
mgba mgba
# utilities # utilities
util-linux util-linux
nmap nmap
lsof lsof
nvd nvd
nix-output-monitor nix-output-monitor
hyprpicker # color picker hyprpicker # color picker
findutils findutils
units units
vim vim
sshfs sshfs
fuse fuse
ventoy ventoy
poppler_utils poppler_utils
# nix # nix
alejandra alejandra
nixpkgs-fmt nixpkgs-fmt
deadnix deadnix
statix statix
nix-tree nix-tree
nix-diff nix-diff
nix-visualize nix-visualize
nix-init nix-init
nix-inspect nix-inspect
nixpkgs-review nixpkgs-review
manix manix
comma comma
# shellscripts # shellscripts
shfmt shfmt
# local file sharing # local file sharing
wormhole-rs wormhole-rs
# b2 backup @backblaze # b2 backup @backblaze
restic restic
# "big" programs # "big" programs
gimp gimp
inkscape inkscape
zoom-us zoom-us
# nomacs # nomacs
libreoffice-qt libreoffice-qt
xournalpp xournalpp
obsidian obsidian
spotify spotify
vesktop # discord client vesktop # discord client
nextcloud-client nextcloud-client
spotify-player spotify-player
element-desktop element-desktop
nicotine-plus nicotine-plus
stable.transmission_3 stable.transmission_3
mktorrent mktorrent
hexchat hexchat
hugo hugo
# kyria # kyria
qmk qmk
qmk-udev-rules qmk-udev-rules
# firefox related # firefox related
tridactyl-native tridactyl-native
# mako related # mako related
mako mako
libnotify libnotify
# general utilities # general utilities
unrar unrar
samba samba
cifs-utils cifs-utils
zbar # qr codes zbar # qr codes
readline readline
autotiling autotiling
brightnessctl brightnessctl
libappindicator-gtk3 libappindicator-gtk3
sqlite sqlite
speechd speechd
networkmanagerapplet networkmanagerapplet
psmisc # kill etc psmisc # kill etc
lm_sensors lm_sensors
# jq # used for searching the i3 tree in check<xxx>.sh files # jq # used for searching the i3 tree in check<xxx>.sh files
# specifically needed for anki # specifically needed for anki
# mpv # mpv
anki-bin anki-bin
# dirvish file previews # dirvish file previews
fd fd
imagemagick imagemagick
# poppler # poppler
ffmpegthumbnailer ffmpegthumbnailer
mediainfo mediainfo
gnutar gnutar
unzip unzip
#nautilus #nautilus
stable.nautilus stable.nautilus
xfce.tumbler xfce.tumbler
libgsf libgsf
# wayland stuff # wayland stuff
wtype wtype
wl-clipboard wl-clipboard
stable.wl-mirror stable.wl-mirror
wf-recorder wf-recorder
kanshi kanshi
# screenshotting tools # screenshotting tools
grim grim
slurp slurp
# the following packages are used (in some way) by waybar # the following packages are used (in some way) by waybar
playerctl playerctl
pavucontrol pavucontrol
stable.pamixer stable.pamixer
# gnome.gnome-clocks # gnome.gnome-clocks
# wlogout # wlogout
# jdiskreport # jdiskreport
# monitor # monitor
#keychain #keychain
qalculate-gtk qalculate-gtk
gcr # needed for gnome-secrets to work gcr # needed for gnome-secrets to work
seahorse seahorse
# sops-related # sops-related
sops sops
ssh-to-age ssh-to-age
# mail related packages # mail related packages
mu mu
# latex and related packages # latex and related packages
(texlive.combine { (texlive.combine {
inherit (pkgs.texlive) scheme-full inherit (pkgs.texlive) scheme-full
dvisvgm dvipng# for preview and export as html dvisvgm dvipng# for preview and export as html
wrapfig amsmath ulem hyperref capt-of; wrapfig amsmath ulem hyperref capt-of;
}) })
# font stuff # font stuff
nerd-fonts.fira-mono nerd-fonts.fira-mono
nerd-fonts.fira-code nerd-fonts.fira-code
nerd-fonts.symbols-only nerd-fonts.symbols-only
noto-fonts-emoji noto-fonts-emoji
font-awesome_5 font-awesome_5
noto-fonts noto-fonts
noto-fonts-cjk-sans noto-fonts-cjk-sans
]; ];
};
} }

View file

@ -1,10 +1,13 @@
{ pkgs, ... }: { lib, config, pkgs, ... }:
{ {
programs.password-store = { options.swarselsystems.modules.passwordstore = lib.mkEnableOption "passwordstore settings";
enable = true; config = lib.mkIf config.swarselsystems.modules.passwordstore {
settings = { programs.password-store = {
PASSWORD_STORE_DIR = "$HOME/.local/share/password-store"; enable = true;
settings = {
PASSWORD_STORE_DIR = "$HOME/.local/share/password-store";
};
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
}; };
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
}; };
} }

View file

@ -1,22 +1,25 @@
{ pkgs, ... }: { lib, config, pkgs, ... }:
{ {
programs = { options.swarselsystems.modules.programs = lib.mkEnableOption "programs settings";
bottom.enable = true; config = lib.mkIf config.swarselsystems.modules.programs {
imv.enable = true; programs = {
sioyek.enable = true; bottom.enable = true;
bat = { imv.enable = true;
enable = true; sioyek.enable = true;
extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ]; bat = {
enable = true;
extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ];
};
carapace.enable = true;
wlogout.enable = true;
swayr.enable = true;
yt-dlp.enable = true;
mpv.enable = true;
jq.enable = true;
ripgrep.enable = true;
pandoc.enable = true;
fzf.enable = true;
zoxide.enable = true;
}; };
carapace.enable = true;
wlogout.enable = true;
swayr.enable = true;
yt-dlp.enable = true;
mpv.enable = true;
jq.enable = true;
ripgrep.enable = true;
pandoc.enable = true;
fzf.enable = true;
zoxide.enable = true;
}; };
} }

View file

@ -3,41 +3,44 @@ let
inherit (config.swarselsystems) mainUser; inherit (config.swarselsystems) mainUser;
in in
{ {
nix = lib.mkIf (!config.swarselsystems.isNixos) { options.swarselsystems.modules.general = lib.mkEnableOption "general nix settings";
settings = { config = lib.mkIf config.swarselsystems.modules.general {
experimental-features = [ nix = lib.mkIf (!config.swarselsystems.isNixos) {
"nix-command" settings = {
"flakes" experimental-features = [
"ca-derivations" "nix-command"
"cgroups" "flakes"
"pipe-operators" "ca-derivations"
]; "cgroups"
trusted-users = [ "@wheel" "${mainUser}" ]; "pipe-operators"
connect-timeout = 5; ];
bash-prompt-prefix = "$SHLVL:\\w "; trusted-users = [ "@wheel" "${mainUser}" ];
bash-prompt = "$(if [[ $? -gt 0 ]]; then printf \"\"; else printf \"\"; fi)\[\e[1m\]λ\[\e[0m\] "; connect-timeout = 5;
fallback = true; bash-prompt-prefix = "$SHLVL:\\w ";
min-free = 128000000; bash-prompt = "$(if [[ $? -gt 0 ]]; then printf \"\"; else printf \"\"; fi)\[\e[1m\]λ\[\e[0m\] ";
max-free = 1000000000; fallback = true;
auto-optimise-store = true; min-free = 128000000;
warn-dirty = false; max-free = 1000000000;
max-jobs = 1; auto-optimise-store = true;
use-cgroups = lib.mkIf config.swarselsystems.isLinux true; warn-dirty = false;
max-jobs = 1;
use-cgroups = lib.mkIf config.swarselsystems.isLinux true;
};
}; };
};
nixpkgs.overlays = lib.mkIf config.swarselsystems.isNixos (lib.mkForce null); nixpkgs.overlays = lib.mkIf config.swarselsystems.isNixos (lib.mkForce null);
programs.home-manager.enable = lib.mkIf (!config.swarselsystems.isNixos) true; programs.home-manager.enable = lib.mkIf (!config.swarselsystems.isNixos) true;
targets.genericLinux.enable = lib.mkIf (!config.swarselsystems.isNixos) true; targets.genericLinux.enable = lib.mkIf (!config.swarselsystems.isNixos) true;
home = { home = {
username = lib.mkDefault mainUser; username = lib.mkDefault mainUser;
homeDirectory = lib.mkDefault "/home/${mainUser}"; homeDirectory = lib.mkDefault "/home/${mainUser}";
stateVersion = lib.mkDefault "23.05"; stateVersion = lib.mkDefault "23.05";
keyboard.layout = "us"; keyboard.layout = "us";
sessionVariables = { sessionVariables = {
FLAKE = "/home/${mainUser}/.dotfiles"; FLAKE = "/home/${mainUser}/.dotfiles";
};
}; };
}; };

View file

@ -3,18 +3,21 @@ let
inherit (config.swarselsystems) homeDir xdgDir; inherit (config.swarselsystems) homeDir xdgDir;
in in
{ {
sops = lib.mkIf (!config.swarselsystems.isPublic) { options.swarselsystems.modules.sops = lib.mkEnableOption "sops settings";
age.sshKeyPaths = [ "${homeDir}/.ssh/sops" "${homeDir}/.ssh/ssh_host_ed25519_key" ]; config = lib.mkIf config.swarselsystems.modules.sops {
defaultSopsFile = lib.swarselsystems.mkIfElseList config.swarselsystems.isBtrfs "/persist/.dotfiles/secrets/general/secrets.yaml" "${homeDir}/.dotfiles/secrets/general/secrets.yaml"; sops = lib.mkIf (!config.swarselsystems.isPublic) {
age.sshKeyPaths = [ "${homeDir}/.ssh/sops" "${homeDir}/.ssh/ssh_host_ed25519_key" ];
defaultSopsFile = lib.swarselsystems.mkIfElseList config.swarselsystems.isBtrfs "/persist/.dotfiles/secrets/general/secrets.yaml" "${homeDir}/.dotfiles/secrets/general/secrets.yaml";
validateSopsFiles = false; validateSopsFiles = false;
secrets = { secrets = {
mrswarsel = { path = "${xdgDir}/secrets/mrswarsel"; }; mrswarsel = { path = "${xdgDir}/secrets/mrswarsel"; };
nautilus = { path = "${xdgDir}/secrets/nautilus"; }; nautilus = { path = "${xdgDir}/secrets/nautilus"; };
leon = { path = "${xdgDir}/secrets/leon"; }; leon = { path = "${xdgDir}/secrets/leon"; };
swarselmail = { path = "${xdgDir}/secrets/swarselmail"; }; swarselmail = { path = "${xdgDir}/secrets/swarselmail"; };
github_notif = { path = "${xdgDir}/secrets/github_notif"; }; github_notif = { path = "${xdgDir}/secrets/github_notif"; };
u2f_keys = { path = "${homeDir}/.config/Yubico/u2f_keys"; }; u2f_keys = { path = "${homeDir}/.config/Yubico/u2f_keys"; };
};
}; };
}; };
} }

View file

@ -1,36 +1,39 @@
_: { lib, config, ... }:
{ {
programs.ssh = { options.swarselsystems.modules.ssh = lib.mkEnableOption "ssh settings";
enable = true; config = lib.mkIf config.swarselsystems.modules.ssh {
forwardAgent = true; programs.ssh = {
extraConfig = '' enable = true;
SetEnv TERM=xterm-256color forwardAgent = true;
ServerAliveInterval 20 extraConfig = ''
''; SetEnv TERM=xterm-256color
matchBlocks = { ServerAliveInterval 20
"pfsense" = { '';
hostname = "192.168.1.1"; matchBlocks = {
user = "root"; "pfsense" = {
}; hostname = "192.168.1.1";
"winters" = { user = "root";
hostname = "192.168.1.2"; };
user = "swarsel"; "winters" = {
}; hostname = "192.168.1.2";
"minecraft" = { user = "swarsel";
hostname = "130.61.119.129"; };
user = "opc"; "minecraft" = {
}; hostname = "130.61.119.129";
"sync" = { user = "opc";
hostname = "193.122.53.173"; };
user = "root"; "sync" = {
}; hostname = "193.122.53.173";
"songdiver" = { user = "root";
hostname = "89.168.100.65"; };
user = "ubuntu"; "songdiver" = {
}; hostname = "89.168.100.65";
"pkv" = { user = "ubuntu";
hostname = "46.232.248.161"; };
user = "root"; "pkv" = {
hostname = "46.232.248.161";
user = "root";
};
}; };
}; };
}; };

View file

@ -1,121 +1,124 @@
_: { lib, config, ... }:
{ {
programs.starship = { options.swarselsystems.modules.starship = lib.mkEnableOption "starship settings";
enable = true; config = lib.mkIf config.swarselsystems.modules.starship {
enableZshIntegration = true; programs.starship = {
settings = { enable = true;
add_newline = false; enableZshIntegration = true;
format = "$shlvl$character"; settings = {
right_format = "$all"; add_newline = false;
command_timeout = 3000; format = "$shlvl$character";
right_format = "$all";
command_timeout = 3000;
directory.substitutions = { directory.substitutions = {
"Documents" = "󰈙 "; "Documents" = "󰈙 ";
"Downloads" = " "; "Downloads" = " ";
"Music" = " "; "Music" = " ";
"Pictures" = " "; "Pictures" = " ";
};
git_status = {
style = "bg:#394260";
format = "[[($all_status$ahead_behind)](fg:#769ff0 bg:#394260)]($style) ";
};
character = {
success_symbol = "[λ](bold green)";
error_symbol = "[λ](bold red)";
};
shlvl = {
disabled = false;
symbol = "";
format = "[$symbol]($style) ";
repeat = true;
repeat_offset = 1;
style = "blue";
};
nix_shell = {
disabled = false;
heuristic = true;
format = "[$symbol$name]($style)";
symbol = " ";
};
aws.symbol = " ";
buf.symbol = " ";
c.symbol = " ";
conda.symbol = " ";
dart.symbol = " ";
directory.read_only = " 󰌾";
docker_context.symbol = " ";
elixir.symbol = " ";
elm.symbol = " ";
fossil_branch.symbol = " ";
git_branch.symbol = " ";
golang.symbol = " ";
guix_shell.symbol = " ";
haskell.symbol = " ";
haxe.symbol = " ";
hg_branch.symbol = " ";
hostname.ssh_symbol = " ";
java.symbol = " ";
julia.symbol = " ";
lua.symbol = " ";
memory_usage.symbol = "󰍛 ";
meson.symbol = "󰔷 ";
nim.symbol = "󰆥 ";
nodejs.symbol = " ";
os.symbols = {
Alpaquita = " ";
Alpine = " ";
Amazon = " ";
Android = " ";
Arch = " ";
Artix = " ";
CentOS = " ";
Debian = " ";
DragonFly = " ";
Emscripten = " ";
EndeavourOS = " ";
Fedora = " ";
FreeBSD = " ";
Garuda = "󰛓 ";
Gentoo = " ";
HardenedBSD = "󰞌 ";
Illumos = "󰈸 ";
Linux = " ";
Mabox = " ";
Macos = " ";
Manjaro = " ";
Mariner = " ";
MidnightBSD = " ";
Mint = " ";
NetBSD = " ";
NixOS = " ";
OpenBSD = "󰈺 ";
openSUSE = " ";
OracleLinux = "󰌷 ";
Pop = " ";
Raspbian = " ";
Redhat = " ";
RedHatEnterprise = " ";
Redox = "󰀘 ";
Solus = "󰠳 ";
SUSE = " ";
Ubuntu = " ";
Unknown = " ";
Windows = "󰍲 ";
};
package.symbol = "󰏗 ";
pijul_channel.symbol = " ";
python.symbol = " ";
rlang.symbol = "󰟔 ";
ruby.symbol = " ";
rust.symbol = " ";
scala.symbol = " ";
}; };
git_status = {
style = "bg:#394260";
format = "[[($all_status$ahead_behind)](fg:#769ff0 bg:#394260)]($style) ";
};
character = {
success_symbol = "[λ](bold green)";
error_symbol = "[λ](bold red)";
};
shlvl = {
disabled = false;
symbol = "";
format = "[$symbol]($style) ";
repeat = true;
repeat_offset = 1;
style = "blue";
};
nix_shell = {
disabled = false;
heuristic = true;
format = "[$symbol$name]($style)";
symbol = " ";
};
aws.symbol = " ";
buf.symbol = " ";
c.symbol = " ";
conda.symbol = " ";
dart.symbol = " ";
directory.read_only = " 󰌾";
docker_context.symbol = " ";
elixir.symbol = " ";
elm.symbol = " ";
fossil_branch.symbol = " ";
git_branch.symbol = " ";
golang.symbol = " ";
guix_shell.symbol = " ";
haskell.symbol = " ";
haxe.symbol = " ";
hg_branch.symbol = " ";
hostname.ssh_symbol = " ";
java.symbol = " ";
julia.symbol = " ";
lua.symbol = " ";
memory_usage.symbol = "󰍛 ";
meson.symbol = "󰔷 ";
nim.symbol = "󰆥 ";
nodejs.symbol = " ";
os.symbols = {
Alpaquita = " ";
Alpine = " ";
Amazon = " ";
Android = " ";
Arch = " ";
Artix = " ";
CentOS = " ";
Debian = " ";
DragonFly = " ";
Emscripten = " ";
EndeavourOS = " ";
Fedora = " ";
FreeBSD = " ";
Garuda = "󰛓 ";
Gentoo = " ";
HardenedBSD = "󰞌 ";
Illumos = "󰈸 ";
Linux = " ";
Mabox = " ";
Macos = " ";
Manjaro = " ";
Mariner = " ";
MidnightBSD = " ";
Mint = " ";
NetBSD = " ";
NixOS = " ";
OpenBSD = "󰈺 ";
openSUSE = " ";
OracleLinux = "󰌷 ";
Pop = " ";
Raspbian = " ";
Redhat = " ";
RedHatEnterprise = " ";
Redox = "󰀘 ";
Solus = "󰠳 ";
SUSE = " ";
Ubuntu = " ";
Unknown = " ";
Windows = "󰍲 ";
};
package.symbol = "󰏗 ";
pijul_channel.symbol = " ";
python.symbol = " ";
rlang.symbol = "󰟔 ";
ruby.symbol = " ";
rust.symbol = " ";
scala.symbol = " ";
}; };
}; };
} }

View file

@ -1,9 +1,12 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
stylix = lib.mkIf (!config.swarselsystems.isNixos) (lib.recursiveUpdate options.swarselsystems.modules.stylix = lib.mkEnableOption "stylix settings";
{ config = lib.mkIf config.swarselsystems.modules.stylix {
image = config.swarselsystems.wallpaper; stylix = lib.mkIf (!config.swarselsystems.isNixos) (lib.recursiveUpdate
targets = config.swarselsystems.stylixHomeTargets; {
} image = config.swarselsystems.wallpaper;
config.swarselsystems.stylix); targets = config.swarselsystems.stylixHomeTargets;
}
config.swarselsystems.stylix);
};
} }

View file

@ -180,13 +180,18 @@
"${modifier}+Print" = "exec screenshare"; "${modifier}+Print" = "exec screenshare";
# exec swaymsg move workspace to "$(swaymsg -t get_outputs | jq '[.[] | select(.active == true)] | .[(map(.focused) | index(true) + 1) % length].name')" # exec swaymsg move workspace to "$(swaymsg -t get_outputs | jq '[.[] | select(.active == true)] | .[(map(.focused) | index(true) + 1) % length].name')"
# "XF86AudioRaiseVolume" = "exec pa 5%"; # "XF86AudioRaiseVolume" = "exec pa 5%";
"XF86AudioRaiseVolume" = "exec pamixer -i 5"; # "XF86AudioRaiseVolume" = "exec pamixer -i 5";
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
# "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; # "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioLowerVolume" = "exec pamixer -d 5"; # "XF86AudioLowerVolume" = "exec pamixer -d 5";
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
# "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; # "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMute" = "exec pamixer -t"; # "XF86AudioMute" = "exec pamixer -t";
"XF86MonBrightnessUp" = "exec brightnessctl set +5%"; "XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
"XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; # "XF86MonBrightnessUp" = "exec brightnessctl set +5%";
"XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
# "XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
"XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
"XF86Display" = "exec wl-mirror eDP-1"; "XF86Display" = "exec wl-mirror eDP-1";
} }
config.swarselsystems.keybindings; config.swarselsystems.keybindings;
@ -363,37 +368,38 @@
swayfxSettings = config.swarselsystems.swayfxConfig; swayfxSettings = config.swarselsystems.swayfxConfig;
in in
" "
exec_always autotiling exec_always autotiling
set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\" set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\"
mode $exit { mode $exit {
bindsym --to-code { bindsym --to-code {
s exec \"systemctl suspend\", mode \"default\" s exec \"systemctl suspend\", mode \"default\"
h exec \"systemctl hibernate\", mode \"default\" h exec \"systemctl hibernate\", mode \"default\"
l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize\", mode \"default\ l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize\", mode \"default\
p exec \"systemctl poweroff\" p exec \"systemctl poweroff\"
r exec \"systemctl reboot\" r exec \"systemctl reboot\"
u exec \"swaymsg exit\" u exec \"swaymsg exit\"
Return mode \"default\" Return mode \"default\"
Escape mode \"default\" Escape mode \"default\"
${modifier}+Escape mode \"default\" ${modifier}+Escape mode \"default\"
} }
} }
exec systemctl --user import-environment exec systemctl --user import-environment
exec swayidle -w exec swayidle -w
seat * hide_cursor 2000 seat * hide_cursor 2000
exec kanshi 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
${swayfxSettings} ${swayfxSettings}
"; ";
}; };
}; };
} }

View file

@ -1,29 +1,32 @@
{ self, lib, ... }: { self, lib, config, ... }:
{ {
home.file = { options.swarselsystems.modules.symlink = lib.mkEnableOption "symlink settings";
"init.el" = lib.mkDefault { config = lib.mkIf config.swarselsystems.modules.symlink {
source = self + /programs/emacs/init.el; home.file = {
target = ".emacs.d/init.el"; "init.el" = lib.mkDefault {
source = self + /programs/emacs/init.el;
target = ".emacs.d/init.el";
};
"early-init.el" = {
source = self + /programs/emacs/early-init.el;
target = ".emacs.d/early-init.el";
};
# on NixOS, Emacs does not find the aspell dicts easily. Write the configuration manually
".aspell.conf" = {
source = self + /programs/config/.aspell.conf;
target = ".aspell.conf";
};
".gitmessage" = {
source = self + /programs/git/.gitmessage;
target = ".gitmessage";
};
}; };
"early-init.el" = {
source = self + /programs/emacs/early-init.el;
target = ".emacs.d/early-init.el";
};
# on NixOS, Emacs does not find the aspell dicts easily. Write the configuration manually
".aspell.conf" = {
source = self + /programs/config/.aspell.conf;
target = ".aspell.conf";
};
".gitmessage" = {
source = self + /programs/git/.gitmessage;
target = ".gitmessage";
};
};
xdg.configFile = { xdg.configFile = {
"tridactyl/tridactylrc".source = self + /programs/firefox/tridactyl/tridactylrc; "tridactyl/tridactylrc".source = self + /programs/firefox/tridactyl/tridactylrc;
"tridactyl/themes/base16-codeschool.css".source = self + /programs/firefox/tridactyl/themes/base16-codeschool.css; "tridactyl/themes/base16-codeschool.css".source = self + /programs/firefox/tridactyl/themes/base16-codeschool.css;
"tridactyl/themes/swarsel.css".source = self + /programs/firefox/tridactyl/themes/swarsel.css; "tridactyl/themes/swarsel.css".source = self + /programs/firefox/tridactyl/themes/swarsel.css;
"swayidle/config".source = self + /programs/swayidle/config; "swayidle/config".source = self + /programs/swayidle/config;
};
}; };
} }

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { lib, config, pkgs, ... }:
let let
tmux-super-fingers = pkgs.tmuxPlugins.mkTmuxPlugin tmux-super-fingers = pkgs.tmuxPlugins.mkTmuxPlugin
{ {
@ -13,85 +13,87 @@ let
}; };
in in
{ {
options.swarselsystems.modules.tmux = lib.mkEnableOption "tmux settings";
config = lib.mkIf config.swarselsystems.modules.tmux {
home.packages = with pkgs; [
lsof
sesh
];
home.packages = with pkgs; [ programs.tmux = {
lsof enable = true;
sesh shell = "${pkgs.zsh}/bin/zsh";
]; terminal = "tmux-256color";
historyLimit = 100000;
plugins = with pkgs;
[
tmuxPlugins.tmux-thumbs
{
plugin = tmux-super-fingers;
extraConfig = "set -g @super-fingers-key f";
}
programs.tmux = { tmuxPlugins.sensible
enable = true; # must be before continuum edits right status bar
shell = "${pkgs.zsh}/bin/zsh"; {
terminal = "tmux-256color"; plugin = tmuxPlugins.catppuccin;
historyLimit = 100000; extraConfig = ''
plugins = with pkgs; set -g @catppuccin_flavour 'frappe'
[ set -g @catppuccin_window_tabs_enabled on
tmuxPlugins.tmux-thumbs set -g @catppuccin_date_time "%H:%M"
{ '';
plugin = tmux-super-fingers; }
extraConfig = "set -g @super-fingers-key f"; {
} plugin = tmuxPlugins.resurrect;
extraConfig = ''
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-capture-pane-contents 'on'
'';
}
{
plugin = tmuxPlugins.continuum;
extraConfig = ''
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @continuum-save-interval '10'
'';
}
tmuxPlugins.better-mouse-mode
tmuxPlugins.yank
];
extraConfig = ''
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
tmuxPlugins.sensible set-option -g prefix C-a
# must be before continuum edits right status bar unbind-key C-b
{ bind-key C-a send-prefix
plugin = tmuxPlugins.catppuccin;
extraConfig = ''
set -g @catppuccin_flavour 'frappe'
set -g @catppuccin_window_tabs_enabled on
set -g @catppuccin_date_time "%H:%M"
'';
}
{
plugin = tmuxPlugins.resurrect;
extraConfig = ''
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-capture-pane-contents 'on'
'';
}
{
plugin = tmuxPlugins.continuum;
extraConfig = ''
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @continuum-save-interval '10'
'';
}
tmuxPlugins.better-mouse-mode
tmuxPlugins.yank
];
extraConfig = ''
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
set-option -g prefix C-a set -g mouse on
unbind-key C-b
bind-key C-a send-prefix
set -g mouse on # Open new split at cwd of current split
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Open new split at cwd of current split # Use vim keybindings in copy mode
bind | split-window -h -c "#{pane_current_path}" set-window-option -g mode-keys vi
bind - split-window -v -c "#{pane_current_path}"
# Use vim keybindings in copy mode # v in copy mode starts making selection
set-window-option -g mode-keys vi bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# v in copy mode starts making selection # Escape turns on copy mode
bind-key -T copy-mode-vi v send-keys -X begin-selection bind Escape copy-mode
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# Escape turns on copy mode set-option -g status-position top
bind Escape copy-mode
set-option -g status-position top # make Prefix p paste the buffer.
unbind p
bind p paste-buffer
# make Prefix p paste the buffer. '';
unbind p };
bind p paste-buffer
'';
}; };
} }

View file

@ -22,6 +22,7 @@ let
in in
{ {
options.swarselsystems = { options.swarselsystems = {
modules.waybar = lib.mkEnableOption "waybar settings";
cpuCount = lib.mkOption { cpuCount = lib.mkOption {
type = lib.types.int; type = lib.types.int;
default = 8; default = 8;
@ -50,7 +51,7 @@ in
internal = true; internal = true;
}; };
}; };
config = { config = lib.mkIf config.swarselsystems.modules.waybar {
swarselsystems = { swarselsystems = {
waybarModules = lib.mkIf config.swarselsystems.isLaptop (modulesLeft ++ [ waybarModules = lib.mkIf config.swarselsystems.isLaptop (modulesLeft ++ [
"battery" "battery"

View file

@ -1,14 +1,17 @@
{ lib, nix-secrets, ... }: { lib, config, nix-secrets, ... }:
let let
secretsDirectory = builtins.toString nix-secrets; secretsDirectory = builtins.toString nix-secrets;
yubikey1 = lib.swarselsystems.getSecret "${secretsDirectory}/yubikey/yubikey1"; yubikey1 = lib.swarselsystems.getSecret "${secretsDirectory}/yubikey/yubikey1";
yubikey2 = lib.swarselsystems.getSecret "${secretsDirectory}/yubikey/yubikey2"; yubikey2 = lib.swarselsystems.getSecret "${secretsDirectory}/yubikey/yubikey2";
in in
{ {
pam.yubico.authorizedYubiKeys = { options.swarselsystems.modules.yubikey = lib.mkEnableOption "yubikey settings";
ids = [ config = lib.mkIf config.swarselsystems.modules.yubikey {
"${yubikey1}" pam.yubico.authorizedYubiKeys = {
"${yubikey2}" ids = [
]; "${yubikey1}"
"${yubikey2}"
];
};
}; };
} }

View file

@ -1,18 +1,20 @@
{ self, config, pkgs, ... }: { self, lib, config, pkgs, ... }:
{ {
options.swarselsystems.modules.zellij = lib.mkEnableOption "zellij settings";
config = lib.mkIf config.swarselsystems.modules.zellij {
programs.zellij = {
enable = true;
enableZshIntegration = true;
};
programs.zellij = { home.packages = with pkgs; [
enable = true; zjstatus
enableZshIntegration = true; ];
};
home.packages = with pkgs; [ xdg.configFile = {
zjstatus "zellij/config.kdl".text = import "${self}/programs/zellij/config.kdl.nix" { inherit config; };
]; "zellij/layouts/default.kdl".text = import "${self}/programs/zellij/layouts/default.kdl.nix" { inherit config pkgs; };
};
xdg.configFile = {
"zellij/config.kdl".text = import "${self}/programs/zellij/config.kdl.nix" { inherit config; };
"zellij/layouts/default.kdl".text = import "${self}/programs/zellij/layouts/default.kdl.nix" { inherit config pkgs; };
}; };
} }

View file

@ -4,12 +4,13 @@ let
in in
{ {
options.swarselsystems = { options.swarselsystems = {
modules.zsh = lib.mkEnableOption "zsh settings";
shellAliases = lib.mkOption { shellAliases = lib.mkOption {
type = lib.types.attrsOf lib.types.str; type = lib.types.attrsOf lib.types.str;
default = { }; default = { };
}; };
}; };
config = { config = lib.mkIf config.swarselsystems.modules.zsh {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
shellAliases = lib.recursiveUpdate shellAliases = lib.recursiveUpdate

View file

@ -143,7 +143,7 @@ in
udev.extraRules = '' udev.extraRules = ''
# share screen when dongle detected # share screen when dongle detected
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", TAG+="systemd", ENV{SYSTEMD_WANTS}="swarsel-screenshare.service" SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="343c", ATTRS{idProduct}=="0000", TAG+="systemd", ENV{SYSTEMD_WANTS}="swarsel-screenshare.service"
# lock screen when yubikey removed # lock screen when yubikey removed
ACTION=="remove", ENV{PRODUCT}=="3/1050/407/110", RUN+="${pkgs.systemd}/bin/systemctl suspend" ACTION=="remove", ENV{PRODUCT}=="3/1050/407/110", RUN+="${pkgs.systemd}/bin/systemctl suspend"

View file

@ -1,5 +1,7 @@
{ lib, ... }: { lib, ... }:
let let
moduleNames = lib.swarselsystems.readNix "profiles/home"; profileNames = lib.swarselsystems.readNix "profiles/home";
in in
lib.swarselsystems.mkProfiles moduleNames "home" {
imports = lib.swarselsystems.mkImports profileNames "profiles/home";
}

View file

@ -0,0 +1,36 @@
{ lib, config, ... }:
{
options.swarselsystems.profiles.personal = lib.mkEnableOption "is this a personal host";
config = lib.mkIf config.swarselsystems.profiles.personal {
swarselsystems.modules = {
packages = lib.mkDefault true;
ownpackages = lib.mkDefault true;
general = lib.mkDefault true;
nixgl = lib.mkDefault true;
sops = lib.mkDefault true;
yubikey = lib.mkDefault true;
ssh = lib.mkDefault true;
stylix = lib.mkDefault true;
desktop = lib.mkDefault true;
symlink = lib.mkDefault true;
env = lib.mkDefault true;
programs = lib.mkDefault true;
nix-index = lib.mkDefault true;
direnv = lib.mkDefault true;
eza = lib.mkDefault true;
git = lib.mkDefault true;
fuzzel = lib.mkDefault true;
starship = lib.mkDefault true;
kitty = lib.mkDefault true;
zsh = lib.mkDefault true;
zellij = lib.mkDefault true;
tmux = lib.mkDefault true;
mail = lib.mkDefault true;
emacs = lib.mkDefault true;
waybar = lib.mkDefault true;
firefox = lib.mkDefault true;
gnome-keyring = lib.mkDefault true;
};
};
}

View file

@ -1,5 +1,7 @@
{ lib, ... }: { lib, ... }:
let let
moduleNames = lib.swarselsystems.readNix "profiles/nixos"; profileNames = lib.swarselsystems.readNix "profiles/nixos";
in in
lib.swarselsystems.mkProfiles moduleNames "nixos" {
imports = lib.swarselsystems.mkImports profileNames "profiles/nixos";
}

View file

@ -0,0 +1,37 @@
{ lib, config, ... }:
{
options.swarselsystems.profiles.server.local = lib.mkEnableOption "is this a local server";
config = lib.mkIf config.swarselsystems.profiles.server.local {
swarselsystems = {
# common modules
modules = {
nix-ld = lib.mkDefault true;
home-manager = lib.mkDefault true;
home-managerExtra = lib.mkDefault true;
xserver = lib.mkDefault true;
gc = lib.mkDefault true;
storeOptimize = lib.mkDefault true;
time = lib.mkDefault true;
users = lib.mkDefault true;
};
# server modules
# server = {
# kavita = lib.mkDefault true;
# jellyfin = lib.mkDefault true;
# navidrome = lib.mkDefault true;
# spotifyd = lib.mkDefault true;
# mpd = lib.mkDefault true;
# matrix = lib.mkDefault true;
# nextcloud = lib.mkDefault true;
# immich = lib.mkDefault true;
# paperless = lib.mkDefault true;
# transmission = lib.mkDefault true;
# syncthing = lib.mkDefault true;
# monitoring = lib.mkDefault true;
# emacs = lib.mkDefault true;
# freshrss = lib.mkDefault true;
# };
};
};
}

View file

@ -1,8 +1,8 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.profiles.personalz = lib.mkEnableOption "is this a personal host"; options.swarselsystems.profiles.personal = lib.mkEnableOption "is this a personal host";
config = lib.mkIf config.swarselsystems.profiles.personalz { config = lib.mkIf config.swarselsystems.profiles.personal {
config.swarselsystems.modules = { swarselsystems.modules = {
packages = lib.mkDefault true; packages = lib.mkDefault true;
general = lib.mkDefault true; general = lib.mkDefault true;
home-manager = lib.mkDefault true; home-manager = lib.mkDefault true;

View file

@ -0,0 +1,25 @@
{ lib, config, ... }:
{
options.swarselsystems.profiles.server.sync = lib.mkEnableOption "is this a oci sync server";
config = lib.mkIf config.swarselsystems.profiles.server.sync {
swarselsystems = {
# common modules
modules = {
nix-ld = lib.mkDefault true;
home-manager = lib.mkDefault true;
home-managerExtra = lib.mkDefault true;
xserver = lib.mkDefault true;
gc = lib.mkDefault true;
storeOptimize = lib.mkDefault true;
time = lib.mkDefault true;
users = lib.mkDefault true;
};
# server modules
# server = {
# forgejo = lib.mkDefault true;
# ankisync = lib.mkDefault true;
# };
};
};
}