style: format everything

This commit is contained in:
Moritz Böhme 2025-04-13 17:58:17 +02:00
parent ca77e23d40
commit 7c7e9317db
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

View file

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

View file

@ -1,11 +1,13 @@
# 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 =
[
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];

View file

@ -15,10 +15,12 @@
networking = {
interfaces.enp2s0 = {
ipv4.addresses = [{
ipv4.addresses = [
{
address = "192.168.0.3";
prefixLength = 24;
}];
}
];
};
defaultGateway = {
address = "192.168.0.1";

View file

@ -1,27 +1,21 @@
{ lib, ... }:
rec {
mkDate = longDate: lib.concatStringsSep "-" [
{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
mkVersionInput = input: let
date = mkDate (input.lastModifiedDate or "19700101");
rev = input.shortRev or "dirty";
in
"unstable-${date}_${rev}";
in "unstable-${date}_${rev}";
mapModules = f: dir:
let
filterModules = name: type:
let
mapModules = f: dir: let
filterModules = name: type: let
isPublic = !(lib.hasPrefix "_" name);
isSomething = type != null;
isModule =
let
isModule = let
path = "${toString dir}/${name}";
isDefault = type == "directory" && builtins.pathExists "${path}/default.nix";
isFile = type == "regular" && lib.hasSuffix ".nix" name && name != "default.nix";
@ -32,8 +26,7 @@ rec {
modulesInDir = lib.filterAttrs filterModules (builtins.readDir dir);
mkModule = name: _:
let
mkModule = name: _: let
path = "${toString dir}/${name}";
normalizedName =
if name == "default.nix"
@ -48,10 +41,8 @@ rec {
listModules = mapModules' (path: path);
mapModulesRec = f: dir:
let
filterDirs = name: type:
let
mapModulesRec = f: dir: let
filterDirs = name: type: let
isPublic = !(lib.hasPrefix "_" name);
isSomething = type != null;
isDir = type == "directory";
@ -61,18 +52,20 @@ rec {
subDirs = lib.filterAttrs filterDirs (builtins.readDir dir);
mkSubModule = name: _:
let
mkSubModule = name: _: let
path = "${toString dir}/${name}";
in
lib.nameValuePair name (mapModulesRec f path);
in
mapModules f dir //
(lib.mapAttrs' mkSubModule subDirs);
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);
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));

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,9 +1,5 @@
{ lib
, ...
}:
with lib;
{
{lib, ...}:
with lib; {
options.my.shell = {
abbreviations = mkOption {
default = {};

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
font = let
fontBasePath = pkgs.nerd-fonts.fira-code;
in
"${fontBasePath}/share/fonts/truetype/NerdFonts/FiraCodeNerdFont-Regular.ttf";
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,8 +36,7 @@ in
prompt = "#${green}";
spinner = "#${orange}";
};
kitty.extraConfig =
''
kitty.extraConfig = ''
# https://draculatheme.com/kitty
foreground #f8f8f2
background #282a36

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
{lib, ...}: let
myLib = import ../lib.nix {inherit lib;};
in
{
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 = [];
type = types.listOf overlayType;
example = literalExpression
example =
literalExpression
''
[
(self: super: {
@ -41,11 +43,11 @@ in
};
config.nixpkgs = {
overlays =
let
overlays = let
channelOverlays = _: prev:
mapAttrs
(_: value:
(
_: value:
import value {
inherit (prev) system;
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;
@ -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 {
@ -99,7 +97,6 @@ in
})
];
fonts = {
enableDefaultPackages = true;
packages = [

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

View file

@ -1,10 +1,13 @@
{ 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 = [
@ -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"

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 {

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 {

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 {

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,14 +1,12 @@
{ 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 = {
@ -21,7 +19,6 @@ in
};
};
config = mkIf cfg.enable {
services.udev.packages = [pkgs.yubikey-personalization];
environment.systemPackages = with pkgs; [

View file

@ -1,13 +1,11 @@
{ 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 {

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 {
@ -15,8 +14,7 @@ let
'';
runtimeInputs = [cfg.package];
};
in
{
in {
options.my.programs.aider = {
enable = mkEnableOption "ssh";
package = mkPackageOption pkgs "aider-chat" {};

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 {

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,10 +15,12 @@ in
};
extensions = mkOption {
type = types.listOf types.package;
default = with pkgs.vscode-extensions; [
default = with pkgs.vscode-extensions;
[
bbenoist.nix
vscodevim.vim
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
]
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "copilot-nightly";
publisher = "GitHub";
@ -42,13 +42,15 @@ in
};
config = mkIf cfg.enable {
environment.systemPackages =
let
environment.systemPackages = let
withExtensions = pkgs.vscode-with-extensions.override {
vscode = cfg.package;
vscodeExtensions = cfg.extensions;
};
maybeExtensions = if cfg.extensions == [ ] then cfg.package else withExtensions;
maybeExtensions =
if cfg.extensions == []
then cfg.package
else withExtensions;
withWayland = pkgs.symlinkJoin {
name = "${maybeExtensions.name}-wayland";
paths = [maybeExtensions];
@ -58,8 +60,10 @@ in
--set NIXOS_OZONE_WL 1
'';
};
final = if cfg.wayland then withWayland else maybeExtensions;
in
[ final ];
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,16 +1,14 @@
{ 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 = {
@ -18,7 +16,8 @@ in
overrides = mkOption {
default = {};
type = with types; attrsOf (oneOf [str bool int]);
apply = overrides: concatStrings (
apply = overrides:
concatStrings (
mapAttrsToList
(
name: value: ''
@ -39,23 +38,20 @@ in
config = mkIf cfg.enable {
home-manager.users.moritz.programs.firefox = {
enable = true;
policies =
let
policies = let
removeExtensions = ["Google" "Amazon.de" "Bing" "Amazon" "Wikipedia (en)" "Wikipedia (de)"];
convertName = name:
let
convertName = name: let
lower = toLower name;
escaped = replaceStrings ["."] ["dot"] lower;
sanitized = head (splitString " " escaped);
in
"${sanitized}@search.mozilla.org";
in
{
in "${sanitized}@search.mozilla.org";
in {
SearchEngines = mkIf (hasInfix "esr" cfg.package) {
Default = "Kagi";
Remove = removeExtensions;
};
ExtensionSettings = genAttrs
ExtensionSettings =
genAttrs
(map convertName removeExtensions)
(_: {installation_mode = "blocked";});
};

View file

@ -1,21 +1,18 @@
{ config
, lib
, pkgs
, ...
{
config,
lib,
pkgs,
...
}:
with lib;
let
with lib; let
cfg = config.my.programs.fish;
shellConfig = config.my.shell;
exportedVariables =
let
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 {
@ -29,7 +26,8 @@ in
programs = {
fish = {
enable = true;
plugins = [{
plugins = [
{
name = "fish-completion-sync";
src = pkgs.fetchFromGitHub {
owner = "pfgray";
@ -37,10 +35,15 @@ in
rev = "ba70b6457228af520751eab48430b1b995e3e0e2";
sha256 = "sha256-JdOLsZZ1VFRv7zA2i/QEZ1eovOym/Wccn0SJyhiP9hI=";
};
}];
}
];
shellAbbrs = shellConfig.abbreviations;
shellAliases = shellConfig.aliases;
shellInit = /* fish */ ''
shellInit =
/*
fish
*/
''
# Vi Mode
fish_vi_key_bindings
@ -85,7 +88,11 @@ in
# Completions
complete -c c -kfa '(zoxide query -l | sed "s|$HOME|~|")'
${optionalString config.virtualisation.podman.dockerCompat /* fish */ "complete -c docker -w podman"}
${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"

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,20 +1,17 @@
{ 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 = ''

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,7 +37,9 @@ in
home-manager.users.moritz.dconf.settings = {
"org/gnome/shell" = {
disable-user-extensions = false;
enabled-extensions = map (p: p.extensionUuid or p.uuid) extensions ++ [
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"
];

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,8 +36,7 @@ in
xdg.configFile."ideavim/ideavimrc" = {
source = ./ideavimrc;
};
home.packages =
let
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 {
@ -22,8 +21,7 @@ let
'';
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,8 +14,7 @@ in
variables = {
LEDGER_FILE = "/home/moritz/Nextcloud/Notes/ledger/main.ledger";
};
aliases =
let
aliases = let
applyCommon = _: command: "${command} --payee note --strict --explicit";
in
mapAttrs applyCommon {
@ -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,14 +1,12 @@
{ 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 {

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,22 +1,22 @@
{ 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" // {
options.my.programs.niri.autoStart =
mkEnableOption "auto start niri"
// {
default = true;
};
@ -95,11 +95,9 @@ in
command = "${lib.getExe pkgs.swaylock} -fF";
}
];
timeouts =
let
timeouts = let
lockTimeout = 10;
in
[
in [
{
timeout = lockTimeout * 60 - 10;
command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'";

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

View file

@ -1,13 +1,18 @@
{ config, lib, pkgs, inputs, ... }:
let
{
config,
lib,
pkgs,
inputs,
...
}: let
inherit (lib) mkEnableOption mkIf readFile;
myLib = import ../../../lib.nix {inherit lib;};
cfg = config.my.programs.nvim;
in
{
imports = (myLib.listModulesRec ./plugins) ++ [
in {
imports =
(myLib.listModulesRec ./plugins)
++ [
{
home-manager.sharedModules = [
inputs.nixvim.homeManagerModules.nixvim
@ -26,7 +31,6 @@ in
];
home-manager.users.moritz = {
home.packages = with pkgs; [
xdotool # for vimtex
];

View file

@ -1,11 +1,12 @@
{ 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 = {

View file

@ -1,9 +1,11 @@
{ lib, pkgs, inputs, ... }:
{
{...}: {
home-manager.users.moritz.programs.nixvim = {
plugins.blink-compat.enable = true;
plugins.lsp.capabilities = /* lua */ ''
plugins.lsp.capabilities =
/*
lua
*/
''
capabilities = require('blink.cmp').get_lsp_capabilities(capabilities)
'';
plugins.blink-cmp = {

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,9 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim = {
plugins.conform-nvim = {
enable = true;
@ -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,9 +1,4 @@
{ 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"];

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,9 +1,4 @@
{ 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"];

View file

@ -1,9 +1,4 @@
{ 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"];

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,9 +1,4 @@
{ 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"];

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;
@ -12,7 +7,11 @@ in
programs.nixvim = {
plugins.luasnip = {
lazyLoad.settings.event = ["InsertEnter"];
lazyLoad.settings.after = /* lua */ ''
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" })

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,9 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim = {
plugins.mini = {
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.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,6 +1,4 @@
_:
{
_: {
home-manager.users.moritz.programs.nixvim = {
autoCmd = [
{

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;

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,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home-manager.users.moritz.programs.nixvim = {
extraPlugins = with pkgs.vimPlugins; [vim-beancount];
performance.combinePlugins.standalonePlugins = [

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,14 +1,14 @@
{ 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];
} ''
@ -16,8 +16,7 @@ let
--set QT_STYLE_OVERRIDE "" \
--set QT_QPA_PLATFORMTHEME "gtk3"
'';
in
{
in {
options.my.programs.prismlauncher.enable = mkEnableOption "prismlauncher";
config = mkIf cfg.enable {

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,8 +14,7 @@ let
pythonPackages = version: attrNames pkgs."python${version}Packages";
commonPackages =
let
commonPackages = let
packageLists = map pythonPackages (attrNames enabledVersions);
in
foldl' intersectLists (head packageLists) (tail packageLists);
@ -28,8 +26,7 @@ let
type = listOf (enum (pythonPackages version));
};
};
in
{
in {
options.my.programs.python = {
versions = genAttrs pythonVersions versionOpts;
defaultPackages = mkOption {
@ -46,8 +43,7 @@ in
users.users.moritz.packages =
(
let
mkPython = version:
let
mkPython = version: let
package = pkgs."python${version}";
finalPythonPackages = cfg.versions.${version}.pythonPackages ++ cfg.defaultPackages;
getPythonPackages = ps: map (flip getAttr ps) finalPythonPackages;
@ -55,6 +51,7 @@ in
package.withPackages getPythonPackages;
in
map mkPython (attrNames enabledVersions)
) ++ cfg.extraPackages;
)
++ cfg.extraPackages;
};
}

View file

@ -1,16 +1,13 @@
{ 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 {
@ -69,7 +66,8 @@ in
passthrough = {
"Super F11" = "enter-mode normal";
};
normal = {
normal =
{
"Super Q" = "close";
"Super Return" = "spawn '${config.my.terminal.package}'";
"Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' '';
@ -108,24 +106,29 @@ in
"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)))";
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
@ -147,7 +150,11 @@ in
set-cursor-warp = "on-focus-change";
keyboard-layout = "-options grp:win_space_toggle,caps:escape ${lib.concatStringsSep "," cfg.keyboardLayouts}";
};
extraConfig = /* bash */ ''
extraConfig =
/*
bash
*/
''
rivercarro_pid="$(pidof rivercarro)"
if [[ -z $rivercarro_pid ]]; then
rivercarro -inner-gaps 4 -outer-gaps 4 &
@ -198,11 +205,9 @@ in
command = "${lib.getExe pkgs.swaylock} -fF";
}
];
timeouts =
let
timeouts = let
lockTimeout = 10;
in
[
in [
{
timeout = lockTimeout * 60 - 10;
command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'";
@ -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,14 +1,17 @@
{ 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;
@ -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,15 +34,15 @@ let
else checkPhase;
};
writeFishApplication =
{ name
, text
, completions ? null
, runtimeInputs ? [ ]
, checkPhase ? null
}:
let
runtimeHeader = lib.optionalString (runtimeInputs != [ ])
writeFishApplication = {
name,
text,
completions ? null,
runtimeInputs ? [],
checkPhase ? null,
}: let
runtimeHeader =
lib.optionalString (runtimeInputs != [])
''export PATH="${lib.makeBinPath runtimeInputs}:$PATH"'';
script = fishFile {
@ -56,15 +60,21 @@ let
in
pkgs.symlinkJoin {
inherit name;
paths = [
paths =
[
script
] ++ lib.optional (completions != null) completions_file;
]
++ lib.optional (completions != null) completions_file;
};
which-nix = writeFishApplication {
name = "which-nix";
runtimeInputs = with pkgs; [which coreutils-full procps];
text = /* fish */ ''
text =
/*
fish
*/
''
function recurse -a path;
if not test -f "$path"
return
@ -80,7 +90,11 @@ let
recurse (which $arg)
end
'';
completions = /* fish */ ''
completions =
/*
fish
*/
''
complete -c which-nix -fa '(__fish_complete_command)'
'';
};
@ -88,7 +102,11 @@ let
gi = writeFishApplication {
name = "gi";
runtimeInputs = with pkgs; [fzf gum curl coreutils-full];
text = /* fish */ ''
text =
/*
fish
*/
''
set url https://www.gitignore.io/api
if test (count $argv) -eq 0
@ -108,7 +126,11 @@ let
echo "$contents" >> .gitignore
end
'';
completions = /* fish */ ''
completions =
/*
fish
*/
''
set args (curl -sL https://www.gitignore.io/api/list | string split ",")
complete -c gi -fa "$args"
'';
@ -117,7 +139,11 @@ let
tmux-switch = pkgs.writeShellApplication {
name = "tmux-switch";
runtimeInputs = with pkgs; [tmux];
text = /* bash */ ''
text =
/*
bash
*/
''
if [[ -z ''${TMUX+x} ]]; then
tmux attach -t "$1"
else
@ -143,7 +169,11 @@ let
tmux-new = pkgs.writeFishApplication {
name = "tn";
runtimeInputs = with pkgs; [tmux];
text = /* fish */ ''
text =
/*
fish
*/
''
if ! tmux has-session -t $argv[1] 2> /dev/null
tmux new-session -ds $argv[1] -c $argv[2]
end
@ -151,17 +181,18 @@ let
tmux-switch $argv[1]
'';
};
in
{
in {
options.my.scripts = {
enable = lib.mkEnableOption "My Scripts";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
environment.systemPackages =
[
which-nix
gi
] ++ lib.optional config.my.programs.tmux.enable [
]
++ lib.optional config.my.programs.tmux.enable [
tmux-sessionizer
tmux-attach
tmux-switch

View file

@ -1,15 +1,13 @@
{ config
, lib
, pkgs
, ...
{
config,
lib,
pkgs,
...
}:
with lib;
let
with lib; let
cfg = config.my.programs.spotify-player;
toml = pkgs.formats.toml {};
in
{
in {
options.my.programs.spotify-player = {
enable = mkEnableOption "spotify-player";
package = mkOption {

View file

@ -1,13 +1,11 @@
{ 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 {

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,22 +1,12 @@
{ 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";
@ -56,19 +46,16 @@ in
vim-tmux-navigator
yank
];
extraConfig =
let
extraConfig = let
mkKeybind = table: mapAttrsToList (keybind: value: "bind-key -T ${table} '${keybind}' ${value}");
keybinds = flatten (mapAttrsToList mkKeybind cfg.keybinds);
in
''
in ''
# Keybinds
${concatStringsSep "\n" keybinds}
'';
};
fzf.tmux.enableShellIntegration = true;
fish.interactiveShellInit =
let
fish.interactiveShellInit = let
insideVariables = ["$TMUX" "$INSIDE_EMACS" "$EMACS" "$VIM" "$VSCODE_RESOLVING_ENVIRONMENT"];
insideVariableMissing = concatStringsSep " && " (map (x: "test -z ${x}") insideVariables);
in

View file

@ -1,20 +1,17 @@
{ config
, lib
, pkgs
, ...
{
config,
lib,
pkgs,
...
}:
with lib;
let
with lib; let
cfg = config.my.programs.tofi;
configText =
let
configText = let
settingsStrings = mapAttrsToList (name: value: "${name} = ${value}") cfg.settings;
in
concatLines settingsStrings;
in
{
in {
options.my.programs.tofi = {
enable = mkEnableOption "tofi";
settings = mkOption {

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; [
@ -18,8 +19,7 @@ let
];
text = builtins.readFile ./wallpaper.sh;
};
in
{
in {
options.my.programs.wallpaper = {
enable = mkEnableOption "wallpaper";
package = mkOption {
@ -29,8 +29,7 @@ in
};
config = mkIf cfg.enable {
environment.systemPackages =
[
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