style: format everything

This commit is contained in:
Moritz Böhme 2025-04-13 17:58:17 +02:00
parent f4c27362c4
commit 4da8981990
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
120 changed files with 1550 additions and 1655 deletions

View file

@ -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;

View file

@ -1,6 +1,4 @@
{ lib, pkgs, ... }:
{
{pkgs, ...}: {
# needed for zfs pool
networking.hostId = "1f8b8073";
disko.devices = {

View file

@ -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

View file

@ -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";

View file

@ -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);

View file

@ -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 {

View file

@ -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;
};
};

View file

@ -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.";

View file

@ -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}";

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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";

View file

@ -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
];

View file

@ -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 {

View file

@ -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 ./.;
}

View file

@ -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;
};

View file

@ -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;

View file

@ -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"];
};
};
}

View file

@ -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";

View file

@ -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 . "$@"
'';

View file

@ -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 {

View file

@ -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";

View file

@ -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"];
};
};
};

View file

@ -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";

View file

@ -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 {

View file

@ -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 {

View file

@ -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"];
});
};
};

View file

@ -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"];
};
}

View file

@ -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];
};
}

View file

@ -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];
};
}

View file

@ -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];
};
}

View file

@ -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 {

View file

@ -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

View file

@ -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";

View file

@ -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 {

View file

@ -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;
};
};

View file

@ -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 {

View file

@ -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 = [ "<Super>q" ];
"org/gnome/desktop/wm/keybindings".minimize = [ ];
"org/gnome/desktop/wm/keybindings".move-to-monitor-down = [ "<Shift><Super>j" ];
"org/gnome/desktop/wm/keybindings".move-to-monitor-left = [ "<Shift><Super>h" ];
"org/gnome/desktop/wm/keybindings".move-to-monitor-right = [ "<Shift><Super>l" ];
"org/gnome/desktop/wm/keybindings".move-to-monitor-up = [ "<Shift><Super>k" ];
"org/gnome/desktop/wm/keybindings".move-to-workspace-1 = [ "<Shift><Super>1" ];
"org/gnome/desktop/wm/keybindings".move-to-workspace-2 = [ "<Shift><Super>2" ];
"org/gnome/desktop/wm/keybindings".move-to-workspace-3 = [ "<Shift><Super>3" ];
"org/gnome/desktop/wm/keybindings".move-to-workspace-4 = [ "<Shift><Super>4" ];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-1 = [ "<Super>1" ];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-2 = [ "<Super>2" ];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-3 = [ "<Super>3" ];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-4 = [ "<Super>4" ];
"org/gnome/desktop/wm/keybindings".close = ["<Super>q"];
"org/gnome/desktop/wm/keybindings".minimize = [];
"org/gnome/desktop/wm/keybindings".move-to-monitor-down = ["<Shift><Super>j"];
"org/gnome/desktop/wm/keybindings".move-to-monitor-left = ["<Shift><Super>h"];
"org/gnome/desktop/wm/keybindings".move-to-monitor-right = ["<Shift><Super>l"];
"org/gnome/desktop/wm/keybindings".move-to-monitor-up = ["<Shift><Super>k"];
"org/gnome/desktop/wm/keybindings".move-to-workspace-1 = ["<Shift><Super>1"];
"org/gnome/desktop/wm/keybindings".move-to-workspace-2 = ["<Shift><Super>2"];
"org/gnome/desktop/wm/keybindings".move-to-workspace-3 = ["<Shift><Super>3"];
"org/gnome/desktop/wm/keybindings".move-to-workspace-4 = ["<Shift><Super>4"];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-1 = ["<Super>1"];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-2 = ["<Super>2"];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-3 = ["<Super>3"];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-4 = ["<Super>4"];
"org/gnome/mutter".dynamic-workspaces = false;
"org/gnome/mutter/wayland/keybindings".restore-shortcuts = [ ];
"org/gnome/settings-daemon/plugins/media-keys".screensaver = [ "<Super>Escape" ];
"org/gnome/shell".favorite-apps = [ ];
"org/gnome/mutter/wayland/keybindings".restore-shortcuts = [];
"org/gnome/settings-daemon/plugins/media-keys".screensaver = ["<Super>Escape"];
"org/gnome/shell".favorite-apps = [];
"org/gnome/desktop/wm/preferences".num-workspaces = 4;
};
};

View file

@ -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 {

View file

@ -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;
};
};

View file

@ -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 {

View file

@ -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 = "!";
}
];
}
{

View file

@ -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" = {

View file

@ -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 {

View file

@ -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

View file

@ -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 {

View file

@ -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";

View file

@ -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;

View file

@ -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
];

View file

@ -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"];
};
};
};

View file

@ -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 = {

View file

@ -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;

View file

@ -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;
};

View file

@ -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";
}
];
};
}

View file

@ -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"];
};
}

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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"];
};
}

View file

@ -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"];
};
}

View file

@ -1,15 +1,30 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim = {
keymaps = [
{ key = "<esc>"; action = "<cmd>noh<cr><esc>"; options.desc = "Escape and clear hlsearch"; mode = [ "i" "n" ]; }
{ key = "<"; action = "<gv"; options.desc = "Shift left"; mode = [ "v" ]; }
{ key = ">"; action = ">gv"; options.desc = "Shift right"; mode = [ "v" ]; }
{ key = "y"; action = "ygv<esc>"; options.desc = "Yank"; mode = [ "v" ]; }
{
key = "<esc>";
action = "<cmd>noh<cr><esc>";
options.desc = "Escape and clear hlsearch";
mode = ["i" "n"];
}
{
key = "<";
action = "<gv";
options.desc = "Shift left";
mode = ["v"];
}
{
key = ">";
action = ">gv";
options.desc = "Shift right";
mode = ["v"];
}
{
key = "y";
action = "ygv<esc>";
options.desc = "Yank";
mode = ["v"];
}
];
};
}

View file

@ -1,9 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim = {
plugins.lastplace.enable = true;
};

View file

@ -1,9 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{pkgs, ...}: {
home-manager.users.moritz.programs.nixvim = {
extraPlugins = with pkgs.vimPlugins; [
elixir-tools-nvim

View file

@ -1,9 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim = {
plugins = {
lspsaga = {

View file

@ -1,11 +1,6 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim.plugins.lualine = {
enable = true;
lazyLoad.settings.event = [ "DeferredUIEnter" ];
lazyLoad.settings.event = ["DeferredUIEnter"];
};
}

View file

@ -1,9 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz = {
xdg.configFile."nvim/snippets" = {
recursive = true;
@ -11,14 +6,18 @@ in
};
programs.nixvim = {
plugins.luasnip = {
lazyLoad.settings.event = [ "InsertEnter" ];
lazyLoad.settings.after = /* lua */ ''
function()
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" })
require("luasnip.loaders.from_snipmate").lazy_load({ paths = "~/.config/nvim/snippets" })
require("luasnip.loaders.from_vscode").lazy_load()
end
'';
lazyLoad.settings.event = ["InsertEnter"];
lazyLoad.settings.after =
/*
lua
*/
''
function()
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" })
require("luasnip.loaders.from_snipmate").lazy_load({ paths = "~/.config/nvim/snippets" })
require("luasnip.loaders.from_vscode").lazy_load()
end
'';
enable = true;
settings = {
history = true;

View file

@ -1,8 +1,3 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim.plugins.lz-n.enable = true;
}

View file

@ -1,9 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim = {
plugins.markdown-preview.enable = true;
};

View file

@ -1,9 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim = {
plugins.marks = {
enable = true;

View file

@ -1,16 +1,11 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim = {
plugins.mini = {
enable = true;
modules = {
align = { };
align = {};
};
};
performance.combinePlugins.standalonePlugins = [ "mini.nvim" ];
performance.combinePlugins.standalonePlugins = ["mini.nvim"];
};
}

View file

@ -1,9 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim = {
plugins.nvim-autopairs.enable = true;
};

View file

@ -1,8 +1,3 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim.plugins.nvim-ufo.enable = true;
}

View file

@ -1,6 +1,4 @@
_:
{
_: {
home-manager.users.moritz.programs.nixvim = {
plugins.obsidian = {
enable = true;
@ -21,14 +19,49 @@ _:
end
'';
mappings = {
"<localleader>n" = { action.__raw = ''function() return vim.cmd("ObsidianNew") end''; opts.desc = "New Note"; opts.buffer = true; };
"<localleader>q" = { action.__raw = ''function() return vim.cmd("ObsidianQuickSwitch") end''; opts.desc = "Quick Switch"; opts.buffer = true; };
"<localleader>b" = { action.__raw = ''function() return vim.cmd("ObsidianBacklinks") end''; opts.desc = "Backlinks"; opts.buffer = true; };
"<localleader>l" = { action.__raw = ''function() return vim.cmd("ObsidianLink") end''; opts.desc = "Link"; opts.buffer = true; };
"<localleader>e" = { action.__raw = ''function() return vim.cmd("ObsidianExtractNote") end''; opts.desc = "Extract Note"; opts.buffer = true; };
"<localleader>r" = { action.__raw = ''function() return vim.cmd("ObsidianRename") end''; opts.desc = "Rename"; opts.buffer = true; };
"<cr>" = { 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; }; };
"<localleader>n" = {
action.__raw = ''function() return vim.cmd("ObsidianNew") end'';
opts.desc = "New Note";
opts.buffer = true;
};
"<localleader>q" = {
action.__raw = ''function() return vim.cmd("ObsidianQuickSwitch") end'';
opts.desc = "Quick Switch";
opts.buffer = true;
};
"<localleader>b" = {
action.__raw = ''function() return vim.cmd("ObsidianBacklinks") end'';
opts.desc = "Backlinks";
opts.buffer = true;
};
"<localleader>l" = {
action.__raw = ''function() return vim.cmd("ObsidianLink") end'';
opts.desc = "Link";
opts.buffer = true;
};
"<localleader>e" = {
action.__raw = ''function() return vim.cmd("ObsidianExtractNote") end'';
opts.desc = "Extract Note";
opts.buffer = true;
};
"<localleader>r" = {
action.__raw = ''function() return vim.cmd("ObsidianRename") end'';
opts.desc = "Rename";
opts.buffer = true;
};
"<cr>" = {
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;
};
};
};
};
};

View file

@ -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 = [

View file

@ -1,6 +1,4 @@
_:
{
_: {
home-manager.users.moritz.programs.nixvim.plugins.otter = {
enable = true;
};

View file

@ -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;

View file

@ -1,6 +1,4 @@
_:
{
_: {
home-manager.users.moritz.programs.nixvim = {
keymaps = [
{

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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"

View file

@ -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;
};

View file

@ -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"
];

View file

@ -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;
};

View file

@ -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;

View file

@ -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;
};

View file

@ -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];
};
}

View file

@ -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;
};
}

View file

@ -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";

View file

@ -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
];
};
}

View file

@ -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];
};
};
}

View file

@ -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;
};
};
}

View file

@ -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 {

View file

@ -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
'';
};
};
}

View file

@ -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;

View file

@ -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
];
};
}

View file

@ -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 {

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