From 7c7e9317db75b7c0a1449fb6a9d5dd736fa83082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 13 Apr 2025 17:58:17 +0200 Subject: [PATCH] style: format everything --- machines/moritz-desktop/configuration.nix | 16 +- machines/moritz-desktop/disko.nix | 4 +- .../moritz-desktop/hardware-configuration.nix | 22 +- machines/moritz-server/configuration.nix | 10 +- modules/lib.nix | 117 ++++----- modules/moritz/config/ai.nix | 13 +- modules/moritz/config/shell.nix | 16 +- modules/moritz/config/terminal.nix | 8 +- modules/moritz/config/theming/_catppuccin.nix | 61 +++-- .../config/theming/catppuccin-frappe.nix | 17 +- .../config/theming/catppuccin-latte.nix | 17 +- .../config/theming/catppuccin-macchiato.nix | 17 +- .../config/theming/catppuccin-mocha.nix | 17 +- modules/moritz/config/theming/default.nix | 26 +- modules/moritz/config/theming/dracula.nix | 109 ++++---- modules/moritz/config/wallpapers/default.nix | 16 +- modules/moritz/default.nix | 8 +- modules/moritz/nixpkgs.nix | 48 ++-- modules/moritz/profiles/base.nix | 26 +- modules/moritz/profiles/desktop.nix | 31 ++- modules/moritz/profiles/gaming.nix | 24 +- modules/moritz/profiles/impermanence.nix | 44 +++- modules/moritz/profiles/personal.nix | 16 +- modules/moritz/profiles/personal_calendar.nix | 19 +- modules/moritz/profiles/personal_contacts.nix | 21 +- modules/moritz/profiles/personal_mail.nix | 18 +- modules/moritz/profiles/ripping.nix | 19 +- modules/moritz/profiles/webis.nix | 17 +- modules/moritz/profiles/yubikey.nix | 25 +- modules/moritz/programs/adb.nix | 18 +- modules/moritz/programs/aider.nix | 22 +- modules/moritz/programs/chromium.nix | 20 +- modules/moritz/programs/code.nix | 96 +++---- modules/moritz/programs/direnv.nix | 16 +- modules/moritz/programs/firefox.nix | 64 +++-- modules/moritz/programs/fish.nix | 157 ++++++------ modules/moritz/programs/foot.nix | 16 +- modules/moritz/programs/ghostty.nix | 23 +- modules/moritz/programs/git.nix | 16 +- modules/moritz/programs/gnome.nix | 60 ++--- modules/moritz/programs/gpg.nix | 16 +- modules/moritz/programs/jetbrains/default.nix | 19 +- modules/moritz/programs/kitty.nix | 16 +- modules/moritz/programs/lazygit.nix | 94 +++++-- modules/moritz/programs/ledger/default.nix | 30 +-- modules/moritz/programs/logseq.nix | 18 +- modules/moritz/programs/miracast.nix | 22 +- modules/moritz/programs/navi/default.nix | 13 +- modules/moritz/programs/niri.nix | 94 ++++--- modules/moritz/programs/nix.nix | 26 +- modules/moritz/programs/nvim/default.nix | 32 +-- .../moritz/programs/nvim/plugins/avante.nix | 15 +- .../programs/nvim/plugins/blink-cmp.nix | 14 +- .../programs/nvim/plugins/catppuccin.nix | 9 +- .../moritz/programs/nvim/plugins/comment.nix | 7 +- .../moritz/programs/nvim/plugins/conform.nix | 40 ++- .../moritz/programs/nvim/plugins/crates.nix | 9 +- .../moritz/programs/nvim/plugins/direnv.nix | 7 +- .../nvim/plugins/friendly-snippets.nix | 7 +- .../moritz/programs/nvim/plugins/fugitive.nix | 7 +- .../moritz/programs/nvim/plugins/gitsigns.nix | 7 +- .../moritz/programs/nvim/plugins/helpview.nix | 9 +- modules/moritz/programs/nvim/plugins/hmts.nix | 9 +- .../moritz/programs/nvim/plugins/keymaps.nix | 35 ++- .../programs/nvim/plugins/lastplace.nix | 7 +- modules/moritz/programs/nvim/plugins/lsp.nix | 7 +- .../moritz/programs/nvim/plugins/lspsaga.nix | 7 +- .../moritz/programs/nvim/plugins/lualine.nix | 9 +- .../moritz/programs/nvim/plugins/luasnip.nix | 27 +- modules/moritz/programs/nvim/plugins/lz-n.nix | 7 +- .../nvim/plugins/markdown-preview.nix | 7 +- .../moritz/programs/nvim/plugins/marks.nix | 7 +- modules/moritz/programs/nvim/plugins/mini.nix | 11 +- .../programs/nvim/plugins/nvim-autopairs.nix | 7 +- .../moritz/programs/nvim/plugins/nvim-ufo.nix | 7 +- .../moritz/programs/nvim/plugins/obsidian.nix | 55 +++- modules/moritz/programs/nvim/plugins/oil.nix | 7 +- .../moritz/programs/nvim/plugins/otter.nix | 4 +- .../programs/nvim/plugins/render-markdown.nix | 7 +- .../moritz/programs/nvim/plugins/snacks.nix | 4 +- .../programs/nvim/plugins/telescope.nix | 6 +- .../programs/nvim/plugins/todo-comments.nix | 7 +- .../nvim/plugins/treesitter-textobjects.nix | 7 +- .../programs/nvim/plugins/treesitter.nix | 9 +- .../nvim/plugins/ts-context-commentstring.nix | 7 +- .../programs/nvim/plugins/vim-beancount.nix | 6 +- .../programs/nvim/plugins/vim-surround.nix | 7 +- .../moritz/programs/nvim/plugins/vimtex.nix | 7 +- .../programs/nvim/plugins/which-key.nix | 7 +- modules/moritz/programs/prismlauncher.nix | 31 ++- modules/moritz/programs/python.nix | 45 ++-- modules/moritz/programs/river/default.nix | 173 ++++++------- modules/moritz/programs/scripts/default.nix | 237 ++++++++++-------- modules/moritz/programs/spotify_player.nix | 24 +- modules/moritz/programs/ssh.nix | 28 +-- modules/moritz/programs/thunar.nix | 18 +- modules/moritz/programs/tmux/default.nix | 69 +++-- modules/moritz/programs/tofi.nix | 27 +- modules/moritz/programs/wallpaper/default.nix | 25 +- modules/moritz/programs/zathura.nix | 16 +- modules/moritz/programs/zsh.nix | 18 +- modules/moritz/security/default.nix | 12 +- modules/moritz/services/dunst.nix | 17 +- modules/moritz/services/gammastep.nix | 13 +- modules/moritz/services/kdeconnect.nix | 18 +- modules/moritz/services/mullvad.nix | 18 +- modules/moritz/services/ollama.nix | 16 +- modules/moritz/services/openconnect.nix | 16 +- modules/moritz/services/picom.nix | 22 +- modules/moritz/services/printing.nix | 16 +- modules/moritz/services/spotify_player.nix | 28 ++- modules/moritz/services/synology-drive.nix | 22 +- modules/moritz/services/timers.nix | 28 +-- modules/moritz/services/wallpaper.nix | 16 +- modules/moritz/services/wireguard.nix | 24 +- modules/moritz/virtualisation/podman.nix | 16 +- .../moritz/virtualisation/virtualisation.nix | 22 +- modules/remote_builders.nix | 58 ++--- modules/shared.nix | 7 +- modules/zfs_unencrypted.nix | 17 +- 120 files changed, 1550 insertions(+), 1655 deletions(-) diff --git a/machines/moritz-desktop/configuration.nix b/machines/moritz-desktop/configuration.nix index 0ff6902..caa4153 100644 --- a/machines/moritz-desktop/configuration.nix +++ b/machines/moritz-desktop/configuration.nix @@ -1,13 +1,7 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ pkgs -, config -, inputs -, ... -}: - -{ +{pkgs, ...}: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -85,7 +79,7 @@ boot = { # BOOT - supportedFilesystems = [ "zfs" "btrfs" "ntfs" ]; + supportedFilesystems = ["zfs" "btrfs" "ntfs"]; loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; @@ -98,7 +92,7 @@ address = "192.168.0.1"; interface = "enp6s0"; }; - nameservers = [ "192.168.0.4" ]; + nameservers = ["192.168.0.4"]; useDHCP = false; interfaces.enp6s0 = { ipv4.addresses = [ @@ -118,9 +112,9 @@ }; services = { - xserver.videoDrivers = [ "nvidia" ]; + xserver.videoDrivers = ["nvidia"]; xserver.xrandrHeads = [ - { output = "HDMI-1"; } + {output = "HDMI-1";} { output = "HDMI-0"; primary = true; diff --git a/machines/moritz-desktop/disko.nix b/machines/moritz-desktop/disko.nix index 831b9ec..dde7721 100644 --- a/machines/moritz-desktop/disko.nix +++ b/machines/moritz-desktop/disko.nix @@ -1,6 +1,4 @@ -{ lib, pkgs, ... }: - -{ +{pkgs, ...}: { # needed for zfs pool networking.hostId = "1f8b8073"; disko.devices = { diff --git a/machines/moritz-desktop/hardware-configuration.nix b/machines/moritz-desktop/hardware-configuration.nix index d5fa4da..897bd5f 100644 --- a/machines/moritz-desktop/hardware-configuration.nix +++ b/machines/moritz-desktop/hardware-configuration.nix @@ -1,18 +1,20 @@ # 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, ... }: - { - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; # 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 diff --git a/machines/moritz-server/configuration.nix b/machines/moritz-server/configuration.nix index 8bd9aa2..e57c667 100644 --- a/machines/moritz-server/configuration.nix +++ b/machines/moritz-server/configuration.nix @@ -15,10 +15,12 @@ networking = { interfaces.enp2s0 = { - ipv4.addresses = [{ - address = "192.168.0.3"; - prefixLength = 24; - }]; + ipv4.addresses = [ + { + address = "192.168.0.3"; + prefixLength = 24; + } + ]; }; defaultGateway = { address = "192.168.0.1"; diff --git a/modules/lib.nix b/modules/lib.nix index 6f9f812..4ab6a5c 100644 --- a/modules/lib.nix +++ b/modules/lib.nix @@ -1,79 +1,72 @@ -{ lib, ... }: - -rec { - mkDate = longDate: lib.concatStringsSep "-" [ - (builtins.substring 0 4 longDate) - (builtins.substring 4 2 longDate) - (builtins.substring 6 2 longDate) - ]; +{lib, ...}: rec { + mkDate = longDate: + lib.concatStringsSep "-" [ + (builtins.substring 0 4 longDate) + (builtins.substring 4 2 longDate) + (builtins.substring 6 2 longDate) + ]; mkVersionSrc = src: "unstable-" + builtins.substring 0 7 src.rev; - mkVersionInput = input: - let - date = mkDate (input.lastModifiedDate or "19700101"); - rev = input.shortRev or "dirty"; + mkVersionInput = input: let + date = mkDate (input.lastModifiedDate or "19700101"); + rev = input.shortRev or "dirty"; + in "unstable-${date}_${rev}"; + + mapModules = f: dir: let + filterModules = name: type: let + isPublic = !(lib.hasPrefix "_" name); + isSomething = type != null; + isModule = let + path = "${toString dir}/${name}"; + isDefault = type == "directory" && builtins.pathExists "${path}/default.nix"; + isFile = type == "regular" && lib.hasSuffix ".nix" name && name != "default.nix"; + in + isDefault || isFile; in - "unstable-${date}_${rev}"; + isPublic && isSomething && isModule; - mapModules = f: dir: - let - filterModules = name: type: - let - isPublic = !(lib.hasPrefix "_" name); - isSomething = type != null; - isModule = - let - path = "${toString dir}/${name}"; - isDefault = type == "directory" && builtins.pathExists "${path}/default.nix"; - isFile = type == "regular" && lib.hasSuffix ".nix" name && name != "default.nix"; - in - isDefault || isFile; - in - isPublic && isSomething && isModule; + modulesInDir = lib.filterAttrs filterModules (builtins.readDir dir); - modulesInDir = lib.filterAttrs filterModules (builtins.readDir dir); - - mkModule = name: _: - let - path = "${toString dir}/${name}"; - normalizedName = - if name == "default.nix" - then name - else lib.removeSuffix ".nix" name; - in - lib.nameValuePair normalizedName (f path); + mkModule = name: _: let + path = "${toString dir}/${name}"; + normalizedName = + if name == "default.nix" + then name + else lib.removeSuffix ".nix" name; in + lib.nameValuePair normalizedName (f path); + in lib.mapAttrs' mkModule modulesInDir; mapModules' = f: dir: lib.attrValues (mapModules f dir); listModules = mapModules' (path: path); - mapModulesRec = f: dir: - let - filterDirs = name: type: - let - isPublic = !(lib.hasPrefix "_" name); - isSomething = type != null; - isDir = type == "directory"; - isDefault = isDir && builtins.pathExists "${toString dir}/${name}/default.nix"; - in - isPublic && isSomething && isDir && !isDefault; - - subDirs = lib.filterAttrs filterDirs (builtins.readDir dir); - - mkSubModule = name: _: - let - path = "${toString dir}/${name}"; - in - lib.nameValuePair name (mapModulesRec f path); + mapModulesRec = f: dir: let + filterDirs = name: type: let + isPublic = !(lib.hasPrefix "_" name); + isSomething = type != null; + isDir = type == "directory"; + isDefault = isDir && builtins.pathExists "${toString dir}/${name}/default.nix"; in - mapModules f dir // - (lib.mapAttrs' mkSubModule subDirs); + isPublic && isSomething && isDir && !isDefault; - mapModulesRec' = f: dir: - let - attrValuesRec = attrs: map (values: if lib.isAttrs values then attrValuesRec values else values) (lib.attrValues attrs); + subDirs = lib.filterAttrs filterDirs (builtins.readDir dir); + + mkSubModule = name: _: let + path = "${toString dir}/${name}"; in + lib.nameValuePair name (mapModulesRec f path); + in + mapModules f dir + // (lib.mapAttrs' mkSubModule subDirs); + + mapModulesRec' = f: dir: let + attrValuesRec = attrs: + map (values: + if lib.isAttrs values + then attrValuesRec values + else values) (lib.attrValues attrs); + in lib.flatten (attrValuesRec (mapModulesRec f dir)); listModulesRec = mapModulesRec' (path: path); diff --git a/modules/moritz/config/ai.nix b/modules/moritz/config/ai.nix index 25d824f..21bc1de 100644 --- a/modules/moritz/config/ai.nix +++ b/modules/moritz/config/ai.nix @@ -1,11 +1,10 @@ -{ lib -, config -, ... -}: -let - cfg = config.my.ai; -in { + lib, + config, + ... +}: let + cfg = config.my.ai; +in { options.my.ai.enable = lib.mkEnableOption "AI stuff"; config = lib.mkIf cfg.enable { diff --git a/modules/moritz/config/shell.nix b/modules/moritz/config/shell.nix index 9a4811b..1d8bed4 100644 --- a/modules/moritz/config/shell.nix +++ b/modules/moritz/config/shell.nix @@ -1,21 +1,17 @@ -{ lib -, ... -}: - -with lib; -{ +{lib, ...}: +with lib; { options.my.shell = { abbreviations = mkOption { - default = { }; + default = {}; type = with types; attrsOf str; - example = { gs = "git status"; }; + example = {gs = "git status";}; }; aliases = mkOption { - default = { }; + default = {}; type = with types; attrsOf str; }; variables = mkOption { - default = { }; + default = {}; type = with types; attrsOf str; }; }; diff --git a/modules/moritz/config/terminal.nix b/modules/moritz/config/terminal.nix index 871e9bd..4a850f7 100644 --- a/modules/moritz/config/terminal.nix +++ b/modules/moritz/config/terminal.nix @@ -1,9 +1,5 @@ -{ lib -, ... -}: - -with lib; -{ +{lib, ...}: +with lib; { options.my.terminal = { package = mkOption { description = "Terminal emulator package to use. Gets converted to path of bin automatically."; diff --git a/modules/moritz/config/theming/_catppuccin.nix b/modules/moritz/config/theming/_catppuccin.nix index 6d69def..4056659 100644 --- a/modules/moritz/config/theming/_catppuccin.nix +++ b/modules/moritz/config/theming/_catppuccin.nix @@ -1,36 +1,33 @@ -{ config -, pkgs -, flavor -, rosewater -, flamingo -, pink -, mauve -, red -, maroon -, peach -, yellow -, green -, teal -, sky -, sapphire -, blue -, lavender -, text -, subtext1 -, subtext0 -, overlay2 -, overlay1 -, overlay0 -, surface2 -, surface1 -, surface0 -, base -, mantle -, crust -, ... -}: - { + config, + pkgs, + flavor, + rosewater, + flamingo, + pink, + mauve, + red, + maroon, + peach, + yellow, + green, + teal, + sapphire, + blue, + lavender, + text, + subtext1, + subtext0, + overlay1, + overlay0, + surface2, + surface1, + surface0, + base, + mantle, + crust, + ... +}: { my.programs.tofi.settings = { text-color = "#${text}"; prompt-color = "#${red}"; diff --git a/modules/moritz/config/theming/catppuccin-frappe.nix b/modules/moritz/config/theming/catppuccin-frappe.nix index 0a98a0f..5fa1729 100644 --- a/modules/moritz/config/theming/catppuccin-frappe.nix +++ b/modules/moritz/config/theming/catppuccin-frappe.nix @@ -1,11 +1,14 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.my.theming; -in { - config = mkIf (cfg.enable && cfg.scheme == "catppuccin-frappe") + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.theming; +in { + config = + mkIf (cfg.enable && cfg.scheme == "catppuccin-frappe") (import ./_catppuccin.nix { inherit config lib pkgs; diff --git a/modules/moritz/config/theming/catppuccin-latte.nix b/modules/moritz/config/theming/catppuccin-latte.nix index 3c64d83..204d87c 100644 --- a/modules/moritz/config/theming/catppuccin-latte.nix +++ b/modules/moritz/config/theming/catppuccin-latte.nix @@ -1,11 +1,14 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.my.theming; -in { - config = mkIf (cfg.enable && cfg.scheme == "catppuccin-latte") + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.theming; +in { + config = + mkIf (cfg.enable && cfg.scheme == "catppuccin-latte") (import ./_catppuccin.nix { inherit config lib pkgs; diff --git a/modules/moritz/config/theming/catppuccin-macchiato.nix b/modules/moritz/config/theming/catppuccin-macchiato.nix index b5029ed..05bba51 100644 --- a/modules/moritz/config/theming/catppuccin-macchiato.nix +++ b/modules/moritz/config/theming/catppuccin-macchiato.nix @@ -1,11 +1,14 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.my.theming; -in { - config = mkIf (cfg.enable && cfg.scheme == "catppuccin-macchiato") + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.theming; +in { + config = + mkIf (cfg.enable && cfg.scheme == "catppuccin-macchiato") (import ./_catppuccin.nix { inherit config lib pkgs; diff --git a/modules/moritz/config/theming/catppuccin-mocha.nix b/modules/moritz/config/theming/catppuccin-mocha.nix index 732ab23..6946459 100644 --- a/modules/moritz/config/theming/catppuccin-mocha.nix +++ b/modules/moritz/config/theming/catppuccin-mocha.nix @@ -1,11 +1,14 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.my.theming; -in { - config = mkIf (cfg.enable && cfg.scheme == "catppuccin-mocha") + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.theming; +in { + config = + mkIf (cfg.enable && cfg.scheme == "catppuccin-mocha") (import ./_catppuccin.nix { inherit config lib pkgs; diff --git a/modules/moritz/config/theming/default.nix b/modules/moritz/config/theming/default.nix index bf794f5..add3045 100644 --- a/modules/moritz/config/theming/default.nix +++ b/modules/moritz/config/theming/default.nix @@ -1,14 +1,12 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.theming; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.theming; +in { imports = [ ./dracula.nix ./catppuccin-frappe.nix @@ -33,11 +31,9 @@ in config = mkIf cfg.enable { my.programs.tofi.settings = { font-size = "20"; - font = - let - fontBasePath = pkgs.nerd-fonts.fira-code; - in - "${fontBasePath}/share/fonts/truetype/NerdFonts/FiraCodeNerdFont-Regular.ttf"; + font = let + fontBasePath = pkgs.nerd-fonts.fira-code; + in "${fontBasePath}/share/fonts/truetype/NerdFonts/FiraCodeNerdFont-Regular.ttf"; height = "360"; width = "720"; outline-width = "0"; diff --git a/modules/moritz/config/theming/dracula.nix b/modules/moritz/config/theming/dracula.nix index d6aca86..8530b0b 100644 --- a/modules/moritz/config/theming/dracula.nix +++ b/modules/moritz/config/theming/dracula.nix @@ -1,11 +1,10 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: - -with lib; -let +with lib; let cfg = config.my.theming; background = "282a36"; @@ -19,8 +18,7 @@ let purple = "bd93f9"; red = "ff5555"; yellow = "f1fa8c"; -in -{ +in { config = mkIf (cfg.enable && cfg.scheme == "dracula") { home-manager.users.moritz = { programs = { @@ -38,66 +36,65 @@ in prompt = "#${green}"; spinner = "#${orange}"; }; - kitty.extraConfig = - '' - # https://draculatheme.com/kitty - foreground #f8f8f2 - background #282a36 - selection_foreground #ffffff - selection_background #44475a + kitty.extraConfig = '' + # https://draculatheme.com/kitty + foreground #f8f8f2 + background #282a36 + selection_foreground #ffffff + selection_background #44475a - url_color #8be9fd + url_color #8be9fd - # black - color0 #21222c - color8 #6272a4 + # black + color0 #21222c + color8 #6272a4 - # red - color1 #ff5555 - color9 #ff6e6e + # red + color1 #ff5555 + color9 #ff6e6e - # green - color2 #50fa7b - color10 #69ff94 + # green + color2 #50fa7b + color10 #69ff94 - # yellow - color3 #f1fa8c - color11 #ffffa5 + # yellow + color3 #f1fa8c + color11 #ffffa5 - # blue - color4 #bd93f9 - color12 #d6acff + # blue + color4 #bd93f9 + color12 #d6acff - # magenta - color5 #ff79c6 - color13 #ff92df + # magenta + color5 #ff79c6 + color13 #ff92df - # cyan - color6 #8be9fd - color14 #a4ffff + # cyan + color6 #8be9fd + color14 #a4ffff - # white - color7 #f8f8f2 - color15 #ffffff + # white + color7 #f8f8f2 + color15 #ffffff - # Cursor colors - cursor #f8f8f2 - cursor_text_color background + # Cursor colors + cursor #f8f8f2 + cursor_text_color background - # Tab bar colors - active_tab_foreground #282a36 - active_tab_background #f8f8f2 - inactive_tab_foreground #282a36 - inactive_tab_background #6272a4 + # Tab bar colors + active_tab_foreground #282a36 + active_tab_background #f8f8f2 + inactive_tab_foreground #282a36 + inactive_tab_background #6272a4 - # Marks - mark1_foreground #282a36 - mark1_background #ff5555 + # Marks + mark1_foreground #282a36 + mark1_background #ff5555 - # Splits/Windows - active_border_color #f8f8f2 - inactive_border_color #6272a4 - ''; + # Splits/Windows + active_border_color #f8f8f2 + inactive_border_color #6272a4 + ''; tmux.plugins = with pkgs.tmuxPlugins; [ dracula ]; diff --git a/modules/moritz/config/wallpapers/default.nix b/modules/moritz/config/wallpapers/default.nix index c19d5a8..b5e0539 100644 --- a/modules/moritz/config/wallpapers/default.nix +++ b/modules/moritz/config/wallpapers/default.nix @@ -1,13 +1,11 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.wallpapers; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.wallpapers; +in { options.my.wallpapers.enable = mkEnableOption "wallpapers"; config = mkIf cfg.enable { diff --git a/modules/moritz/default.nix b/modules/moritz/default.nix index 3a16f9b..1d2d936 100644 --- a/modules/moritz/default.nix +++ b/modules/moritz/default.nix @@ -1,7 +1,5 @@ -{ lib, ... }: -let - myLib = import ../lib.nix { inherit lib; }; -in -{ +{lib, ...}: let + myLib = import ../lib.nix {inherit lib;}; +in { imports = myLib.listModulesRec ./.; } diff --git a/modules/moritz/nixpkgs.nix b/modules/moritz/nixpkgs.nix index e6b3442..8eed234 100644 --- a/modules/moritz/nixpkgs.nix +++ b/modules/moritz/nixpkgs.nix @@ -1,7 +1,9 @@ -{ config, lib, ... }: - -with lib; -let +{ + config, + lib, + ... +}: +with lib; let cfg = config.my.nixpkgs; overlayType = mkOptionType { @@ -10,13 +12,13 @@ let check = lib.isFunction; merge = lib.mergeOneOption; }; -in -{ +in { options.my.nixpkgs = { overlays = mkOption { - default = [ ]; + default = []; type = types.listOf overlayType; - example = literalExpression + example = + literalExpression '' [ (self: super: { @@ -29,7 +31,7 @@ in ''; }; channels = mkOption { - default = { }; + default = {}; example = literalExpression '' { stable = inputs.nixpkgs-stable; @@ -41,20 +43,20 @@ in }; config.nixpkgs = { - overlays = - let - channelOverlays = _: prev: - mapAttrs - (_: value: - import value { - inherit (prev) system; - config.allowUnfree = true; - overlays = optional cfg.overlaysForAllChannels cfg.overlays; - } - ) - cfg.channels; - in - cfg.overlays ++ [ channelOverlays ]; + overlays = let + channelOverlays = _: prev: + mapAttrs + ( + _: value: + import value { + inherit (prev) system; + config.allowUnfree = true; + overlays = optional cfg.overlaysForAllChannels cfg.overlays; + } + ) + cfg.channels; + in + cfg.overlays ++ [channelOverlays]; config.allowUnfree = true; }; diff --git a/modules/moritz/profiles/base.nix b/modules/moritz/profiles/base.nix index b600edf..6e643b4 100644 --- a/modules/moritz/profiles/base.nix +++ b/modules/moritz/profiles/base.nix @@ -1,22 +1,19 @@ -{ config -, lib -, pkgs -, inputs -, ... -}: - -let - inherit (lib) getExe; -in { + lib, + pkgs, + inputs, + ... +}: let + inherit (lib) getExe; +in { imports = [ inputs.home-manager.nixosModules.default ]; my = { nixpkgs = { overlays = [ - (_: prev: - { + ( + _: prev: { nur = import inputs.nur { pkgs = prev; nurpkgs = prev; @@ -43,7 +40,7 @@ in rm = "rm -i"; mv = "mv -i"; }; - variables = { EDITOR = "vim"; }; + variables = {EDITOR = "vim";}; }; programs = { lazygit.enable = true; @@ -82,7 +79,7 @@ in bottom # utils - (viu.override { withSixel = true; }) + (viu.override {withSixel = true;}) bat cht-sh fd @@ -91,7 +88,6 @@ in wget ]; - programs = { mtr.enable = true; command-not-found.enable = false; diff --git a/modules/moritz/profiles/desktop.nix b/modules/moritz/profiles/desktop.nix index 347714d..7b22bbc 100644 --- a/modules/moritz/profiles/desktop.nix +++ b/modules/moritz/profiles/desktop.nix @@ -1,15 +1,13 @@ -{ lib -, config -, pkgs -, inputs -, ... -}: - -let +{ + lib, + config, + pkgs, + inputs, + ... +}: let inherit (lib) mkEnableOption mkIf mkDefault; cfg = config.my.profiles.desktop; -in -{ +in { options.my.profiles.desktop.enable = mkEnableOption "desktop profile"; config = mkIf cfg.enable { @@ -28,7 +26,7 @@ in ghostty.settings = { font-family = "IntoneMono Nerd Font"; window-decoration = false; - font-feature = [ "ss01" "ss02" ]; + font-feature = ["ss01" "ss02"]; }; niri.enable = mkDefault true; nvim.enable = mkDefault true; @@ -36,13 +34,13 @@ in spotify-player = { enable = mkDefault true; package = pkgs.spotify-player.overrideAttrs (old: { - buildFeatures = lib.lists.remove "notify" (old.buildFeatures or [ ]); + buildFeatures = lib.lists.remove "notify" (old.buildFeatures or []); }); config = { client_id = "3172dbeaf64949728920c58b823bc24b"; copy_command = { command = "wl-copy"; - args = [ ]; + args = []; }; enable_cover_image_cache = true; default_device = "spotify-player-daemon"; @@ -90,8 +88,8 @@ in vlc (symlinkJoin { name = "obsidian-wayland"; - paths = [ obsidian ]; - nativeBuildInputs = [ makeWrapper ]; + paths = [obsidian]; + nativeBuildInputs = [makeWrapper]; postBuild = '' wrapProgram $out/bin/obsidian \ --add-flags "--socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland" @@ -99,7 +97,6 @@ in }) ]; - fonts = { enableDefaultPackages = true; packages = [ @@ -142,7 +139,7 @@ in systemd.services.NetworkManager-wait-online.enable = false; boot = { consoleLogLevel = 0; - kernelParams = [ "quiet" "udev.log_level=3" ]; + kernelParams = ["quiet" "udev.log_level=3"]; }; }; } diff --git a/modules/moritz/profiles/gaming.nix b/modules/moritz/profiles/gaming.nix index eef9149..b015f91 100644 --- a/modules/moritz/profiles/gaming.nix +++ b/modules/moritz/profiles/gaming.nix @@ -1,15 +1,13 @@ -{ lib -, config -, inputs -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.profiles.gaming; -in { + lib, + config, + inputs, + pkgs, + ... +}: +with lib; let + cfg = config.my.profiles.gaming; +in { imports = [ inputs.jovian.nixosModules.default ]; @@ -17,14 +15,14 @@ in config = mkIf cfg.enable { specialisation.gaming.configuration = { - imports = [ inputs.jovian.nixosModules.default ]; + imports = [inputs.jovian.nixosModules.default]; environment.persistence."/persist".users.moritz.directories = [ ".cache/lutris/" ".config/gamescope" ".local/share/Steam/" ".local/share/lutris/" ]; - users.users.moritz.packages = [ pkgs.lutris ]; + users.users.moritz.packages = [pkgs.lutris]; jovian.steam.enable = true; jovian.steam.autoStart = true; jovian.steam.user = "moritz"; diff --git a/modules/moritz/profiles/impermanence.nix b/modules/moritz/profiles/impermanence.nix index 7267fd6..c03c969 100644 --- a/modules/moritz/profiles/impermanence.nix +++ b/modules/moritz/profiles/impermanence.nix @@ -1,14 +1,17 @@ -{ config, lib, pkgs, inputs, ... }: - -with lib; -let - cfg = config.my.profiles.impermanence; -in { + config, + lib, + pkgs, + inputs, + ... +}: +with lib; let + cfg = config.my.profiles.impermanence; +in { options.my.profiles.impermanence.enable = mkEnableOption "impermanence"; imports = [ - { environment.persistence."/persist".enable = cfg.enable; } + {environment.persistence."/persist".enable = cfg.enable;} inputs.impermanence.nixosModules.impermanence ]; @@ -48,9 +51,18 @@ in "Music" "Pictures" "Videos" - { directory = ".gnupg"; mode = "0700"; } - { directory = ".local/share/keyrings"; mode = "0700"; } - { directory = ".ssh"; mode = "0700"; } + { + directory = ".gnupg"; + mode = "0700"; + } + { + directory = ".local/share/keyrings"; + mode = "0700"; + } + { + directory = ".ssh"; + mode = "0700"; + } ]; files = [ ".local/share/fish/fish_history" @@ -62,8 +74,14 @@ in users.root = { home = "/root"; directories = [ - { directory = ".gnupg"; mode = "0700"; } - { directory = ".ssh"; mode = "0700"; } + { + directory = ".gnupg"; + mode = "0700"; + } + { + directory = ".ssh"; + mode = "0700"; + } ]; files = [ ".local/share/nix/trusted-settings.json" @@ -75,7 +93,7 @@ in ( pkgs.writeShellApplication { name = "zfs-diff"; - runtimeInputs = with pkgs; [ zfs coreutils parallel tree ]; + runtimeInputs = with pkgs; [zfs coreutils parallel tree]; text = '' zfs diff -F zroot/encrypted/root@blank | awk '$2 == "F" && system("test -e /persist/"$3) != 0 { print $3 }' 2>/dev/null | tree --fromfile . "$@" ''; diff --git a/modules/moritz/profiles/personal.nix b/modules/moritz/profiles/personal.nix index 43055bb..1af362d 100644 --- a/modules/moritz/profiles/personal.nix +++ b/modules/moritz/profiles/personal.nix @@ -1,13 +1,11 @@ -{ lib -, config -, ... -}: - -with lib; -let - cfg = config.my.profiles.personal; -in { + lib, + config, + ... +}: +with lib; let + cfg = config.my.profiles.personal; +in { options.my.profiles.personal.enable = mkEnableOption "personal profile"; config = mkIf cfg.enable { diff --git a/modules/moritz/profiles/personal_calendar.nix b/modules/moritz/profiles/personal_calendar.nix index 1b0ed15..af32e19 100644 --- a/modules/moritz/profiles/personal_calendar.nix +++ b/modules/moritz/profiles/personal_calendar.nix @@ -1,14 +1,11 @@ -{ lib -, config -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.profiles.personal; -in { + lib, + config, + ... +}: +with lib; let + cfg = config.my.profiles.personal; +in { options.my.profiles.personal.calendar = mkEnableOption "calendar"; config = mkIf cfg.contacts { @@ -27,7 +24,7 @@ in fileExt = ".ics"; }; remote = { - passwordCommand = [ "cat" config.clan.core.vars.generators.moritz-nextcloud.files.password.path ]; + passwordCommand = ["cat" config.clan.core.vars.generators.moritz-nextcloud.files.password.path]; url = "https://nextcloud.moritzboeh.me/remote.php/dav"; type = "caldav"; userName = "moritz"; diff --git a/modules/moritz/profiles/personal_contacts.nix b/modules/moritz/profiles/personal_contacts.nix index 497297e..e06cfce 100644 --- a/modules/moritz/profiles/personal_contacts.nix +++ b/modules/moritz/profiles/personal_contacts.nix @@ -1,14 +1,11 @@ -{ lib -, config -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.profiles.personal; -in { + lib, + config, + ... +}: +with lib; let + cfg = config.my.profiles.personal; +in { options.my.profiles.personal.contacts = mkEnableOption "contacts"; config = mkIf cfg.contacts { @@ -28,7 +25,7 @@ in fileExt = ".vcf"; }; remote = { - passwordCommand = [ "cat" config.clan.core.vars.generators.moritz-nextcloud.files.password.path ]; + passwordCommand = ["cat" config.clan.core.vars.generators.moritz-nextcloud.files.password.path]; url = "https://nextcloud.moritzboeh.me/remote.php/dav"; type = "carddav"; userName = "moritz"; @@ -41,7 +38,7 @@ in # "z-server-generated--system" # Accounts "contacts" # Contacts ]; - vdirsyncer.conflictResolution = [ "vimdiff" ]; + vdirsyncer.conflictResolution = ["vimdiff"]; }; }; }; diff --git a/modules/moritz/profiles/personal_mail.nix b/modules/moritz/profiles/personal_mail.nix index f1b6c9d..e4afa20 100644 --- a/modules/moritz/profiles/personal_mail.nix +++ b/modules/moritz/profiles/personal_mail.nix @@ -1,11 +1,10 @@ -{ lib -, config -, pkgs -, ... +{ + lib, + config, + pkgs, + ... }: - -with lib; -let +with lib; let cfg = config.my.profiles.personal; filterHtml = pkgs.writeScript "filter_html" '' @@ -15,8 +14,7 @@ let -o display_image=false \ -o display_link_number=true "$@" ''; -in -{ +in { options.my.profiles.personal.mail = mkEnableOption "personal email"; config = mkIf cfg.mail { @@ -47,7 +45,7 @@ in programs.mbsync.enable = true; accounts.email.accounts.personal = { imapnotify.enable = true; - imapnotify.boxes = [ "Inbox" ]; + imapnotify.boxes = ["Inbox"]; imapnotify.onNotify = "${lib.getExe' pkgs.systemd "systemctl"} start --user mbsync.service"; primary = true; address = "mail@moritzboeh.me"; diff --git a/modules/moritz/profiles/ripping.nix b/modules/moritz/profiles/ripping.nix index d01d1ac..bbc2e33 100644 --- a/modules/moritz/profiles/ripping.nix +++ b/modules/moritz/profiles/ripping.nix @@ -1,15 +1,12 @@ -{ lib -, config -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.profiles.ripping; -in - { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.my.profiles.ripping; +in { options.my.profiles.ripping.enable = mkEnableOption "ripping profile"; config = mkIf cfg.enable { diff --git a/modules/moritz/profiles/webis.nix b/modules/moritz/profiles/webis.nix index da990d0..a1a08a9 100644 --- a/modules/moritz/profiles/webis.nix +++ b/modules/moritz/profiles/webis.nix @@ -1,15 +1,12 @@ -{ lib -, config -, pkgs -, ... -}: - -let +{ + lib, + config, + pkgs, + ... +}: let cfg = config.my.profiles.webis; inherit (lib) mkEnableOption mkIf; -in - -{ +in { options.my.profiles.webis.enable = mkEnableOption "webis profile"; config = mkIf cfg.enable { diff --git a/modules/moritz/profiles/yubikey.nix b/modules/moritz/profiles/yubikey.nix index cbffa66..e8a5f50 100644 --- a/modules/moritz/profiles/yubikey.nix +++ b/modules/moritz/profiles/yubikey.nix @@ -1,29 +1,26 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.profiles.yubikey; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.profiles.yubikey; +in { options.my.profiles.yubikey = { enable = mkEnableOption "yubikey"; luksSupport = { enable = mkEnableOption "fido2 luks support"; devices = mkOption { type = types.listOf types.str; - default = [ ]; + default = []; description = "List of luks devices to enable fido2 support for."; }; }; }; - config = mkIf cfg.enable { - services.udev.packages = [ pkgs.yubikey-personalization ]; + services.udev.packages = [pkgs.yubikey-personalization]; environment.systemPackages = with pkgs; [ # cli yubikey-manager @@ -37,7 +34,7 @@ in boot = mkIf cfg.luksSupport.enable { initrd.systemd.enable = true; initrd.luks.devices = genAttrs cfg.luksSupport.devices (_: { - crypttabExtraOpts = [ "fido2-device=auto" ]; + crypttabExtraOpts = ["fido2-device=auto"]; }); }; }; diff --git a/modules/moritz/programs/adb.nix b/modules/moritz/programs/adb.nix index e773d4c..1fcbb70 100644 --- a/modules/moritz/programs/adb.nix +++ b/modules/moritz/programs/adb.nix @@ -1,17 +1,15 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.programs.adb; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.programs.adb; +in { options.my.programs.adb.enable = mkEnableOption "adb"; config = mkIf cfg.enable { programs.adb.enable = true; - users.users.moritz.extraGroups = [ "adbusers" ]; + users.users.moritz.extraGroups = ["adbusers"]; }; } diff --git a/modules/moritz/programs/aider.nix b/modules/moritz/programs/aider.nix index 49b3b62..1c4bd55 100644 --- a/modules/moritz/programs/aider.nix +++ b/modules/moritz/programs/aider.nix @@ -1,11 +1,10 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: - -with lib; -let +with lib; let cfg = config.my.programs.aider; wrapped = pkgs.writeShellApplication { @@ -13,16 +12,15 @@ let text = '' aider --openai-api-key "$(cat ${config.clan.core.vars.generators.moritz-openai.files.api-key.path})" --anthropic-api-key "$(cat ${config.clan.core.vars.generators.moritz-anthropic.files.api-key.path})" --no-attribute-author --no-attribute-committer "$@" ''; - runtimeInputs = [ cfg.package ]; + runtimeInputs = [cfg.package]; }; -in -{ +in { options.my.programs.aider = { enable = mkEnableOption "ssh"; - package = mkPackageOption pkgs "aider-chat" { }; + package = mkPackageOption pkgs "aider-chat" {}; }; config = mkIf cfg.enable { - environment.systemPackages = [ wrapped ]; + environment.systemPackages = [wrapped]; }; } diff --git a/modules/moritz/programs/chromium.nix b/modules/moritz/programs/chromium.nix index 3533ecb..5372855 100644 --- a/modules/moritz/programs/chromium.nix +++ b/modules/moritz/programs/chromium.nix @@ -1,14 +1,12 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.programs.chromium; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.programs.chromium; +in { options.my.programs.chromium = { enable = mkEnableOption "chromium"; package = mkOption { @@ -21,6 +19,6 @@ in config = mkIf cfg.enable { programs.chromium.enable = true; - environment.systemPackages = [ cfg.package ]; + environment.systemPackages = [cfg.package]; }; } diff --git a/modules/moritz/programs/code.nix b/modules/moritz/programs/code.nix index f2a2955..8cd9ec6 100644 --- a/modules/moritz/programs/code.nix +++ b/modules/moritz/programs/code.nix @@ -1,14 +1,12 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.programs.code; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.programs.code; +in { options.my.programs.code = { enable = mkEnableOption "code"; package = mkOption { @@ -17,23 +15,25 @@ in }; extensions = mkOption { type = types.listOf types.package; - default = with pkgs.vscode-extensions; [ - bbenoist.nix - vscodevim.vim - ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ - { - name = "copilot-nightly"; - publisher = "GitHub"; - version = "1.86.118"; - sha256 = "04nspnmd5cfnv3m9igww6h6la6pvhdqzqmdnbm1znapxqiw2m927"; - } - { - name = "copilot-chat"; - publisher = "GitHub"; - version = "0.1.2023052602"; - sha256 = "0anlzzs4g7c9mmw7yxy5bgjcs0niwa3bswgvhwspf5fh8bbq5n44"; - } - ]; + default = with pkgs.vscode-extensions; + [ + bbenoist.nix + vscodevim.vim + ] + ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "copilot-nightly"; + publisher = "GitHub"; + version = "1.86.118"; + sha256 = "04nspnmd5cfnv3m9igww6h6la6pvhdqzqmdnbm1znapxqiw2m927"; + } + { + name = "copilot-chat"; + publisher = "GitHub"; + version = "0.1.2023052602"; + sha256 = "0anlzzs4g7c9mmw7yxy5bgjcs0niwa3bswgvhwspf5fh8bbq5n44"; + } + ]; }; wayland = mkOption { type = types.bool; @@ -42,24 +42,28 @@ in }; config = mkIf cfg.enable { - environment.systemPackages = - let - withExtensions = pkgs.vscode-with-extensions.override { - vscode = cfg.package; - vscodeExtensions = cfg.extensions; - }; - maybeExtensions = if cfg.extensions == [ ] then cfg.package else withExtensions; - withWayland = pkgs.symlinkJoin { - name = "${maybeExtensions.name}-wayland"; - paths = [ maybeExtensions ]; - nativeBuildInputs = [ pkgs.makeWrapper ]; - postBuild = '' - wrapProgram $out/bin/code* \ - --set NIXOS_OZONE_WL 1 - ''; - }; - final = if cfg.wayland then withWayland else maybeExtensions; - in - [ final ]; + environment.systemPackages = let + withExtensions = pkgs.vscode-with-extensions.override { + vscode = cfg.package; + vscodeExtensions = cfg.extensions; + }; + maybeExtensions = + if cfg.extensions == [] + then cfg.package + else withExtensions; + withWayland = pkgs.symlinkJoin { + name = "${maybeExtensions.name}-wayland"; + paths = [maybeExtensions]; + nativeBuildInputs = [pkgs.makeWrapper]; + postBuild = '' + wrapProgram $out/bin/code* \ + --set NIXOS_OZONE_WL 1 + ''; + }; + final = + if cfg.wayland + then withWayland + else maybeExtensions; + in [final]; }; } diff --git a/modules/moritz/programs/direnv.nix b/modules/moritz/programs/direnv.nix index 0452939..1f9fe10 100644 --- a/modules/moritz/programs/direnv.nix +++ b/modules/moritz/programs/direnv.nix @@ -1,13 +1,11 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.programs.direnv; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.programs.direnv; +in { options.my.programs.direnv.enable = mkEnableOption "direnv"; config = mkIf cfg.enable { diff --git a/modules/moritz/programs/firefox.nix b/modules/moritz/programs/firefox.nix index acaf882..48cddce 100644 --- a/modules/moritz/programs/firefox.nix +++ b/modules/moritz/programs/firefox.nix @@ -1,32 +1,31 @@ -{ config -, lib -, inputs -, pkgs -, ... +{ + config, + lib, + inputs, + pkgs, + ... }: - -with lib; -let +with lib; let cfg = config.my.programs.firefox; arkenfox = builtins.readFile "${inputs.arkenfox-userjs}/user.js"; -in -{ +in { options.my.programs.firefox = { enable = mkEnableOption "firefox"; arkenfox = { enable = mkEnableOption "arkenfox"; overrides = mkOption { - default = { }; - type = with types; attrsOf (oneOf [ str bool int ]); - apply = overrides: concatStrings ( - mapAttrsToList + default = {}; + type = with types; attrsOf (oneOf [str bool int]); + apply = overrides: + concatStrings ( + mapAttrsToList ( name: value: '' user_pref("${name}", ${builtins.toJSON value}); '' ) overrides - ); + ); }; }; package = mkOption { @@ -39,26 +38,23 @@ in config = mkIf cfg.enable { home-manager.users.moritz.programs.firefox = { enable = true; - policies = - let - removeExtensions = [ "Google" "Amazon.de" "Bing" "Amazon" "Wikipedia (en)" "Wikipedia (de)" ]; - convertName = name: - let - lower = toLower name; - escaped = replaceStrings [ "." ] [ "dot" ] lower; - sanitized = head (splitString " " escaped); - in - "${sanitized}@search.mozilla.org"; - in - { - SearchEngines = mkIf (hasInfix "esr" cfg.package) { - Default = "Kagi"; - Remove = removeExtensions; - }; - ExtensionSettings = genAttrs - (map convertName removeExtensions) - (_: { installation_mode = "blocked"; }); + policies = let + removeExtensions = ["Google" "Amazon.de" "Bing" "Amazon" "Wikipedia (en)" "Wikipedia (de)"]; + convertName = name: let + lower = toLower name; + escaped = replaceStrings ["."] ["dot"] lower; + sanitized = head (splitString " " escaped); + in "${sanitized}@search.mozilla.org"; + in { + SearchEngines = mkIf (hasInfix "esr" cfg.package) { + Default = "Kagi"; + Remove = removeExtensions; }; + ExtensionSettings = + genAttrs + (map convertName removeExtensions) + (_: {installation_mode = "blocked";}); + }; profiles."default" = { extraConfig = mkIf cfg.arkenfox.enable '' // Arkenfox user.js diff --git a/modules/moritz/programs/fish.nix b/modules/moritz/programs/fish.nix index 026452f..7990f77 100644 --- a/modules/moritz/programs/fish.nix +++ b/modules/moritz/programs/fish.nix @@ -1,27 +1,24 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: - -with lib; -let +with lib; let cfg = config.my.programs.fish; shellConfig = config.my.shell; - exportedVariables = - let - exportVariables = - lib.mapAttrsToList (n: v: ''set -x ${n} "${v}"'') shellConfig.variables; - in + exportedVariables = let + exportVariables = + lib.mapAttrsToList (n: v: ''set -x ${n} "${v}"'') shellConfig.variables; + in lib.concatStringsSep "\n" exportVariables; -in -{ +in { options.my.programs.fish.enable = mkEnableOption "fish"; config = lib.mkIf cfg.enable { # set as default shell users.users.moritz.shell = pkgs.fish; - environment.systemPackages = with pkgs.fishPlugins; [ fzf-fish pisces ]; + environment.systemPackages = with pkgs.fishPlugins; [fzf-fish pisces]; # needed for nix completions programs.fish.enable = true; @@ -29,79 +26,89 @@ in programs = { fish = { enable = true; - plugins = [{ - name = "fish-completion-sync"; - src = pkgs.fetchFromGitHub { - owner = "pfgray"; - repo = "fish-completion-sync"; - rev = "ba70b6457228af520751eab48430b1b995e3e0e2"; - sha256 = "sha256-JdOLsZZ1VFRv7zA2i/QEZ1eovOym/Wccn0SJyhiP9hI="; - }; - }]; + plugins = [ + { + name = "fish-completion-sync"; + src = pkgs.fetchFromGitHub { + owner = "pfgray"; + repo = "fish-completion-sync"; + rev = "ba70b6457228af520751eab48430b1b995e3e0e2"; + sha256 = "sha256-JdOLsZZ1VFRv7zA2i/QEZ1eovOym/Wccn0SJyhiP9hI="; + }; + } + ]; shellAbbrs = shellConfig.abbreviations; shellAliases = shellConfig.aliases; - shellInit = /* fish */ '' - # Vi Mode - fish_vi_key_bindings + shellInit = + /* + fish + */ + '' + # Vi Mode + fish_vi_key_bindings - # Emulates vim's cursor shape behavior - # Set the normal and visual mode cursors to a block - set fish_cursor_default block - # Set the insert mode cursor to a line - set fish_cursor_insert line - # Set the replace mode cursor to an underscore - set fish_cursor_replace_one underscore - # The following variable can be used to configure cursor shape in - # visual mode, but due to fish_cursor_default, is redundant here - set fish_cursor_visual block + # Emulates vim's cursor shape behavior + # Set the normal and visual mode cursors to a block + set fish_cursor_default block + # Set the insert mode cursor to a line + set fish_cursor_insert line + # Set the replace mode cursor to an underscore + set fish_cursor_replace_one underscore + # The following variable can be used to configure cursor shape in + # visual mode, but due to fish_cursor_default, is redundant here + set fish_cursor_visual block - # Complex abbreviations - function last_history_item - echo $history[1] - end - abbr -a !! --position anywhere --function last_history_item + # Complex abbreviations + function last_history_item + echo $history[1] + end + abbr -a !! --position anywhere --function last_history_item - function sed_history_item - echo $history[1] | perl -p -e (string trim -l --chars=! $argv) - end - abbr -a sed_history --position command --regex '^!s/.+/.*/g?' --function sed_history_item + function sed_history_item + echo $history[1] | perl -p -e (string trim -l --chars=! $argv) + end + abbr -a sed_history --position command --regex '^!s/.+/.*/g?' --function sed_history_item - function multicd - echo cd (string repeat -n (math (string length -- $argv[1]) - 1) ../) - end - abbr --add dotdot --regex '^\.\.+$' --function multicd + function multicd + echo cd (string repeat -n (math (string length -- $argv[1]) - 1) ../) + end + abbr --add dotdot --regex '^\.\.+$' --function multicd - abbr -a .P --position anywhere --set-cursor "% | $PAGER" + abbr -a .P --position anywhere --set-cursor "% | $PAGER" - function editor_edit - echo $EDITOR $argv - end - abbr -a editor_edit_files --position command --regex ".+\.(txt|md|org)" --function editor_edit + function editor_edit + echo $EDITOR $argv + end + abbr -a editor_edit_files --position command --regex ".+\.(txt|md|org)" --function editor_edit - function editor - echo $EDITOR - end - abbr -a e --function editor + function editor + echo $EDITOR + end + abbr -a e --function editor - # Completions - complete -c c -kfa '(zoxide query -l | sed "s|$HOME|~|")' - ${optionalString config.virtualisation.podman.dockerCompat /* fish */ "complete -c docker -w podman"} - complete -c nom -fn "not __fish_seen_subcommand_from build shell develop" -a "build shell develop" + # Completions + complete -c c -kfa '(zoxide query -l | sed "s|$HOME|~|")' + ${optionalString config.virtualisation.podman.dockerCompat + /* + fish + */ + "complete -c docker -w podman"} + complete -c nom -fn "not __fish_seen_subcommand_from build shell develop" -a "build shell develop" - complete -c nom -fn "__fish_seen_subcommand_from build" -w "nix build" - complete -c nom -fn "__fish_seen_subcommand_from shell" -w "nix shell" - complete -c nom -fn "__fish_seen_subcommand_from develop" -w "nix develop" + complete -c nom -fn "__fish_seen_subcommand_from build" -w "nix build" + complete -c nom -fn "__fish_seen_subcommand_from shell" -w "nix shell" + complete -c nom -fn "__fish_seen_subcommand_from develop" -w "nix develop" - complete -c timers \ - -n "__fish_seen_subcommand_from toggle" \ - -fa '(timers --json l | ${getExe pkgs.jq} -r .[][].name)' - complete -c timers \ - -n "__fish_seen_subcommand_from remove" \ - -fa '(timers --json l | ${getExe pkgs.jq} -r .[][].name)' + complete -c timers \ + -n "__fish_seen_subcommand_from toggle" \ + -fa '(timers --json l | ${getExe pkgs.jq} -r .[][].name)' + complete -c timers \ + -n "__fish_seen_subcommand_from remove" \ + -fa '(timers --json l | ${getExe pkgs.jq} -r .[][].name)' - # Variables - ${exportedVariables} - ''; + # Variables + ${exportedVariables} + ''; functions = { fish_greeting = ""; cheat = "cht.sh $argv | bat -p"; diff --git a/modules/moritz/programs/foot.nix b/modules/moritz/programs/foot.nix index 029dec4..e1ddeb7 100644 --- a/modules/moritz/programs/foot.nix +++ b/modules/moritz/programs/foot.nix @@ -1,13 +1,11 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.programs.foot; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.programs.foot; +in { options.my.programs.foot.enable = mkEnableOption "foot"; config = mkIf cfg.enable { diff --git a/modules/moritz/programs/ghostty.nix b/modules/moritz/programs/ghostty.nix index c66aeb4..67b1408 100644 --- a/modules/moritz/programs/ghostty.nix +++ b/modules/moritz/programs/ghostty.nix @@ -1,32 +1,29 @@ -{ config -, lib -, pkgs -, inputs -, ... +{ + config, + lib, + pkgs, + ... }: - -with lib; -let +with lib; let cfg = config.my.programs.ghostty; format = pkgs.formats.keyValue { listsAsDuplicateKeys = true; }; -in -{ +in { options.my.programs.ghostty.enable = mkEnableOption "Ghostty"; - options.my.programs.ghostty.package = (mkPackageOption pkgs "ghostty" { }); + options.my.programs.ghostty.package = mkPackageOption pkgs "ghostty" {}; options.my.programs.ghostty.settings = mkOption { inherit (format) type; description = '' Configuration written to {file}`$XDG_CONFIG_HOME/ghostty/config`. ''; - default = { }; + default = {}; }; config = mkIf cfg.enable { my.terminal.package = cfg.package; home-manager.users.moritz = { - home.packages = [ cfg.package ]; + home.packages = [cfg.package]; xdg.configFile."ghostty/config".source = format.generate "ghostty-config" cfg.settings; }; }; diff --git a/modules/moritz/programs/git.nix b/modules/moritz/programs/git.nix index 12171e0..c6319d5 100644 --- a/modules/moritz/programs/git.nix +++ b/modules/moritz/programs/git.nix @@ -1,13 +1,11 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.programs.git; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.programs.git; +in { options.my.programs.git = { enable = mkEnableOption "git"; signing = mkOption { diff --git a/modules/moritz/programs/gnome.nix b/modules/moritz/programs/gnome.nix index ecf2c3d..87280f8 100644 --- a/modules/moritz/programs/gnome.nix +++ b/modules/moritz/programs/gnome.nix @@ -1,11 +1,10 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: - -with lib; -let +with lib; let cfg = config.my.programs.gnome; extensions = with pkgs.gnomeExtensions; [ @@ -14,8 +13,7 @@ let blur-my-shell pop-shell ]; -in -{ +in { options.my.programs.gnome.enable = mkEnableOption "gnome"; config = lib.mkIf cfg.enable { @@ -39,33 +37,35 @@ in home-manager.users.moritz.dconf.settings = { "org/gnome/shell" = { disable-user-extensions = false; - enabled-extensions = map (p: p.extensionUuid or p.uuid) extensions ++ [ - "launch-new-instance@gnome-shell-extensions.gcampax.github.com" - "workspace-indicator@gnome-shell-extensions.gcampax.github.com" - ]; + enabled-extensions = + map (p: p.extensionUuid or p.uuid) extensions + ++ [ + "launch-new-instance@gnome-shell-extensions.gcampax.github.com" + "workspace-indicator@gnome-shell-extensions.gcampax.github.com" + ]; }; "org/gnome/shell/extensions/pop-shell".tile-by-default = true; "org/gnome/desktop/interface".enable-hot-corners = false; "org/gnome/desktop/wm/preferences".focus-mode = "sloppy"; "org.gnome.mutter".focus-change-on-pointer-rest = false; - "org/gnome/desktop/wm/keybindings".close = [ "q" ]; - "org/gnome/desktop/wm/keybindings".minimize = [ ]; - "org/gnome/desktop/wm/keybindings".move-to-monitor-down = [ "j" ]; - "org/gnome/desktop/wm/keybindings".move-to-monitor-left = [ "h" ]; - "org/gnome/desktop/wm/keybindings".move-to-monitor-right = [ "l" ]; - "org/gnome/desktop/wm/keybindings".move-to-monitor-up = [ "k" ]; - "org/gnome/desktop/wm/keybindings".move-to-workspace-1 = [ "1" ]; - "org/gnome/desktop/wm/keybindings".move-to-workspace-2 = [ "2" ]; - "org/gnome/desktop/wm/keybindings".move-to-workspace-3 = [ "3" ]; - "org/gnome/desktop/wm/keybindings".move-to-workspace-4 = [ "4" ]; - "org/gnome/desktop/wm/keybindings".switch-to-workspace-1 = [ "1" ]; - "org/gnome/desktop/wm/keybindings".switch-to-workspace-2 = [ "2" ]; - "org/gnome/desktop/wm/keybindings".switch-to-workspace-3 = [ "3" ]; - "org/gnome/desktop/wm/keybindings".switch-to-workspace-4 = [ "4" ]; + "org/gnome/desktop/wm/keybindings".close = ["q"]; + "org/gnome/desktop/wm/keybindings".minimize = []; + "org/gnome/desktop/wm/keybindings".move-to-monitor-down = ["j"]; + "org/gnome/desktop/wm/keybindings".move-to-monitor-left = ["h"]; + "org/gnome/desktop/wm/keybindings".move-to-monitor-right = ["l"]; + "org/gnome/desktop/wm/keybindings".move-to-monitor-up = ["k"]; + "org/gnome/desktop/wm/keybindings".move-to-workspace-1 = ["1"]; + "org/gnome/desktop/wm/keybindings".move-to-workspace-2 = ["2"]; + "org/gnome/desktop/wm/keybindings".move-to-workspace-3 = ["3"]; + "org/gnome/desktop/wm/keybindings".move-to-workspace-4 = ["4"]; + "org/gnome/desktop/wm/keybindings".switch-to-workspace-1 = ["1"]; + "org/gnome/desktop/wm/keybindings".switch-to-workspace-2 = ["2"]; + "org/gnome/desktop/wm/keybindings".switch-to-workspace-3 = ["3"]; + "org/gnome/desktop/wm/keybindings".switch-to-workspace-4 = ["4"]; "org/gnome/mutter".dynamic-workspaces = false; - "org/gnome/mutter/wayland/keybindings".restore-shortcuts = [ ]; - "org/gnome/settings-daemon/plugins/media-keys".screensaver = [ "Escape" ]; - "org/gnome/shell".favorite-apps = [ ]; + "org/gnome/mutter/wayland/keybindings".restore-shortcuts = []; + "org/gnome/settings-daemon/plugins/media-keys".screensaver = ["Escape"]; + "org/gnome/shell".favorite-apps = []; "org/gnome/desktop/wm/preferences".num-workspaces = 4; }; }; diff --git a/modules/moritz/programs/gpg.nix b/modules/moritz/programs/gpg.nix index 64ce070..a3c987f 100644 --- a/modules/moritz/programs/gpg.nix +++ b/modules/moritz/programs/gpg.nix @@ -1,13 +1,11 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.programs.gpg; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.programs.gpg; +in { options.my.programs.gpg.enable = mkEnableOption "gpg"; config = mkIf cfg.enable { diff --git a/modules/moritz/programs/jetbrains/default.nix b/modules/moritz/programs/jetbrains/default.nix index 2a283ee..326f051 100644 --- a/modules/moritz/programs/jetbrains/default.nix +++ b/modules/moritz/programs/jetbrains/default.nix @@ -1,13 +1,15 @@ -{ config, lib, pkgs, ... }: - -let +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) any filterAttrs mapAttrsToList mkEnableOption mkIf mkOption; cfg = config.my.programs.jetbrains; isEnabled = _: value: value.enable; anyEnabled = any (x: x) (mapAttrsToList isEnabled cfg); -in -{ +in { options.my.programs.jetbrains = { pycharm = { enable = mkEnableOption "pycharm"; @@ -34,10 +36,9 @@ in xdg.configFile."ideavim/ideavimrc" = { source = ./ideavimrc; }; - home.packages = - let - enabledPackages = filterAttrs isEnabled cfg; - in + home.packages = let + enabledPackages = filterAttrs isEnabled cfg; + in mapAttrsToList (_: value: value.package) enabledPackages; }; }; diff --git a/modules/moritz/programs/kitty.nix b/modules/moritz/programs/kitty.nix index 02ff047..0c0e6f3 100644 --- a/modules/moritz/programs/kitty.nix +++ b/modules/moritz/programs/kitty.nix @@ -1,13 +1,11 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.programs.kitty; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.programs.kitty; +in { options.my.programs.kitty.enable = mkEnableOption "kitty"; config = mkIf cfg.enable { diff --git a/modules/moritz/programs/lazygit.nix b/modules/moritz/programs/lazygit.nix index e3a07ca..f06c97e 100644 --- a/modules/moritz/programs/lazygit.nix +++ b/modules/moritz/programs/lazygit.nix @@ -1,11 +1,10 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: - -with lib; -let +with lib; let cfg = config.my.programs.lazygit; wrapper = pkgs.writeShellApplication { @@ -20,10 +19,9 @@ let rm -f "$LAZYGIT_NEW_DIR_FILE" > /dev/null fi ''; - runtimeInputs = [ pkgs.lazygit ]; + runtimeInputs = [pkgs.lazygit]; }; -in -{ +in { options.my.programs.lazygit.enable = mkEnableOption "lazygit"; config = mkIf cfg.enable { @@ -44,17 +42,61 @@ in key = "Type"; title = "Type of change"; options = [ - { name = "build"; description = "Changes that affect the build system or external dependencies"; value = "build"; } - { name = "feat"; description = "A new feature"; value = "feat"; } - { name = "fix"; description = "A bug fix"; value = "fix"; } - { name = "chore"; description = "Other changes that don't modify src or test files"; value = "chore"; } - { name = "ci"; description = "Changes to CI configuration files and scripts"; value = "ci"; } - { name = "docs"; description = "Documentation only changes"; value = "docs"; } - { name = "perf"; description = "A code change that improves performance"; value = "perf"; } - { name = "refactor"; description = "A code change that neither fixes a bug nor adds a feature"; value = "refactor"; } - { name = "revert"; description = "Reverts a previous commit"; value = "revert"; } - { name = "style"; description = "Changes that do not affect the meaning of the code"; value = "style"; } - { name = "test"; description = "Adding missing tests or correcting existing tests"; value = "test"; } + { + name = "build"; + description = "Changes that affect the build system or external dependencies"; + value = "build"; + } + { + name = "feat"; + description = "A new feature"; + value = "feat"; + } + { + name = "fix"; + description = "A bug fix"; + value = "fix"; + } + { + name = "chore"; + description = "Other changes that don't modify src or test files"; + value = "chore"; + } + { + name = "ci"; + description = "Changes to CI configuration files and scripts"; + value = "ci"; + } + { + name = "docs"; + description = "Documentation only changes"; + value = "docs"; + } + { + name = "perf"; + description = "A code change that improves performance"; + value = "perf"; + } + { + name = "refactor"; + description = "A code change that neither fixes a bug nor adds a feature"; + value = "refactor"; + } + { + name = "revert"; + description = "Reverts a previous commit"; + value = "revert"; + } + { + name = "style"; + description = "Changes that do not affect the meaning of the code"; + value = "style"; + } + { + name = "test"; + description = "Adding missing tests or correcting existing tests"; + value = "test"; + } ]; } { @@ -68,8 +110,14 @@ in key = "Breaking"; title = "Breaking change"; options = [ - { name = "no"; value = ""; } - { name = "yes"; value = "!"; } + { + name = "no"; + value = ""; + } + { + name = "yes"; + value = "!"; + } ]; } { diff --git a/modules/moritz/programs/ledger/default.nix b/modules/moritz/programs/ledger/default.nix index ce54b3e..8e97424 100644 --- a/modules/moritz/programs/ledger/default.nix +++ b/modules/moritz/programs/ledger/default.nix @@ -1,14 +1,12 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.programs.ledger; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.programs.ledger; +in { options.my.programs.ledger.enable = mkEnableOption "ledger"; config = mkIf cfg.enable { @@ -16,10 +14,9 @@ in variables = { LEDGER_FILE = "/home/moritz/Nextcloud/Notes/ledger/main.ledger"; }; - aliases = - let - applyCommon = _: command: "${command} --payee note --strict --explicit"; - in + aliases = let + applyCommon = _: command: "${command} --payee note --strict --explicit"; + in mapAttrs applyCommon { bal = "ledger bal"; balcash = "ledger bal -R -X € --current --flat ^assets:bank ^liabilities"; @@ -33,7 +30,7 @@ in reg-copy = writeShellApplication { name = "reg-copy"; - runtimeInputs = [ ledger xclip ]; + runtimeInputs = [ledger xclip]; text = '' table="$(printf '%-10s %-30s %8s %8s\n' Datum Beschreibung Einzeln Gesamt && ledger reg -V --format '%10D %.30P %8t %8T\n' "$@")" @@ -41,8 +38,7 @@ in echo "$table" | xclip -selection clipboard ''; }; - in - [ ledger reg-copy hledger hledger-ui hledger-web ]; + in [ledger reg-copy hledger hledger-ui hledger-web]; home-manager.users.moritz = { xdg.configFile = { "fish/completions/ledger.fish" = { diff --git a/modules/moritz/programs/logseq.nix b/modules/moritz/programs/logseq.nix index 35349b3..21121af 100644 --- a/modules/moritz/programs/logseq.nix +++ b/modules/moritz/programs/logseq.nix @@ -1,14 +1,12 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.programs.logseq; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.programs.logseq; +in { options.my.programs.logseq.enable = mkEnableOption "logseq"; config = mkIf cfg.enable { diff --git a/modules/moritz/programs/miracast.nix b/modules/moritz/programs/miracast.nix index 6181a88..1ad1a55 100644 --- a/modules/moritz/programs/miracast.nix +++ b/modules/moritz/programs/miracast.nix @@ -1,20 +1,18 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.programs.miracast; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.programs.miracast; +in { options.my.programs.miracast.enable = mkEnableOption "miracast"; config = mkIf cfg.enable { networking.firewall = { - allowedTCPPorts = [ 7236 7250 ]; - allowedUDPPorts = [ 7236 5353 ]; + allowedTCPPorts = [7236 7250]; + allowedUDPPorts = [7236 5353]; }; users.users.moritz.packages = with pkgs; [ gnome-network-displays diff --git a/modules/moritz/programs/navi/default.nix b/modules/moritz/programs/navi/default.nix index 1772d61..42d7d4b 100644 --- a/modules/moritz/programs/navi/default.nix +++ b/modules/moritz/programs/navi/default.nix @@ -1,10 +1,11 @@ -{ config, lib, ... }: - -with lib; -let - cfg = config.my.programs.navi; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.programs.navi; +in { options.my.programs.navi.enable = mkEnableOption "navi"; config = mkIf cfg.enable { diff --git a/modules/moritz/programs/niri.nix b/modules/moritz/programs/niri.nix index 65b76bb..a92962b 100644 --- a/modules/moritz/programs/niri.nix +++ b/modules/moritz/programs/niri.nix @@ -1,24 +1,24 @@ -{ config -, lib -, pkgs -, inputs -, ... -}: - -let +{ + config, + lib, + pkgs, + inputs, + ... +}: let cfg = config.my.programs.niri; inherit (config.home-manager.users.moritz.lib.niri) actions; inherit (lib) mkEnableOption getExe mkIf; -in -{ +in { imports = [ inputs.niri.nixosModules.niri ]; options.my.programs.niri.enable = mkEnableOption "niri"; - options.my.programs.niri.autoStart = mkEnableOption "auto start niri" // { - default = true; - }; + options.my.programs.niri.autoStart = + mkEnableOption "auto start niri" + // { + default = true; + }; config = mkIf cfg.enable { users.users.moritz.packages = with pkgs; [ @@ -32,7 +32,7 @@ in ]; # adds pam module for swaylock - security.pam.services.swaylock = { }; + security.pam.services.swaylock = {}; programs.niri.enable = true; programs.niri.package = pkgs.niri; @@ -69,9 +69,9 @@ in layer = "top"; position = "top"; height = 20; - modules-left = [ "niri/workspaces" ]; - modules-center = [ "niri/window" ]; - modules-right = [ "network" "memory" "cpu" "battery" "clock" ]; + modules-left = ["niri/workspaces"]; + modules-center = ["niri/window"]; + modules-right = ["network" "memory" "cpu" "battery" "clock"]; }; }; }; @@ -95,20 +95,18 @@ in command = "${lib.getExe pkgs.swaylock} -fF"; } ]; - timeouts = - let - lockTimeout = 10; - in - [ - { - timeout = lockTimeout * 60 - 10; - command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'"; - } - { - timeout = lockTimeout * 60 + 10; - command = "${pkgs.systemd}/bin/loginctl lock-session"; - } - ]; + timeouts = let + lockTimeout = 10; + in [ + { + timeout = lockTimeout * 60 - 10; + command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'"; + } + { + timeout = lockTimeout * 60 + 10; + command = "${pkgs.systemd}/bin/loginctl lock-session"; + } + ]; systemdTarget = "niri.service"; }; home.packages = with pkgs; [ @@ -129,7 +127,7 @@ in binds = { # spawn different programs "Mod+Return".action.spawn = config.my.terminal.package; - "Mod+Shift+escape".action.spawn = [ "loginctl" "lock-session" ]; + "Mod+Shift+escape".action.spawn = ["loginctl" "lock-session"]; "Mod+R".action.spawn = "${lib.getExe pkgs.fuzzel}"; # keyboard layout @@ -152,7 +150,7 @@ in "Mod+H".action = actions.move-column-left-or-to-monitor-left; "Mod+L".action = actions.move-column-right-or-to-monitor-right; - "Mod+W".action.spawn = [ "pkill" "-USR1" "waybar" ]; + "Mod+W".action.spawn = ["pkill" "-USR1" "waybar"]; "Mod+C".action = actions.consume-window-into-column; "Mod+E".action = actions.expel-window-from-column; @@ -187,9 +185,9 @@ in "Mod+0".action.focus-workspace = 10; # audio - "XF86_AudioMute".action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle" ]; - "XF86AudioRaiseVolume".action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+" "-l" "1.0" ]; - "XF86AudioLowerVolume".action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-" ]; + "XF86_AudioMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"]; + "XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+" "-l" "1.0"]; + "XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"]; # TODO(mangoiv): mic mute toggle }; environment = { @@ -200,9 +198,9 @@ in focus-ring.enable = false; default-column-width.proportion = 2.0 / 3.0; preset-column-widths = [ - { proportion = 1.0 / 3.0; } - { proportion = 2.0 / 3.0; } - { proportion = 1.0 / 1.0; } + {proportion = 1.0 / 3.0;} + {proportion = 2.0 / 3.0;} + {proportion = 1.0 / 1.0;} ]; gaps = 3; }; @@ -215,9 +213,9 @@ in window-rules = [ { matches = [ - { title = "^.*1Password.*$"; } - { title = "^.*Bitwarden.*$"; } - { title = "^.*KeePassXC.*$"; } + {title = "^.*1Password.*$";} + {title = "^.*Bitwarden.*$";} + {title = "^.*KeePassXC.*$";} ]; block-out-from = "screen-capture"; } @@ -232,7 +230,7 @@ in } ]; switch-events = { - lid-close.action.spawn = [ "loginctl" "lock-session" ]; + lid-close.action.spawn = ["loginctl" "lock-session"]; }; input = { touchpad.natural-scroll = false; @@ -248,11 +246,11 @@ in systemd.user.services.xwayland-satellite = { description = "Xwayland outside your Wayland"; - after = [ "graphical-session.target" ]; - wantedBy = [ "graphical-session.target" ]; - partOf = [ "graphical-session.target" ]; - bindsTo = [ "graphical-session.target" ]; - requisite = [ "graphical-session.target" ]; + after = ["graphical-session.target"]; + wantedBy = ["graphical-session.target"]; + partOf = ["graphical-session.target"]; + bindsTo = ["graphical-session.target"]; + requisite = ["graphical-session.target"]; serviceConfig = { Type = "notify"; Restart = "always"; diff --git a/modules/moritz/programs/nix.nix b/modules/moritz/programs/nix.nix index dfbc26f..73a83bf 100644 --- a/modules/moritz/programs/nix.nix +++ b/modules/moritz/programs/nix.nix @@ -1,17 +1,15 @@ -{ config -, lib -, inputs -, self -, pkgs -, ... -}: - -let +{ + config, + lib, + inputs, + self, + pkgs, + ... +}: let inherit (lib) mkEnableOption mkOption types; cfg = config.my.programs.nix; -in -{ +in { options.my.programs.nix = { gc = { enable = mkEnableOption "nix-gc"; @@ -30,7 +28,7 @@ in }; nix = { - nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; + nixPath = ["nixpkgs=${inputs.nixpkgs}"]; package = pkgs.lix; @@ -46,7 +44,7 @@ in optimise = { automatic = cfg.optimise.enable; - dates = [ "weekly" ]; + dates = ["weekly"]; }; registry = { @@ -71,7 +69,7 @@ in "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ]; - trusted-users = [ "root" "@wheel" ]; + trusted-users = ["root" "@wheel"]; # https://bmcgee.ie/posts/2023/12/til-how-to-optimise-substitutions-in-nix/ http-connections = 128; diff --git a/modules/moritz/programs/nvim/default.nix b/modules/moritz/programs/nvim/default.nix index 3300da9..757b477 100644 --- a/modules/moritz/programs/nvim/default.nix +++ b/modules/moritz/programs/nvim/default.nix @@ -1,19 +1,24 @@ -{ config, lib, pkgs, inputs, ... }: - -let +{ + config, + lib, + pkgs, + inputs, + ... +}: let inherit (lib) mkEnableOption mkIf readFile; - myLib = import ../../../lib.nix { inherit lib; }; + myLib = import ../../../lib.nix {inherit lib;}; cfg = config.my.programs.nvim; -in -{ - imports = (myLib.listModulesRec ./plugins) ++ [ - { - home-manager.sharedModules = [ - inputs.nixvim.homeManagerModules.nixvim - ]; - } - ]; +in { + imports = + (myLib.listModulesRec ./plugins) + ++ [ + { + home-manager.sharedModules = [ + inputs.nixvim.homeManagerModules.nixvim + ]; + } + ]; options.my.programs.nvim.enable = mkEnableOption "nvim"; @@ -26,7 +31,6 @@ in ]; home-manager.users.moritz = { - home.packages = with pkgs; [ xdotool # for vimtex ]; diff --git a/modules/moritz/programs/nvim/plugins/avante.nix b/modules/moritz/programs/nvim/plugins/avante.nix index a9e74d2..a0fde07 100644 --- a/modules/moritz/programs/nvim/plugins/avante.nix +++ b/modules/moritz/programs/nvim/plugins/avante.nix @@ -1,16 +1,17 @@ -{ config, lib, pkgs, ... }: - -let +{ + config, + lib, + ... +}: let inherit (lib) mkIf; cfg = config.my.ai; -in -{ +in { config = mkIf cfg.enable { home-manager.users.moritz.programs.nixvim.plugins = { render-markdown = { enable = true; - settings.file_types = [ "markdown" "Avante" ]; + settings.file_types = ["markdown" "Avante"]; }; nui.enable = true; dressing.enable = true; @@ -22,7 +23,7 @@ in api_key_name = "cmd:cat ${config.clan.core.vars.generators.moritz-openai.files.api-key.path}"; }; }; - lazyLoad.settings.event = [ "DeferredUIEnter" ]; + lazyLoad.settings.event = ["DeferredUIEnter"]; }; }; }; diff --git a/modules/moritz/programs/nvim/plugins/blink-cmp.nix b/modules/moritz/programs/nvim/plugins/blink-cmp.nix index 47dbc0a..836e995 100644 --- a/modules/moritz/programs/nvim/plugins/blink-cmp.nix +++ b/modules/moritz/programs/nvim/plugins/blink-cmp.nix @@ -1,11 +1,13 @@ -{ lib, pkgs, inputs, ... }: - -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.blink-compat.enable = true; - plugins.lsp.capabilities = /* lua */ '' - capabilities = require('blink.cmp').get_lsp_capabilities(capabilities) - ''; + plugins.lsp.capabilities = + /* + lua + */ + '' + capabilities = require('blink.cmp').get_lsp_capabilities(capabilities) + ''; plugins.blink-cmp = { enable = true; settings = { diff --git a/modules/moritz/programs/nvim/plugins/catppuccin.nix b/modules/moritz/programs/nvim/plugins/catppuccin.nix index a9c4f76..af2218e 100644 --- a/modules/moritz/programs/nvim/plugins/catppuccin.nix +++ b/modules/moritz/programs/nvim/plugins/catppuccin.nix @@ -1,11 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; - - -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { colorschemes.catppuccin = { enable = true; diff --git a/modules/moritz/programs/nvim/plugins/comment.nix b/modules/moritz/programs/nvim/plugins/comment.nix index 7dd0ae1..b470be2 100644 --- a/modules/moritz/programs/nvim/plugins/comment.nix +++ b/modules/moritz/programs/nvim/plugins/comment.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.comment.enable = true; }; diff --git a/modules/moritz/programs/nvim/plugins/conform.nix b/modules/moritz/programs/nvim/plugins/conform.nix index d591551..9275bcf 100644 --- a/modules/moritz/programs/nvim/plugins/conform.nix +++ b/modules/moritz/programs/nvim/plugins/conform.nix @@ -1,31 +1,26 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.conform-nvim = { enable = true; settings.formatters_by_ft = { - "*" = [ "codespell" "trim_whitespace" ]; - elixir = [ "mix" ]; - gleam = [ "gleam" ]; - go = [ "gofmt" ]; - json = [ "jq" ]; - lua = [ "stylua" ]; - nix = [ "nixpkgs_fmt" ]; + "*" = ["codespell" "trim_whitespace"]; + elixir = ["mix"]; + gleam = ["gleam"]; + go = ["gofmt"]; + json = ["jq"]; + lua = ["stylua"]; + nix = ["nixpkgs_fmt"]; python.__raw = '' function(bufnr) return { first(bufnr, "ruff_organize_imports", "isort"), first(bufnr, "ruff_format", "black")} end ''; - rust = [ "rustfmt" ]; - sh = [ "shfmt" ]; - tex = [ "latexindent" ]; - toml = [ "taplo" ]; - yaml = [ "yamlfix" ]; - markdown = [ "injected" ]; + rust = ["rustfmt"]; + sh = ["shfmt"]; + tex = ["latexindent"]; + toml = ["taplo"]; + yaml = ["yamlfix"]; + markdown = ["injected"]; }; }; opts.formatexpr = "v:lua.require'conform'.formatexpr()"; @@ -67,8 +62,11 @@ in "conform.nvim" ]; keymaps = [ - { key = "="; action.__raw = ''function() require("conform").format() end''; options.desc = "Format current file"; } + { + key = "="; + action.__raw = ''function() require("conform").format() end''; + options.desc = "Format current file"; + } ]; }; - } diff --git a/modules/moritz/programs/nvim/plugins/crates.nix b/modules/moritz/programs/nvim/plugins/crates.nix index a8f46ea..9b736e4 100644 --- a/modules/moritz/programs/nvim/plugins/crates.nix +++ b/modules/moritz/programs/nvim/plugins/crates.nix @@ -1,11 +1,6 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.crates.enable = true; - plugins.crates.lazyLoad.settings.event = [ "BufRead Cargo.toml" ]; + plugins.crates.lazyLoad.settings.event = ["BufRead Cargo.toml"]; }; } diff --git a/modules/moritz/programs/nvim/plugins/direnv.nix b/modules/moritz/programs/nvim/plugins/direnv.nix index 3f6922a..0a328eb 100644 --- a/modules/moritz/programs/nvim/plugins/direnv.nix +++ b/modules/moritz/programs/nvim/plugins/direnv.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.direnv.enable = true; }; diff --git a/modules/moritz/programs/nvim/plugins/friendly-snippets.nix b/modules/moritz/programs/nvim/plugins/friendly-snippets.nix index 9c64552..4507d7e 100644 --- a/modules/moritz/programs/nvim/plugins/friendly-snippets.nix +++ b/modules/moritz/programs/nvim/plugins/friendly-snippets.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.friendly-snippets.enable = true; }; diff --git a/modules/moritz/programs/nvim/plugins/fugitive.nix b/modules/moritz/programs/nvim/plugins/fugitive.nix index 97d5d11..169fad2 100644 --- a/modules/moritz/programs/nvim/plugins/fugitive.nix +++ b/modules/moritz/programs/nvim/plugins/fugitive.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.fugitive.enable = true; }; diff --git a/modules/moritz/programs/nvim/plugins/gitsigns.nix b/modules/moritz/programs/nvim/plugins/gitsigns.nix index 2e1db6e..10ce027 100644 --- a/modules/moritz/programs/nvim/plugins/gitsigns.nix +++ b/modules/moritz/programs/nvim/plugins/gitsigns.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.gitsigns.enable = true; }; diff --git a/modules/moritz/programs/nvim/plugins/helpview.nix b/modules/moritz/programs/nvim/plugins/helpview.nix index 6b00df4..38f43c8 100644 --- a/modules/moritz/programs/nvim/plugins/helpview.nix +++ b/modules/moritz/programs/nvim/plugins/helpview.nix @@ -1,11 +1,6 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.helpview.enable = true; - performance.combinePlugins.standalonePlugins = [ "helpview.nvim" ]; + performance.combinePlugins.standalonePlugins = ["helpview.nvim"]; }; } diff --git a/modules/moritz/programs/nvim/plugins/hmts.nix b/modules/moritz/programs/nvim/plugins/hmts.nix index 041793f..c1c158c 100644 --- a/modules/moritz/programs/nvim/plugins/hmts.nix +++ b/modules/moritz/programs/nvim/plugins/hmts.nix @@ -1,11 +1,6 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.hmts.enable = true; - performance.combinePlugins.standalonePlugins = [ "hmts.nvim" ]; + performance.combinePlugins.standalonePlugins = ["hmts.nvim"]; }; } diff --git a/modules/moritz/programs/nvim/plugins/keymaps.nix b/modules/moritz/programs/nvim/plugins/keymaps.nix index 7c14693..99f06f1 100644 --- a/modules/moritz/programs/nvim/plugins/keymaps.nix +++ b/modules/moritz/programs/nvim/plugins/keymaps.nix @@ -1,15 +1,30 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { keymaps = [ - { key = ""; action = "noh"; options.desc = "Escape and clear hlsearch"; mode = [ "i" "n" ]; } - { key = "<"; action = "n" = { action.__raw = ''function() return vim.cmd("ObsidianNew") end''; opts.desc = "New Note"; opts.buffer = true; }; - "q" = { action.__raw = ''function() return vim.cmd("ObsidianQuickSwitch") end''; opts.desc = "Quick Switch"; opts.buffer = true; }; - "b" = { action.__raw = ''function() return vim.cmd("ObsidianBacklinks") end''; opts.desc = "Backlinks"; opts.buffer = true; }; - "l" = { action.__raw = ''function() return vim.cmd("ObsidianLink") end''; opts.desc = "Link"; opts.buffer = true; }; - "e" = { action.__raw = ''function() return vim.cmd("ObsidianExtractNote") end''; opts.desc = "Extract Note"; opts.buffer = true; }; - "r" = { action.__raw = ''function() return vim.cmd("ObsidianRename") end''; opts.desc = "Rename"; opts.buffer = true; }; - "" = { action.__raw = ''function() return require("obsidian").util.smart_action() end''; opts.buffer = true; opts.expr = true; }; - "gf" = { action.__raw = ''function() return require("obsidian").util.gf_passthrough() end''; opts = { noremap = false; expr = true; buffer = true; }; }; + "n" = { + action.__raw = ''function() return vim.cmd("ObsidianNew") end''; + opts.desc = "New Note"; + opts.buffer = true; + }; + "q" = { + action.__raw = ''function() return vim.cmd("ObsidianQuickSwitch") end''; + opts.desc = "Quick Switch"; + opts.buffer = true; + }; + "b" = { + action.__raw = ''function() return vim.cmd("ObsidianBacklinks") end''; + opts.desc = "Backlinks"; + opts.buffer = true; + }; + "l" = { + action.__raw = ''function() return vim.cmd("ObsidianLink") end''; + opts.desc = "Link"; + opts.buffer = true; + }; + "e" = { + action.__raw = ''function() return vim.cmd("ObsidianExtractNote") end''; + opts.desc = "Extract Note"; + opts.buffer = true; + }; + "r" = { + action.__raw = ''function() return vim.cmd("ObsidianRename") end''; + opts.desc = "Rename"; + opts.buffer = true; + }; + "" = { + action.__raw = ''function() return require("obsidian").util.smart_action() end''; + opts.buffer = true; + opts.expr = true; + }; + "gf" = { + action.__raw = ''function() return require("obsidian").util.gf_passthrough() end''; + opts = { + noremap = false; + expr = true; + buffer = true; + }; + }; }; }; }; diff --git a/modules/moritz/programs/nvim/plugins/oil.nix b/modules/moritz/programs/nvim/plugins/oil.nix index 5e0fc85..aee93f5 100644 --- a/modules/moritz/programs/nvim/plugins/oil.nix +++ b/modules/moritz/programs/nvim/plugins/oil.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.oil.enable = true; performance.combinePlugins.standalonePlugins = [ diff --git a/modules/moritz/programs/nvim/plugins/otter.nix b/modules/moritz/programs/nvim/plugins/otter.nix index 5117cc7..c68cfae 100644 --- a/modules/moritz/programs/nvim/plugins/otter.nix +++ b/modules/moritz/programs/nvim/plugins/otter.nix @@ -1,6 +1,4 @@ -_: - -{ +_: { home-manager.users.moritz.programs.nixvim.plugins.otter = { enable = true; }; diff --git a/modules/moritz/programs/nvim/plugins/render-markdown.nix b/modules/moritz/programs/nvim/plugins/render-markdown.nix index a2a9b0a..370a879 100644 --- a/modules/moritz/programs/nvim/plugins/render-markdown.nix +++ b/modules/moritz/programs/nvim/plugins/render-markdown.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim.plugins.render-markdown = { enable = true; settings.latex.enable = false; diff --git a/modules/moritz/programs/nvim/plugins/snacks.nix b/modules/moritz/programs/nvim/plugins/snacks.nix index 8f2cddb..2c5bed1 100644 --- a/modules/moritz/programs/nvim/plugins/snacks.nix +++ b/modules/moritz/programs/nvim/plugins/snacks.nix @@ -1,6 +1,4 @@ -_: - -{ +_: { home-manager.users.moritz.programs.nixvim = { keymaps = [ { diff --git a/modules/moritz/programs/nvim/plugins/telescope.nix b/modules/moritz/programs/nvim/plugins/telescope.nix index 689f6dc..ae69da1 100644 --- a/modules/moritz/programs/nvim/plugins/telescope.nix +++ b/modules/moritz/programs/nvim/plugins/telescope.nix @@ -1,10 +1,8 @@ -_: - -{ +_: { home-manager.users.moritz.programs.nixvim = { autoCmd = [ { - event = [ "VimEnter" ]; + event = ["VimEnter"]; callback.__raw = '' function() if vim.fn.len(vim.api.nvim_get_vvar("argv")) <= 8 then diff --git a/modules/moritz/programs/nvim/plugins/todo-comments.nix b/modules/moritz/programs/nvim/plugins/todo-comments.nix index 288c4e4..36b053b 100644 --- a/modules/moritz/programs/nvim/plugins/todo-comments.nix +++ b/modules/moritz/programs/nvim/plugins/todo-comments.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.todo-comments = { enable = true; diff --git a/modules/moritz/programs/nvim/plugins/treesitter-textobjects.nix b/modules/moritz/programs/nvim/plugins/treesitter-textobjects.nix index 589b923..5ad0a09 100644 --- a/modules/moritz/programs/nvim/plugins/treesitter-textobjects.nix +++ b/modules/moritz/programs/nvim/plugins/treesitter-textobjects.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.treesitter-textobjects = { enable = true; diff --git a/modules/moritz/programs/nvim/plugins/treesitter.nix b/modules/moritz/programs/nvim/plugins/treesitter.nix index b85ddc2..f1cc3f4 100644 --- a/modules/moritz/programs/nvim/plugins/treesitter.nix +++ b/modules/moritz/programs/nvim/plugins/treesitter.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.treesitter = { enable = true; @@ -17,7 +12,7 @@ in keymaps.node_decremental = "gp"; keymaps.node_incremental = "gn"; }; - lazyLoad.settings.event = [ "DeferredUIEnter" ]; + lazyLoad.settings.event = ["DeferredUIEnter"]; }; performance.combinePlugins.standalonePlugins = [ "nvim-treesitter" diff --git a/modules/moritz/programs/nvim/plugins/ts-context-commentstring.nix b/modules/moritz/programs/nvim/plugins/ts-context-commentstring.nix index 14dd92a..553bd55 100644 --- a/modules/moritz/programs/nvim/plugins/ts-context-commentstring.nix +++ b/modules/moritz/programs/nvim/plugins/ts-context-commentstring.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.ts-context-commentstring.enable = true; }; diff --git a/modules/moritz/programs/nvim/plugins/vim-beancount.nix b/modules/moritz/programs/nvim/plugins/vim-beancount.nix index f40b90e..a83e9ad 100644 --- a/modules/moritz/programs/nvim/plugins/vim-beancount.nix +++ b/modules/moritz/programs/nvim/plugins/vim-beancount.nix @@ -1,8 +1,6 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { home-manager.users.moritz.programs.nixvim = { - extraPlugins = with pkgs.vimPlugins; [ vim-beancount ]; + extraPlugins = with pkgs.vimPlugins; [vim-beancount]; performance.combinePlugins.standalonePlugins = [ "vim-beancount" ]; diff --git a/modules/moritz/programs/nvim/plugins/vim-surround.nix b/modules/moritz/programs/nvim/plugins/vim-surround.nix index 08f8c0d..862f132 100644 --- a/modules/moritz/programs/nvim/plugins/vim-surround.nix +++ b/modules/moritz/programs/nvim/plugins/vim-surround.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.vim-surround.enable = true; }; diff --git a/modules/moritz/programs/nvim/plugins/vimtex.nix b/modules/moritz/programs/nvim/plugins/vimtex.nix index b775417..0b40b0d 100644 --- a/modules/moritz/programs/nvim/plugins/vimtex.nix +++ b/modules/moritz/programs/nvim/plugins/vimtex.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{pkgs, ...}: { home-manager.users.moritz.programs.nixvim = { plugins.vimtex = { enable = true; diff --git a/modules/moritz/programs/nvim/plugins/which-key.nix b/modules/moritz/programs/nvim/plugins/which-key.nix index e4e4eec..8e68e9a 100644 --- a/modules/moritz/programs/nvim/plugins/which-key.nix +++ b/modules/moritz/programs/nvim/plugins/which-key.nix @@ -1,9 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: - -let - inherit (lib) mkEnableOption mkIf readFile; -in -{ +{...}: { home-manager.users.moritz.programs.nixvim = { plugins.which-key.enable = true; }; diff --git a/modules/moritz/programs/prismlauncher.nix b/modules/moritz/programs/prismlauncher.nix index fe8dda2..e3ef1c6 100644 --- a/modules/moritz/programs/prismlauncher.nix +++ b/modules/moritz/programs/prismlauncher.nix @@ -1,23 +1,22 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: - -with lib; -let +with lib; let cfg = config.my.programs.prismlauncher; - prismlauncher = pkgs.runCommandNoCC "prismlauncher" + prismlauncher = + pkgs.runCommandNoCC "prismlauncher" { - nativeBuildInputs = [ pkgs.makeWrapper ]; + nativeBuildInputs = [pkgs.makeWrapper]; } '' - makeWrapper ${lib.getExe pkgs.prismlauncher} $out/bin/prismlauncher \ - --set QT_STYLE_OVERRIDE "" \ - --set QT_QPA_PLATFORMTHEME "gtk3" - ''; -in -{ + makeWrapper ${lib.getExe pkgs.prismlauncher} $out/bin/prismlauncher \ + --set QT_STYLE_OVERRIDE "" \ + --set QT_QPA_PLATFORMTHEME "gtk3" + ''; +in { options.my.programs.prismlauncher.enable = mkEnableOption "prismlauncher"; config = mkIf cfg.enable { @@ -25,6 +24,6 @@ in ".local/share/PrismLauncher/" ]; - users.users.moritz.packages = [ prismlauncher ]; + users.users.moritz.packages = [prismlauncher]; }; } diff --git a/modules/moritz/programs/python.nix b/modules/moritz/programs/python.nix index 9fbfb26..213cb5f 100644 --- a/modules/moritz/programs/python.nix +++ b/modules/moritz/programs/python.nix @@ -1,10 +1,9 @@ -{ config -, lib -, pkgs -, ... -}: - -let +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) range filterAttrs attrNames foldl' head tail mkOption mkEnableOption intersectLists genAttrs flip getAttr; inherit (lib.types) listOf enum package; @@ -15,29 +14,27 @@ let pythonPackages = version: attrNames pkgs."python${version}Packages"; - commonPackages = - let - packageLists = map pythonPackages (attrNames enabledVersions); - in + commonPackages = let + packageLists = map pythonPackages (attrNames enabledVersions); + in foldl' intersectLists (head packageLists) (tail packageLists); versionOpts = version: { enable = mkEnableOption (toString version); pythonPackages = mkOption { - default = [ ]; + default = []; type = listOf (enum (pythonPackages version)); }; }; -in -{ +in { options.my.programs.python = { versions = genAttrs pythonVersions versionOpts; defaultPackages = mkOption { - default = [ ]; + default = []; type = listOf (enum commonPackages); }; extraPackages = mkOption { - default = [ ]; + default = []; type = listOf package; }; }; @@ -46,15 +43,15 @@ in users.users.moritz.packages = ( let - mkPython = version: - let - package = pkgs."python${version}"; - finalPythonPackages = cfg.versions.${version}.pythonPackages ++ cfg.defaultPackages; - getPythonPackages = ps: map (flip getAttr ps) finalPythonPackages; - in + mkPython = version: let + package = pkgs."python${version}"; + finalPythonPackages = cfg.versions.${version}.pythonPackages ++ cfg.defaultPackages; + getPythonPackages = ps: map (flip getAttr ps) finalPythonPackages; + in package.withPackages getPythonPackages; in - map mkPython (attrNames enabledVersions) - ) ++ cfg.extraPackages; + map mkPython (attrNames enabledVersions) + ) + ++ cfg.extraPackages; }; } diff --git a/modules/moritz/programs/river/default.nix b/modules/moritz/programs/river/default.nix index 5436ea1..20356fa 100644 --- a/modules/moritz/programs/river/default.nix +++ b/modules/moritz/programs/river/default.nix @@ -1,22 +1,19 @@ -{ config -, lib -, pkgs -, ... -}: - - -let +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) mkEnableOption mkIf mkOption types; cfg = config.my.programs.river; -in -{ +in { options.my.programs.river = { enable = mkEnableOption "river"; keyboardLayouts = mkOption { type = types.listOf types.str; description = "List of keyboard layouts."; - default = [ "us" "de" ]; + default = ["us" "de"]; }; nvidiaSupport = mkEnableOption "nvidia gpu support"; }; @@ -69,68 +66,74 @@ in passthrough = { "Super F11" = "enter-mode normal"; }; - normal = { - "Super Q" = "close"; - "Super Return" = "spawn '${config.my.terminal.package}'"; - "Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' ''; - "Super W" = ''spawn "pkill -USR1 waybar"''; - "Super+Shift R" = "spawn ~/.config/river/init"; + normal = + { + "Super Q" = "close"; + "Super Return" = "spawn '${config.my.terminal.package}'"; + "Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' ''; + "Super W" = ''spawn "pkill -USR1 waybar"''; + "Super+Shift R" = "spawn ~/.config/river/init"; - # Focus view - "Super J" = "focus-view next"; - "Super K" = "focus-view previous"; + # Focus view + "Super J" = "focus-view next"; + "Super K" = "focus-view previous"; - # swap the focused view - "Super+Shift J" = "swap next"; - "Super+Shift K" = "swap previous"; + # swap the focused view + "Super+Shift J" = "swap next"; + "Super+Shift K" = "swap previous"; - # focus output - "Super Period" = "focus-output next"; - "Super Comma" = "focus-output previous"; + # focus output + "Super Period" = "focus-output next"; + "Super Comma" = "focus-output previous"; - # send to output - "Super+Shift Period" = "send-to-output next"; - "Super+Shift Comma" = "send-to-output previous"; + # send to output + "Super+Shift Period" = "send-to-output next"; + "Super+Shift Comma" = "send-to-output previous"; - # bump in layout stack - "Super Z" = "zoom"; + # bump in layout stack + "Super Z" = "zoom"; - # lock screen - "Super+Alt L" = ''spawn "loginctl lock-session"''; - "Control I" = ''spawn "loginctl lock-session"''; + # lock screen + "Super+Alt L" = ''spawn "loginctl lock-session"''; + "Control I" = ''spawn "loginctl lock-session"''; - # XF86 keys - "None XF86AudioLowerVolume" = "spawn 'pamixer -d 5'"; - "None XF86AudioRaiseVolume" = "spawn 'pamixer -i 5'"; - "None XF86AudioMute" = "spawn 'pamixer -t'"; - "None XF86AudioNext" = "spawn 'playerctl -p spotifyd,firefox next'"; - "None XF86AudioPlay" = "spawn 'playerctl -p spotifyd,firefox play-pause'"; - "None XF86AudioPrev" = "spawn 'playerctl -p spotifyd,firefox previous'"; + # XF86 keys + "None XF86AudioLowerVolume" = "spawn 'pamixer -d 5'"; + "None XF86AudioRaiseVolume" = "spawn 'pamixer -i 5'"; + "None XF86AudioMute" = "spawn 'pamixer -t'"; + "None XF86AudioNext" = "spawn 'playerctl -p spotifyd,firefox next'"; + "None XF86AudioPlay" = "spawn 'playerctl -p spotifyd,firefox play-pause'"; + "None XF86AudioPrev" = "spawn 'playerctl -p spotifyd,firefox previous'"; - "Super F11" = "enter-mode passthrough"; - } // - # tags - ( - let - numbers = lib.range 1 9; - toTag = num: "$((1 << (${toString num} - 1)))"; + "Super F11" = "enter-mode passthrough"; + } + // + # tags + ( + let + numbers = lib.range 1 9; + toTag = num: "$((1 << (${toString num} - 1)))"; - mkMappings = num: - let + mkMappings = num: let numStr = toString num; tag = toTag num; - in - [ + in [ # Super+Control+[1-9] to toggle focus of tag [0-8] - { name = "Super ${numStr}"; value = "set-focused-tags ${tag}"; } + { + name = "Super ${numStr}"; + value = "set-focused-tags ${tag}"; + } # Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view - { name = "Super+Shift ${numStr}"; value = "toggle-view-tags ${tag}"; } + { + name = "Super+Shift ${numStr}"; + value = "toggle-view-tags ${tag}"; + } ]; - mappings = lib.flatten (map mkMappings numbers); - in - lib.listToAttrs mappings - ); + mappings = lib.flatten (map mkMappings numbers); + in + lib.listToAttrs mappings + ); }; map-pointer.normal = { "Super BTN_LEFT" = "move-view"; @@ -147,12 +150,16 @@ in set-cursor-warp = "on-focus-change"; keyboard-layout = "-options grp:win_space_toggle,caps:escape ${lib.concatStringsSep "," cfg.keyboardLayouts}"; }; - extraConfig = /* bash */ '' - rivercarro_pid="$(pidof rivercarro)" - if [[ -z $rivercarro_pid ]]; then - rivercarro -inner-gaps 4 -outer-gaps 4 & - fi - ''; + extraConfig = + /* + bash + */ + '' + rivercarro_pid="$(pidof rivercarro)" + if [[ -z $rivercarro_pid ]]; then + rivercarro -inner-gaps 4 -outer-gaps 4 & + fi + ''; }; # add waybar as a status bar @@ -171,9 +178,9 @@ in layer = "top"; position = "top"; height = 20; - modules-left = [ "river/tags" ]; - modules-center = [ "river/window" ]; - modules-right = [ "network" "memory" "cpu" "battery" "clock" ]; + modules-left = ["river/tags"]; + modules-center = ["river/window"]; + modules-right = ["network" "memory" "cpu" "battery" "clock"]; }; }; style = lib.readFile ./style.css; @@ -198,26 +205,24 @@ in command = "${lib.getExe pkgs.swaylock} -fF"; } ]; - timeouts = - let - lockTimeout = 10; - in - [ - { - timeout = lockTimeout * 60 - 10; - command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'"; - } - { - timeout = lockTimeout * 60 + 10; - command = "${pkgs.systemd}/bin/loginctl lock-session"; - } - ]; + timeouts = let + lockTimeout = 10; + in [ + { + timeout = lockTimeout * 60 - 10; + command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'"; + } + { + timeout = lockTimeout * 60 + 10; + command = "${pkgs.systemd}/bin/loginctl lock-session"; + } + ]; systemdTarget = "river-session.target"; }; }; # adds pam module for swaylock - security.pam.services.swaylock = { }; + security.pam.services.swaylock = {}; users.users.moritz.packages = with pkgs; [ brightnessctl # control brightness @@ -229,7 +234,6 @@ in wl-clipboard # clipboard tool for wayland ]; - # additional environment variables environment.sessionVariables = { @@ -241,7 +245,8 @@ in QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; QT_QPA_PLATFORMTHEME = "qt5ct"; _JAVA_AWT_WM_NONEREPARENTING = "1"; - } // (lib.optionalAttrs cfg.nvidiaSupport + } + // (lib.optionalAttrs cfg.nvidiaSupport { GBM_BACKEND = "nvidia-drm"; GDK_BACKEND = "wayland"; diff --git a/modules/moritz/programs/scripts/default.nix b/modules/moritz/programs/scripts/default.nix index 8ba75ed..09bd6eb 100644 --- a/modules/moritz/programs/scripts/default.nix +++ b/modules/moritz/programs/scripts/default.nix @@ -1,15 +1,18 @@ -{ lib, pkgs, config, ... }: - -let +{ + lib, + pkgs, + config, + ... +}: let cfg = config.my.scripts; inherit (lib) readFile; - fishFile = - { name - , destination - , content - , checkPhase ? null - }: + fishFile = { + name, + destination, + content, + checkPhase ? null, + }: pkgs.writeTextFile { inherit name destination; executable = true; @@ -22,7 +25,8 @@ let ''; checkPhase = - if checkPhase == null then '' + if checkPhase == null + then '' runHook preCheck ${lib.getExe pkgs.fish} -n "$target" runHook postCheck @@ -30,142 +34,169 @@ let else checkPhase; }; - writeFishApplication = - { name - , text - , completions ? null - , runtimeInputs ? [ ] - , checkPhase ? null - }: - let - runtimeHeader = lib.optionalString (runtimeInputs != [ ]) - ''export PATH="${lib.makeBinPath runtimeInputs}:$PATH"''; + writeFishApplication = { + name, + text, + completions ? null, + runtimeInputs ? [], + checkPhase ? null, + }: let + runtimeHeader = + lib.optionalString (runtimeInputs != []) + ''export PATH="${lib.makeBinPath runtimeInputs}:$PATH"''; - script = fishFile { - inherit checkPhase; - name = "${name}_script"; - destination = "/bin/${name}"; - content = lib.concatLines [ runtimeHeader text ]; - }; - completions_file = fishFile { - inherit checkPhase; - name = "${name}_completions"; - destination = "/share/fish/vendor_completions.d/${name}.fish"; - content = lib.concatLines [ runtimeHeader completions ]; - }; - in + script = fishFile { + inherit checkPhase; + name = "${name}_script"; + destination = "/bin/${name}"; + content = lib.concatLines [runtimeHeader text]; + }; + completions_file = fishFile { + inherit checkPhase; + name = "${name}_completions"; + destination = "/share/fish/vendor_completions.d/${name}.fish"; + content = lib.concatLines [runtimeHeader completions]; + }; + in pkgs.symlinkJoin { inherit name; - paths = [ - script - ] ++ lib.optional (completions != null) completions_file; + paths = + [ + script + ] + ++ lib.optional (completions != null) completions_file; }; which-nix = writeFishApplication { name = "which-nix"; - runtimeInputs = with pkgs; [ which coreutils-full procps ]; - text = /* fish */ '' - function recurse -a path; - if not test -f "$path" - return + runtimeInputs = with pkgs; [which coreutils-full procps]; + text = + /* + fish + */ + '' + function recurse -a path; + if not test -f "$path" + return + end + + echo $path + if test -L $path + recurse (readlink $path) + end end - echo $path - if test -L $path - recurse (readlink $path) + for arg in $argv + recurse (which $arg) end - end - - for arg in $argv - recurse (which $arg) - end - ''; - completions = /* fish */ '' - complete -c which-nix -fa '(__fish_complete_command)' - ''; + ''; + completions = + /* + fish + */ + '' + complete -c which-nix -fa '(__fish_complete_command)' + ''; }; gi = writeFishApplication { name = "gi"; - runtimeInputs = with pkgs; [ fzf gum curl coreutils-full ]; - text = /* fish */ '' - set url https://www.gitignore.io/api + runtimeInputs = with pkgs; [fzf gum curl coreutils-full]; + text = + /* + fish + */ + '' + set url https://www.gitignore.io/api - if test (count $argv) -eq 0 - set choice ( curl -sL $url/list \ - | string split "," \ - | fzf -m \ - | string join "," ) - else - set choice (string join "," $argv[1..]) - end + if test (count $argv) -eq 0 + set choice ( curl -sL $url/list \ + | string split "," \ + | fzf -m \ + | string join "," ) + else + set choice (string join "," $argv[1..]) + end - set contents "$(curl -sL $url/$choice | head -n -2 | tail -n +4)" + set contents "$(curl -sL $url/$choice | head -n -2 | tail -n +4)" - if gum confirm "Overwrite current .gitignore?" - echo "$contents" > .gitignore - else - echo "$contents" >> .gitignore - end - ''; - completions = /* fish */ '' - set args (curl -sL https://www.gitignore.io/api/list | string split ",") - complete -c gi -fa "$args" - ''; + if gum confirm "Overwrite current .gitignore?" + echo "$contents" > .gitignore + else + echo "$contents" >> .gitignore + end + ''; + completions = + /* + fish + */ + '' + set args (curl -sL https://www.gitignore.io/api/list | string split ",") + complete -c gi -fa "$args" + ''; }; tmux-switch = pkgs.writeShellApplication { name = "tmux-switch"; - runtimeInputs = with pkgs; [ tmux ]; - text = /* bash */ '' - if [[ -z ''${TMUX+x} ]]; then - tmux attach -t "$1" - else - tmux switch-client -t "$1" - fi - ''; + runtimeInputs = with pkgs; [tmux]; + text = + /* + bash + */ + '' + if [[ -z ''${TMUX+x} ]]; then + tmux attach -t "$1" + else + tmux switch-client -t "$1" + fi + ''; }; tmux-sessionizer = pkgs.writeFishApplication { name = "ts"; - runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd tmux-new gawk ]; + runtimeInputs = with pkgs; [tmux findutils coreutils procps fd tmux-new gawk]; text = readFile ./tmux-sessionizer/script.fish; completions = readFile ./tmux-sessionizer/completions.fish; }; tmux-attach = pkgs.writeFishApplication { name = "ta"; - runtimeInputs = with pkgs; [ tmux tmux-switch ]; + runtimeInputs = with pkgs; [tmux tmux-switch]; text = readFile ./tmux-attach/script.fish; completions = readFile ./tmux-attach/completions.fish; }; tmux-new = pkgs.writeFishApplication { name = "tn"; - runtimeInputs = with pkgs; [ tmux ]; - text = /* fish */ '' - if ! tmux has-session -t $argv[1] 2> /dev/null - tmux new-session -ds $argv[1] -c $argv[2] - end + runtimeInputs = with pkgs; [tmux]; + text = + /* + fish + */ + '' + if ! tmux has-session -t $argv[1] 2> /dev/null + tmux new-session -ds $argv[1] -c $argv[2] + end - tmux-switch $argv[1] - ''; + tmux-switch $argv[1] + ''; }; -in -{ +in { options.my.scripts = { enable = lib.mkEnableOption "My Scripts"; }; config = lib.mkIf cfg.enable { - environment.systemPackages = [ - which-nix - gi - ] ++ lib.optional config.my.programs.tmux.enable [ - tmux-sessionizer - tmux-attach - tmux-switch - tmux-new - ]; + environment.systemPackages = + [ + which-nix + gi + ] + ++ lib.optional config.my.programs.tmux.enable [ + tmux-sessionizer + tmux-attach + tmux-switch + tmux-new + ]; }; } diff --git a/modules/moritz/programs/spotify_player.nix b/modules/moritz/programs/spotify_player.nix index 435b9c8..921975f 100644 --- a/modules/moritz/programs/spotify_player.nix +++ b/modules/moritz/programs/spotify_player.nix @@ -1,15 +1,13 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.programs.spotify-player; - toml = pkgs.formats.toml { }; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.programs.spotify-player; + toml = pkgs.formats.toml {}; +in { options.my.programs.spotify-player = { enable = mkEnableOption "spotify-player"; package = mkOption { @@ -18,7 +16,7 @@ in }; config = mkOption { inherit (toml) type; - default = { }; + default = {}; }; }; @@ -27,7 +25,7 @@ in xdg.configFile."spotify-player/app.toml" = { source = toml.generate "app.toml" cfg.config; }; - home.packages = [ cfg.package ]; + home.packages = [cfg.package]; }; }; } diff --git a/modules/moritz/programs/ssh.nix b/modules/moritz/programs/ssh.nix index 3c6d5ee..af71370 100644 --- a/modules/moritz/programs/ssh.nix +++ b/modules/moritz/programs/ssh.nix @@ -1,27 +1,25 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.programs.ssh; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.programs.ssh; +in { options.my.programs.ssh = { enable = mkEnableOption "ssh"; includes = mkOption { - default = [ ]; + default = []; type = with types; listOf str; }; }; config = mkIf cfg.enable - { - home-manager.users.moritz.programs.ssh = { - inherit (cfg) includes; - enable = true; - }; + { + home-manager.users.moritz.programs.ssh = { + inherit (cfg) includes; + enable = true; }; + }; } diff --git a/modules/moritz/programs/thunar.nix b/modules/moritz/programs/thunar.nix index 3a6a6c7..36c2e9b 100644 --- a/modules/moritz/programs/thunar.nix +++ b/modules/moritz/programs/thunar.nix @@ -1,14 +1,12 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.programs.thunar; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.programs.thunar; +in { options.my.programs.thunar.enable = mkEnableOption "thunar"; config = mkIf cfg.enable { diff --git a/modules/moritz/programs/tmux/default.nix b/modules/moritz/programs/tmux/default.nix index aadce26..44839b4 100644 --- a/modules/moritz/programs/tmux/default.nix +++ b/modules/moritz/programs/tmux/default.nix @@ -1,28 +1,18 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.my.programs.tmux; - - tmux-switch = pkgs.writeShellApplication { - name = "tmux-switch"; - runtimeInputs = with pkgs; [ tmux ]; - text = /* bash */ '' - if [[ -z ''${TMUX+x} ]]; then - tmux attach -t "$1" - else - tmux switch-client -t "$1" - fi - ''; - }; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.programs.tmux; +in { options.my.programs.tmux = { enable = mkEnableOption "tmux"; autoAttach = mkEnableOption "autoAttach"; keybinds = mkOption { type = with types; attrsOf (attrsOf str); - default = { }; + default = {}; description = "Keybinds for tmux"; example = literalExample '' { @@ -56,31 +46,28 @@ in vim-tmux-navigator yank ]; - extraConfig = - let - mkKeybind = table: mapAttrsToList (keybind: value: "bind-key -T ${table} '${keybind}' ${value}"); - keybinds = flatten (mapAttrsToList mkKeybind cfg.keybinds); - in - '' - # Keybinds - ${concatStringsSep "\n" keybinds} - ''; + extraConfig = let + mkKeybind = table: mapAttrsToList (keybind: value: "bind-key -T ${table} '${keybind}' ${value}"); + keybinds = flatten (mapAttrsToList mkKeybind cfg.keybinds); + in '' + # Keybinds + ${concatStringsSep "\n" keybinds} + ''; }; fzf.tmux.enableShellIntegration = true; - fish.interactiveShellInit = - let - insideVariables = [ "$TMUX" "$INSIDE_EMACS" "$EMACS" "$VIM" "$VSCODE_RESOLVING_ENVIRONMENT" ]; - insideVariableMissing = concatStringsSep " && " (map (x: "test -z ${x}") insideVariables); - in + fish.interactiveShellInit = let + insideVariables = ["$TMUX" "$INSIDE_EMACS" "$EMACS" "$VIM" "$VSCODE_RESOLVING_ENVIRONMENT"]; + insideVariableMissing = concatStringsSep " && " (map (x: "test -z ${x}") insideVariables); + in mkIf cfg.autoAttach - '' - if ! fish_is_root_user && test "$TERM_PROGRAM" != 'vscode' && ${insideVariableMissing} - if test -z $tmux_autostarted - set -x tmux_autostarted true - tn home ~ - end - end - ''; + '' + if ! fish_is_root_user && test "$TERM_PROGRAM" != 'vscode' && ${insideVariableMissing} + if test -z $tmux_autostarted + set -x tmux_autostarted true + tn home ~ + end + end + ''; }; }; } diff --git a/modules/moritz/programs/tofi.nix b/modules/moritz/programs/tofi.nix index 54913ca..e5ca135 100644 --- a/modules/moritz/programs/tofi.nix +++ b/modules/moritz/programs/tofi.nix @@ -1,25 +1,22 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: - -with lib; -let +with lib; let cfg = config.my.programs.tofi; - configText = - let - settingsStrings = mapAttrsToList (name: value: "${name} = ${value}") cfg.settings; - in + configText = let + settingsStrings = mapAttrsToList (name: value: "${name} = ${value}") cfg.settings; + in concatLines settingsStrings; -in -{ +in { options.my.programs.tofi = { enable = mkEnableOption "tofi"; settings = mkOption { type = with types; attrsOf str; - default = { }; + default = {}; }; }; @@ -30,7 +27,7 @@ in # rofi-power-menu ]; home-manager.users.moritz = { - home.packages = with pkgs; [ tofi ]; + home.packages = with pkgs; [tofi]; xdg = { enable = true; configFile."tofi/config".text = configText; diff --git a/modules/moritz/programs/wallpaper/default.nix b/modules/moritz/programs/wallpaper/default.nix index cd7a7c4..6abf8e9 100644 --- a/modules/moritz/programs/wallpaper/default.nix +++ b/modules/moritz/programs/wallpaper/default.nix @@ -1,11 +1,12 @@ -{ lib, config, pkgs, ... }: - - -with lib; -let +{ + lib, + config, + pkgs, + ... +}: +with lib; let cfg = config.my.programs.wallpaper; - script = pkgs.writeShellApplication { name = "wallpaper"; runtimeInputs = with pkgs; [ @@ -14,12 +15,11 @@ let feh swaybg fzf - (viu.override { withSixel = true; }) + (viu.override {withSixel = true;}) ]; text = builtins.readFile ./wallpaper.sh; }; -in -{ +in { options.my.programs.wallpaper = { enable = mkEnableOption "wallpaper"; package = mkOption { @@ -29,9 +29,8 @@ in }; config = mkIf cfg.enable { - environment.systemPackages = - [ - cfg.package - ]; + environment.systemPackages = [ + cfg.package + ]; }; } diff --git a/modules/moritz/programs/zathura.nix b/modules/moritz/programs/zathura.nix index d561c67..ed70058 100644 --- a/modules/moritz/programs/zathura.nix +++ b/modules/moritz/programs/zathura.nix @@ -1,13 +1,11 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.programs.zathura; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.programs.zathura; +in { options.my.programs.zathura.enable = mkEnableOption "zathura"; config = mkIf cfg.enable { diff --git a/modules/moritz/programs/zsh.nix b/modules/moritz/programs/zsh.nix index b8cc5ab..5d43a40 100644 --- a/modules/moritz/programs/zsh.nix +++ b/modules/moritz/programs/zsh.nix @@ -1,19 +1,17 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: - -with lib; -let +with lib; let cfg = config.my.programs.zsh; shellConfig = config.my.shell; -in -{ +in { options.my.programs.zsh.enable = mkEnableOption "zsh"; config = lib.mkIf cfg.enable { - environment.pathsToLink = [ "/share/zsh" ]; + environment.pathsToLink = ["/share/zsh"]; users.users.moritz.shell = pkgs.zsh; home-manager.users.moritz.programs = { zsh = { diff --git a/modules/moritz/security/default.nix b/modules/moritz/security/default.nix index e7b42fe..8f4642c 100644 --- a/modules/moritz/security/default.nix +++ b/modules/moritz/security/default.nix @@ -1,13 +1,13 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: { ## System security tweaks # Prevent replacing the running kernel w/o reboot # security.protectKernelImage = lib.mkDefault true; # NOTE disabled for now to enable hibernate boot = { - # tmpfs = /tmp is mounted in ram. Doing so makes temp file management speedy # on ssd systems, and volatile! Because it's wiped on reboot. tmp.useTmpfs = lib.mkDefault true; @@ -62,7 +62,7 @@ "net.ipv4.tcp_congestion_control" = "bbr"; "net.core.default_qdisc" = "cake"; }; - kernelModules = [ "tcp_bbr" ]; + kernelModules = ["tcp_bbr"]; }; # So we don't have to do this later... diff --git a/modules/moritz/services/dunst.nix b/modules/moritz/services/dunst.nix index db80828..02376e5 100644 --- a/modules/moritz/services/dunst.nix +++ b/modules/moritz/services/dunst.nix @@ -1,14 +1,11 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.services.dunst; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.services.dunst; +in { options.my.services.dunst.enable = mkEnableOption "dunst"; config = lib.mkIf cfg.enable { diff --git a/modules/moritz/services/gammastep.nix b/modules/moritz/services/gammastep.nix index 8c7b25e..daa9079 100644 --- a/modules/moritz/services/gammastep.nix +++ b/modules/moritz/services/gammastep.nix @@ -1,10 +1,11 @@ -{ config, lib, ... }: - -with lib; -let - cfg = config.my.services.gammastep; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.services.gammastep; +in { options.my.services.gammastep.enable = mkEnableOption "gammastep"; config = lib.mkIf cfg.enable { diff --git a/modules/moritz/services/kdeconnect.nix b/modules/moritz/services/kdeconnect.nix index 5725e02..5419731 100644 --- a/modules/moritz/services/kdeconnect.nix +++ b/modules/moritz/services/kdeconnect.nix @@ -1,17 +1,15 @@ -{ config -, lib -, ... +{ + config, + lib, + ... }: - -with lib; -let +with lib; let ports = { from = 1714; to = 1764; }; cfg = config.my.services.kdeconnect; -in -{ +in { options.my.services.kdeconnect.enable = mkEnableOption "kdeconnect"; config = mkIf cfg.enable { @@ -21,8 +19,8 @@ in home-manager.users.moritz.services.kdeconnect.enable = mkIf (!config.my.programs.gnome.enable) true; networking.firewall = { - allowedTCPPortRanges = [ ports ]; - allowedUDPPortRanges = [ ports ]; + allowedTCPPortRanges = [ports]; + allowedUDPPortRanges = [ports]; }; }; } diff --git a/modules/moritz/services/mullvad.nix b/modules/moritz/services/mullvad.nix index 581f06e..3da89d7 100644 --- a/modules/moritz/services/mullvad.nix +++ b/modules/moritz/services/mullvad.nix @@ -1,14 +1,12 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.services.mullvad; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.services.mullvad; +in { options.my.services.mullvad.enable = mkEnableOption "mullvad"; config = lib.mkIf cfg.enable { diff --git a/modules/moritz/services/ollama.nix b/modules/moritz/services/ollama.nix index 275d2c4..63a2d51 100644 --- a/modules/moritz/services/ollama.nix +++ b/modules/moritz/services/ollama.nix @@ -1,10 +1,12 @@ -{ lib, config, pkgs, ... }: - -with lib; -let - cfg = config.my.services.ollama; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.my.services.ollama; +in { options.my.services.ollama = { enable = mkEnableOption "ollama"; package = mkOption { @@ -15,7 +17,7 @@ in config = mkIf cfg.enable { systemd.user.services.ollama = { - after = [ "network.target" ]; + after = ["network.target"]; serviceConfig = { Type = "simple"; Restart = "on-failure"; diff --git a/modules/moritz/services/openconnect.nix b/modules/moritz/services/openconnect.nix index f5b857f..1c6ddee 100644 --- a/modules/moritz/services/openconnect.nix +++ b/modules/moritz/services/openconnect.nix @@ -1,13 +1,11 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.services.openconnect; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.services.openconnect; +in { options.my.services.openconnect.enable = mkEnableOption "openconnect"; config = lib.mkIf cfg.enable { diff --git a/modules/moritz/services/picom.nix b/modules/moritz/services/picom.nix index 13b0024..d10aaef 100644 --- a/modules/moritz/services/picom.nix +++ b/modules/moritz/services/picom.nix @@ -1,14 +1,12 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.services.picom; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.services.picom; +in { options.my.services.picom.enable = mkEnableOption "picom"; config = lib.mkIf cfg.enable { @@ -18,7 +16,7 @@ in package = pkgs.picom-next; settings = { blur = true; - blurExclude = [ "class_g = 'Polybar'" ]; + blurExclude = ["class_g = 'Polybar'"]; # improve performance glx-no-rebind-pixmap = true; @@ -43,7 +41,7 @@ in xrender-sync-fence = true; }; inactiveOpacity = 0.97; - opacityRules = [ "100:fullscreen" "100:class_g = 'Polybar'" ]; + opacityRules = ["100:fullscreen" "100:class_g = 'Polybar'"]; vSync = true; }; }; diff --git a/modules/moritz/services/printing.nix b/modules/moritz/services/printing.nix index c958654..e0485bb 100644 --- a/modules/moritz/services/printing.nix +++ b/modules/moritz/services/printing.nix @@ -1,17 +1,19 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.my.services.printing; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.services.printing; +in { options.my.services.printing.enable = mkEnableOption "printing"; config = lib.mkIf cfg.enable { services = { printing = { enable = true; - drivers = with pkgs; [ epson-escpr2 ]; + drivers = with pkgs; [epson-escpr2]; }; avahi = { enable = true; diff --git a/modules/moritz/services/spotify_player.nix b/modules/moritz/services/spotify_player.nix index a8dcd24..394ba45 100644 --- a/modules/moritz/services/spotify_player.nix +++ b/modules/moritz/services/spotify_player.nix @@ -1,8 +1,11 @@ -{ lib, config, pkgs, ... }: - -with lib; -let - toml = pkgs.formats.toml { }; +{ + lib, + config, + pkgs, + ... +}: +with lib; let + toml = pkgs.formats.toml {}; cfg = config.my.services.spotify-player; tomlConfig = @@ -10,17 +13,16 @@ let then cfg.configFile else toml.generate "app.toml" cfg.config; - configFolder = pkgs.runCommand "spotify-player-config" { } '' + configFolder = pkgs.runCommand "spotify-player-config" {} '' mkdir $out ln -s "${tomlConfig}" $out/app.toml ''; -in -{ +in { options.my.services.spotify-player = { enable = mkEnableOption "spotify_player"; config = mkOption { inherit (toml) type; - default = { }; + default = {}; }; configFile = mkOption { type = with types; nullOr path; @@ -39,17 +41,17 @@ in config = mkIf cfg.enable { assertions = [ { - assertion = cfg.config == { } || cfg.configFile == null; + assertion = cfg.config == {} || cfg.configFile == null; message = "At least one of the options 'config' or 'configFile' must be set."; } { - assertion = cfg.config != { } || cfg.configFile != null; + assertion = cfg.config != {} || cfg.configFile != null; message = "Only one of the options 'config' or 'configFile' may be set."; } ]; systemd.user.services.spotify-player = { - after = [ cfg.target "network.target" ]; - wantedBy = [ cfg.target ]; + after = [cfg.target "network.target"]; + wantedBy = [cfg.target]; serviceConfig = { Type = "forking"; Restart = "always"; diff --git a/modules/moritz/services/synology-drive.nix b/modules/moritz/services/synology-drive.nix index ac057cf..897d4fc 100644 --- a/modules/moritz/services/synology-drive.nix +++ b/modules/moritz/services/synology-drive.nix @@ -1,10 +1,12 @@ -{ lib, config, pkgs, ... }: - -with lib; -let - cfg = config.my.services.synology-drive; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.my.services.synology-drive; +in { options.my.services.synology-drive = { enable = mkEnableOption "synology-drive"; package = mkOption { @@ -21,9 +23,9 @@ in ]; systemd.user.services.synology-drive = { - after = [ "graphical-session.target" "network.target" ]; - partOf = [ "graphical-session.target" ]; - wantedBy = [ "graphical-session.target" ]; + after = ["graphical-session.target" "network.target"]; + partOf = ["graphical-session.target"]; + wantedBy = ["graphical-session.target"]; serviceConfig = { ExitType = "cgroup"; Restart = "always"; @@ -32,6 +34,6 @@ in ExecStart = "${cfg.package}/bin/synology-drive"; }; }; - environment.systemPackages = [ cfg.package ]; + environment.systemPackages = [cfg.package]; }; } diff --git a/modules/moritz/services/timers.nix b/modules/moritz/services/timers.nix index 47039fa..920232b 100644 --- a/modules/moritz/services/timers.nix +++ b/modules/moritz/services/timers.nix @@ -1,15 +1,13 @@ -{ config -, inputs -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.services.timers; -in { + config, + inputs, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.services.timers; +in { options.my.services.timers.enable = mkEnableOption "timers"; options.my.services.timers.package = mkOption { type = types.package; @@ -17,12 +15,12 @@ in }; config = lib.mkIf cfg.enable { - environment.systemPackages = [ cfg.package ]; + environment.systemPackages = [cfg.package]; systemd.user.services.timers-daemon = { - after = [ "graphical-session.target" ]; - partOf = [ "graphical-session.target" ]; - wantedBy = [ "graphical-session.target" ]; + after = ["graphical-session.target"]; + partOf = ["graphical-session.target"]; + wantedBy = ["graphical-session.target"]; serviceConfig = { Restart = "always"; RestartSec = "1s"; diff --git a/modules/moritz/services/wallpaper.nix b/modules/moritz/services/wallpaper.nix index 8329205..b62b861 100644 --- a/modules/moritz/services/wallpaper.nix +++ b/modules/moritz/services/wallpaper.nix @@ -1,9 +1,11 @@ -{ lib, config, ... }: -with lib; -let - cfg = config.my.services.wallpaper; -in { + lib, + config, + ... +}: +with lib; let + cfg = config.my.services.wallpaper; +in { options.my.services.wallpaper = { enable = mkEnableOption "wallpaper changer"; frequency = mkOption { @@ -19,8 +21,8 @@ in config = mkIf cfg.enable { systemd.user.services.wallpaper = { script = "${getExe config.my.programs.wallpaper.package} -r -v"; - wantedBy = [ cfg.target ]; - after = [ cfg.target ]; + wantedBy = [cfg.target]; + after = [cfg.target]; serviceConfig = { Restart = "always"; RuntimeMaxSec = cfg.frequency; diff --git a/modules/moritz/services/wireguard.nix b/modules/moritz/services/wireguard.nix index 8486fd4..beb7098 100644 --- a/modules/moritz/services/wireguard.nix +++ b/modules/moritz/services/wireguard.nix @@ -1,13 +1,11 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.services.wireguard; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.services.wireguard; +in { options.my.services.wireguard.enable = mkEnableOption "wireguard"; config = lib.mkIf cfg.enable { @@ -21,21 +19,21 @@ in share = true; }; networking.firewall = { - allowedUDPPorts = [ 51820 ]; + allowedUDPPorts = [51820]; }; networking.wg-quick.interfaces = { wg0 = { autostart = false; - address = [ "10.8.0.3/24" ]; + address = ["10.8.0.3/24"]; listenPort = 51820; privateKeyFile = config.clan.core.vars.generators.moritz-wireguard.files.private-key.path; - dns = [ "192.168.0.4" "9.9.9.9" ]; + dns = ["192.168.0.4" "9.9.9.9"]; peers = [ { publicKey = "bT/U8ko3i//vH8LNn2R56JkGMg+0GLFrZSF81BBax08="; presharedKeyFile = config.clan.core.vars.generators.moritz-wireguard.files.preshared-key.path; # Forward all the traffic via VPN. - allowedIPs = [ "0.0.0.0/0" ]; + allowedIPs = ["0.0.0.0/0"]; endpoint = "wg.moritzboeh.me:51820"; persistentKeepalive = 25; } diff --git a/modules/moritz/virtualisation/podman.nix b/modules/moritz/virtualisation/podman.nix index 744004f..e88feb7 100644 --- a/modules/moritz/virtualisation/podman.nix +++ b/modules/moritz/virtualisation/podman.nix @@ -1,13 +1,11 @@ -{ config -, lib -, ... -}: - -with lib; -let - cfg = config.my.virtualisation.podman; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.my.virtualisation.podman; +in { options.my.virtualisation.podman.enable = mkEnableOption "podman"; config = mkIf cfg.enable { diff --git a/modules/moritz/virtualisation/virtualisation.nix b/modules/moritz/virtualisation/virtualisation.nix index 0f32600..1cf2148 100644 --- a/modules/moritz/virtualisation/virtualisation.nix +++ b/modules/moritz/virtualisation/virtualisation.nix @@ -1,14 +1,12 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.virtualisation.libvirtd; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.my.virtualisation.libvirtd; +in { options.my.virtualisation.libvirtd.enable = mkEnableOption "libvirtd"; config = mkIf cfg.enable { @@ -20,8 +18,8 @@ in programs.dconf.enable = true; users.users.moritz = { - extraGroups = [ "libvirtd" ]; - packages = with pkgs; [ virt-manager virt-viewer ]; + extraGroups = ["libvirtd"]; + packages = with pkgs; [virt-manager virt-viewer]; }; }; } diff --git a/modules/remote_builders.nix b/modules/remote_builders.nix index 60f8374..241d3d1 100644 --- a/modules/remote_builders.nix +++ b/modules/remote_builders.nix @@ -4,10 +4,9 @@ pkgs, self, ... -}: - -let - inherit (lib) +}: let + inherit + (lib) filterAttrs mkEnableOption mkIf @@ -20,48 +19,49 @@ let ; cfg = config.our.buildMachines; - others = filterAttrs (n: v: n != config.networking.hostName) self.nixosConfigurations; + others = filterAttrs (n: _v: n != config.networking.hostName) self.nixosConfigurations; - max = a: b: if a > b then a else b; + max = a: b: + if a > b + then a + else b; - mkBuilder = - hostName: attrs: - let - config' = attrs.config; - cfg' = config'.our.buildMachines; - pkgs' = attrs.pkgs; - in + mkBuilder = hostName: attrs: let + config' = attrs.config; + cfg' = config'.our.buildMachines; + pkgs' = attrs.pkgs; + in mkIf cfg'.enable { hostName = hostName; sshUser = "remotebuild"; # CPU architecture of the builder, and the operating system it runs. # If your builder supports multiple architectures # (e.g. search for "binfmt" for emulation), - systems = [ pkgs'.system ] ++ config'.boot.binfmt.emulatedSystems; + systems = [pkgs'.system] ++ config'.boot.binfmt.emulatedSystems; # Nix custom ssh-variant that avoids lots of "trusted-users" settings pain protocol = "ssh-ng"; # default is 1 but may keep the builder idle in between builds maxJobs = 3; speedFactor = max (cfg'.speedFactor - cfg.speedFactor + 1) 1; supportedFeatures = cfg'.supportedFeatures; - mandatoryFeatures = [ ]; + mandatoryFeatures = []; }; buildMachines = mapAttrsToList mkBuilder others; - remotebuildKeys = mapAttrsToList ( - _name: attrs: attrs.config.clan.core.vars.generators.remotebuild.files."ssh.id_ed25519.pub".value - ) others; + remotebuildKeys = + mapAttrsToList ( + _name: attrs: attrs.config.clan.core.vars.generators.remotebuild.files."ssh.id_ed25519.pub".value + ) + others; - mkMatch = host: - '' - Match User remotebuild Host ${host} - IdentityFile ${config.clan.core.vars.generators.remotebuild.files."ssh.id_ed25519".path} - ''; + mkMatch = host: '' + Match User remotebuild Host ${host} + IdentityFile ${config.clan.core.vars.generators.remotebuild.files."ssh.id_ed25519".path} + ''; othersName = attrNames others; sshConfig = concatLines (map mkMatch othersName); -in -{ +in { options.our.buildMachines = { enable = mkEnableOption "Use this machine as a remoteBuilder for others and vice versa."; supportedFeatures = mkOption { @@ -73,7 +73,7 @@ in "kvm" ] ); - default = [ ]; + default = []; description = '' kvm | Everything which builds inside a vm, like NixOS tests nixos-test | Machine can run NixOS tests @@ -96,10 +96,10 @@ in openssh.authorizedKeys.keys = remotebuildKeys; }; - users.groups.remotebuild = { }; + users.groups.remotebuild = {}; clan.core.vars.generators.remotebuild = { - files."ssh.id_ed25519" = { }; + files."ssh.id_ed25519" = {}; files."ssh.id_ed25519.pub".secret = false; runtimeInputs = [ pkgs.coreutils @@ -119,7 +119,7 @@ in # optional, useful when the builder has a faster internet connection than yours settings = { builders-use-substitutes = true; - trusted-users = [ "remotebuild" ]; + trusted-users = ["remotebuild"]; }; }; }; diff --git a/modules/shared.nix b/modules/shared.nix index 12bc959..c75006a 100644 --- a/modules/shared.nix +++ b/modules/shared.nix @@ -1,5 +1,8 @@ -{ config, clan-core, ... }: { + config, + clan-core, + ... +}: { imports = [ clan-core.clanModules.sshd clan-core.clanModules.root-password @@ -10,7 +13,7 @@ ./remote_builders.nix ]; - networking.hosts."fd77:acc0:1d56:2265:499:9367:28e0:97d3" = [ "moritz-remarkable" ]; + networking.hosts."fd77:acc0:1d56:2265:499:9367:28e0:97d3" = ["moritz-remarkable"]; # Locale service discovery and mDNS services.avahi.enable = true; diff --git a/modules/zfs_unencrypted.nix b/modules/zfs_unencrypted.nix index bff8dd0..8c47af6 100644 --- a/modules/zfs_unencrypted.nix +++ b/modules/zfs_unencrypted.nix @@ -1,13 +1,10 @@ -{ lib -, clan-core -, config -, ... -}: - -let - suffix = config.clan.core.vars.generators.disk-id.files.diskId.value; -in { + clan-core, + config, + ... +}: let + suffix = config.clan.core.vars.generators.disk-id.files.diskId.value; +in { imports = [ clan-core.clanModules.disk-id ]; @@ -36,7 +33,7 @@ in type = "filesystem"; format = "vfat"; mountpoint = "/boot"; - mountOptions = [ "nofail" ]; + mountOptions = ["nofail"]; }; }; "zfs" = {