Compare commits

...

4 commits

125 changed files with 1725 additions and 1736 deletions

3
.gitignore vendored
View file

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

View file

@ -1,6 +1,5 @@
{ {
inputs = inputs = {
{
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
master.url = "github:nixos/nixpkgs"; master.url = "github:nixos/nixpkgs";
stable.url = "github:nixos/nixpkgs/nixos-24.11"; stable.url = "github:nixos/nixpkgs/nixos-24.11";
@ -8,11 +7,11 @@
# New flake-parts input # New flake-parts input
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
git-hooks-nix.url = "github:cachix/git-hooks.nix";
clan-core = { clan-core = {
url = "git+https://git.clan.lol/clan/clan-core"; url = "git+https://git.clan.lol/clan/clan-core";
inputs.nixpkgs.follows = "nixpkgs"; # Needed if your configuration uses nixpkgs unstable. inputs.nixpkgs.follows = "nixpkgs"; # Needed if your configuration uses nixpkgs unstable.
# New
inputs.flake-parts.follows = "flake-parts"; inputs.flake-parts.follows = "flake-parts";
}; };
@ -57,20 +56,34 @@
arkenfox-userjs.flake = false; arkenfox-userjs.flake = false;
}; };
outputs = inputs@{ flake-parts, ... }: 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. # 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 # See: https://flake.parts/getting-started
systems = [ "x86_64-linux" ]; systems = ["x86_64-linux"];
# import clan-core modules # import clan-core modules
imports = [ imports = [
inputs.clan-core.flakeModules.default inputs.clan-core.flakeModules.default
inputs.git-hooks-nix.flakeModule
]; ];
perSystem = { config, inputs', pkgs, ... }: { perSystem = {
config,
inputs',
pkgs,
...
}: {
devShells.default = pkgs.mkShell { 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 # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ pkgs {pkgs, ...}: {
, config
, inputs
, ...
}:
{
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
@ -53,6 +47,8 @@
stable.calibre # NOTE: breaks often in unstable stable.calibre # NOTE: breaks often in unstable
]; ];
networking.firewall.allowedTCPPorts = [9090];
home-manager.users.moritz.services.kanshi.settings = [ home-manager.users.moritz.services.kanshi.settings = [
{ {
profile.name = "default"; profile.name = "default";
@ -83,7 +79,7 @@
boot = { boot = {
# BOOT # BOOT
supportedFilesystems = [ "zfs" "btrfs" "ntfs" ]; supportedFilesystems = ["zfs" "btrfs" "ntfs"];
loader = { loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
@ -96,7 +92,7 @@
address = "192.168.0.1"; address = "192.168.0.1";
interface = "enp6s0"; interface = "enp6s0";
}; };
nameservers = [ "192.168.0.4" ]; nameservers = ["192.168.0.4"];
useDHCP = false; useDHCP = false;
interfaces.enp6s0 = { interfaces.enp6s0 = {
ipv4.addresses = [ ipv4.addresses = [
@ -116,9 +112,9 @@
}; };
services = { services = {
xserver.videoDrivers = [ "nvidia" ]; xserver.videoDrivers = ["nvidia"];
xserver.xrandrHeads = [ xserver.xrandrHeads = [
{ output = "HDMI-1"; } {output = "HDMI-1";}
{ {
output = "HDMI-0"; output = "HDMI-0";
primary = true; primary = true;

View file

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

View file

@ -1,18 +1,20 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View file

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

View file

@ -1,27 +1,21 @@
{ lib, ... }: {lib, ...}: rec {
mkDate = longDate:
rec { lib.concatStringsSep "-" [
mkDate = longDate: lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate) (builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate) (builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate) (builtins.substring 6 2 longDate)
]; ];
mkVersionSrc = src: "unstable-" + builtins.substring 0 7 src.rev; mkVersionSrc = src: "unstable-" + builtins.substring 0 7 src.rev;
mkVersionInput = input: mkVersionInput = input: let
let
date = mkDate (input.lastModifiedDate or "19700101"); date = mkDate (input.lastModifiedDate or "19700101");
rev = input.shortRev or "dirty"; rev = input.shortRev or "dirty";
in in "unstable-${date}_${rev}";
"unstable-${date}_${rev}";
mapModules = f: dir: mapModules = f: dir: let
let filterModules = name: type: let
filterModules = name: type:
let
isPublic = !(lib.hasPrefix "_" name); isPublic = !(lib.hasPrefix "_" name);
isSomething = type != null; isSomething = type != null;
isModule = isModule = let
let
path = "${toString dir}/${name}"; path = "${toString dir}/${name}";
isDefault = type == "directory" && builtins.pathExists "${path}/default.nix"; isDefault = type == "directory" && builtins.pathExists "${path}/default.nix";
isFile = type == "regular" && lib.hasSuffix ".nix" name && name != "default.nix"; isFile = type == "regular" && lib.hasSuffix ".nix" name && name != "default.nix";
@ -32,8 +26,7 @@ rec {
modulesInDir = lib.filterAttrs filterModules (builtins.readDir dir); modulesInDir = lib.filterAttrs filterModules (builtins.readDir dir);
mkModule = name: _: mkModule = name: _: let
let
path = "${toString dir}/${name}"; path = "${toString dir}/${name}";
normalizedName = normalizedName =
if name == "default.nix" if name == "default.nix"
@ -48,10 +41,8 @@ rec {
listModules = mapModules' (path: path); listModules = mapModules' (path: path);
mapModulesRec = f: dir: mapModulesRec = f: dir: let
let filterDirs = name: type: let
filterDirs = name: type:
let
isPublic = !(lib.hasPrefix "_" name); isPublic = !(lib.hasPrefix "_" name);
isSomething = type != null; isSomething = type != null;
isDir = type == "directory"; isDir = type == "directory";
@ -61,18 +52,20 @@ rec {
subDirs = lib.filterAttrs filterDirs (builtins.readDir dir); subDirs = lib.filterAttrs filterDirs (builtins.readDir dir);
mkSubModule = name: _: mkSubModule = name: _: let
let
path = "${toString dir}/${name}"; path = "${toString dir}/${name}";
in in
lib.nameValuePair name (mapModulesRec f path); lib.nameValuePair name (mapModulesRec f path);
in in
mapModules f dir // mapModules f dir
(lib.mapAttrs' mkSubModule subDirs); // (lib.mapAttrs' mkSubModule subDirs);
mapModulesRec' = f: dir: mapModulesRec' = f: dir: let
let attrValuesRec = attrs:
attrValuesRec = attrs: map (values: if lib.isAttrs values then attrValuesRec values else values) (lib.attrValues attrs); map (values:
if lib.isAttrs values
then attrValuesRec values
else values) (lib.attrValues attrs);
in in
lib.flatten (attrValuesRec (mapModulesRec f dir)); 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"; options.my.ai.enable = lib.mkEnableOption "AI stuff";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -1,21 +1,17 @@
{ lib {lib, ...}:
, ... with lib; {
}:
with lib;
{
options.my.shell = { options.my.shell = {
abbreviations = mkOption { abbreviations = mkOption {
default = { }; default = {};
type = with types; attrsOf str; type = with types; attrsOf str;
example = { gs = "git status"; }; example = {gs = "git status";};
}; };
aliases = mkOption { aliases = mkOption {
default = { }; default = {};
type = with types; attrsOf str; type = with types; attrsOf str;
}; };
variables = mkOption { variables = mkOption {
default = { }; default = {};
type = with types; attrsOf str; type = with types; attrsOf str;
}; };
}; };

View file

@ -1,9 +1,5 @@
{ lib {lib, ...}:
, ... with lib; {
}:
with lib;
{
options.my.terminal = { options.my.terminal = {
package = mkOption { package = mkOption {
description = "Terminal emulator package to use. Gets converted to path of bin automatically."; 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 = { my.programs.tofi.settings = {
text-color = "#${text}"; text-color = "#${text}";
prompt-color = "#${red}"; 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 (import ./_catppuccin.nix
{ {
inherit config lib pkgs; 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 (import ./_catppuccin.nix
{ {
inherit config lib pkgs; 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 (import ./_catppuccin.nix
{ {
inherit config lib pkgs; 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 (import ./_catppuccin.nix
{ {
inherit config lib pkgs; 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 = [ imports = [
./dracula.nix ./dracula.nix
./catppuccin-frappe.nix ./catppuccin-frappe.nix
@ -33,11 +31,9 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
my.programs.tofi.settings = { my.programs.tofi.settings = {
font-size = "20"; font-size = "20";
font = font = let
let
fontBasePath = pkgs.nerd-fonts.fira-code; fontBasePath = pkgs.nerd-fonts.fira-code;
in in "${fontBasePath}/share/fonts/truetype/NerdFonts/FiraCodeNerdFont-Regular.ttf";
"${fontBasePath}/share/fonts/truetype/NerdFonts/FiraCodeNerdFont-Regular.ttf";
height = "360"; height = "360";
width = "720"; width = "720";
outline-width = "0"; outline-width = "0";

View file

@ -1,11 +1,10 @@
{ config {
, lib config,
, pkgs lib,
, ... pkgs,
...
}: }:
with lib; let
with lib;
let
cfg = config.my.theming; cfg = config.my.theming;
background = "282a36"; background = "282a36";
@ -19,8 +18,7 @@ let
purple = "bd93f9"; purple = "bd93f9";
red = "ff5555"; red = "ff5555";
yellow = "f1fa8c"; yellow = "f1fa8c";
in in {
{
config = mkIf (cfg.enable && cfg.scheme == "dracula") { config = mkIf (cfg.enable && cfg.scheme == "dracula") {
home-manager.users.moritz = { home-manager.users.moritz = {
programs = { programs = {
@ -38,8 +36,7 @@ in
prompt = "#${green}"; prompt = "#${green}";
spinner = "#${orange}"; spinner = "#${orange}";
}; };
kitty.extraConfig = kitty.extraConfig = ''
''
# https://draculatheme.com/kitty # https://draculatheme.com/kitty
foreground #f8f8f2 foreground #f8f8f2
background #282a36 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"; options.my.wallpapers.enable = mkEnableOption "wallpapers";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,7 +1,5 @@
{ lib, ... }: {lib, ...}: let
let myLib = import ../lib.nix {inherit lib;};
myLib = import ../lib.nix { inherit lib; }; in {
in
{
imports = myLib.listModulesRec ./.; imports = myLib.listModulesRec ./.;
} }

View file

@ -1,7 +1,9 @@
{ config, lib, ... }: {
config,
with lib; lib,
let ...
}:
with lib; let
cfg = config.my.nixpkgs; cfg = config.my.nixpkgs;
overlayType = mkOptionType { overlayType = mkOptionType {
@ -10,13 +12,13 @@ let
check = lib.isFunction; check = lib.isFunction;
merge = lib.mergeOneOption; merge = lib.mergeOneOption;
}; };
in in {
{
options.my.nixpkgs = { options.my.nixpkgs = {
overlays = mkOption { overlays = mkOption {
default = [ ]; default = [];
type = types.listOf overlayType; type = types.listOf overlayType;
example = literalExpression example =
literalExpression
'' ''
[ [
(self: super: { (self: super: {
@ -29,7 +31,7 @@ in
''; '';
}; };
channels = mkOption { channels = mkOption {
default = { }; default = {};
example = literalExpression '' example = literalExpression ''
{ {
stable = inputs.nixpkgs-stable; stable = inputs.nixpkgs-stable;
@ -41,11 +43,11 @@ in
}; };
config.nixpkgs = { config.nixpkgs = {
overlays = overlays = let
let
channelOverlays = _: prev: channelOverlays = _: prev:
mapAttrs mapAttrs
(_: value: (
_: value:
import value { import value {
inherit (prev) system; inherit (prev) system;
config.allowUnfree = true; config.allowUnfree = true;
@ -54,7 +56,7 @@ in
) )
cfg.channels; cfg.channels;
in in
cfg.overlays ++ [ channelOverlays ]; cfg.overlays ++ [channelOverlays];
config.allowUnfree = true; 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 = [ imports = [
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
]; ];
my = { my = {
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
(_: prev: (
{ _: prev: {
nur = import inputs.nur { nur = import inputs.nur {
pkgs = prev; pkgs = prev;
nurpkgs = prev; nurpkgs = prev;
@ -43,7 +40,7 @@ in
rm = "rm -i"; rm = "rm -i";
mv = "mv -i"; mv = "mv -i";
}; };
variables = { EDITOR = "vim"; }; variables = {EDITOR = "vim";};
}; };
programs = { programs = {
lazygit.enable = true; lazygit.enable = true;
@ -82,7 +79,7 @@ in
bottom bottom
# utils # utils
(viu.override { withSixel = true; }) (viu.override {withSixel = true;})
bat bat
cht-sh cht-sh
fd fd
@ -91,7 +88,6 @@ in
wget wget
]; ];
programs = { programs = {
mtr.enable = true; mtr.enable = true;
command-not-found.enable = false; command-not-found.enable = false;

View file

@ -1,15 +1,13 @@
{ lib {
, config lib,
, pkgs config,
, inputs pkgs,
, ... inputs,
}: ...
}: let
let
inherit (lib) mkEnableOption mkIf mkDefault; inherit (lib) mkEnableOption mkIf mkDefault;
cfg = config.my.profiles.desktop; cfg = config.my.profiles.desktop;
in in {
{
options.my.profiles.desktop.enable = mkEnableOption "desktop profile"; options.my.profiles.desktop.enable = mkEnableOption "desktop profile";
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -28,7 +26,7 @@ in
ghostty.settings = { ghostty.settings = {
font-family = "IntoneMono Nerd Font"; font-family = "IntoneMono Nerd Font";
window-decoration = false; window-decoration = false;
font-feature = [ "ss01" "ss02" ]; font-feature = ["ss01" "ss02"];
}; };
niri.enable = mkDefault true; niri.enable = mkDefault true;
nvim.enable = mkDefault true; nvim.enable = mkDefault true;
@ -36,13 +34,13 @@ in
spotify-player = { spotify-player = {
enable = mkDefault true; enable = mkDefault true;
package = pkgs.spotify-player.overrideAttrs (old: { package = pkgs.spotify-player.overrideAttrs (old: {
buildFeatures = lib.lists.remove "notify" (old.buildFeatures or [ ]); buildFeatures = lib.lists.remove "notify" (old.buildFeatures or []);
}); });
config = { config = {
client_id = "3172dbeaf64949728920c58b823bc24b"; client_id = "3172dbeaf64949728920c58b823bc24b";
copy_command = { copy_command = {
command = "wl-copy"; command = "wl-copy";
args = [ ]; args = [];
}; };
enable_cover_image_cache = true; enable_cover_image_cache = true;
default_device = "spotify-player-daemon"; default_device = "spotify-player-daemon";
@ -90,8 +88,8 @@ in
vlc vlc
(symlinkJoin { (symlinkJoin {
name = "obsidian-wayland"; name = "obsidian-wayland";
paths = [ obsidian ]; paths = [obsidian];
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [makeWrapper];
postBuild = '' postBuild = ''
wrapProgram $out/bin/obsidian \ wrapProgram $out/bin/obsidian \
--add-flags "--socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland" --add-flags "--socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland"
@ -99,7 +97,6 @@ in
}) })
]; ];
fonts = { fonts = {
enableDefaultPackages = true; enableDefaultPackages = true;
packages = [ packages = [
@ -142,7 +139,7 @@ in
systemd.services.NetworkManager-wait-online.enable = false; systemd.services.NetworkManager-wait-online.enable = false;
boot = { boot = {
consoleLogLevel = 0; consoleLogLevel = 0;
kernelParams = [ "quiet" "udev.log_level=3" ]; kernelParams = ["quiet" "udev.log_level=3"];
}; };
}; };
} }

View file

@ -1,15 +1,13 @@
{ lib
, config
, inputs
, pkgs
, ...
}:
with lib;
let
cfg = config.my.profiles.gaming;
in
{ {
lib,
config,
inputs,
pkgs,
...
}:
with lib; let
cfg = config.my.profiles.gaming;
in {
imports = [ imports = [
inputs.jovian.nixosModules.default inputs.jovian.nixosModules.default
]; ];
@ -17,14 +15,14 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
specialisation.gaming.configuration = { specialisation.gaming.configuration = {
imports = [ inputs.jovian.nixosModules.default ]; imports = [inputs.jovian.nixosModules.default];
environment.persistence."/persist".users.moritz.directories = [ environment.persistence."/persist".users.moritz.directories = [
".cache/lutris/" ".cache/lutris/"
".config/gamescope" ".config/gamescope"
".local/share/Steam/" ".local/share/Steam/"
".local/share/lutris/" ".local/share/lutris/"
]; ];
users.users.moritz.packages = [ pkgs.lutris ]; users.users.moritz.packages = [pkgs.lutris];
jovian.steam.enable = true; jovian.steam.enable = true;
jovian.steam.autoStart = true; jovian.steam.autoStart = true;
jovian.steam.user = "moritz"; jovian.steam.user = "moritz";

View file

@ -1,14 +1,17 @@
{ config, lib, pkgs, inputs, ... }:
with lib;
let
cfg = config.my.profiles.impermanence;
in
{ {
config,
lib,
pkgs,
inputs,
...
}:
with lib; let
cfg = config.my.profiles.impermanence;
in {
options.my.profiles.impermanence.enable = mkEnableOption "impermanence"; options.my.profiles.impermanence.enable = mkEnableOption "impermanence";
imports = [ imports = [
{ environment.persistence."/persist".enable = cfg.enable; } {environment.persistence."/persist".enable = cfg.enable;}
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence
]; ];
@ -48,9 +51,18 @@ in
"Music" "Music"
"Pictures" "Pictures"
"Videos" "Videos"
{ directory = ".gnupg"; mode = "0700"; } {
{ directory = ".local/share/keyrings"; mode = "0700"; } directory = ".gnupg";
{ directory = ".ssh"; mode = "0700"; } mode = "0700";
}
{
directory = ".local/share/keyrings";
mode = "0700";
}
{
directory = ".ssh";
mode = "0700";
}
]; ];
files = [ files = [
".local/share/fish/fish_history" ".local/share/fish/fish_history"
@ -62,8 +74,14 @@ in
users.root = { users.root = {
home = "/root"; home = "/root";
directories = [ directories = [
{ directory = ".gnupg"; mode = "0700"; } {
{ directory = ".ssh"; mode = "0700"; } directory = ".gnupg";
mode = "0700";
}
{
directory = ".ssh";
mode = "0700";
}
]; ];
files = [ files = [
".local/share/nix/trusted-settings.json" ".local/share/nix/trusted-settings.json"
@ -75,7 +93,7 @@ in
( (
pkgs.writeShellApplication { pkgs.writeShellApplication {
name = "zfs-diff"; name = "zfs-diff";
runtimeInputs = with pkgs; [ zfs coreutils parallel tree ]; runtimeInputs = with pkgs; [zfs coreutils parallel tree];
text = '' text = ''
zfs diff -F zroot/encrypted/root@blank | awk '$2 == "F" && system("test -e /persist/"$3) != 0 { print $3 }' 2>/dev/null | tree --fromfile . "$@" zfs diff -F zroot/encrypted/root@blank | awk '$2 == "F" && system("test -e /persist/"$3) != 0 { print $3 }' 2>/dev/null | tree --fromfile . "$@"
''; '';

View file

@ -1,13 +1,11 @@
{ lib
, config
, ...
}:
with lib;
let
cfg = config.my.profiles.personal;
in
{ {
lib,
config,
...
}:
with lib; let
cfg = config.my.profiles.personal;
in {
options.my.profiles.personal.enable = mkEnableOption "personal profile"; options.my.profiles.personal.enable = mkEnableOption "personal profile";
config = mkIf cfg.enable { 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"; options.my.profiles.personal.calendar = mkEnableOption "calendar";
config = mkIf cfg.contacts { config = mkIf cfg.contacts {
@ -27,7 +24,7 @@ in
fileExt = ".ics"; fileExt = ".ics";
}; };
remote = { remote = {
passwordCommand = [ "cat" config.clan.core.vars.generators.moritz-nextcloud.files.password.path ]; passwordCommand = ["cat" config.clan.core.vars.generators.moritz-nextcloud.files.password.path];
url = "https://nextcloud.moritzboeh.me/remote.php/dav"; url = "https://nextcloud.moritzboeh.me/remote.php/dav";
type = "caldav"; type = "caldav";
userName = "moritz"; userName = "moritz";

View file

@ -1,14 +1,11 @@
{ lib
, config
, pkgs
, ...
}:
with lib;
let
cfg = config.my.profiles.personal;
in
{ {
lib,
config,
...
}:
with lib; let
cfg = config.my.profiles.personal;
in {
options.my.profiles.personal.contacts = mkEnableOption "contacts"; options.my.profiles.personal.contacts = mkEnableOption "contacts";
config = mkIf cfg.contacts { config = mkIf cfg.contacts {
@ -28,7 +25,7 @@ in
fileExt = ".vcf"; fileExt = ".vcf";
}; };
remote = { remote = {
passwordCommand = [ "cat" config.clan.core.vars.generators.moritz-nextcloud.files.password.path ]; passwordCommand = ["cat" config.clan.core.vars.generators.moritz-nextcloud.files.password.path];
url = "https://nextcloud.moritzboeh.me/remote.php/dav"; url = "https://nextcloud.moritzboeh.me/remote.php/dav";
type = "carddav"; type = "carddav";
userName = "moritz"; userName = "moritz";
@ -41,7 +38,7 @@ in
# "z-server-generated--system" # Accounts # "z-server-generated--system" # Accounts
"contacts" # Contacts "contacts" # Contacts
]; ];
vdirsyncer.conflictResolution = [ "vimdiff" ]; vdirsyncer.conflictResolution = ["vimdiff"];
}; };
}; };
}; };

View file

@ -1,11 +1,10 @@
{ lib {
, config lib,
, pkgs config,
, ... pkgs,
...
}: }:
with lib; let
with lib;
let
cfg = config.my.profiles.personal; cfg = config.my.profiles.personal;
filterHtml = pkgs.writeScript "filter_html" '' filterHtml = pkgs.writeScript "filter_html" ''
@ -15,8 +14,7 @@ let
-o display_image=false \ -o display_image=false \
-o display_link_number=true "$@" -o display_link_number=true "$@"
''; '';
in in {
{
options.my.profiles.personal.mail = mkEnableOption "personal email"; options.my.profiles.personal.mail = mkEnableOption "personal email";
config = mkIf cfg.mail { config = mkIf cfg.mail {
@ -47,7 +45,7 @@ in
programs.mbsync.enable = true; programs.mbsync.enable = true;
accounts.email.accounts.personal = { accounts.email.accounts.personal = {
imapnotify.enable = true; imapnotify.enable = true;
imapnotify.boxes = [ "Inbox" ]; imapnotify.boxes = ["Inbox"];
imapnotify.onNotify = "${lib.getExe' pkgs.systemd "systemctl"} start --user mbsync.service"; imapnotify.onNotify = "${lib.getExe' pkgs.systemd "systemctl"} start --user mbsync.service";
primary = true; primary = true;
address = "mail@moritzboeh.me"; address = "mail@moritzboeh.me";

View file

@ -1,15 +1,12 @@
{ lib
, config
, pkgs
, ...
}:
with lib;
let
cfg = config.my.profiles.ripping;
in
{ {
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.my.profiles.ripping;
in {
options.my.profiles.ripping.enable = mkEnableOption "ripping profile"; options.my.profiles.ripping.enable = mkEnableOption "ripping profile";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,15 +1,12 @@
{ lib {
, config lib,
, pkgs config,
, ... pkgs,
}: ...
}: let
let
cfg = config.my.profiles.webis; cfg = config.my.profiles.webis;
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;
in in {
{
options.my.profiles.webis.enable = mkEnableOption "webis profile"; options.my.profiles.webis.enable = mkEnableOption "webis profile";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,29 +1,26 @@
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.profiles.yubikey;
in
{ {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.my.profiles.yubikey;
in {
options.my.profiles.yubikey = { options.my.profiles.yubikey = {
enable = mkEnableOption "yubikey"; enable = mkEnableOption "yubikey";
luksSupport = { luksSupport = {
enable = mkEnableOption "fido2 luks support"; enable = mkEnableOption "fido2 luks support";
devices = mkOption { devices = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = [ ]; default = [];
description = "List of luks devices to enable fido2 support for."; description = "List of luks devices to enable fido2 support for.";
}; };
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.udev.packages = [ pkgs.yubikey-personalization ]; services.udev.packages = [pkgs.yubikey-personalization];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# cli # cli
yubikey-manager yubikey-manager
@ -37,7 +34,7 @@ in
boot = mkIf cfg.luksSupport.enable { boot = mkIf cfg.luksSupport.enable {
initrd.systemd.enable = true; initrd.systemd.enable = true;
initrd.luks.devices = genAttrs cfg.luksSupport.devices (_: { initrd.luks.devices = genAttrs cfg.luksSupport.devices (_: {
crypttabExtraOpts = [ "fido2-device=auto" ]; crypttabExtraOpts = ["fido2-device=auto"];
}); });
}; };
}; };

View file

@ -1,17 +1,15 @@
{ config
, lib
, ...
}:
with lib;
let
cfg = config.my.programs.adb;
in
{ {
config,
lib,
...
}:
with lib; let
cfg = config.my.programs.adb;
in {
options.my.programs.adb.enable = mkEnableOption "adb"; options.my.programs.adb.enable = mkEnableOption "adb";
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.adb.enable = true; programs.adb.enable = true;
users.users.moritz.extraGroups = [ "adbusers" ]; users.users.moritz.extraGroups = ["adbusers"];
}; };
} }

View file

@ -1,11 +1,10 @@
{ config {
, lib config,
, pkgs lib,
, ... pkgs,
...
}: }:
with lib; let
with lib;
let
cfg = config.my.programs.aider; cfg = config.my.programs.aider;
wrapped = pkgs.writeShellApplication { wrapped = pkgs.writeShellApplication {
@ -13,16 +12,15 @@ let
text = '' text = ''
aider --openai-api-key "$(cat ${config.clan.core.vars.generators.moritz-openai.files.api-key.path})" --anthropic-api-key "$(cat ${config.clan.core.vars.generators.moritz-anthropic.files.api-key.path})" --no-attribute-author --no-attribute-committer "$@" aider --openai-api-key "$(cat ${config.clan.core.vars.generators.moritz-openai.files.api-key.path})" --anthropic-api-key "$(cat ${config.clan.core.vars.generators.moritz-anthropic.files.api-key.path})" --no-attribute-author --no-attribute-committer "$@"
''; '';
runtimeInputs = [ cfg.package ]; runtimeInputs = [cfg.package];
}; };
in in {
{
options.my.programs.aider = { options.my.programs.aider = {
enable = mkEnableOption "ssh"; enable = mkEnableOption "ssh";
package = mkPackageOption pkgs "aider-chat" { }; package = mkPackageOption pkgs "aider-chat" {};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = [ wrapped ]; environment.systemPackages = [wrapped];
}; };
} }

View file

@ -1,14 +1,12 @@
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.programs.chromium;
in
{ {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.my.programs.chromium;
in {
options.my.programs.chromium = { options.my.programs.chromium = {
enable = mkEnableOption "chromium"; enable = mkEnableOption "chromium";
package = mkOption { package = mkOption {
@ -21,6 +19,6 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.chromium.enable = true; programs.chromium.enable = true;
environment.systemPackages = [ cfg.package ]; environment.systemPackages = [cfg.package];
}; };
} }

View file

@ -1,14 +1,12 @@
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.programs.code;
in
{ {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.my.programs.code;
in {
options.my.programs.code = { options.my.programs.code = {
enable = mkEnableOption "code"; enable = mkEnableOption "code";
package = mkOption { package = mkOption {
@ -17,10 +15,12 @@ in
}; };
extensions = mkOption { extensions = mkOption {
type = types.listOf types.package; type = types.listOf types.package;
default = with pkgs.vscode-extensions; [ default = with pkgs.vscode-extensions;
[
bbenoist.nix bbenoist.nix
vscodevim.vim vscodevim.vim
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ ]
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{ {
name = "copilot-nightly"; name = "copilot-nightly";
publisher = "GitHub"; publisher = "GitHub";
@ -42,24 +42,28 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = environment.systemPackages = let
let
withExtensions = pkgs.vscode-with-extensions.override { withExtensions = pkgs.vscode-with-extensions.override {
vscode = cfg.package; vscode = cfg.package;
vscodeExtensions = cfg.extensions; vscodeExtensions = cfg.extensions;
}; };
maybeExtensions = if cfg.extensions == [ ] then cfg.package else withExtensions; maybeExtensions =
if cfg.extensions == []
then cfg.package
else withExtensions;
withWayland = pkgs.symlinkJoin { withWayland = pkgs.symlinkJoin {
name = "${maybeExtensions.name}-wayland"; name = "${maybeExtensions.name}-wayland";
paths = [ maybeExtensions ]; paths = [maybeExtensions];
nativeBuildInputs = [ pkgs.makeWrapper ]; nativeBuildInputs = [pkgs.makeWrapper];
postBuild = '' postBuild = ''
wrapProgram $out/bin/code* \ wrapProgram $out/bin/code* \
--set NIXOS_OZONE_WL 1 --set NIXOS_OZONE_WL 1
''; '';
}; };
final = if cfg.wayland then withWayland else maybeExtensions; final =
in if cfg.wayland
[ final ]; 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"; options.my.programs.direnv.enable = mkEnableOption "direnv";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,24 +1,23 @@
{ config {
, lib config,
, inputs lib,
, pkgs inputs,
, ... pkgs,
...
}: }:
with lib; let
with lib;
let
cfg = config.my.programs.firefox; cfg = config.my.programs.firefox;
arkenfox = builtins.readFile "${inputs.arkenfox-userjs}/user.js"; arkenfox = builtins.readFile "${inputs.arkenfox-userjs}/user.js";
in in {
{
options.my.programs.firefox = { options.my.programs.firefox = {
enable = mkEnableOption "firefox"; enable = mkEnableOption "firefox";
arkenfox = { arkenfox = {
enable = mkEnableOption "arkenfox"; enable = mkEnableOption "arkenfox";
overrides = mkOption { overrides = mkOption {
default = { }; default = {};
type = with types; attrsOf (oneOf [ str bool int ]); type = with types; attrsOf (oneOf [str bool int]);
apply = overrides: concatStrings ( apply = overrides:
concatStrings (
mapAttrsToList mapAttrsToList
( (
name: value: '' name: value: ''
@ -39,25 +38,22 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
home-manager.users.moritz.programs.firefox = { home-manager.users.moritz.programs.firefox = {
enable = true; enable = true;
policies = policies = let
let removeExtensions = ["Google" "Amazon.de" "Bing" "Amazon" "Wikipedia (en)" "Wikipedia (de)"];
removeExtensions = [ "Google" "Amazon.de" "Bing" "Amazon" "Wikipedia (en)" "Wikipedia (de)" ]; convertName = name: let
convertName = name:
let
lower = toLower name; lower = toLower name;
escaped = replaceStrings [ "." ] [ "dot" ] lower; escaped = replaceStrings ["."] ["dot"] lower;
sanitized = head (splitString " " escaped); sanitized = head (splitString " " escaped);
in in "${sanitized}@search.mozilla.org";
"${sanitized}@search.mozilla.org"; in {
in
{
SearchEngines = mkIf (hasInfix "esr" cfg.package) { SearchEngines = mkIf (hasInfix "esr" cfg.package) {
Default = "Kagi"; Default = "Kagi";
Remove = removeExtensions; Remove = removeExtensions;
}; };
ExtensionSettings = genAttrs ExtensionSettings =
genAttrs
(map convertName removeExtensions) (map convertName removeExtensions)
(_: { installation_mode = "blocked"; }); (_: {installation_mode = "blocked";});
}; };
profiles."default" = { profiles."default" = {
extraConfig = mkIf cfg.arkenfox.enable '' extraConfig = mkIf cfg.arkenfox.enable ''

View file

@ -1,27 +1,24 @@
{ config {
, lib config,
, pkgs lib,
, ... pkgs,
...
}: }:
with lib; let
with lib;
let
cfg = config.my.programs.fish; cfg = config.my.programs.fish;
shellConfig = config.my.shell; shellConfig = config.my.shell;
exportedVariables = exportedVariables = let
let
exportVariables = exportVariables =
lib.mapAttrsToList (n: v: ''set -x ${n} "${v}"'') shellConfig.variables; lib.mapAttrsToList (n: v: ''set -x ${n} "${v}"'') shellConfig.variables;
in in
lib.concatStringsSep "\n" exportVariables; lib.concatStringsSep "\n" exportVariables;
in in {
{
options.my.programs.fish.enable = mkEnableOption "fish"; options.my.programs.fish.enable = mkEnableOption "fish";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# set as default shell # set as default shell
users.users.moritz.shell = pkgs.fish; users.users.moritz.shell = pkgs.fish;
environment.systemPackages = with pkgs.fishPlugins; [ fzf-fish pisces ]; environment.systemPackages = with pkgs.fishPlugins; [fzf-fish pisces];
# needed for nix completions # needed for nix completions
programs.fish.enable = true; programs.fish.enable = true;
@ -29,7 +26,8 @@ in
programs = { programs = {
fish = { fish = {
enable = true; enable = true;
plugins = [{ plugins = [
{
name = "fish-completion-sync"; name = "fish-completion-sync";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "pfgray"; owner = "pfgray";
@ -37,10 +35,15 @@ in
rev = "ba70b6457228af520751eab48430b1b995e3e0e2"; rev = "ba70b6457228af520751eab48430b1b995e3e0e2";
sha256 = "sha256-JdOLsZZ1VFRv7zA2i/QEZ1eovOym/Wccn0SJyhiP9hI="; sha256 = "sha256-JdOLsZZ1VFRv7zA2i/QEZ1eovOym/Wccn0SJyhiP9hI=";
}; };
}]; }
];
shellAbbrs = shellConfig.abbreviations; shellAbbrs = shellConfig.abbreviations;
shellAliases = shellConfig.aliases; shellAliases = shellConfig.aliases;
shellInit = /* fish */ '' shellInit =
/*
fish
*/
''
# Vi Mode # Vi Mode
fish_vi_key_bindings fish_vi_key_bindings
@ -85,7 +88,11 @@ in
# Completions # Completions
complete -c c -kfa '(zoxide query -l | sed "s|$HOME|~|")' 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 "not __fish_seen_subcommand_from build shell develop" -a "build shell develop"
complete -c nom -fn "__fish_seen_subcommand_from build" -w "nix build" complete -c nom -fn "__fish_seen_subcommand_from 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"; options.my.programs.foot.enable = mkEnableOption "foot";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,32 +1,29 @@
{ config {
, lib config,
, pkgs lib,
, inputs pkgs,
, ... ...
}: }:
with lib; let
with lib;
let
cfg = config.my.programs.ghostty; cfg = config.my.programs.ghostty;
format = pkgs.formats.keyValue { format = pkgs.formats.keyValue {
listsAsDuplicateKeys = true; listsAsDuplicateKeys = true;
}; };
in in {
{
options.my.programs.ghostty.enable = mkEnableOption "Ghostty"; 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 { options.my.programs.ghostty.settings = mkOption {
inherit (format) type; inherit (format) type;
description = '' description = ''
Configuration written to {file}`$XDG_CONFIG_HOME/ghostty/config`. Configuration written to {file}`$XDG_CONFIG_HOME/ghostty/config`.
''; '';
default = { }; default = {};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
my.terminal.package = cfg.package; my.terminal.package = cfg.package;
home-manager.users.moritz = { home-manager.users.moritz = {
home.packages = [ cfg.package ]; home.packages = [cfg.package];
xdg.configFile."ghostty/config".source = format.generate "ghostty-config" cfg.settings; xdg.configFile."ghostty/config".source = format.generate "ghostty-config" cfg.settings;
}; };
}; };

View file

@ -1,13 +1,11 @@
{ config
, lib
, ...
}:
with lib;
let
cfg = config.my.programs.git;
in
{ {
config,
lib,
...
}:
with lib; let
cfg = config.my.programs.git;
in {
options.my.programs.git = { options.my.programs.git = {
enable = mkEnableOption "git"; enable = mkEnableOption "git";
signing = mkOption { signing = mkOption {

View file

@ -1,11 +1,10 @@
{ config {
, lib config,
, pkgs lib,
, ... pkgs,
...
}: }:
with lib; let
with lib;
let
cfg = config.my.programs.gnome; cfg = config.my.programs.gnome;
extensions = with pkgs.gnomeExtensions; [ extensions = with pkgs.gnomeExtensions; [
@ -14,8 +13,7 @@ let
blur-my-shell blur-my-shell
pop-shell pop-shell
]; ];
in in {
{
options.my.programs.gnome.enable = mkEnableOption "gnome"; options.my.programs.gnome.enable = mkEnableOption "gnome";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -39,7 +37,9 @@ in
home-manager.users.moritz.dconf.settings = { home-manager.users.moritz.dconf.settings = {
"org/gnome/shell" = { "org/gnome/shell" = {
disable-user-extensions = false; 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" "launch-new-instance@gnome-shell-extensions.gcampax.github.com"
"workspace-indicator@gnome-shell-extensions.gcampax.github.com" "workspace-indicator@gnome-shell-extensions.gcampax.github.com"
]; ];
@ -48,24 +48,24 @@ in
"org/gnome/desktop/interface".enable-hot-corners = false; "org/gnome/desktop/interface".enable-hot-corners = false;
"org/gnome/desktop/wm/preferences".focus-mode = "sloppy"; "org/gnome/desktop/wm/preferences".focus-mode = "sloppy";
"org.gnome.mutter".focus-change-on-pointer-rest = false; "org.gnome.mutter".focus-change-on-pointer-rest = false;
"org/gnome/desktop/wm/keybindings".close = [ "<Super>q" ]; "org/gnome/desktop/wm/keybindings".close = ["<Super>q"];
"org/gnome/desktop/wm/keybindings".minimize = [ ]; "org/gnome/desktop/wm/keybindings".minimize = [];
"org/gnome/desktop/wm/keybindings".move-to-monitor-down = [ "<Shift><Super>j" ]; "org/gnome/desktop/wm/keybindings".move-to-monitor-down = ["<Shift><Super>j"];
"org/gnome/desktop/wm/keybindings".move-to-monitor-left = [ "<Shift><Super>h" ]; "org/gnome/desktop/wm/keybindings".move-to-monitor-left = ["<Shift><Super>h"];
"org/gnome/desktop/wm/keybindings".move-to-monitor-right = [ "<Shift><Super>l" ]; "org/gnome/desktop/wm/keybindings".move-to-monitor-right = ["<Shift><Super>l"];
"org/gnome/desktop/wm/keybindings".move-to-monitor-up = [ "<Shift><Super>k" ]; "org/gnome/desktop/wm/keybindings".move-to-monitor-up = ["<Shift><Super>k"];
"org/gnome/desktop/wm/keybindings".move-to-workspace-1 = [ "<Shift><Super>1" ]; "org/gnome/desktop/wm/keybindings".move-to-workspace-1 = ["<Shift><Super>1"];
"org/gnome/desktop/wm/keybindings".move-to-workspace-2 = [ "<Shift><Super>2" ]; "org/gnome/desktop/wm/keybindings".move-to-workspace-2 = ["<Shift><Super>2"];
"org/gnome/desktop/wm/keybindings".move-to-workspace-3 = [ "<Shift><Super>3" ]; "org/gnome/desktop/wm/keybindings".move-to-workspace-3 = ["<Shift><Super>3"];
"org/gnome/desktop/wm/keybindings".move-to-workspace-4 = [ "<Shift><Super>4" ]; "org/gnome/desktop/wm/keybindings".move-to-workspace-4 = ["<Shift><Super>4"];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-1 = [ "<Super>1" ]; "org/gnome/desktop/wm/keybindings".switch-to-workspace-1 = ["<Super>1"];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-2 = [ "<Super>2" ]; "org/gnome/desktop/wm/keybindings".switch-to-workspace-2 = ["<Super>2"];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-3 = [ "<Super>3" ]; "org/gnome/desktop/wm/keybindings".switch-to-workspace-3 = ["<Super>3"];
"org/gnome/desktop/wm/keybindings".switch-to-workspace-4 = [ "<Super>4" ]; "org/gnome/desktop/wm/keybindings".switch-to-workspace-4 = ["<Super>4"];
"org/gnome/mutter".dynamic-workspaces = false; "org/gnome/mutter".dynamic-workspaces = false;
"org/gnome/mutter/wayland/keybindings".restore-shortcuts = [ ]; "org/gnome/mutter/wayland/keybindings".restore-shortcuts = [];
"org/gnome/settings-daemon/plugins/media-keys".screensaver = [ "<Super>Escape" ]; "org/gnome/settings-daemon/plugins/media-keys".screensaver = ["<Super>Escape"];
"org/gnome/shell".favorite-apps = [ ]; "org/gnome/shell".favorite-apps = [];
"org/gnome/desktop/wm/preferences".num-workspaces = 4; "org/gnome/desktop/wm/preferences".num-workspaces = 4;
}; };
}; };

View file

@ -1,13 +1,11 @@
{ config
, lib
, ...
}:
with lib;
let
cfg = config.my.programs.gpg;
in
{ {
config,
lib,
...
}:
with lib; let
cfg = config.my.programs.gpg;
in {
options.my.programs.gpg.enable = mkEnableOption "gpg"; options.my.programs.gpg.enable = mkEnableOption "gpg";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,13 +1,15 @@
{ config, lib, pkgs, ... }: {
config,
let lib,
pkgs,
...
}: let
inherit (lib) any filterAttrs mapAttrsToList mkEnableOption mkIf mkOption; inherit (lib) any filterAttrs mapAttrsToList mkEnableOption mkIf mkOption;
cfg = config.my.programs.jetbrains; cfg = config.my.programs.jetbrains;
isEnabled = _: value: value.enable; isEnabled = _: value: value.enable;
anyEnabled = any (x: x) (mapAttrsToList isEnabled cfg); anyEnabled = any (x: x) (mapAttrsToList isEnabled cfg);
in in {
{
options.my.programs.jetbrains = { options.my.programs.jetbrains = {
pycharm = { pycharm = {
enable = mkEnableOption "pycharm"; enable = mkEnableOption "pycharm";
@ -34,8 +36,7 @@ in
xdg.configFile."ideavim/ideavimrc" = { xdg.configFile."ideavim/ideavimrc" = {
source = ./ideavimrc; source = ./ideavimrc;
}; };
home.packages = home.packages = let
let
enabledPackages = filterAttrs isEnabled cfg; enabledPackages = filterAttrs isEnabled cfg;
in in
mapAttrsToList (_: value: value.package) enabledPackages; 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"; options.my.programs.kitty.enable = mkEnableOption "kitty";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,11 +1,10 @@
{ config {
, lib config,
, pkgs lib,
, ... pkgs,
...
}: }:
with lib; let
with lib;
let
cfg = config.my.programs.lazygit; cfg = config.my.programs.lazygit;
wrapper = pkgs.writeShellApplication { wrapper = pkgs.writeShellApplication {
@ -20,10 +19,9 @@ let
rm -f "$LAZYGIT_NEW_DIR_FILE" > /dev/null rm -f "$LAZYGIT_NEW_DIR_FILE" > /dev/null
fi fi
''; '';
runtimeInputs = [ pkgs.lazygit ]; runtimeInputs = [pkgs.lazygit];
}; };
in in {
{
options.my.programs.lazygit.enable = mkEnableOption "lazygit"; options.my.programs.lazygit.enable = mkEnableOption "lazygit";
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -44,17 +42,61 @@ in
key = "Type"; key = "Type";
title = "Type of change"; title = "Type of change";
options = [ options = [
{ name = "build"; description = "Changes that affect the build system or external dependencies"; value = "build"; } {
{ name = "feat"; description = "A new feature"; value = "feat"; } name = "build";
{ name = "fix"; description = "A bug fix"; value = "fix"; } description = "Changes that affect the build system or external dependencies";
{ name = "chore"; description = "Other changes that don't modify src or test files"; value = "chore"; } value = "build";
{ 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 = "feat";
{ name = "refactor"; description = "A code change that neither fixes a bug nor adds a feature"; value = "refactor"; } description = "A new feature";
{ name = "revert"; description = "Reverts a previous commit"; value = "revert"; } value = "feat";
{ 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 = "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"; key = "Breaking";
title = "Breaking change"; title = "Breaking change";
options = [ 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"; options.my.programs.ledger.enable = mkEnableOption "ledger";
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -16,8 +14,7 @@ in
variables = { variables = {
LEDGER_FILE = "/home/moritz/Nextcloud/Notes/ledger/main.ledger"; LEDGER_FILE = "/home/moritz/Nextcloud/Notes/ledger/main.ledger";
}; };
aliases = aliases = let
let
applyCommon = _: command: "${command} --payee note --strict --explicit"; applyCommon = _: command: "${command} --payee note --strict --explicit";
in in
mapAttrs applyCommon { mapAttrs applyCommon {
@ -33,7 +30,7 @@ in
reg-copy = writeShellApplication { reg-copy = writeShellApplication {
name = "reg-copy"; name = "reg-copy";
runtimeInputs = [ ledger xclip ]; runtimeInputs = [ledger xclip];
text = '' text = ''
table="$(printf '%-10s %-30s %8s %8s\n' Datum Beschreibung Einzeln Gesamt && ledger reg -V --format '%10D %.30P %8t %8T\n' "$@")" table="$(printf '%-10s %-30s %8s %8s\n' Datum Beschreibung Einzeln Gesamt && ledger reg -V --format '%10D %.30P %8t %8T\n' "$@")"
@ -41,8 +38,7 @@ in
echo "$table" | xclip -selection clipboard echo "$table" | xclip -selection clipboard
''; '';
}; };
in in [ledger reg-copy hledger hledger-ui hledger-web];
[ ledger reg-copy hledger hledger-ui hledger-web ];
home-manager.users.moritz = { home-manager.users.moritz = {
xdg.configFile = { xdg.configFile = {
"fish/completions/ledger.fish" = { "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"; options.my.programs.logseq.enable = mkEnableOption "logseq";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,20 +1,18 @@
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.programs.miracast;
in
{ {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.my.programs.miracast;
in {
options.my.programs.miracast.enable = mkEnableOption "miracast"; options.my.programs.miracast.enable = mkEnableOption "miracast";
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 7236 7250 ]; allowedTCPPorts = [7236 7250];
allowedUDPPorts = [ 7236 5353 ]; allowedUDPPorts = [7236 5353];
}; };
users.users.moritz.packages = with pkgs; [ users.users.moritz.packages = with pkgs; [
gnome-network-displays gnome-network-displays

View file

@ -1,10 +1,11 @@
{ config, lib, ... }:
with lib;
let
cfg = config.my.programs.navi;
in
{ {
config,
lib,
...
}:
with lib; let
cfg = config.my.programs.navi;
in {
options.my.programs.navi.enable = mkEnableOption "navi"; options.my.programs.navi.enable = mkEnableOption "navi";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,22 +1,22 @@
{ config {
, lib config,
, pkgs lib,
, inputs pkgs,
, ... inputs,
}: ...
}: let
let
cfg = config.my.programs.niri; cfg = config.my.programs.niri;
inherit (config.home-manager.users.moritz.lib.niri) actions; inherit (config.home-manager.users.moritz.lib.niri) actions;
inherit (lib) mkEnableOption getExe mkIf; inherit (lib) mkEnableOption getExe mkIf;
in in {
{
imports = [ imports = [
inputs.niri.nixosModules.niri inputs.niri.nixosModules.niri
]; ];
options.my.programs.niri.enable = mkEnableOption "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; default = true;
}; };
@ -32,7 +32,7 @@ in
]; ];
# adds pam module for swaylock # adds pam module for swaylock
security.pam.services.swaylock = { }; security.pam.services.swaylock = {};
programs.niri.enable = true; programs.niri.enable = true;
programs.niri.package = pkgs.niri; programs.niri.package = pkgs.niri;
@ -69,9 +69,9 @@ in
layer = "top"; layer = "top";
position = "top"; position = "top";
height = 20; height = 20;
modules-left = [ "niri/workspaces" ]; modules-left = ["niri/workspaces"];
modules-center = [ "niri/window" ]; modules-center = ["niri/window"];
modules-right = [ "network" "memory" "cpu" "battery" "clock" ]; modules-right = ["network" "memory" "cpu" "battery" "clock"];
}; };
}; };
}; };
@ -95,11 +95,9 @@ in
command = "${lib.getExe pkgs.swaylock} -fF"; command = "${lib.getExe pkgs.swaylock} -fF";
} }
]; ];
timeouts = timeouts = let
let
lockTimeout = 10; lockTimeout = 10;
in in [
[
{ {
timeout = lockTimeout * 60 - 10; timeout = lockTimeout * 60 - 10;
command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'"; command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'";
@ -129,7 +127,7 @@ in
binds = { binds = {
# spawn different programs # spawn different programs
"Mod+Return".action.spawn = config.my.terminal.package; "Mod+Return".action.spawn = config.my.terminal.package;
"Mod+Shift+escape".action.spawn = [ "loginctl" "lock-session" ]; "Mod+Shift+escape".action.spawn = ["loginctl" "lock-session"];
"Mod+R".action.spawn = "${lib.getExe pkgs.fuzzel}"; "Mod+R".action.spawn = "${lib.getExe pkgs.fuzzel}";
# keyboard layout # keyboard layout
@ -152,7 +150,7 @@ in
"Mod+H".action = actions.move-column-left-or-to-monitor-left; "Mod+H".action = actions.move-column-left-or-to-monitor-left;
"Mod+L".action = actions.move-column-right-or-to-monitor-right; "Mod+L".action = actions.move-column-right-or-to-monitor-right;
"Mod+W".action.spawn = [ "pkill" "-USR1" "waybar" ]; "Mod+W".action.spawn = ["pkill" "-USR1" "waybar"];
"Mod+C".action = actions.consume-window-into-column; "Mod+C".action = actions.consume-window-into-column;
"Mod+E".action = actions.expel-window-from-column; "Mod+E".action = actions.expel-window-from-column;
@ -187,9 +185,9 @@ in
"Mod+0".action.focus-workspace = 10; "Mod+0".action.focus-workspace = 10;
# audio # audio
"XF86_AudioMute".action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle" ]; "XF86_AudioMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"];
"XF86AudioRaiseVolume".action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+" "-l" "1.0" ]; "XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+" "-l" "1.0"];
"XF86AudioLowerVolume".action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-" ]; "XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"];
# TODO(mangoiv): mic mute toggle # TODO(mangoiv): mic mute toggle
}; };
environment = { environment = {
@ -200,9 +198,9 @@ in
focus-ring.enable = false; focus-ring.enable = false;
default-column-width.proportion = 2.0 / 3.0; default-column-width.proportion = 2.0 / 3.0;
preset-column-widths = [ preset-column-widths = [
{ proportion = 1.0 / 3.0; } {proportion = 1.0 / 3.0;}
{ proportion = 2.0 / 3.0; } {proportion = 2.0 / 3.0;}
{ proportion = 1.0 / 1.0; } {proportion = 1.0 / 1.0;}
]; ];
gaps = 3; gaps = 3;
}; };
@ -215,9 +213,9 @@ in
window-rules = [ window-rules = [
{ {
matches = [ matches = [
{ title = "^.*1Password.*$"; } {title = "^.*1Password.*$";}
{ title = "^.*Bitwarden.*$"; } {title = "^.*Bitwarden.*$";}
{ title = "^.*KeePassXC.*$"; } {title = "^.*KeePassXC.*$";}
]; ];
block-out-from = "screen-capture"; block-out-from = "screen-capture";
} }
@ -232,7 +230,7 @@ in
} }
]; ];
switch-events = { switch-events = {
lid-close.action.spawn = [ "loginctl" "lock-session" ]; lid-close.action.spawn = ["loginctl" "lock-session"];
}; };
input = { input = {
touchpad.natural-scroll = false; touchpad.natural-scroll = false;
@ -248,11 +246,11 @@ in
systemd.user.services.xwayland-satellite = { systemd.user.services.xwayland-satellite = {
description = "Xwayland outside your Wayland"; description = "Xwayland outside your Wayland";
after = [ "graphical-session.target" ]; after = ["graphical-session.target"];
wantedBy = [ "graphical-session.target" ]; wantedBy = ["graphical-session.target"];
partOf = [ "graphical-session.target" ]; partOf = ["graphical-session.target"];
bindsTo = [ "graphical-session.target" ]; bindsTo = ["graphical-session.target"];
requisite = [ "graphical-session.target" ]; requisite = ["graphical-session.target"];
serviceConfig = { serviceConfig = {
Type = "notify"; Type = "notify";
Restart = "always"; Restart = "always";

View file

@ -1,17 +1,15 @@
{ config {
, lib config,
, inputs lib,
, self inputs,
, pkgs self,
, ... pkgs,
}: ...
}: let
let
inherit (lib) mkEnableOption mkOption types; inherit (lib) mkEnableOption mkOption types;
cfg = config.my.programs.nix; cfg = config.my.programs.nix;
in in {
{
options.my.programs.nix = { options.my.programs.nix = {
gc = { gc = {
enable = mkEnableOption "nix-gc"; enable = mkEnableOption "nix-gc";
@ -30,7 +28,7 @@ in
}; };
nix = { nix = {
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; nixPath = ["nixpkgs=${inputs.nixpkgs}"];
package = pkgs.lix; package = pkgs.lix;
@ -46,7 +44,7 @@ in
optimise = { optimise = {
automatic = cfg.optimise.enable; automatic = cfg.optimise.enable;
dates = [ "weekly" ]; dates = ["weekly"];
}; };
registry = { registry = {
@ -71,7 +69,7 @@ in
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
]; ];
trusted-users = [ "root" "@wheel" ]; trusted-users = ["root" "@wheel"];
# https://bmcgee.ie/posts/2023/12/til-how-to-optimise-substitutions-in-nix/ # https://bmcgee.ie/posts/2023/12/til-how-to-optimise-substitutions-in-nix/
http-connections = 128; http-connections = 128;

View file

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

View file

@ -12,13 +12,13 @@ vim.opt.number = true
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.opt.scrolloff = 4 -- lines of context vim.opt.scrolloff = 4 -- lines of context
vim.opt.shiftround = true -- round indent 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.shortmess:append({ c = true })
vim.opt.signcolumn = "yes" vim.opt.signcolumn = "yes"
vim.opt.smartcase = true vim.opt.smartcase = true
vim.opt.splitbelow = true vim.opt.splitbelow = true
vim.opt.splitright = true vim.opt.splitright = true
vim.opt.tabstop = 2
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.opt.undofile = true vim.opt.undofile = true
vim.opt.undolevels = 10000 vim.opt.undolevels = 10000

View file

@ -1,16 +1,17 @@
{ config, lib, pkgs, ... }: {
config,
let lib,
...
}: let
inherit (lib) mkIf; inherit (lib) mkIf;
cfg = config.my.ai; cfg = config.my.ai;
in in {
{
config = mkIf cfg.enable { config = mkIf cfg.enable {
home-manager.users.moritz.programs.nixvim.plugins = { home-manager.users.moritz.programs.nixvim.plugins = {
render-markdown = { render-markdown = {
enable = true; enable = true;
settings.file_types = [ "markdown" "Avante" ]; settings.file_types = ["markdown" "Avante"];
}; };
nui.enable = true; nui.enable = true;
dressing.enable = true; dressing.enable = true;
@ -22,7 +23,7 @@ in
api_key_name = "cmd:cat ${config.clan.core.vars.generators.moritz-openai.files.api-key.path}"; api_key_name = "cmd:cat ${config.clan.core.vars.generators.moritz-openai.files.api-key.path}";
}; };
}; };
lazyLoad.settings.event = [ "DeferredUIEnter" ]; lazyLoad.settings.event = ["DeferredUIEnter"];
}; };
}; };
}; };

View file

@ -1,9 +1,11 @@
{ lib, pkgs, inputs, ... }: {...}: {
{
home-manager.users.moritz.programs.nixvim = { home-manager.users.moritz.programs.nixvim = {
plugins.blink-compat.enable = true; plugins.blink-compat.enable = true;
plugins.lsp.capabilities = /* lua */ '' plugins.lsp.capabilities =
/*
lua
*/
''
capabilities = require('blink.cmp').get_lsp_capabilities(capabilities) capabilities = require('blink.cmp').get_lsp_capabilities(capabilities)
''; '';
plugins.blink-cmp = { 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 = { home-manager.users.moritz.programs.nixvim = {
colorschemes.catppuccin = { colorschemes.catppuccin = {
enable = true; 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 = { home-manager.users.moritz.programs.nixvim = {
plugins.comment.enable = true; plugins.comment.enable = true;
}; };

View file

@ -1,31 +1,26 @@
{ config, lib, pkgs, inputs, ... }: {...}: {
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
home-manager.users.moritz.programs.nixvim = { home-manager.users.moritz.programs.nixvim = {
plugins.conform-nvim = { plugins.conform-nvim = {
enable = true; enable = true;
settings.formatters_by_ft = { settings.formatters_by_ft = {
"*" = [ "codespell" "trim_whitespace" ]; "*" = ["codespell" "trim_whitespace"];
elixir = [ "mix" ]; elixir = ["mix"];
gleam = [ "gleam" ]; gleam = ["gleam"];
go = [ "gofmt" ]; go = ["gofmt"];
json = [ "jq" ]; json = ["jq"];
lua = [ "stylua" ]; lua = ["stylua"];
nix = [ "nixpkgs_fmt" ]; nix = ["nixpkgs_fmt"];
python.__raw = '' python.__raw = ''
function(bufnr) function(bufnr)
return { first(bufnr, "ruff_organize_imports", "isort"), first(bufnr, "ruff_format", "black")} return { first(bufnr, "ruff_organize_imports", "isort"), first(bufnr, "ruff_format", "black")}
end end
''; '';
rust = [ "rustfmt" ]; rust = ["rustfmt"];
sh = [ "shfmt" ]; sh = ["shfmt"];
tex = [ "latexindent" ]; tex = ["latexindent"];
toml = [ "taplo" ]; toml = ["taplo"];
yaml = [ "yamlfix" ]; yaml = ["yamlfix"];
markdown = [ "injected" ]; markdown = ["injected"];
}; };
}; };
opts.formatexpr = "v:lua.require'conform'.formatexpr()"; opts.formatexpr = "v:lua.require'conform'.formatexpr()";
@ -67,8 +62,11 @@ in
"conform.nvim" "conform.nvim"
]; ];
keymaps = [ keymaps = [
{ key = "="; action.__raw = ''function() require("conform").format() end''; options.desc = "Format current file"; } {
key = "=";
action.__raw = ''function() require("conform").format() end'';
options.desc = "Format current file";
}
]; ];
}; };
} }

View file

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

View file

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

View file

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

View file

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

View file

@ -1,15 +1,30 @@
{ config, lib, pkgs, inputs, ... }: {...}: {
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
home-manager.users.moritz.programs.nixvim = { home-manager.users.moritz.programs.nixvim = {
keymaps = [ 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 = "<esc>";
{ key = ">"; action = ">gv"; options.desc = "Shift right"; mode = [ "v" ]; } action = "<cmd>noh<cr><esc>";
{ key = "y"; action = "ygv<esc>"; options.desc = "Yank"; mode = [ "v" ]; } 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 = { home-manager.users.moritz.programs.nixvim = {
plugins.lastplace.enable = true; plugins.lastplace.enable = true;
}; };

View file

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

View file

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

View file

@ -1,9 +1,4 @@
{ config, lib, pkgs, inputs, ... }: {...}: {
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
home-manager.users.moritz = { home-manager.users.moritz = {
xdg.configFile."nvim/snippets" = { xdg.configFile."nvim/snippets" = {
recursive = true; recursive = true;
@ -11,8 +6,12 @@ in
}; };
programs.nixvim = { programs.nixvim = {
plugins.luasnip = { plugins.luasnip = {
lazyLoad.settings.event = [ "InsertEnter" ]; lazyLoad.settings.event = ["InsertEnter"];
lazyLoad.settings.after = /* lua */ '' lazyLoad.settings.after =
/*
lua
*/
''
function() function()
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" }) require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" })
require("luasnip.loaders.from_snipmate").lazy_load({ paths = "~/.config/nvim/snippets" }) require("luasnip.loaders.from_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; 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 = { home-manager.users.moritz.programs.nixvim = {
plugins.markdown-preview.enable = true; 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 = { home-manager.users.moritz.programs.nixvim = {
plugins.marks = { plugins.marks = {
enable = true; enable = true;

View file

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

View file

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

View file

@ -1,6 +1,4 @@
_: _: {
{
home-manager.users.moritz.programs.nixvim = { home-manager.users.moritz.programs.nixvim = {
plugins.obsidian = { plugins.obsidian = {
enable = true; enable = true;
@ -21,14 +19,49 @@ _:
end end
''; '';
mappings = { mappings = {
"<localleader>n" = { action.__raw = ''function() return vim.cmd("ObsidianNew") end''; opts.desc = "New Note"; opts.buffer = true; }; "<localleader>n" = {
"<localleader>q" = { action.__raw = ''function() return vim.cmd("ObsidianQuickSwitch") end''; opts.desc = "Quick Switch"; opts.buffer = true; }; action.__raw = ''function() return vim.cmd("ObsidianNew") end'';
"<localleader>b" = { action.__raw = ''function() return vim.cmd("ObsidianBacklinks") end''; opts.desc = "Backlinks"; opts.buffer = true; }; opts.desc = "New Note";
"<localleader>l" = { action.__raw = ''function() return vim.cmd("ObsidianLink") end''; opts.desc = "Link"; opts.buffer = true; }; 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; }; "<localleader>q" = {
"<cr>" = { action.__raw = ''function() return require("obsidian").util.smart_action() end''; opts.buffer = true; opts.expr = true; }; action.__raw = ''function() return vim.cmd("ObsidianQuickSwitch") end'';
"gf" = { action.__raw = ''function() return require("obsidian").util.gf_passthrough() end''; opts = { noremap = false; expr = true; buffer = true; }; }; 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 = { home-manager.users.moritz.programs.nixvim = {
plugins.oil.enable = true; plugins.oil.enable = true;
performance.combinePlugins.standalonePlugins = [ performance.combinePlugins.standalonePlugins = [

View file

@ -1,6 +1,4 @@
_: _: {
{
home-manager.users.moritz.programs.nixvim.plugins.otter = { home-manager.users.moritz.programs.nixvim.plugins.otter = {
enable = true; 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 = { home-manager.users.moritz.programs.nixvim.plugins.render-markdown = {
enable = true; enable = true;
settings.latex.enable = false; settings.latex.enable = false;

View file

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

View file

@ -1,10 +1,8 @@
_: _: {
{
home-manager.users.moritz.programs.nixvim = { home-manager.users.moritz.programs.nixvim = {
autoCmd = [ autoCmd = [
{ {
event = [ "VimEnter" ]; event = ["VimEnter"];
callback.__raw = '' callback.__raw = ''
function() function()
if vim.fn.len(vim.api.nvim_get_vvar("argv")) <= 8 then if vim.fn.len(vim.api.nvim_get_vvar("argv")) <= 8 then

View file

@ -1,9 +1,4 @@
{ config, lib, pkgs, inputs, ... }: {...}: {
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
home-manager.users.moritz.programs.nixvim = { home-manager.users.moritz.programs.nixvim = {
plugins.todo-comments = { plugins.todo-comments = {
enable = true; 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 = { home-manager.users.moritz.programs.nixvim = {
plugins.treesitter-textobjects = { plugins.treesitter-textobjects = {
enable = true; 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 = { home-manager.users.moritz.programs.nixvim = {
plugins.treesitter = { plugins.treesitter = {
enable = true; enable = true;
folding = true; folding = true;
nixvimInjections = true; nixvimInjections = true;
settings.indent.enable = true;
settings.highlight.enable = true; settings.highlight.enable = true;
settings.incremental_selection = { settings.incremental_selection = {
enable = true; enable = true;
@ -17,7 +11,7 @@ in
keymaps.node_decremental = "gp"; keymaps.node_decremental = "gp";
keymaps.node_incremental = "gn"; keymaps.node_incremental = "gn";
}; };
lazyLoad.settings.event = [ "DeferredUIEnter" ]; lazyLoad.settings.event = ["DeferredUIEnter"];
}; };
performance.combinePlugins.standalonePlugins = [ performance.combinePlugins.standalonePlugins = [
"nvim-treesitter" "nvim-treesitter"

View file

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

View file

@ -1,8 +1,6 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home-manager.users.moritz.programs.nixvim = { home-manager.users.moritz.programs.nixvim = {
extraPlugins = with pkgs.vimPlugins; [ vim-beancount ]; extraPlugins = with pkgs.vimPlugins; [vim-beancount];
performance.combinePlugins.standalonePlugins = [ performance.combinePlugins.standalonePlugins = [
"vim-beancount" "vim-beancount"
]; ];

View file

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

View file

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

View file

@ -1,23 +1,22 @@
{ config {
, lib config,
, pkgs lib,
, ... pkgs,
...
}: }:
with lib; let
with lib;
let
cfg = config.my.programs.prismlauncher; cfg = config.my.programs.prismlauncher;
prismlauncher = pkgs.runCommandNoCC "prismlauncher" prismlauncher =
pkgs.runCommandNoCC "prismlauncher"
{ {
nativeBuildInputs = [ pkgs.makeWrapper ]; nativeBuildInputs = [pkgs.makeWrapper];
} '' } ''
makeWrapper ${lib.getExe pkgs.prismlauncher} $out/bin/prismlauncher \ makeWrapper ${lib.getExe pkgs.prismlauncher} $out/bin/prismlauncher \
--set QT_STYLE_OVERRIDE "" \ --set QT_STYLE_OVERRIDE "" \
--set QT_QPA_PLATFORMTHEME "gtk3" --set QT_QPA_PLATFORMTHEME "gtk3"
''; '';
in in {
{
options.my.programs.prismlauncher.enable = mkEnableOption "prismlauncher"; options.my.programs.prismlauncher.enable = mkEnableOption "prismlauncher";
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -25,6 +24,6 @@ in
".local/share/PrismLauncher/" ".local/share/PrismLauncher/"
]; ];
users.users.moritz.packages = [ prismlauncher ]; users.users.moritz.packages = [prismlauncher];
}; };
} }

View file

@ -1,10 +1,9 @@
{ config {
, lib config,
, pkgs lib,
, ... pkgs,
}: ...
}: let
let
inherit (lib) range filterAttrs attrNames foldl' head tail mkOption mkEnableOption intersectLists genAttrs flip getAttr; inherit (lib) range filterAttrs attrNames foldl' head tail mkOption mkEnableOption intersectLists genAttrs flip getAttr;
inherit (lib.types) listOf enum package; inherit (lib.types) listOf enum package;
@ -15,8 +14,7 @@ let
pythonPackages = version: attrNames pkgs."python${version}Packages"; pythonPackages = version: attrNames pkgs."python${version}Packages";
commonPackages = commonPackages = let
let
packageLists = map pythonPackages (attrNames enabledVersions); packageLists = map pythonPackages (attrNames enabledVersions);
in in
foldl' intersectLists (head packageLists) (tail packageLists); foldl' intersectLists (head packageLists) (tail packageLists);
@ -24,20 +22,19 @@ let
versionOpts = version: { versionOpts = version: {
enable = mkEnableOption (toString version); enable = mkEnableOption (toString version);
pythonPackages = mkOption { pythonPackages = mkOption {
default = [ ]; default = [];
type = listOf (enum (pythonPackages version)); type = listOf (enum (pythonPackages version));
}; };
}; };
in in {
{
options.my.programs.python = { options.my.programs.python = {
versions = genAttrs pythonVersions versionOpts; versions = genAttrs pythonVersions versionOpts;
defaultPackages = mkOption { defaultPackages = mkOption {
default = [ ]; default = [];
type = listOf (enum commonPackages); type = listOf (enum commonPackages);
}; };
extraPackages = mkOption { extraPackages = mkOption {
default = [ ]; default = [];
type = listOf package; type = listOf package;
}; };
}; };
@ -46,8 +43,7 @@ in
users.users.moritz.packages = users.users.moritz.packages =
( (
let let
mkPython = version: mkPython = version: let
let
package = pkgs."python${version}"; package = pkgs."python${version}";
finalPythonPackages = cfg.versions.${version}.pythonPackages ++ cfg.defaultPackages; finalPythonPackages = cfg.versions.${version}.pythonPackages ++ cfg.defaultPackages;
getPythonPackages = ps: map (flip getAttr ps) finalPythonPackages; getPythonPackages = ps: map (flip getAttr ps) finalPythonPackages;
@ -55,6 +51,7 @@ in
package.withPackages getPythonPackages; package.withPackages getPythonPackages;
in in
map mkPython (attrNames enabledVersions) map mkPython (attrNames enabledVersions)
) ++ cfg.extraPackages; )
++ cfg.extraPackages;
}; };
} }

View file

@ -1,22 +1,19 @@
{ config {
, lib config,
, pkgs lib,
, ... pkgs,
}: ...
}: let
let
inherit (lib) mkEnableOption mkIf mkOption types; inherit (lib) mkEnableOption mkIf mkOption types;
cfg = config.my.programs.river; cfg = config.my.programs.river;
in in {
{
options.my.programs.river = { options.my.programs.river = {
enable = mkEnableOption "river"; enable = mkEnableOption "river";
keyboardLayouts = mkOption { keyboardLayouts = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
description = "List of keyboard layouts."; description = "List of keyboard layouts.";
default = [ "us" "de" ]; default = ["us" "de"];
}; };
nvidiaSupport = mkEnableOption "nvidia gpu support"; nvidiaSupport = mkEnableOption "nvidia gpu support";
}; };
@ -69,7 +66,8 @@ in
passthrough = { passthrough = {
"Super F11" = "enter-mode normal"; "Super F11" = "enter-mode normal";
}; };
normal = { normal =
{
"Super Q" = "close"; "Super Q" = "close";
"Super Return" = "spawn '${config.my.terminal.package}'"; "Super Return" = "spawn '${config.my.terminal.package}'";
"Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' ''; "Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' '';
@ -108,24 +106,29 @@ in
"None XF86AudioPrev" = "spawn 'playerctl -p spotifyd,firefox previous'"; "None XF86AudioPrev" = "spawn 'playerctl -p spotifyd,firefox previous'";
"Super F11" = "enter-mode passthrough"; "Super F11" = "enter-mode passthrough";
} // }
//
# tags # tags
( (
let let
numbers = lib.range 1 9; numbers = lib.range 1 9;
toTag = num: "$((1 << (${toString num} - 1)))"; toTag = num: "$((1 << (${toString num} - 1)))";
mkMappings = num: mkMappings = num: let
let
numStr = toString num; numStr = toString num;
tag = toTag num; tag = toTag num;
in in [
[
# Super+Control+[1-9] to toggle focus of tag [0-8] # 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 # 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); mappings = lib.flatten (map mkMappings numbers);
in in
@ -147,7 +150,11 @@ in
set-cursor-warp = "on-focus-change"; set-cursor-warp = "on-focus-change";
keyboard-layout = "-options grp:win_space_toggle,caps:escape ${lib.concatStringsSep "," cfg.keyboardLayouts}"; keyboard-layout = "-options grp:win_space_toggle,caps:escape ${lib.concatStringsSep "," cfg.keyboardLayouts}";
}; };
extraConfig = /* bash */ '' extraConfig =
/*
bash
*/
''
rivercarro_pid="$(pidof rivercarro)" rivercarro_pid="$(pidof rivercarro)"
if [[ -z $rivercarro_pid ]]; then if [[ -z $rivercarro_pid ]]; then
rivercarro -inner-gaps 4 -outer-gaps 4 & rivercarro -inner-gaps 4 -outer-gaps 4 &
@ -171,9 +178,9 @@ in
layer = "top"; layer = "top";
position = "top"; position = "top";
height = 20; height = 20;
modules-left = [ "river/tags" ]; modules-left = ["river/tags"];
modules-center = [ "river/window" ]; modules-center = ["river/window"];
modules-right = [ "network" "memory" "cpu" "battery" "clock" ]; modules-right = ["network" "memory" "cpu" "battery" "clock"];
}; };
}; };
style = lib.readFile ./style.css; style = lib.readFile ./style.css;
@ -198,11 +205,9 @@ in
command = "${lib.getExe pkgs.swaylock} -fF"; command = "${lib.getExe pkgs.swaylock} -fF";
} }
]; ];
timeouts = timeouts = let
let
lockTimeout = 10; lockTimeout = 10;
in in [
[
{ {
timeout = lockTimeout * 60 - 10; timeout = lockTimeout * 60 - 10;
command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'"; command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'";
@ -217,7 +222,7 @@ in
}; };
# adds pam module for swaylock # adds pam module for swaylock
security.pam.services.swaylock = { }; security.pam.services.swaylock = {};
users.users.moritz.packages = with pkgs; [ users.users.moritz.packages = with pkgs; [
brightnessctl # control brightness brightnessctl # control brightness
@ -229,7 +234,6 @@ in
wl-clipboard # clipboard tool for wayland wl-clipboard # clipboard tool for wayland
]; ];
# additional environment variables # additional environment variables
environment.sessionVariables = environment.sessionVariables =
{ {
@ -241,7 +245,8 @@ in
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_QPA_PLATFORMTHEME = "qt5ct"; QT_QPA_PLATFORMTHEME = "qt5ct";
_JAVA_AWT_WM_NONEREPARENTING = "1"; _JAVA_AWT_WM_NONEREPARENTING = "1";
} // (lib.optionalAttrs cfg.nvidiaSupport }
// (lib.optionalAttrs cfg.nvidiaSupport
{ {
GBM_BACKEND = "nvidia-drm"; GBM_BACKEND = "nvidia-drm";
GDK_BACKEND = "wayland"; GDK_BACKEND = "wayland";

View file

@ -1,14 +1,17 @@
{ lib, pkgs, config, ... }: {
lib,
let pkgs,
config,
...
}: let
cfg = config.my.scripts; cfg = config.my.scripts;
inherit (lib) readFile; inherit (lib) readFile;
fishFile = fishFile = {
{ name name,
, destination destination,
, content content,
, checkPhase ? null checkPhase ? null,
}: }:
pkgs.writeTextFile { pkgs.writeTextFile {
inherit name destination; inherit name destination;
@ -22,7 +25,8 @@ let
''; '';
checkPhase = checkPhase =
if checkPhase == null then '' if checkPhase == null
then ''
runHook preCheck runHook preCheck
${lib.getExe pkgs.fish} -n "$target" ${lib.getExe pkgs.fish} -n "$target"
runHook postCheck runHook postCheck
@ -30,41 +34,47 @@ let
else checkPhase; else checkPhase;
}; };
writeFishApplication = writeFishApplication = {
{ name name,
, text text,
, completions ? null completions ? null,
, runtimeInputs ? [ ] runtimeInputs ? [],
, checkPhase ? null checkPhase ? null,
}: }: let
let runtimeHeader =
runtimeHeader = lib.optionalString (runtimeInputs != [ ]) lib.optionalString (runtimeInputs != [])
''export PATH="${lib.makeBinPath runtimeInputs}:$PATH"''; ''export PATH="${lib.makeBinPath runtimeInputs}:$PATH"'';
script = fishFile { script = fishFile {
inherit checkPhase; inherit checkPhase;
name = "${name}_script"; name = "${name}_script";
destination = "/bin/${name}"; destination = "/bin/${name}";
content = lib.concatLines [ runtimeHeader text ]; content = lib.concatLines [runtimeHeader text];
}; };
completions_file = fishFile { completions_file = fishFile {
inherit checkPhase; inherit checkPhase;
name = "${name}_completions"; name = "${name}_completions";
destination = "/share/fish/vendor_completions.d/${name}.fish"; destination = "/share/fish/vendor_completions.d/${name}.fish";
content = lib.concatLines [ runtimeHeader completions ]; content = lib.concatLines [runtimeHeader completions];
}; };
in in
pkgs.symlinkJoin { pkgs.symlinkJoin {
inherit name; inherit name;
paths = [ paths =
[
script script
] ++ lib.optional (completions != null) completions_file; ]
++ lib.optional (completions != null) completions_file;
}; };
which-nix = writeFishApplication { which-nix = writeFishApplication {
name = "which-nix"; name = "which-nix";
runtimeInputs = with pkgs; [ which coreutils-full procps ]; runtimeInputs = with pkgs; [which coreutils-full procps];
text = /* fish */ '' text =
/*
fish
*/
''
function recurse -a path; function recurse -a path;
if not test -f "$path" if not test -f "$path"
return return
@ -80,15 +90,23 @@ let
recurse (which $arg) recurse (which $arg)
end end
''; '';
completions = /* fish */ '' completions =
/*
fish
*/
''
complete -c which-nix -fa '(__fish_complete_command)' complete -c which-nix -fa '(__fish_complete_command)'
''; '';
}; };
gi = writeFishApplication { gi = writeFishApplication {
name = "gi"; name = "gi";
runtimeInputs = with pkgs; [ fzf gum curl coreutils-full ]; runtimeInputs = with pkgs; [fzf gum curl coreutils-full];
text = /* fish */ '' text =
/*
fish
*/
''
set url https://www.gitignore.io/api set url https://www.gitignore.io/api
if test (count $argv) -eq 0 if test (count $argv) -eq 0
@ -108,7 +126,11 @@ let
echo "$contents" >> .gitignore echo "$contents" >> .gitignore
end end
''; '';
completions = /* fish */ '' completions =
/*
fish
*/
''
set args (curl -sL https://www.gitignore.io/api/list | string split ",") set args (curl -sL https://www.gitignore.io/api/list | string split ",")
complete -c gi -fa "$args" complete -c gi -fa "$args"
''; '';
@ -116,8 +138,12 @@ let
tmux-switch = pkgs.writeShellApplication { tmux-switch = pkgs.writeShellApplication {
name = "tmux-switch"; name = "tmux-switch";
runtimeInputs = with pkgs; [ tmux ]; runtimeInputs = with pkgs; [tmux];
text = /* bash */ '' text =
/*
bash
*/
''
if [[ -z ''${TMUX+x} ]]; then if [[ -z ''${TMUX+x} ]]; then
tmux attach -t "$1" tmux attach -t "$1"
else else
@ -128,22 +154,26 @@ let
tmux-sessionizer = pkgs.writeFishApplication { tmux-sessionizer = pkgs.writeFishApplication {
name = "ts"; name = "ts";
runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd tmux-new gawk ]; runtimeInputs = with pkgs; [tmux findutils coreutils procps fd tmux-new gawk];
text = readFile ./tmux-sessionizer/script.fish; text = readFile ./tmux-sessionizer/script.fish;
completions = readFile ./tmux-sessionizer/completions.fish; completions = readFile ./tmux-sessionizer/completions.fish;
}; };
tmux-attach = pkgs.writeFishApplication { tmux-attach = pkgs.writeFishApplication {
name = "ta"; name = "ta";
runtimeInputs = with pkgs; [ tmux tmux-switch ]; runtimeInputs = with pkgs; [tmux tmux-switch];
text = readFile ./tmux-attach/script.fish; text = readFile ./tmux-attach/script.fish;
completions = readFile ./tmux-attach/completions.fish; completions = readFile ./tmux-attach/completions.fish;
}; };
tmux-new = pkgs.writeFishApplication { tmux-new = pkgs.writeFishApplication {
name = "tn"; name = "tn";
runtimeInputs = with pkgs; [ tmux ]; runtimeInputs = with pkgs; [tmux];
text = /* fish */ '' text =
/*
fish
*/
''
if ! tmux has-session -t $argv[1] 2> /dev/null if ! tmux has-session -t $argv[1] 2> /dev/null
tmux new-session -ds $argv[1] -c $argv[2] tmux new-session -ds $argv[1] -c $argv[2]
end end
@ -151,17 +181,18 @@ let
tmux-switch $argv[1] tmux-switch $argv[1]
''; '';
}; };
in in {
{
options.my.scripts = { options.my.scripts = {
enable = lib.mkEnableOption "My Scripts"; enable = lib.mkEnableOption "My Scripts";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = [ environment.systemPackages =
[
which-nix which-nix
gi gi
] ++ lib.optional config.my.programs.tmux.enable [ ]
++ lib.optional config.my.programs.tmux.enable [
tmux-sessionizer tmux-sessionizer
tmux-attach tmux-attach
tmux-switch tmux-switch

View file

@ -1,15 +1,13 @@
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.programs.spotify-player;
toml = pkgs.formats.toml { };
in
{ {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.my.programs.spotify-player;
toml = pkgs.formats.toml {};
in {
options.my.programs.spotify-player = { options.my.programs.spotify-player = {
enable = mkEnableOption "spotify-player"; enable = mkEnableOption "spotify-player";
package = mkOption { package = mkOption {
@ -18,7 +16,7 @@ in
}; };
config = mkOption { config = mkOption {
inherit (toml) type; inherit (toml) type;
default = { }; default = {};
}; };
}; };
@ -27,7 +25,7 @@ in
xdg.configFile."spotify-player/app.toml" = { xdg.configFile."spotify-player/app.toml" = {
source = toml.generate "app.toml" cfg.config; source = toml.generate "app.toml" cfg.config;
}; };
home.packages = [ cfg.package ]; home.packages = [cfg.package];
}; };
}; };
} }

View file

@ -1,17 +1,15 @@
{ 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 = { options.my.programs.ssh = {
enable = mkEnableOption "ssh"; enable = mkEnableOption "ssh";
includes = mkOption { includes = mkOption {
default = [ ]; default = [];
type = with types; listOf str; type = with types; listOf str;
}; };
}; };

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