format: format codebase using nixfmt-rfc-style

This commit is contained in:
Tigor Hutasuhut 2024-10-21 12:31:30 +07:00
parent 9b5b84ed5a
commit ebfaa0e940
128 changed files with 1832 additions and 1336 deletions

View file

@ -44,16 +44,17 @@
};
};
outputs =
inputs @ { self
, nur
, nixpkgs
, home-manager
, sops-nix
, neovim-nightly-overlay
, nix-index-database
, rust-overlay
, nix-flatpak
, ...
inputs@{
self,
nur,
nixpkgs,
home-manager,
sops-nix,
neovim-nightly-overlay,
nix-index-database,
rust-overlay,
nix-flatpak,
...
}:
let
commonModules = [
@ -78,9 +79,7 @@
"https://cache.nixos.org/"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ];
};
}
sops-nix.nixosModules.sops
@ -99,19 +98,23 @@
};
in
{
nixosConfigurations =
{
nixosConfigurations = {
castle =
let
profile-path = ./profiles/castle.nix;
hardware-configuration = ./hardware-configuration/castle.nix;
specialArgs = { inherit inputs unstable profile-path hardware-configuration; };
specialArgs = {
inherit
inputs
unstable
profile-path
hardware-configuration
;
};
in
nixpkgs.lib.nixosSystem
{
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
[
modules = [
./system
{
home-manager.extraSpecialArgs = specialArgs;
@ -124,7 +127,14 @@
let
profile-path = ./profiles/fort.nix;
hardware-configuration = ./hardware-configuration/fort.nix;
specialArgs = { inherit inputs unstable profile-path hardware-configuration; };
specialArgs = {
inherit
inputs
unstable
profile-path
hardware-configuration
;
};
in
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
@ -141,7 +151,14 @@
let
profile-path = ./profiles/homeserver.nix;
hardware-configuration = ./hardware-configuration/homeserver.nix;
specialArgs = { inherit inputs unstable profile-path hardware-configuration; };
specialArgs = {
inherit
inputs
unstable
profile-path
hardware-configuration
;
};
in
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";

View file

@ -1,16 +1,26 @@
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
sops.secrets."smb/secrets" = {
owner = config.profile.user.name;
};
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
@ -26,9 +36,11 @@
systemd.packages = with pkgs; [ lact ];
systemd.services.lactd.wantedBy = [ "multi-user.target" ];
system.fsPackages = [ pkgs.bindfs pkgs.cifs-utils ];
fileSystems."/nas" =
{
system.fsPackages = [
pkgs.bindfs
pkgs.cifs-utils
];
fileSystems."/nas" = {
device = "//192.168.100.5/nas";
fsType = "cifs";
options = [
@ -44,34 +56,27 @@
];
};
fileSystems."/" =
{
fileSystems."/" = {
device = "/dev/disk/by-uuid/6a987bc7-1f00-4494-bcef-b0f8afc62b7b";
fsType = "ext4";
};
fileSystems."/boot" =
{
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/812C-A3A9";
fsType = "vfat";
};
fileSystems."/home" =
{
fileSystems."/home" = {
device = "/dev/disk/by-uuid/0add1f95-4cd5-4d44-876e-c1b381b7d133";
fsType = "ext4";
};
fileSystems."/workstation" =
{
fileSystems."/workstation" = {
device = "/dev/disk/by-uuid/7a3a7a8a-91d5-43fb-a80b-376bacdb54ec";
fsType = "ext4";
};
swapDevices =
[
{ device = "/dev/disk/by-uuid/15139a5f-a695-47a1-bd59-7e530989860c"; }
];
swapDevices = [ { device = "/dev/disk/by-uuid/15139a5f-a695-47a1-bd59-7e530989860c"; } ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -1,32 +1,37 @@
{ config, lib, modulesPath, ... }:
{
config,
lib,
modulesPath,
...
}:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# boot.kernelParams = [ "snd-intel-dspcfg.dsp_driver=1" ];
fileSystems."/" =
{
fileSystems."/" = {
device = "/dev/disk/by-label/NIXROOT";
fsType = "ext4";
};
fileSystems."/boot" =
{
fileSystems."/boot" = {
device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-label/NIXSWAP"; }];
swapDevices = [ { device = "/dev/disk/by-label/NIXSWAP"; } ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View file

@ -1,30 +1,44 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
config = {
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "nct6775" ];
boot.kernelModules = [
"kvm-amd"
"nct6775"
];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
fileSystems."/" = {
device = "/dev/disk/by-uuid/439a1beb-1443-495b-9891-012605819803";
fsType = "ext4";
};
fileSystems."/boot" =
{
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/47A1-0296";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
options = [
"fmask=0022"
"dmask=0022"
];
};
fileSystems."/nas" = {
@ -123,7 +137,8 @@
];
};
services.caddy.virtualHosts."public.tigor.web.id".extraConfig = /*caddy*/ ''
services.caddy.virtualHosts."public.tigor.web.id".extraConfig = # caddy
''
file_server browse
root * /nas/public
'';
@ -151,6 +166,8 @@
libvdpau-va-gl
];
};
environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; # Force intel-media-driver
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "iHD";
}; # Force intel-media-driver
};
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
imports = [
./protobuf.nix
];
imports = [ ./protobuf.nix ];
}

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.home.environments.protobuf;
inherit (lib) mkIf;

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
imports = [
./minecraft.nix
];
imports = [ ./minecraft.nix ];
}

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.games.minecraft;
inherit (lib) mkIf;

View file

@ -10,6 +10,8 @@ in
};
programs.zsh.shellAliases = {
vpn-bareksa = "sudo ${pkgs.openvpn}/bin/openvpn --config ${config.sops.secrets."bareksa/openvpn".path}";
vpn-bareksa = "sudo ${pkgs.openvpn}/bin/openvpn --config ${
config.sops.secrets."bareksa/openvpn".path
}";
};
}

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.firefox;
in

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.gnome;
in

View file

@ -7,9 +7,7 @@ in
programs.alacritty = {
enable = true;
settings = {
import = [
"${config.home.homeDirectory}/.cache/wallust/alacritty.toml"
];
import = [ "${config.home.homeDirectory}/.cache/wallust/alacritty.toml" ];
live_config_reload = true;
font = {
normal = {

View file

@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }:
{
pkgs,
lib,
config,
...
}:
let
cfg = config.profile.hyprland;
in

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.hyprland;
inherit (lib) mkIf;

View file

@ -1,4 +1,9 @@
{ lib, pkgs, config, ... }:
{
lib,
pkgs,
config,
...
}:
let
cfg = config.profile.hyprland;
inherit (lib) mkIf;
@ -7,21 +12,19 @@ let
in
{
config = mkIf cfg.enable {
home.packages = with pkgs; [
gnome.gnome-keyring
];
home.packages = with pkgs; [ gnome.gnome-keyring ];
sops.secrets.${secretKey} = { };
wayland.windowManager.hyprland.settings.exec-once =
let
scriptFile = getExe (pkgs.writeShellScriptBin "gnome-keyring.sh" /*sh*/ ''
scriptFile = getExe (
pkgs.writeShellScriptBin "gnome-keyring.sh" # sh
''
cat "${config.sops.secrets.${secretKey}.path}" | gnome-keyring-daemon --unlock
gnome-keyring-daemon --start --components=pkcs11,secrets,ssh
'');
''
);
in
[
''${scriptFile}''
];
[ ''${scriptFile}'' ];
};
}

View file

@ -1,4 +1,9 @@
{ lib, config, unstable, ... }:
{
lib,
config,
unstable,
...
}:
let
cfg = config.profile.hyprland;
in

View file

@ -1,4 +1,9 @@
{ lib, pkgs, config, ... }:
{
lib,
pkgs,
config,
...
}:
let
cfg = config.profile.hyprland;
in
@ -14,12 +19,8 @@ in
enable = true;
systemd.variables = [ "all" ];
settings = {
env = [
"DBUS_SESSION_BUS_ADDRESS,unix:path=/run/user/${toString config.profile.user.uid}/bus"
];
exec-once = lib.mkOrder 5 [
''${pkgs.dbus}/bin/dbus-update-activation-environment --all''
];
env = [ "DBUS_SESSION_BUS_ADDRESS,unix:path=/run/user/${toString config.profile.user.uid}/bus" ];
exec-once = lib.mkOrder 5 [ ''${pkgs.dbus}/bin/dbus-update-activation-environment --all'' ];
# window decors
general = {
gaps_in = 10;
@ -197,7 +198,8 @@ in
''stayfocused,class:^(lazygit)$''
];
};
extraConfig = /*hyprlang*/ ''
extraConfig = # hyprlang
''
exec-once=foot --server
exec-once=nm-applet

View file

@ -1,4 +1,9 @@
{ lib, pkgs, config, ... }:
{
lib,
pkgs,
config,
...
}:
let
cfg = config.profile.hyprland;
in

View file

@ -1,18 +1,21 @@
{ lib, unstable, config, ... }:
{
lib,
unstable,
config,
...
}:
let
cfg = config.profile.hyprland;
in
{
config = lib.mkIf cfg.enable {
home.packages = [
unstable.hyprpaper
];
home.packages = [ unstable.hyprpaper ];
home.file.".config/hypr/hyprpaper.conf".text =
let
recent_wallpaper = "${config.home.homeDirectory}/.cache/wallpaper/current";
in
/*hyprlang*/
# hyprlang
''
preload = ${recent_wallpaper}
wallpaper = ,${recent_wallpaper}

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.hyprland;
saveDir = "${config.home.homeDirectory}/Pictures/screenshots";
@ -10,7 +15,9 @@ in
satty
];
home.activation.sattyDirCreate = lib.hm.dag.entryAfter [ "writeBoundary" ] /*sh*/ ''
home.activation.sattyDirCreate =
lib.hm.dag.entryAfter [ "writeBoundary" ] # sh
''
mkdir -p "${saveDir}"
chown ${config.home.username} "${saveDir}"
'';

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
hyprland = config.profile.hyprland;
cfg = config.profile.services.ntfy-sh.client;
@ -6,9 +11,7 @@ let
in
{
config = mkIf (hyprland.enable && cfg.enable) {
home.packages = with pkgs; [
ntfy-sh
];
home.packages = with pkgs; [ ntfy-sh ];
# wayland.windowManager.hyprland.settings.exec-once = [
# "ntfy subscribe --config /etc/ntfy/client.yml --from-config"

View file

@ -1,9 +1,17 @@
{ lib, pkgs, unstable, config, ... }:
{
lib,
pkgs,
unstable,
config,
...
}:
let
cfg = config.profile.hyprland;
inherit (lib.meta) getExe;
wallpaperDir = "${config.home.homeDirectory}/.cache/wallpaper";
draw-wallpaper = pkgs.writeShellScriptBin "draw-wallpaper.sh" /*sh*/ ''
draw-wallpaper =
pkgs.writeShellScriptBin "draw-wallpaper.sh" # sh
''
image_file=$1
target="${wallpaperDir}/current"
blur_target="${wallpaperDir}/blurred.png"
@ -29,9 +37,7 @@ in
tomlFormat = pkgs.formats.toml { };
in
tomlFormat.generate "pyprland.toml" {
pyprland.plugins = [
"wallpapers"
];
pyprland.plugins = [ "wallpapers" ];
wallpapers = {
path = cfg.pyprland.wallpaper-dirs;
unique = false;
@ -45,9 +51,7 @@ in
"swww-daemon"
"sleep 0.2 && swww img ${config.home.homeDirectory}/.cache/wallpaper/current"
];
bind = [
"$mod, W, exec, pypr wall next"
];
bind = [ "$mod, W, exec, pypr wall next" ];
};
};
}

View file

@ -1,8 +1,15 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.hyprland;
inherit (lib.meta) getExe;
selectWindowScript = pkgs.writeShellScriptBin ''select-window.sh'' /*sh*/ ''
selectWindowScript =
pkgs.writeShellScriptBin ''select-window.sh'' # sh
''
state="$(hyprctl -j clients)"
active_window="$(hyprctl -j activewindow)"

View file

@ -1,4 +1,9 @@
{ lib, pkgs, config, ... }:
{
lib,
pkgs,
config,
...
}:
let
cfg = config.profile.hyprland;
in

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.hyprland;
in
@ -36,7 +41,9 @@ in
};
Service =
let
reloadScript = pkgs.writeShellScriptBin "swaync-reload.sh" /*sh*/ ''
reloadScript =
pkgs.writeShellScriptBin "swaync-reload.sh" # sh
''
${pkgs.swaynotificationcenter}/bin/swaync-client --reload-config
${pkgs.swaynotificationcenter}/bin/swaync-client --reload-css
'';
@ -46,8 +53,6 @@ in
};
};
home.packages = with pkgs; [
libnotify
];
home.packages = with pkgs; [ libnotify ];
};
}

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.hyprland;
in
@ -8,9 +13,7 @@ in
# enable = true;
# display = config.profile.hyprland.swayosd.display;
# };
home.packages = with pkgs; [
swayosd
];
home.packages = with pkgs; [ swayosd ];
wayland.windowManager.hyprland.settings = {
exec-once = [

View file

@ -1,10 +1,11 @@
{ lib
, fetchFromGitea
, rustPlatform
, nix-update-script
, imagemagick
, makeWrapper
, pkgs
{
lib,
fetchFromGitea,
rustPlatform,
nix-update-script,
imagemagick,
makeWrapper,
pkgs,
}:
rustPlatform.buildRustPackage rec {
pname = "wallust";
@ -20,7 +21,10 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-o6VRekazqbKTef6SLjHqs9/z/Q70auvunP+yFDkclpg=";
nativeBuildInputs = [ makeWrapper pkgs.rust-bin.stable."1.79.0".default ];
nativeBuildInputs = [
makeWrapper
pkgs.rust-bin.stable."1.79.0".default
];
postFixup = ''
wrapProgram $out/bin/wallust \
@ -33,7 +37,10 @@ rustPlatform.buildRustPackage rec {
description = "A better pywal";
homepage = "https://codeberg.org/explosion-mental/wallust";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ onemoresuza iynaix ];
maintainers = with lib.maintainers; [
onemoresuza
iynaix
];
downloadPage = "https://codeberg.org/explosion-mental/wallust/releases/tag/${version}";
mainProgram = "wallust";
};

View file

@ -1,4 +1,10 @@
{ pkgs, unstable, lib, config, ... }:
{
pkgs,
unstable,
lib,
config,
...
}:
let
cfg = config.profile.hyprland;
inherit (lib.meta) getExe;
@ -45,7 +51,8 @@ in
recursive = true;
};
home.file.".config/wallust/wallust.toml".source = ((pkgs.formats.toml { }).generate "wallust.toml" {
home.file.".config/wallust/wallust.toml".source = (
(pkgs.formats.toml { }).generate "wallust.toml" {
# See https://codeberg.org/explosion-mental/wallust/src/branch/master/wallust.toml
# for more information about the configuration options.
@ -122,6 +129,7 @@ in
target = "${config.home.homeDirectory}/.config/foot/colors.ini";
};
};
});
}
);
};
}

View file

@ -1,4 +1,10 @@
{ lib, config, unstable, pkgs, ... }:
{
lib,
config,
unstable,
pkgs,
...
}:
let
cfg = config.profile.hyprland;
modules = (pkgs.formats.json { }).generate "modules.json" {
@ -16,7 +22,11 @@ let
phone = " ";
portable = " ";
car = " ";
default = [ " " " " " " ];
default = [
" "
" "
" "
];
};
on-click = "pavucontrol";
};
@ -37,7 +47,13 @@ let
format-charging = " {capacity}%";
format-plugged = " {capacity}%";
format-alt = "{icon} {time}";
format-icons = [ " " " " " " " " " " ];
format-icons = [
" "
" "
" "
" "
" "
];
};
network = {
format = "{ifname}";
@ -58,7 +74,6 @@ let
tooltip = false;
};
"hyprland/workspaces" = {
on-click = "activate";
active-only = false;
@ -164,12 +179,8 @@ in
margin-right = 0;
spacing = 0;
reload_style_on_change = true;
include = [
modules
];
modules-left = [
"hyprland/window"
];
include = [ modules ];
modules-left = [ "hyprland/window" ];
modules-center = [
"hyprland/workspaces"
"custom/notification"
@ -193,5 +204,3 @@ in
};
};
}

View file

@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }:
{
lib,
config,
pkgs,
...
}:
let
cfg = config.profile.obs;
in

View file

@ -1,14 +1,15 @@
{ pkgs, config, lib, ... }:
{
pkgs,
config,
lib,
...
}:
let
cfg = config.profile.bitwarden;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
bitwarden
];
home.packages = with pkgs; [ bitwarden ];
home.file = {
".config/autostart/bitwarden.desktop" = lib.mkIf cfg.autostart {

View file

@ -1,12 +1,13 @@
{ pkgs, config, lib, ... }:
{
pkgs,
config,
lib,
...
}:
let
cfg = config.profile.home.programs.bruno;
inherit (lib) mkIf;
in
{
config = mkIf cfg.enable {
home.packages = with pkgs; [
bruno
];
};
config = mkIf cfg.enable { home.packages = with pkgs; [ bruno ]; };
}

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.dbeaver;
in
{
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.dbeaver-bin ];
};
config = lib.mkIf cfg.enable { home.packages = [ pkgs.dbeaver-bin ]; };
}

View file

@ -1,9 +1,16 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
inherit (lib) mkIf;
inherit (lib.meta) getExe;
cfg = config.profile.discord;
autostartScript = pkgs.writeShellScriptBin "discord.sh" /*sh*/ ''
autostartScript =
pkgs.writeShellScriptBin "discord.sh" # sh
''
sleep 10;
until ${pkgs.unixtools.ping}/bin/ping -c 1 discord.com;
do sleep 1;
@ -14,21 +21,13 @@ let
in
{
config = mkIf cfg.enable {
home.packages = with pkgs; [
vesktop
];
home.packages = with pkgs; [ vesktop ];
home.file.".config/discord/settings.json".text = builtins.toJSON {
SKIP_HOST_UPDATE = true;
};
home.file.".config/discord/settings.json".text = builtins.toJSON { SKIP_HOST_UPDATE = true; };
wayland.windowManager.hyprland.settings.exec-once = lib.mkIf cfg.autostart [
autostartScriptFile
];
wayland.windowManager.hyprland.settings.exec-once = lib.mkIf cfg.autostart [ autostartScriptFile ];
home.file.".config/autostart/discord.sh" = lib.mkIf cfg.autostart {
source = autostartScriptFile;
};
home.file.".config/autostart/discord.sh" = lib.mkIf cfg.autostart { source = autostartScriptFile; };
services.swaync.settings.scripts._10-discord =
let

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.programs.easyeffects;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ easyeffects ];
};
config = lib.mkIf cfg.enable { home.packages = with pkgs; [ easyeffects ]; };
}

View file

@ -1,12 +1,13 @@
{ pkgs, config, lib, ... }:
{
pkgs,
config,
lib,
...
}:
let
cfg = config.profile.home.programs.elisa;
inherit (lib) mkIf;
in
{
config = mkIf cfg.enable {
home.packages = with pkgs; [
kdePackages.elisa
];
};
config = mkIf cfg.enable { home.packages = with pkgs; [ kdePackages.elisa ]; };
}

View file

@ -21,7 +21,8 @@ in
};
};
programs.zsh.initExtra = /*bash*/ ''
programs.zsh.initExtra = # bash
''
function osc7-pwd() {
emulate -L zsh # also sets localoptions for us
setopt extendedglob

View file

@ -85,30 +85,14 @@
"#f4dbd6"
"bold"
];
inactiveBorderColor = [
"#a5adcb"
];
optionsTextColor = [
"#8aadf4"
];
selectedLineBgColor = [
"#363a4f"
];
cherryPickedCommitBgColor = [
"#494d64"
];
cherryPickedCommitFgColor = [
"#f4dbd6"
];
unstagedChangesColor = [
"#ed8796"
];
defaultFgColor = [
"#cad3f5"
];
searchingActiveBorderColor = [
"#eed49f"
];
inactiveBorderColor = [ "#a5adcb" ];
optionsTextColor = [ "#8aadf4" ];
selectedLineBgColor = [ "#363a4f" ];
cherryPickedCommitBgColor = [ "#494d64" ];
cherryPickedCommitFgColor = [ "#f4dbd6" ];
unstagedChangesColor = [ "#ed8796" ];
defaultFgColor = [ "#cad3f5" ];
searchingActiveBorderColor = [ "#eed49f" ];
};
};
};

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.gh;
in
{
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.gh ];
};
config = lib.mkIf cfg.enable { home.packages = [ pkgs.gh ]; };
}

View file

@ -1,4 +1,10 @@
{ config, lib, pkgs, unstable, ... }:
{
config,
lib,
pkgs,
unstable,
...
}:
let
cfg = config.profile.go;
impl = pkgs.buildGoModule rec {
@ -17,9 +23,7 @@ in
config = lib.mkIf cfg.enable {
programs.go = {
enable = true;
goPrivate = [
"gitlab.bareksa.com"
];
goPrivate = [ "gitlab.bareksa.com" ];
package = unstable.go_1_23;
};
home.packages = with pkgs; [

View file

@ -1,11 +1,12 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.jellyfin;
in
{
config = lib.mkIf cfg.enable {
home.packages = [
pkgs.jellyfin-media-player
];
};
config = lib.mkIf cfg.enable { home.packages = [ pkgs.jellyfin-media-player ]; };
}

View file

@ -4,7 +4,8 @@ let
in
{
config = lib.mkIf cfg.enable {
programs.zsh.initExtra = /*bash*/ ''
programs.zsh.initExtra = # bash
''
if [[ "$TERM" == "xterm-kitty" ]]; then
alias ssh="kitty +kitten ssh"
fi
@ -24,7 +25,7 @@ in
tab_bar_margin_width = toString 0.2;
tab_bar_style = "slant";
background_blur = 40;
background_opacity = toString 0.90;
background_opacity = toString 0.9;
cursor_blink_interval = toString 0.5;
};
keybindings = {

View file

@ -1,9 +1,12 @@
{ config, lib, unstable, ... }:
{
config,
lib,
unstable,
...
}:
let
cfg = config.profile.microsoft-edge;
in
{
config = lib.mkIf cfg.enable {
home.packages = [ unstable.microsoft-edge ];
};
config = lib.mkIf cfg.enable { home.packages = [ unstable.microsoft-edge ]; };
}

View file

@ -1,11 +1,18 @@
{ config, lib, unstable, ... }:
{
config,
lib,
unstable,
...
}:
let
cfg = config.profile.programs.mongodb-compass;
sopsFile = ../../secrets/bareksa.yaml;
in
{
config = lib.mkIf cfg.enable {
sops.secrets."bareksa/mongodb-compass" = { inherit sopsFile; };
sops.secrets."bareksa/mongodb-compass" = {
inherit sopsFile;
};
home.packages = [ unstable.mongodb-compass ];
};
}

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.mpv;
in

View file

@ -1,12 +1,16 @@
{ config, unstable, pkgs, lib, ... }:
{
config,
unstable,
pkgs,
lib,
...
}:
let
cfg = config.profile.neovide;
in
{
config = lib.mkIf cfg.enable {
home.packages = [
unstable.neovide
];
home.packages = [ unstable.neovide ];
home.file.".config/neovide/config.toml".source =
let

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, unstable, ... }:
{
config,
pkgs,
lib,
unstable,
...
}:
let
cfg = config.profile.neovim;
inherit (lib) mkIf;
@ -22,7 +28,9 @@ in
ping = "${pkgs.unixtools.ping}/bin/ping";
host = "github.com";
sleep = "${pkgs.coreutils}/bin/sleep";
script = pkgs.writeScriptBin "clone-nvim.sh" /*bash*/ ''
script =
pkgs.writeScriptBin "clone-nvim.sh" # bash
''
#!${bash}
if [ -d "${nvimCloneDir}" ]; then

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.nextcloud;
in
{
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.nextcloud-client ];
};
config = lib.mkIf cfg.enable { home.packages = [ pkgs.nextcloud-client ]; };
}

View file

@ -3,7 +3,5 @@ let
cfg = config.profile.nnn;
in
{
config = lib.mkIf cfg.enable {
programs.nnn.enable = true;
};
config = lib.mkIf cfg.enable { programs.nnn.enable = true; };
}

View file

@ -1,12 +1,13 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.home.programs.obsidian;
inherit (lib) mkIf;
in
{
config = mkIf cfg.enable {
home.packages = with pkgs; [
obsidian
];
};
config = mkIf cfg.enable { home.packages = with pkgs; [ obsidian ]; };
}

View file

@ -1,12 +1,11 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.services.redis;
inherit (lib) mkIf;
in
lib.mkMerge [
(mkIf cfg.client.cli.enable {
home.packages = [
pkgs.redis
];
})
]
lib.mkMerge [ (mkIf cfg.client.cli.enable { home.packages = [ pkgs.redis ]; }) ]

View file

@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }:
{
pkgs,
lib,
config,
...
}:
let
cfg = config.profile.slack;
autostartScript = pkgs.writeShellScriptBin "slack.sh" ''
@ -11,13 +16,9 @@ in
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ slack ];
wayland.windowManager.hyprland.settings.exec-once = lib.mkIf cfg.autostart [
autostartScriptFile
];
wayland.windowManager.hyprland.settings.exec-once = lib.mkIf cfg.autostart [ autostartScriptFile ];
home.file.".config/autostart/slack.sh" = lib.mkIf cfg.autostart {
source = autostartScriptFile;
};
home.file.".config/autostart/slack.sh" = lib.mkIf cfg.autostart { source = autostartScriptFile; };
services.swaync.settings.scripts._10-slack =
let

View file

@ -1,11 +1,12 @@
{ pkgs, config, lib, ... }:
{
pkgs,
config,
lib,
...
}:
let
cfg = config.profile.spotify;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
spotify
];
};
config = lib.mkIf cfg.enable { home.packages = with pkgs; [ spotify ]; };
}

View file

@ -35,7 +35,6 @@
format = "[$ssh_symbol$hostname]($style)\\] ";
};
palette = "catppuccin_${flavour}";
} // builtins.fromTOML (builtins.readFile
(catppuccin-starship-repo + /palettes/${flavour}.toml));
} // builtins.fromTOML (builtins.readFile (catppuccin-starship-repo + /palettes/${flavour}.toml));
};
}

View file

@ -1,4 +1,9 @@
{ pkgs, config, lib, ... }:
{
pkgs,
config,
lib,
...
}:
let
cfg = config.profile.tofi;
in

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.variety;
in

View file

@ -1,4 +1,9 @@
{ config, lib, unstable, ... }:
{
config,
lib,
unstable,
...
}:
let
cfg = config.profile.vscode;
in

View file

@ -9,7 +9,8 @@ in
enableZshIntegration = true;
enableBashIntegration = true;
extraConfig = /*lua*/ ''
extraConfig = # lua
''
-- take config from ./base_config.lua
local config = require('base_config')
@ -20,7 +21,8 @@ in
'';
};
programs.zsh.initExtra = /*bash*/ ''
programs.zsh.initExtra = # bash
''
if [ -n "$WEZTERM_PANE" ]; then
alias ssh="wezterm ssh"
fi

View file

@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }:
{
lib,
config,
pkgs,
...
}:
let
cfg = config.profile.whatsapp;
in

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.programs.yazi;
inherit (lib) mkIf;
@ -11,7 +16,11 @@ in
settings = {
manager = {
# 1/8 width for parent, 4/8 width for current, 3/8 width for preview
ratio = [ 1 4 3 ];
ratio = [
1
4
3
];
sort_by = "natural";
sort_sensitive = false;
sort_dir_first = true;
@ -22,13 +31,24 @@ in
};
opener = {
edit = [
{ run = ''nvim "$@"''; block = true; desc = "Edit in Neovim"; }
{
run = ''nvim "$@"'';
block = true;
desc = "Edit in Neovim";
}
];
play = [
{ run = ''mpv "$@"''; orphan = true; desc = "Play in MPV"; }
{
run = ''mpv "$@"'';
orphan = true;
desc = "Play in MPV";
}
];
open = [
{ run = ''xdg-open "$@"''; desc = "Open"; }
{
run = ''xdg-open "$@"'';
desc = "Open";
}
];
};
open = {
@ -48,17 +68,29 @@ in
# Multiple openers for a single rule
{
name = "*.html";
use = [ "open" "edit" ];
use = [
"open"
"edit"
];
}
];
append_rules = [
{ name = "*"; use = "open"; }
{
name = "*";
use = "open";
}
];
};
plugin = {
prepend_previewers = [
{ mime = "{image,audio,video}/*"; run = "mediainfo"; }
{ mime = "application/x-subrip"; run = "mediainfo"; }
{
mime = "{image,audio,video}/*";
run = "mediainfo";
}
{
mime = "application/x-subrip";
run = "mediainfo";
}
];
};
};

View file

@ -1,4 +1,10 @@
{ config, lib, pkgs, unstable, ... }:
{
config,
lib,
pkgs,
unstable,
...
}:
let
cfg = config.profile.home.programs.zellij;
plugins = {
@ -26,7 +32,7 @@ in
# autoloaded first after zshenv.
programs.zsh.initExtraFirst = lib.mkOrder 50 (
if cfg.autoAttach then
/*bash*/
# bash
''
if [[ ! -z "$SSH_CLIENT" ]]; then
if [[ -z "$ZELLIJ" ]]; then
@ -47,7 +53,8 @@ in
fi
''
else
/*bash*/ ''
# bash
''
if [[ ! -z "$SSH_CLIENT" ]]; then
if [[ -z "$ZELLIJ" ]]; then
zellij attach -c default
@ -61,7 +68,8 @@ in
let
mod = cfg.mod;
in
/*kdl*/ ''
# kdl
''
theme "catppuccin-mocha";
plugins {

View file

@ -1,5 +1,6 @@
{ plugins, timezone, ... }:
/*kdl*/ ''
# kdl
''
layout {
pane split_direction="vertical" {
pane

View file

@ -1,5 +1,6 @@
{ plugins, timezone, ... }:
/*kdl*/ ''
# kdl
''
layout {
pane split_direction="vertical" {
pane

View file

@ -1,5 +1,6 @@
{ plugins, timezone, ... }:
/*kdl*/ ''
# kdl
''
layout {
pane split_direction="vertical" {
pane

View file

@ -1,5 +1,6 @@
{ plugins, timezone, ... }:
/*kdl*/ ''
# kdl
''
layout {
pane split_direction="vertical" {
pane

View file

@ -1,5 +1,6 @@
{ plugins, timezone, ... }:
/*kdl*/ ''
# kdl
''
layout {
pane split_direction="vertical" {
pane

View file

@ -1,5 +1,6 @@
{ plugins, timezone, ... }:
/*kdl*/ ''
# kdl
''
layout {
pane split_direction="vertical" {
pane

View file

@ -1,12 +1,13 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.home.programs.zoom;
inherit (lib) mkIf;
in
{
config = mkIf cfg.enable {
home.packages = with pkgs; [
zoom-us
];
};
config = mkIf cfg.enable { home.packages = with pkgs; [ zoom-us ]; };
}

View file

@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }:
{
pkgs,
lib,
config,
...
}:
let
inherit (lib.strings) optionalString concatStrings;
in
@ -11,7 +16,8 @@ in
];
programs.zsh = {
enable = true;
envExtra = /*bash*/ ''
envExtra = # bash
''
# Disable loading global RC files in /etc/zsh/*
# Mostly because they are unneeded
# and global rc files has to be small for security reasons (no plugins)
@ -52,25 +58,28 @@ in
size = 40000;
};
completionInit = lib.mkOrder 9999 (concatStrings [
/* bash */
# bash
''
mkdir -p $ZSH_CACHE_DIR/completions
fpath+=$ZSH_CACHE_DIR/completions
fpath+=${pkgs.zsh-completions}/share/zsh/site-functions
''
(optionalString config.profile.podman.enable /*bash*/ ''
(optionalString config.profile.podman.enable # bash
''
if [ ! -f $ZSH_CACHE_DIR/completions/_podman ]; then
podman completion zsh > $ZSH_CACHE_DIR/completions/_podman
fi
'')
''
)
# Value below must be always last in the completionInit
/* bash */
# bash
''
autoload -U compinit && compinit
''
]);
syntaxHighlighting.enable = true;
initExtraFirst = /*bash*/ ''
initExtraFirst = # bash
''
export ZSH_CACHE_DIR=$HOME/.cache/zsh
# if [ -f $HOME/.config/zsh/.p10k.zsh ]; then
@ -83,7 +92,7 @@ in
fi
'';
initExtra = concatStrings [
/*bash*/
# bash
''
packfiles() {
find $(NIXPKGS_ALLOW_UNFREE=1 nix build "nixpkgs#$1" --impure --no-link --print-out-paths)

View file

@ -13,9 +13,7 @@
#### Required Options ####
hostname = lib.mkOption {
type = lib.types.str;
};
hostname = lib.mkOption { type = lib.types.str; };
networking.disableWaitOnline = lib.mkEnableOption "disable waiting for network";
networking.externalInterface = lib.mkOption {
type = lib.types.str;
@ -28,12 +26,8 @@
};
user = {
name = lib.mkOption {
type = lib.types.str;
};
fullName = lib.mkOption {
type = lib.types.str;
};
name = lib.mkOption { type = lib.types.str; };
fullName = lib.mkOption { type = lib.types.str; };
uid = lib.mkOption {
type = lib.types.int;
default = 1000;
@ -46,9 +40,7 @@
getty.autoLogin = lib.mkEnableOption "auto-login to getty";
};
system.stateVersion = lib.mkOption {
type = lib.types.str;
};
system.stateVersion = lib.mkOption { type = lib.types.str; };
#### Optionals ####

View file

@ -21,7 +21,10 @@ in
};
displayManager = lib.mkOption {
type = lib.types.enum [ "sddm" "tuigreet" ];
type = lib.types.enum [
"sddm"
"tuigreet"
];
default = "tuigreet";
};
@ -74,12 +77,24 @@ in
wallust = {
backend = lib.mkOption {
type = lib.types.enum [ "full" "resized" "wal" "thumb" "fastresize" "kmeans" ];
type = lib.types.enum [
"full"
"resized"
"wal"
"thumb"
"fastresize"
"kmeans"
];
default = "kmeans";
description = "How the image is parse, in order to get the colors";
};
colorSpace = lib.mkOption {
type = lib.types.enum [ "lab" "labmixed" "lch" "lchmixed" ];
type = lib.types.enum [
"lab"
"labmixed"
"lch"
"lchmixed"
];
default = "lch";
description = "What color space to use to produce and select the most prominent colors";
};

View file

@ -43,7 +43,6 @@
autostart = lib.mkEnableOption "variety autostart";
};
bitwarden = {
enable = lib.mkEnableOption "bitwarden";
autostart = lib.mkEnableOption "bitwarden autostart";

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkEnableOption mkOption types;
in

View file

@ -4,9 +4,7 @@ let
secondaryMonitor = "ViewSonic Corporation VX3276-QHD V9W204243765";
in
{
imports = [
../options
];
imports = [ ../options ];
profile = {
hostname = "castle";
@ -36,8 +34,20 @@ in
];
};
waybar.persistent-workspaces = {
DP-1 = [ 1 2 3 4 5 6 7 ];
DP-2 = [ 8 9 10 ];
DP-1 = [
1
2
3
4
5
6
7
];
DP-2 = [
8
9
10
];
};
pyprland.wallpaper-dirs = [ "/nas/redmage/images/windows" ];
wallust.alpha = 80;

View file

@ -1,8 +1,6 @@
{ ... }:
{
imports = [
../options
];
imports = [ ../options ];
profile = {
hostname = "fort";
@ -15,9 +13,7 @@
hyprland = {
enable = true;
settings = {
monitors = [
",preferred,auto,1"
];
monitors = [ ",preferred,auto,1" ];
workspaces = [
"1,default:true"
"2"
@ -32,7 +28,18 @@
];
};
waybar.persistent-workspaces = {
eDP-1 = [ 1 2 3 4 5 6 7 8 9 10 ];
eDP-1 = [
1
2
3
4
5
6
7
8
9
10
];
};
pyprland.wallpaper-dirs = [ "/home/tigor/Syncthing/Redmage/Laptop-Kerja" ];
wallust.alpha = 80;

View file

@ -1,8 +1,6 @@
{ ... }:
{
imports = [
../options
];
imports = [ ../options ];
profile = {
hostname = "homeserver";
@ -23,7 +21,10 @@
openssh.enable = true;
go.enable = true;
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedTCPPorts = [
80
443
];
podman = {
enable = true;
pihole.enable = true;

View file

@ -3,7 +3,8 @@ let
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
gojq = "${pkgs.gojq}/bin/gojq";
in
pkgs.writeShellScriptBin "focus-window.sh" /*sh*/ ''
pkgs.writeShellScriptBin "focus-window.sh" # sh
''
appname="$SWAYNC_APP_NAME"
state="$(${hyprctl} -j clients)"
window="$(echo "$state" | ${gojq} -r --arg APP "$appname" '.[] | select(.class == $APP) | .address')"
@ -11,4 +12,4 @@ pkgs.writeShellScriptBin "focus-window.sh" /*sh*/ ''
if [[ "$window" != "" ]]; then
${hyprctl} dispatch focuswindow address:"$window"
fi
''
''

View file

@ -1,4 +1,10 @@
{ hardware-configuration, profile-path, config, pkgs, ... }:
{
hardware-configuration,
profile-path,
config,
pkgs,
...
}:
{
imports = [
profile-path
@ -16,10 +22,12 @@
networking.hostName = config.profile.hostname;
systemd.services.NetworkManager-wait-online.enable = !config.profile.networking.disableWaitOnline;
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.extraOptions = ''
http-connections = 8
connect-timeout = 5
@ -79,6 +87,7 @@
# Tools for nh
nix-output-monitor
nvd
nixfmt-rfc-style
];
services.dbus.implementation = "broker";

View file

@ -12,7 +12,8 @@ in
enable = true;
onCalendar = "weekly"; # Default value
};
packages = [ ]
packages =
[ ]
++ optional cfg.zen-browser.enable "io.github.zen_browser.zen"
++ optional cfg.redisinsight.enable "com.redis.RedisInsight";
};

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.keyboard;
in

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.android;
username = config.profile.user.name;
@ -7,8 +12,6 @@ in
config = lib.mkIf cfg.enable {
users.users.${username}.extraGroups = [ "adbusers" ];
programs.adb.enable = true;
environment.systemPackages = with pkgs; [
androidenv.androidPkgs_9_0.platform-tools
];
environment.systemPackages = with pkgs; [ androidenv.androidPkgs_9_0.platform-tools ];
};
}

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.brightnessctl;
in
{
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.brightnessctl ];
};
config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.brightnessctl ]; };
}

View file

@ -1,8 +1,7 @@
{ pkgs, ... }:
{
fonts = {
packages = with pkgs;
[
packages = with pkgs; [
# icon fonts
material-design-icons
@ -26,9 +25,18 @@
# the reason there's Noto Color Emoji everywhere is to override DejaVu's
# B&W emojis that would sometimes show instead of some Color emojis
fontconfig.defaultFonts = {
serif = [ "Noto Serif" "Noto Color Emoji" ];
sansSerif = [ "Noto Sans" "Noto Color Emoji" ];
monospace = [ "JetBrainsMono Nerd Font" "Noto Color Emoji" ];
serif = [
"Noto Serif"
"Noto Color Emoji"
];
sansSerif = [
"Noto Sans"
"Noto Color Emoji"
];
monospace = [
"JetBrainsMono Nerd Font"
"Noto Color Emoji"
];
emoji = [ "Noto Color Emoji" ];
};
};

View file

@ -1,4 +1,10 @@
{ inputs, config, lib, pkgs, ... }:
{
inputs,
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.hyprland;
hyprlandPkg = inputs.hyprland.packages."${pkgs.system}".hyprland;
@ -68,9 +74,7 @@ in
services.dbus.enable = true;
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
};
programs.file-roller.enable = true;

View file

@ -1,4 +1,9 @@
{ pkgs, config, lib, ... }:
{
pkgs,
config,
lib,
...
}:
let
cfg = config.profile.kde;
in
@ -24,8 +29,7 @@ in
haruna
];
environment.etc."chromium/native-messaging-hosts/org.kde.plasma.browser_integration.json".source =
"${pkgs.plasma-browser-integration}/etc/chromium/native-messaging-hosts/org.kde.plasma.browser_integration.json";
environment.etc."chromium/native-messaging-hosts/org.kde.plasma.browser_integration.json".source = "${pkgs.plasma-browser-integration}/etc/chromium/native-messaging-hosts/org.kde.plasma.browser_integration.json";
# Configure keymap in X11
services.xserver = {

View file

@ -24,7 +24,9 @@
enable = true;
};
environment.etc."systemd/resolved.conf.d/10-bareksa.conf".source = (pkgs.formats.ini { }).generate "10-bareksa.conf" {
environment.etc."systemd/resolved.conf.d/10-bareksa.conf".source =
(pkgs.formats.ini { }).generate "10-bareksa.conf"
{
Resolve = {
# This dns server is only available when VPN is connected.
DNS = "192.168.3.215";

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.openssh;
inherit (lib.meta) getExe;
@ -39,9 +44,14 @@ lib.mkMerge [
};
};
sops.secrets."ntfy/tokens/homeserver" = { sopsFile = ../../secrets/ntfy.yaml; };
sops.secrets."ntfy/tokens/homeserver" = {
sopsFile = ../../secrets/ntfy.yaml;
};
sops.templates."ntfy-ssh-login.sh" = {
content = builtins.readFile (lib.meta.getExe (pkgs.writeShellScriptBin "ntfy-ssh-login.sh" /*sh*/ ''
content = builtins.readFile (
lib.meta.getExe (
pkgs.writeShellScriptBin "ntfy-ssh-login.sh" # sh
''
if [ "$PAM_TYPE" == "open_session" ]; then
${getExe pkgs.curl} -X POST \
-H "X-Priority: 4" \
@ -51,18 +61,16 @@ lib.mkMerge [
-d "$PAM_USER from $PAM_RHOST" \
https://ntfy.tigor.web.id/ssh
fi
''));
''
)
);
};
security.pam.services.sshd.text = lib.mkDefault (lib.mkAfter ''
security.pam.services.sshd.text = lib.mkDefault (
lib.mkAfter ''
session optional pam_exec.so ${getExe pkgs.bash} ${config.sops.templates."ntfy-ssh-login.sh".path}
'');
''
);
})
{
profile.services.ntfy-sh.client.settings.subscribe = [
{
topic = "ssh";
}
];
}
{ profile.services.ntfy-sh.client.settings.subscribe = [ { topic = "ssh"; } ]; }
]

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.printing;
username = config.profile.user.name;

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.scanner;
username = config.profile.user.name;
@ -6,15 +11,11 @@ in
{
config = lib.mkIf cfg.enable {
users.users.${username}.extraGroups = [ "scanner" ];
environment.systemPackages = with pkgs; [
skanlite
];
environment.systemPackages = with pkgs; [ skanlite ];
hardware.sane = {
enable = true;
brscan4.enable = true; # Brother Scanner
extraBackends = with pkgs; [
sane-airscan
];
extraBackends = with pkgs; [ sane-airscan ];
};
};
}

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
cfg = config.profile.vial;
in

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.programs.yazi;
inherit (lib) mkIf;
@ -16,7 +21,11 @@ in
yazi = {
manager = {
# 1/8 width for parent, 4/8 width for current, 3/8 width for preview
ratio = [ 1 4 3 ];
ratio = [
1
4
3
];
sort_by = "natural";
sort_sensitive = false;
sort_dir_first = true;
@ -27,13 +36,24 @@ in
};
opener = {
edit = [
{ run = ''nvim "$@"''; block = true; desc = "Edit in Neovim"; }
{
run = ''nvim "$@"'';
block = true;
desc = "Edit in Neovim";
}
];
play = [
{ run = ''mpv "$@"''; orphan = true; desc = "Play in MPV"; }
{
run = ''mpv "$@"'';
orphan = true;
desc = "Play in MPV";
}
];
open = [
{ run = ''xdg-open "$@"''; desc = "Open"; }
{
run = ''xdg-open "$@"'';
desc = "Open";
}
];
};
open = {
@ -53,11 +73,17 @@ in
# Multiple openers for a single rule
{
name = "*.html";
use = [ "open" "edit" ];
use = [
"open"
"edit"
];
}
];
append_rules = [
{ name = "*"; use = "open"; }
{
name = "*";
use = "open";
}
];
};
};

View file

@ -1,4 +1,10 @@
{ lib, stdenv, fetchzip, gettext, ... }:
{
lib,
stdenv,
fetchzip,
gettext,
...
}:
stdenv.mkDerivation rec {
pname = "cockpit-podman";
@ -9,11 +15,12 @@ stdenv.mkDerivation rec {
sha256 = "sha256-qLt6x9W+M/DztzcFxyWZLHUTM1ZsPCOykO+6o/URa6c=";
};
nativeBuildInputs = [
gettext
];
nativeBuildInputs = [ gettext ];
makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
makeFlags = [
"DESTDIR=$(out)"
"PREFIX="
];
postPatch = ''
substituteInPlace Makefile \

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.podman;
username = config.profile.user.name;
@ -34,7 +39,6 @@ in
};
};
# Taken IP-Range Subnets
#
# 10.88.0.2 -> Redmage

View file

@ -31,9 +31,7 @@ in
TZ = "Asia/Jakarta";
# MEMOS_PUBLIC = "true";
};
volumes = [
"${rootVolume}:/var/opt/memos"
];
volumes = [ "${rootVolume}:/var/opt/memos" ];
extraOptions = [
"--network=podman"
"--ip=${ip}"

View file

@ -5,7 +5,9 @@ let
inherit (lib) mkIf;
in
{
virtualisation.oci-containers.containers."metrics" = mkIf (cfg.enable && config.profile.services.telemetry.enable) {
virtualisation.oci-containers.containers."metrics" =
mkIf (cfg.enable && config.profile.services.telemetry.enable)
{
image = "quay.io/navidys/prometheus-podman-exporter";
hostname = "metrics";
autoStart = true;
@ -14,9 +16,7 @@ in
TZ = "Asia/Jakarta";
CONTAINER_HOST = "unix:///run/podman/podman.sock";
};
volumes = [
"/run/podman/podman.sock:/run/podman/podman.sock"
];
volumes = [ "/run/podman/podman.sock:/run/podman/podman.sock" ];
extraOptions = [
"--network=podman"
"--ip=${ip}"
@ -26,7 +26,8 @@ in
"io.containers.autoupdate" = "registry";
};
};
environment.etc."alloy/config.alloy".text = /*hcl*/ ''
environment.etc."alloy/config.alloy".text = # hcl
''
prometheus.scrape "podman" {
targets = [{__address__ = "${ip}:9882"}]

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
name = "minecraft";
podman = config.profile.podman;
@ -24,7 +29,8 @@ let
in
{
config = mkIf (podman.enable && podman.${name}.enable) {
services.caddy.virtualHosts.${domain}.extraConfig = /*html*/ ''
services.caddy.virtualHosts.${domain}.extraConfig = # html
''
header Content-Type text/html
respond <<EOF
<!DOCTYPE html>
@ -50,7 +56,9 @@ in
#
# To keep up with the update, restart the server at 4am everyday.
systemd =
let serviceName = "podman-${name}"; in
let
serviceName = "podman-${name}";
in
{
tmpfiles.settings."${serviceName}-mount".${rootVolume}.d = {
group = config.profile.user.name;
@ -88,9 +96,7 @@ in
"19132:19132/udp"
"19132:19132"
];
volumes = [
"${rootVolume}:/minecraft"
];
volumes = [ "${rootVolume}:/minecraft" ];
extraOptions = [
"--network=podman"
"--ip=${ip}"

View file

@ -24,9 +24,7 @@ in
environment = {
TZ = "Asia/Jakarta";
};
volumes = [
"/tmp:/tmp"
];
volumes = [ "/tmp:/tmp" ];
extraOptions = [
"--network=podman"
"--ip=${ip}"

View file

@ -34,16 +34,12 @@ in
ZO_DATA_DIR = "/data";
ZO_WEB_URL = "https://${domain}";
};
volumes = [
"${rootVolume}/data:/data"
];
volumes = [ "${rootVolume}/data:/data" ];
extraOptions = [
"--network=podman"
"--ip=${ip}"
];
environmentFiles = [
config.sops.secrets."openobserve/env".path
];
environmentFiles = [ config.sops.secrets."openobserve/env".path ];
labels = {
"io.containers.autoupdate" = "registry";
};

View file

@ -27,7 +27,9 @@ in
#
# This works by collecting all the virtual hosts defined in caddy
# and check if the length of the list changes, if it does, we restart the pihole container.
systemd.services."podman-${name}".restartTriggers = attrsets.mapAttrsToList (name: _: name) config.services.caddy.virtualHosts;
systemd.services."podman-${name}".restartTriggers = attrsets.mapAttrsToList (
name: _: name
) config.services.caddy.virtualHosts;
environment.etc."pihole/custom.list" = {
# Copy file instead of symlink
mode = "0444";
@ -46,7 +48,9 @@ in
''
192.168.100.5 vpn.tigor.web.id
${strings.concatStringsSep "\n" (
attrsets.mapAttrsToList (name: _: "192.168.100.5 ${strings.removePrefix "https://" name}") config.services.caddy.virtualHosts
attrsets.mapAttrsToList (
name: _: "192.168.100.5 ${strings.removePrefix "https://" name}"
) config.services.caddy.virtualHosts
)}
'';
};
@ -72,9 +76,7 @@ in
"pihole-dnsmasq:/etc/dnsmasq.d"
"/etc/pihole/custom.list:/etc/pihole/custom.list"
];
environmentFiles = [
config.sops.secrets."pihole/env".path
];
environmentFiles = [ config.sops.secrets."pihole/env".path ];
extraOptions = [
"--ip=${ip}"
"--network=podman"

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
name = "qbittorrent";
domain = "${name}.tigor.web.id";
@ -24,17 +29,19 @@ lib.mkMerge [
chown ${uid}:${gid} ${volume} ${volume}/{config,downloads,progress,watch}
'';
sops = {
secrets =
let
opts = { sopsFile = ../../secrets/ntfy.yaml; };
opts = {
sopsFile = ../../secrets/ntfy.yaml;
};
in
{
"ntfy/tokens/homeserver" = opts;
};
templates = {
"qbittorrent-ntfy-env".content = /*sh*/ ''
"qbittorrent-ntfy-env".content = # sh
''
NTFY_TOKEN=${config.sops.placeholder."ntfy/tokens/homeserver"}
'';
};
@ -42,7 +49,9 @@ lib.mkMerge [
virtualisation.oci-containers.containers.${name} =
let
finish-notify-script = pkgs.writeScriptBin "notify-finish.sh" (optionalString config.services.ntfy-sh.enable /*sh*/ ''
finish-notify-script = pkgs.writeScriptBin "notify-finish.sh" (
optionalString config.services.ntfy-sh.enable # sh
''
#!/bin/bash
# $1 = %N | Torrent Name
# $2 = %L | Category
@ -64,8 +73,11 @@ lib.mkMerge [
-H "X-Tags: white_check_mark,$2" \
-d "Number of Files: $7, Size: $size" \
https://ntfy.tigor.web.id/qbittorrent?priority=4
'');
start-notify-script = pkgs.writeScriptBin "notify-start.sh" (optionalString config.services.ntfy-sh.enable /*sh*/ ''
''
);
start-notify-script = pkgs.writeScriptBin "notify-start.sh" (
optionalString config.services.ntfy-sh.enable # sh
''
#!/bin/bash
curl -X POST \
-H "Authorization: Bearer $NTFY_TOKEN" \
@ -73,7 +85,8 @@ lib.mkMerge [
-H "X-Tags: rocket,$2" \
-d "Starts downloading" \
https://ntfy.tigor.web.id/qbittorrent
'');
''
);
in
{
inherit image;
@ -102,19 +115,11 @@ lib.mkMerge [
"--ip=${ip}"
"--network=podman"
];
environmentFiles = [
config.sops.templates."qbittorrent-ntfy-env".path
];
environmentFiles = [ config.sops.templates."qbittorrent-ntfy-env".path ];
labels = {
"io.containers.autoupdate" = "registry";
};
};
})
{
profile.services.ntfy-sh.client.settings.subscribe = [
{
topic = "qbittorrent";
}
];
}
{ profile.services.ntfy-sh.client.settings.subscribe = [ { topic = "qbittorrent"; } ]; }
]

Some files were not shown because too many files have changed in this diff Show more