Compare commits

...

4 commits

125 changed files with 1725 additions and 1736 deletions

3
.gitignore vendored
View file

@ -1,2 +1,5 @@
### direnv ###
.direnv
### pre-commit ###
.pre-commit-config.yaml

3
alejandra.toml Normal file
View file

@ -0,0 +1,3 @@
# (experimental) Configuration options for Alejandra
indentation = "TwoSpaces" # Or: FourSpaces, Tabs

112
flake.lock generated
View file

@ -176,6 +176,22 @@
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1733328505,
@ -191,7 +207,7 @@
"type": "github"
}
},
"flake-compat_2": {
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -207,7 +223,7 @@
"type": "github"
}
},
"flake-compat_3": {
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -344,8 +360,8 @@
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"flake-compat": "flake-compat_3",
"gitignore": "gitignore_2",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
@ -365,7 +381,48 @@
"type": "github"
}
},
"git-hooks-nix": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1742649964,
"narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gitignore_2": {
"inputs": {
"nixpkgs": [
"neovim-nightly-overlay",
@ -387,7 +444,7 @@
"type": "github"
}
},
"gitignore_2": {
"gitignore_3": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
@ -496,7 +553,7 @@
"jovian": {
"inputs": {
"nix-github-actions": "nix-github-actions",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1744436521,
@ -551,12 +608,12 @@
},
"neovim-nightly-overlay": {
"inputs": {
"flake-compat": "flake-compat",
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts_2",
"git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
@ -777,6 +834,22 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1730768919,
"narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1743583204,
"narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=",
@ -792,7 +865,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1744316434,
"narHash": "sha256-lzFCg/1C39pyY2hMB2gcuHV79ozpOz/Vu15hdjiFOfI=",
@ -808,7 +881,7 @@
"type": "github"
}
},
"nixpkgs_4": {
"nixpkgs_5": {
"locked": {
"lastModified": 1744442362,
"narHash": "sha256-i47t4DRIZgwBZw2Osbrp1OJhhO1k/n+QzRx+TrmfE9Y=",
@ -824,7 +897,7 @@
"type": "github"
}
},
"nixpkgs_5": {
"nixpkgs_6": {
"locked": {
"lastModified": 1744232761,
"narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=",
@ -840,7 +913,7 @@
"type": "github"
}
},
"nixpkgs_6": {
"nixpkgs_7": {
"locked": {
"lastModified": 1730768919,
"narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=",
@ -856,7 +929,7 @@
"type": "github"
}
},
"nixpkgs_7": {
"nixpkgs_8": {
"locked": {
"lastModified": 1692934111,
"narHash": "sha256-9EEE59v/esKNMR5zKbLRV9NoRPYvERw5jHQOnfr47bk=",
@ -899,7 +972,7 @@
"nur": {
"inputs": {
"flake-parts": "flake-parts_4",
"nixpkgs": "nixpkgs_5",
"nixpkgs": "nixpkgs_6",
"treefmt-nix": "treefmt-nix_3"
},
"locked": {
@ -941,9 +1014,9 @@
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat_3",
"gitignore": "gitignore_2",
"nixpkgs": "nixpkgs_6"
"flake-compat": "flake-compat_4",
"gitignore": "gitignore_3",
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1742649964,
@ -966,6 +1039,7 @@
"clan-core": "clan-core",
"filetags": "filetags",
"flake-parts": "flake-parts",
"git-hooks-nix": "git-hooks-nix",
"home-manager": "home-manager",
"impermanence": "impermanence",
"jovian": "jovian",
@ -974,7 +1048,7 @@
"niri": "niri",
"nix-index-database": "nix-index-database",
"nix-monitored": "nix-monitored",
"nixpkgs": "nixpkgs_4",
"nixpkgs": "nixpkgs_5",
"nixvim": "nixvim",
"nur": "nur",
"pre-commit-hooks": "pre-commit-hooks",
@ -1099,7 +1173,7 @@
"timers": {
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_7",
"nixpkgs": "nixpkgs_8",
"utils": "utils"
},
"locked": {

View file

@ -1,6 +1,5 @@
{
inputs =
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
master.url = "github:nixos/nixpkgs";
stable.url = "github:nixos/nixpkgs/nixos-24.11";
@ -8,11 +7,11 @@
# New flake-parts input
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
git-hooks-nix.url = "github:cachix/git-hooks.nix";
clan-core = {
url = "git+https://git.clan.lol/clan/clan-core";
inputs.nixpkgs.follows = "nixpkgs"; # Needed if your configuration uses nixpkgs unstable.
# New
inputs.flake-parts.follows = "flake-parts";
};
@ -58,7 +57,7 @@
};
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake { inherit inputs; } ({ self, pkgs, ... }: {
flake-parts.lib.mkFlake {inherit inputs;} ({self, ...}: {
# We define our own systems below. you can still use this to add system specific outputs to your flake.
# See: https://flake.parts/getting-started
systems = ["x86_64-linux"];
@ -66,11 +65,25 @@
# import clan-core modules
imports = [
inputs.clan-core.flakeModules.default
inputs.git-hooks-nix.flakeModule
];
perSystem = { config, inputs', pkgs, ... }: {
perSystem = {
config,
inputs',
pkgs,
...
}: {
devShells.default = pkgs.mkShell {
packages = [ inputs'.clan-core.packages.clan-cli ];
inherit (config.pre-commit.devShell) shellHook nativeBuildInputs;
packages = [inputs'.clan-core.packages.clan-cli pkgs.alejandra];
};
pre-commit.settings.hooks = {
alejandra.enable = true;
check-merge-conflicts.enable = true;
flake-checker.enable = true;
deadnix.enable = true;
nil.enable = true;
};
};

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
@ -53,6 +47,8 @@
stable.calibre # NOTE: breaks often in unstable
];
networking.firewall.allowedTCPPorts = [9090];
home-manager.users.moritz.services.kanshi.settings = [
{
profile.name = "default";

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

@ -12,13 +12,13 @@ vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.scrolloff = 4 -- lines of context
vim.opt.shiftround = true -- round indent
vim.opt.shiftwidth = 0 -- use tabstop value
vim.opt.shiftwidth = 2
vim.opt.softtabstop = 2
vim.opt.shortmess:append({ c = true })
vim.opt.signcolumn = "yes"
vim.opt.smartcase = true
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.tabstop = 2
vim.opt.termguicolors = true
vim.opt.undofile = true
vim.opt.undolevels = 10000

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,15 +1,9 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
{...}: {
home-manager.users.moritz.programs.nixvim = {
plugins.treesitter = {
enable = true;
folding = true;
nixvimInjections = true;
settings.indent.enable = true;
settings.highlight.enable = true;
settings.incremental_selection = {
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 {

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