diff --git a/SwarselSystems.org b/SwarselSystems.org
index 97bb774..8e96c99 100644
--- a/SwarselSystems.org
+++ b/SwarselSystems.org
@@ -54,7 +54,7 @@ This file is structured as follows:
#+RESULTS:
: --prefix=/nix/store/lymgpfqr5dp1wc0khbcbhhjnxq8ccsy9-emacs-pgtk-20240521.0 --disable-build-details --with-modules --with-pgtk --with-compress-install --with-toolkit-scroll-bars --with-native-compilation --without-imagemagick --with-mailutils --without-small-ja-dic --with-tree-sitter --without-xinput2 --with-xwidgets --with-dbus --with-selinux
- This file is not loaded by Emacs directly as the configuration (even though this would be possible) - instead, it generates two more files:
+This file is not loaded by Emacs directly as the configuration (even though this would be possible) - instead, it generates two more files:
- =early-init.el=
This file handle startup optimization and sets up the basic frame that I will be working in.
@@ -64,19 +64,19 @@ This file is structured as follows:
By using the configuration offered by this file, the file you are reading right now (=SwarselSystems.org=) will not be freshly tangled on every file save, as this slows down emacs over time. However, when you clone this configuration yourself and have not yet activated it, you need to tangle the file yourself. This can be done using the general keybind =C-c C-v t= or my personal chord =C-SPC o t=. Alternatively, execute the following block:
- #+begin_src emacs-lisp :tangle no :export both :results silent
+#+begin_src emacs-lisp :tangle no :export both :results silent
- (org-babel-tangle)
+ (org-babel-tangle)
- #+end_src
+#+end_src
The =.html= version of this page can be generated by calling the chord =C-SPC o e=, or by executing the below block
- #+begin_src emacs-lisp :tangle no :export both :results silent
+#+begin_src emacs-lisp :tangle no :export both :results silent
- (org-html-export-to-html)
+ (org-html-export-to-html)
- #+end_src
+#+end_src
The web version is useful because it allows navigation using org-mode links, which makes the configuration easier to follow (I hope!).
Lastly, I add this javascript bit to the file in order to have a darkmode toggle when exporting to html:
@@ -87,8 +87,8 @@ Lastly, I add this javascript bit to the file in order to have a darkmode toggle
"")
#+end_src
@@ -130,61 +130,46 @@ In the start, I enable some public cache repositories. This saves some time duri
In =outputs = inputs@ [...]=, the =inputs@= makes it so that all inputs are automatically passed to the outputs and can be called as =inputs.=, whereas explicit arguments may just be called by using ==. For most flakes this is fully sufficient, as they do not need to be called often and it saves me maintainance effort with this file.
#+begin_src nix :noweb yes :tangle flake.nix
+ {
+ description = "SwarseFlake - Nix Flake for all SwarselSystems";
+ nixConfig = {
+ extra-substituters = [
+ "https://nix-community.cachix.org"
+ "https://cache.ngi0.nixos.org/"
+ ];
+ extra-trusted-public-keys = [
+ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
+ "cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA="
+ ];
+ };
+ inputs = {
+ <>
+ };
+ outputs =
+ inputs@{ self
+ , nixpkgs
+ , home-manager
+ , systems
+ , ...
+ }:
+ let
+ <>
+ in
{
- description = "SwarseFlake - Nix Flake for all SwarselSystems";
-
- nixConfig = {
- extra-substituters = [
- "https://nix-community.cachix.org"
- "https://cache.ngi0.nixos.org/"
- ];
-
- extra-trusted-public-keys = [
- "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
- "cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA="
- ];
- };
-
- inputs = {
- <>
+ <>
+ nixosConfigurations =
+ <>
+ homeConfigurations =
+ <>
+ darwinConfigurations =
+ <>
+ nixOnDroidConfigurations =
+ <>
+ topology =
+ <>
};
-
- outputs =
- inputs@{ self
- , nixpkgs
- , home-manager
- , systems
- , ...
- }:
- let
- <>
- in
- {
- <>
-
- nixosConfigurations =
- <>
-
- homeConfigurations =
- <>
-
-
- darwinConfigurations =
- <>
-
- nixOnDroidConfigurations =
- <>
-
-
- topology =
- <>
-
- };
- }
-
-
-
+ }
#+end_src
** Pre-commit-hooks (Checks)
:PROPERTIES:
@@ -297,105 +282,67 @@ When setting this option normally, the password would normally be written world-
#+begin_src nix :tangle no :noweb-ref flakeinputs
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
-
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
-
systems.url = "github:nix-systems/default-linux";
-
- # user-level configuration
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
-
- # overlay to access bleeding edge emacs
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
-
- # nix user repository
- # i use this mainly to not have to build all firefox extensions
- # myself as well as for the emacs-init package (tbd)
nur.url = "github:nix-community/NUR";
-
- # provides GL to non-NixOS hosts
nixgl.url = "github:guibou/nixGL";
-
- # manages all theming using Home-Manager
stylix.url = "github:danth/stylix";
-
- # nix secrets management
sops-nix.url = "github:Mic92/sops-nix";
-
- # enable secure boot on NixOS
lanzaboote.url = "github:nix-community/lanzaboote";
-
- # nix for android
nix-on-droid = {
url = "github:nix-community/nix-on-droid/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
-
- # generate NixOS images
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
-
- # hardware quirks on nix
nixos-hardware = {
url = "github:NixOS/nixos-hardware/master";
};
-
- # dynamic library loading
nix-alien = {
url = "github:thiagokokada/nix-alien";
};
-
- # automatic nintendo switch payload injection
nswitch-rcm-nix = {
url = "github:Swarsel/nswitch-rcm-nix";
};
-
- # weekly updated nix-index database
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
-
disko = {
- url = "github:nix-community/disko";
- inputs.nixpkgs.follows = "nixpkgs";
+ url = "github:nix-community/disko";
+ inputs.nixpkgs.follows = "nixpkgs";
};
-
impermanence.url = "github:nix-community/impermanence";
-
zjstatus = {
url = "github:dj95/zjstatus";
};
-
fw-fanctrl = {
url = "github:TamtamHero/fw-fanctrl/packaging/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
-
nix-darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
-
pre-commit-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
-
nix-secrets = {
url = "git+ssh://git@github.com/Swarsel/nix-secrets.git?ref=main&shallow=1";
flake = false;
inputs = { };
};
-
nix-topology.url = "github:oddlama/nix-topology";
#+end_src
@@ -486,42 +433,42 @@ In this section I am creating some attributes that define general concepts of my
];
appSet = lib.swarselsystems.mkApps system appNames self;
in
- {
- inherit appSet;
- default = appSet.bootstrap;
- });
+ {
+ inherit appSet;
+ default = appSet.bootstrap;
+ });
devShells = lib.swarselsystems.forAllSystems (system:
let
pkgs = lib.swarselsystems.pkgsFor.${system};
checks = self.checks.${system};
in
- {
- default = pkgs.mkShell {
- NIX_CONFIG = "experimental-features = nix-command flakes";
- inherit (checks.pre-commit-check) shellHook;
- buildInputs = checks.pre-commit-check.enabledPackages;
- nativeBuildInputs = [
- pkgs.nix
- pkgs.home-manager
- pkgs.git
- pkgs.just
- pkgs.age
- pkgs.ssh-to-age
- pkgs.sops
- pkgs.statix
- pkgs.deadnix
- pkgs.nixpkgs-fmt
- ];
- };
- }
+ {
+ default = pkgs.mkShell {
+ NIX_CONFIG = "experimental-features = nix-command flakes";
+ inherit (checks.pre-commit-check) shellHook;
+ buildInputs = checks.pre-commit-check.enabledPackages;
+ nativeBuildInputs = [
+ pkgs.nix
+ pkgs.home-manager
+ pkgs.git
+ pkgs.just
+ pkgs.age
+ pkgs.ssh-to-age
+ pkgs.sops
+ pkgs.statix
+ pkgs.deadnix
+ pkgs.nixpkgs-fmt
+ ];
+ };
+ }
);
checks = lib.swarselsystems.forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
- import ./checks { inherit self inputs system pkgs; }
+ import ./checks { inherit self inputs system pkgs; }
);
#+end_src
@@ -880,7 +827,7 @@ My work machine. Built for more security, this is the gold standard of my config
inputs.home-manager.nixosModules.home-manager
{
- home-manager.users.swarsel.imports = outputs.mixedModules ++ [
+ home-manager.users.swarsel.imports = outputs.mixedModules ++ [
"${profilesPath}/optional/home/gaming.nix"
"${profilesPath}/optional/home/work.nix"
] ++ (builtins.attrValues outputs.homeManagerModules);
@@ -906,15 +853,15 @@ My work machine. Built for more security, this is the gold standard of my config
resumeDevice = "/dev/disk/by-label/nixos";
};
- hardware = {
- amdgpu = {
- opencl.enable = true;
- amdvlk = {
- enable = true;
- support32Bit.enable = true;
- };
- };
- };
+ hardware = {
+ amdgpu = {
+ opencl.enable = true;
+ amdvlk = {
+ enable = true;
+ support32Bit.enable = true;
+ };
+ };
+ };
programs.fw-fanctrl.enable = true;
@@ -932,143 +879,147 @@ My work machine. Built for more security, this is the gold standard of my config
'';
};
- swarselsystems = lib.recursiveUpdate {
- wallpaper = self + /wallpaper/lenovowp.png;
- hasBluetooth = true;
- hasFingerprint = true;
- isImpermanence = false;
- isSecureBoot = true;
- isCrypted = true;
- } sharedOptions;
+ swarselsystems = lib.recursiveUpdate
+ {
+ wallpaper = self + /wallpaper/lenovowp.png;
+ hasBluetooth = true;
+ hasFingerprint = true;
+ isImpermanence = false;
+ isSecureBoot = true;
+ isCrypted = true;
+ }
+ sharedOptions;
- home-manager.users.swarsel.swarselsystems = lib.recursiveUpdate {
- isLaptop = true;
- isNixos = true;
- flakePath = "/home/swarsel/.dotfiles";
- cpuCount = 16;
- # temperatureHwmon = {
- # isAbsolutePath = true;
- # path = "/sys/devices/platform/thinkpad_hwmon/hwmon/";
- # input-filename = "temp1_input";
- # };
- # ------ -----
- # | DP-4 | |eDP-1|
- # ------ -----
- startup = [
- { command = "nextcloud --background"; }
- { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
- { command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
- { command = "ANKI_WAYLAND=1 anki"; }
- { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
- { command = "nm-applet"; }
- { command = "teams-for-linux"; }
- { command = "1password"; }
- { command = "feishin"; }
- ];
- sharescreen = "eDP-2";
- lowResolution = "1280x800";
- highResolution = "2560x1600";
- monitors = {
- main = {
- name = "BOE 0x0BC9 Unknown";
- mode = "2560x1600"; # TEMPLATE
- scale = "1";
- position = "2560,0";
- workspace = "15:L";
- output = "eDP-2";
- };
- homedesktop = {
- name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
- mode = "2560x1440";
- scale = "1";
- position = "0,0";
- workspace = "1:一";
- output = "DP-11";
- };
- work_back_middle = {
- name = "LG Electronics LG Ultra HD 0x000305A6";
- mode = "2560x1440";
- scale = "1";
- position = "5120,0";
- workspace = "1:一";
- output = "DP-10";
- };
- work_front_left = {
- name = "LG Electronics LG Ultra HD 0x0007AB45";
- mode = "3840x2160";
- scale = "1";
- position = "5120,0";
- workspace = "1:一";
- output = "DP-7";
- };
- work_back_right = {
- name = "HP Inc. HP Z32 CN41212T55";
- mode = "3840x2160";
- scale = "1";
- position = "5120,0";
- workspace = "1:一";
- output = "DP-3";
- };
- work_middle_middle_main = {
- name = "HP Inc. HP 732pk CNC4080YL5";
- mode = "3840x2160";
- scale = "1";
- position = "-1280,0";
- workspace = "11:M";
- output = "DP-8";
- };
- work_middle_middle_side = {
- name = "Hewlett Packard HP Z24i CN44250RDT";
- mode = "1920x1200";
- transform = "270";
- scale = "1";
- position = "-2480,0";
- workspace = "12:S";
- output = "DP-9";
- };
- work_seminary = {
- name = "Applied Creative Technology Transmitter QUATTRO201811";
- mode = "1280x720";
- scale = "1";
- position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse
- workspace = "12:S";
- output = "DP-4";
- };
- };
- inputs = {
- "12972:18:Framework_Laptop_16_Keyboard_Module_-_ANSI_Keyboard" = {
- xkb_layout = "us";
- xkb_variant = "altgr-intl";
- };
- "1133:45081:MX_Master_2S_Keyboard" = {
- xkb_layout = "us";
- xkb_variant = "altgr-intl";
+ home-manager.users.swarsel.swarselsystems = lib.recursiveUpdate
+ {
+ isLaptop = true;
+ isNixos = true;
+ flakePath = "/home/swarsel/.dotfiles";
+ cpuCount = 16;
+ # temperatureHwmon = {
+ # isAbsolutePath = true;
+ # path = "/sys/devices/platform/thinkpad_hwmon/hwmon/";
+ # input-filename = "temp1_input";
+ # };
+ # ------ -----
+ # | DP-4 | |eDP-1|
+ # ------ -----
+ startup = [
+ { command = "nextcloud --background"; }
+ { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
+ { command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
+ { command = "ANKI_WAYLAND=1 anki"; }
+ { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
+ { command = "nm-applet"; }
+ { command = "teams-for-linux"; }
+ { command = "1password"; }
+ { command = "feishin"; }
+ ];
+ sharescreen = "eDP-2";
+ lowResolution = "1280x800";
+ highResolution = "2560x1600";
+ monitors = {
+ main = {
+ name = "BOE 0x0BC9 Unknown";
+ mode = "2560x1600"; # TEMPLATE
+ scale = "1";
+ position = "2560,0";
+ workspace = "15:L";
+ output = "eDP-2";
+ };
+ homedesktop = {
+ name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
+ mode = "2560x1440";
+ scale = "1";
+ position = "0,0";
+ workspace = "1:一";
+ output = "DP-11";
+ };
+ work_back_middle = {
+ name = "LG Electronics LG Ultra HD 0x000305A6";
+ mode = "2560x1440";
+ scale = "1";
+ position = "5120,0";
+ workspace = "1:一";
+ output = "DP-10";
+ };
+ work_front_left = {
+ name = "LG Electronics LG Ultra HD 0x0007AB45";
+ mode = "3840x2160";
+ scale = "1";
+ position = "5120,0";
+ workspace = "1:一";
+ output = "DP-7";
+ };
+ work_back_right = {
+ name = "HP Inc. HP Z32 CN41212T55";
+ mode = "3840x2160";
+ scale = "1";
+ position = "5120,0";
+ workspace = "1:一";
+ output = "DP-3";
+ };
+ work_middle_middle_main = {
+ name = "HP Inc. HP 732pk CNC4080YL5";
+ mode = "3840x2160";
+ scale = "1";
+ position = "-1280,0";
+ workspace = "11:M";
+ output = "DP-8";
+ };
+ work_middle_middle_side = {
+ name = "Hewlett Packard HP Z24i CN44250RDT";
+ mode = "1920x1200";
+ transform = "270";
+ scale = "1";
+ position = "-2480,0";
+ workspace = "12:S";
+ output = "DP-9";
+ };
+ work_seminary = {
+ name = "Applied Creative Technology Transmitter QUATTRO201811";
+ mode = "1280x720";
+ scale = "1";
+ position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse
+ workspace = "12:S";
+ output = "DP-4";
+ };
};
- "2362:628:PIXA3854:00_093A:0274_Touchpad" = {
- dwt = "enabled";
- tap = "enabled";
- natural_scroll = "enabled";
- middle_emulation = "enabled";
+ inputs = {
+ "12972:18:Framework_Laptop_16_Keyboard_Module_-_ANSI_Keyboard" = {
+ xkb_layout = "us";
+ xkb_variant = "altgr-intl";
+ };
+ "1133:45081:MX_Master_2S_Keyboard" = {
+ xkb_layout = "us";
+ xkb_variant = "altgr-intl";
+ };
+ "2362:628:PIXA3854:00_093A:0274_Touchpad" = {
+ dwt = "enabled";
+ tap = "enabled";
+ natural_scroll = "enabled";
+ middle_emulation = "enabled";
+ };
+ "1133:50504:Logitech_USB_Receiver" = {
+ xkb_layout = "us";
+ xkb_variant = "altgr-intl";
+ };
+ "1133:45944:MX_KEYS_S" = {
+ xkb_layout = "us";
+ xkb_variant = "altgr-intl";
+ };
};
- "1133:50504:Logitech_USB_Receiver" = {
- xkb_layout = "us";
- xkb_variant = "altgr-intl";
+ keybindings = {
+ "Mod4+Ctrl+Shift+p" = "exec screenshare";
};
- "1133:45944:MX_KEYS_S" = {
- xkb_layout = "us";
- xkb_variant = "altgr-intl";
+ shellAliases = {
+ ans2-15_3-9 = ". ~/.venvs/ansible39_2_15_0/bin/activate";
+ ans3-9 = ". ~/.venvs/ansible39/bin/activate";
+ ans = ". ~/.venvs/ansible/bin/activate";
+ ans2-15 = ". ~/.venvs/ansible2.15.0/bin/activate";
};
- };
- keybindings = {
- "Mod4+Ctrl+Shift+p" = "exec screenshare";
- };
- shellAliases = {
- ans2-15_3-9 = ". ~/.venvs/ansible39_2_15_0/bin/activate";
- ans3-9 = ". ~/.venvs/ansible39/bin/activate";
- ans = ". ~/.venvs/ansible/bin/activate";
- ans2-15 = ". ~/.venvs/ansible2.15.0/bin/activate";
- };
- } sharedOptions;
+ }
+ sharedOptions;
}
@@ -1226,7 +1177,7 @@ This is my main server that I run at home. It handles most tasks that require bi
inputs.home-manager.nixosModules.home-manager
{
home-manager.users.swarsel.imports = [
- "${profilesPath}/server/home"
+ "${profilesPath}/server/home"
] ++ (builtins.attrValues outputs.homeManagerModules);
}
@@ -1558,7 +1509,7 @@ This is a slim setup for developing base configuration. I do not track the hardw
in
{
- imports = [
+ imports = [
inputs.disko.nixosModules.disko
"${self}/hosts/nixos/toto/disk-config.nix"
./hardware-configuration.nix
@@ -1579,7 +1530,7 @@ This is a slim setup for developing base configuration. I do not track the hardw
inputs.home-manager.nixosModules.home-manager
{
- home-manager.users.swarsel.imports = [
+ home-manager.users.swarsel.imports = [
inputs.sops-nix.homeManagerModules.sops
"${profilesPath}/common/home/settings.nix"
"${profilesPath}/common/home/sops.nix"
@@ -1622,22 +1573,26 @@ This is a slim setup for developing base configuration. I do not track the hardw
firewall.enable = false;
};
- swarselsystems = lib.recursiveUpdate {
- wallpaper = self + /wallpaper/lenovowp.png;
- isImpermanence = true;
- isCrypted = true;
- isSecureBoot = false;
- isSwap = true;
- swapSize = "8G";
- # rootDisk = "/dev/nvme0n1";
- rootDisk = "/dev/vda";
- } sharedOptions;
-
- home-manager.users.swarsel.swarselsystems = lib.recursiveUpdate {
- isLaptop = false;
- isNixos = true;
- flakePath = "/home/swarsel/.dotfiles";
- } sharedOptions;
+ swarselsystems = lib.recursiveUpdate
+ {
+ wallpaper = self + /wallpaper/lenovowp.png;
+ isImpermanence = true;
+ isCrypted = true;
+ isSecureBoot = false;
+ isSwap = true;
+ swapSize = "8G";
+ # rootDisk = "/dev/nvme0n1";
+ rootDisk = "/dev/vda";
+ }
+ sharedOptions;
+
+ home-manager.users.swarsel.swarselsystems = lib.recursiveUpdate
+ {
+ isLaptop = false;
+ isNixos = true;
+ flakePath = "/home/swarsel/.dotfiles";
+ }
+ sharedOptions;
}
@@ -1789,17 +1744,17 @@ For added convenience, the live environment displays a helpful text on login, we
#+begin_src bash :tangle programs/etc/issue
[32m~SwarselSystems~[0m
- IP of primary interface: [31m\4[0m
- The Password for all users & root is '[31msetup[0m'.
- Install the system remotely by running '[33mbootstrap -n -d [0m' on a machine with deployed secrets.
- Alternatively, run '[33mswarsel-install -n [0m' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access).
+ IP of primary interface: [31m\4[0m
+ The Password for all users & root is '[31msetup[0m'.
+ Install the system remotely by running '[33mbootstrap -n -d [0m' on a machine with deployed secrets.
+ Alternatively, run '[33mswarsel-install -n [0m' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access).
#+end_src
Also, an initial bash history is provided to allow for a very quick local deployment:
#+begin_src shell :tangle programs/bash/.bash_history
-swarsel-install -n chaostheatre
+ swarsel-install -n chaostheatre
#+end_src
@@ -2091,8 +2046,8 @@ Note: The structure of generating the packages was changed in commit =2cf03a3 re
"vershell"
"eontimer"
];
- in
- lib.swarselsystems.mkPackages packageNames pkgs
+ in
+ lib.swarselsystems.mkPackages packageNames pkgs
#+end_src
@@ -2773,14 +2728,14 @@ This program sets up a new NixOS host remotely. It also takes care of secret man
SOPS_FILE=".sops.yaml"
sed -i "{
- # Remove any * and & entries for this host
- /[*&]$key_name/ d;
- # Inject a new age: entry
- # n matches the first line following age: and p prints it, then we transform it while reusing the spacing
- /age:/{n; p; s/\(.*- \*\).*/\1$key_name/};
- # Inject a new hosts or user: entry
- /&$key_type/{n; p; s/\(.*- &\).*/\1$key_name $key/}
- }" $SOPS_FILE
+ # Remove any * and & entries for this host
+ /[*&]$key_name/ d;
+ # Inject a new age: entry
+ # n matches the first line following age: and p prints it, then we transform it while reusing the spacing
+ /age:/{n; p; s/\(.*- \*\).*/\1$key_name/};
+ # Inject a new hosts or user: entry
+ /&$key_type/{n; p; s/\(.*- &\).*/\1$key_name $key/}
+ }" $SOPS_FILE
green "Updating .sops.yaml"
cd -
}
@@ -3409,7 +3364,6 @@ This program sets up a new NixOS host locally.
sed -i '/swarselsystems\.initialSetup = true;/d' /home/"$target_user"/.dotfiles/hosts/nixos/"$target_config"/hardware-configuration.nix
sudo nixos-rebuild --flake .#"$target_config" switch
green "Post-install finished!"
-
#+end_src
@@ -3566,15 +3520,15 @@ When adding a new entry here, do not forget to add it in the default output of t
};
retroarch = prev.retroarch.withCores (cores: with cores; [
- snes9x # snes
- nestopia # nes
- dosbox # dos
- scummvm # scumm
- vba-m # gb/a
- mgba # gb/a
- melonds # ds
- dolphin # gc/wii
- ]);
+ snes9x # snes
+ nestopia # nes
+ dosbox # dos
+ scummvm # scumm
+ vba-m # gb/a
+ mgba # gb/a
+ melonds # ds
+ dolphin # gc/wii
+ ]);
# #river = prev.river.overrideAttrs (oldAttrs: rec {
# pname = "river";
@@ -4043,10 +3997,10 @@ These are some extra options that will be used if the machine also runs NixOS. F
Provides settings related to nix-darwin systems. At the moment, I am only making use of a =isDarwin= flag.
#+begin_src nix :noweb yes :tangle modules/home/darwin.nix
-{ lib, ... }:
-{
- options.swarselsystems.isDarwin = lib.mkEnableOption "darwin host";
-}
+ { lib, ... }:
+ {
+ options.swarselsystems.isDarwin = lib.mkEnableOption "darwin host";
+ }
#+end_src
***** System startup
@@ -4065,21 +4019,21 @@ These other apps currently include:
Do not that =syncthingtray= is also not mentioned here. It is installed as a home manager package that automatically starts at system start.
#+begin_src nix :tangle modules/home/startup.nix
-{ lib, ... }:
-{
- options.swarselsystems.startup = lib.mkOption {
- type = lib.types.listOf (lib.types.attrsOf lib.types.str);
- default = [
- { command = "nextcloud --background"; }
- { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
- { command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
- { command = "ANKI_WAYLAND=1 anki"; }
- { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
- { command = "nm-applet"; }
- { command = "feishin"; }
- ];
- };
-}
+ { lib, ... }:
+ {
+ options.swarselsystems.startup = lib.mkOption {
+ type = lib.types.listOf (lib.types.attrsOf lib.types.str);
+ default = [
+ { command = "nextcloud --background"; }
+ { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
+ { command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
+ { command = "ANKI_WAYLAND=1 anki"; }
+ { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
+ { command = "nm-applet"; }
+ { command = "feishin"; }
+ ];
+ };
+ }
#+end_src
***** Wallpaper
@@ -4124,7 +4078,7 @@ At work I am using several services that are using SSO login - however, as I am
Set in firefox =about:config > toolkit.legacyUserProfileCustomizations.stylesheets= to true. This should in principle be set automatically using the below config, but it seems not to be working reliably
#+begin_src nix :noweb yes :tangle modules/home/firefox.nix
-{ self, lib, pkgs, ... }:
+ { self, lib, pkgs, ... }:
let
lock-false = {
Value = false;
@@ -4135,248 +4089,248 @@ Set in firefox =about:config > toolkit.legacyUserProfileCustomizations.styleshee
Status = "locked";
};
in
-{
- options.swarselsystems.firefox = lib.mkOption {
- type = lib.types.attrs;
- default = {
- isDefault = false;
- userChrome = builtins.readFile "${self}/programs/firefox/chrome/userChrome.css";
- extensions = with pkgs.nur.repos.rycee.firefox-addons; [
- tridactyl
- tampermonkey
- sidebery
- browserpass
- clearurls
- darkreader
- enhancer-for-youtube
- istilldontcareaboutcookies
- translate-web-pages
- ublock-origin
- reddit-enhancement-suite
- sponsorblock
- web-archives
- onepassword-password-manager
- single-file
- widegithub
- enhanced-github
- unpaywall
- don-t-fuck-with-paste
- plasma-integration
- (buildFirefoxXpiAddon {
- pname = "shortkeys";
- version = "4.0.2";
- addonId = "Shortkeys@Shortkeys.com";
- url = "https://addons.mozilla.org/firefox/downloads/file/3673761/shortkeys-4.0.2.xpi";
- sha256 = "c6fe12efdd7a871787ac4526eea79ecc1acda8a99724aa2a2a55c88a9acf467c";
- meta = with lib;
- {
- description = "Easily customizable custom keyboard shortcuts for Firefox. To configure this addon go to Addons (ctrl+shift+a) ->Shortkeys ->Options. Report issues here (please specify that the issue is found in Firefox): https://github.com/mikecrittenden/shortkeys";
- mozPermissions = [
- "tabs"
- "downloads"
- "clipboardWrite"
- "browsingData"
- "storage"
- "bookmarks"
- "sessions"
- ""
- ];
- platforms = platforms.all;
- };
- })
- ];
-
- settings =
- {
- "extensions.autoDisableScopes" = 0;
- "browser.bookmarks.showMobileBookmarks" = lock-true;
- "toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true;
- "browser.search.suggest.enabled" = lock-false;
- "browser.search.suggest.enabled.private" = lock-false;
- "browser.urlbar.suggest.searches" = lock-false;
- "browser.urlbar.showSearchSuggestionsFirst" = lock-false;
- "browser.topsites.contile.enabled" = lock-false;
- "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false;
- "browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
- "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false;
- "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false;
- "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false;
- "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false;
- "browser.newtabpage.activity-stream.showSponsored" = lock-false;
- "browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
- "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
- };
+ {
+ options.swarselsystems.firefox = lib.mkOption {
+ type = lib.types.attrs;
+ default = {
+ isDefault = false;
+ userChrome = builtins.readFile "${self}/programs/firefox/chrome/userChrome.css";
+ extensions = with pkgs.nur.repos.rycee.firefox-addons; [
+ tridactyl
+ tampermonkey
+ sidebery
+ browserpass
+ clearurls
+ darkreader
+ enhancer-for-youtube
+ istilldontcareaboutcookies
+ translate-web-pages
+ ublock-origin
+ reddit-enhancement-suite
+ sponsorblock
+ web-archives
+ onepassword-password-manager
+ single-file
+ widegithub
+ enhanced-github
+ unpaywall
+ don-t-fuck-with-paste
+ plasma-integration
+ (buildFirefoxXpiAddon {
+ pname = "shortkeys";
+ version = "4.0.2";
+ addonId = "Shortkeys@Shortkeys.com";
+ url = "https://addons.mozilla.org/firefox/downloads/file/3673761/shortkeys-4.0.2.xpi";
+ sha256 = "c6fe12efdd7a871787ac4526eea79ecc1acda8a99724aa2a2a55c88a9acf467c";
+ meta = with lib;
+ {
+ description = "Easily customizable custom keyboard shortcuts for Firefox. To configure this addon go to Addons (ctrl+shift+a) ->Shortkeys ->Options. Report issues here (please specify that the issue is found in Firefox): https://github.com/mikecrittenden/shortkeys";
+ mozPermissions = [
+ "tabs"
+ "downloads"
+ "clipboardWrite"
+ "browsingData"
+ "storage"
+ "bookmarks"
+ "sessions"
+ ""
+ ];
+ platforms = platforms.all;
+ };
+ })
+ ];
- search = {
- default = "Kagi";
- privateDefault = "Kagi";
- engines = {
- "Kagi" = {
- urls = [{
- template = "https://kagi.com/search";
- params = [
- { name = "q"; value = "{searchTerms}"; }
- ];
- }];
- iconUpdateURL = "https://kagi.com/favicon.ico";
- updateInterval = 24 * 60 * 60 * 1000; # every day
- definedAliases = [ "@k" ];
+ settings =
+ {
+ "extensions.autoDisableScopes" = 0;
+ "browser.bookmarks.showMobileBookmarks" = lock-true;
+ "toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true;
+ "browser.search.suggest.enabled" = lock-false;
+ "browser.search.suggest.enabled.private" = lock-false;
+ "browser.urlbar.suggest.searches" = lock-false;
+ "browser.urlbar.showSearchSuggestionsFirst" = lock-false;
+ "browser.topsites.contile.enabled" = lock-false;
+ "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false;
+ "browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
+ "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false;
+ "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false;
+ "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false;
+ "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false;
+ "browser.newtabpage.activity-stream.showSponsored" = lock-false;
+ "browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
+ "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
};
- "Nix Packages" = {
- urls = [{
- template = "https://search.nixos.org/packages";
- params = [
- { name = "type"; value = "packages"; }
- { name = "query"; value = "{searchTerms}"; }
- ];
- }];
- icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
- definedAliases = [ "@np" ];
- };
+ search = {
+ default = "Kagi";
+ privateDefault = "Kagi";
+ engines = {
+ "Kagi" = {
+ urls = [{
+ template = "https://kagi.com/search";
+ params = [
+ { name = "q"; value = "{searchTerms}"; }
+ ];
+ }];
+ iconUpdateURL = "https://kagi.com/favicon.ico";
+ updateInterval = 24 * 60 * 60 * 1000; # every day
+ definedAliases = [ "@k" ];
+ };
- "NixOS Wiki" = {
- urls = [{
- template = "https://nixos.wiki/index.php?search={searchTerms}";
- }];
- iconUpdateURL = "https://nixos.wiki/favicon.png";
- updateInterval = 24 * 60 * 60 * 1000; # every day
- definedAliases = [ "@nw" ];
- };
+ "Nix Packages" = {
+ urls = [{
+ template = "https://search.nixos.org/packages";
+ params = [
+ { name = "type"; value = "packages"; }
+ { name = "query"; value = "{searchTerms}"; }
+ ];
+ }];
+ icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+ definedAliases = [ "@np" ];
+ };
- "NixOS Options" = {
- urls = [{
- template = "https://search.nixos.org/options";
- params = [
- { name = "query"; value = "{searchTerms}"; }
- ];
- }];
+ "NixOS Wiki" = {
+ urls = [{
+ template = "https://nixos.wiki/index.php?search={searchTerms}";
+ }];
+ iconUpdateURL = "https://nixos.wiki/favicon.png";
+ updateInterval = 24 * 60 * 60 * 1000; # every day
+ definedAliases = [ "@nw" ];
+ };
- icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
- definedAliases = [ "@no" ];
- };
+ "NixOS Options" = {
+ urls = [{
+ template = "https://search.nixos.org/options";
+ params = [
+ { name = "query"; value = "{searchTerms}"; }
+ ];
+ }];
- "Home Manager Options" = {
- urls = [{
- template = "https://home-manager-options.extranix.com/";
- params = [
- { name = "query"; value = "{searchTerms}"; }
- ];
- }];
+ icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+ definedAliases = [ "@no" ];
+ };
- icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
- definedAliases = [ "@hm" "@ho" "@hmo" ];
- };
+ "Home Manager Options" = {
+ urls = [{
+ template = "https://home-manager-options.extranix.com/";
+ params = [
+ { name = "query"; value = "{searchTerms}"; }
+ ];
+ }];
+
+ icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+ definedAliases = [ "@hm" "@ho" "@hmo" ];
+ };
- "Google".metaData.alias = "@g";
+ "Google".metaData.alias = "@g";
+ };
+ force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
};
- force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
};
};
- };
-}
+ }
#+end_src
*** Library functions
- This section defines all functions of my own that I add to =lib=. These are used in all places over the config, with many of them being used in =flake.nix=.
+This section defines all functions of my own that I add to =lib=. These are used in all places over the config, with many of them being used in =flake.nix=.
- A breakdown of each function:
+A breakdown of each function:
#+begin_src nix :tangle lib/default.nix
-{ self, lib, systems, inputs, outputs, ... }:
-{
+ { self, lib, systems, inputs, outputs, ... }:
+ {
- mkIfElseList = p: yes: no: lib.mkMerge [
- (lib.mkIf p yes)
- (lib.mkIf (!p) no)
- ];
+ mkIfElseList = p: yes: no: lib.mkMerge [
+ (lib.mkIf p yes)
+ (lib.mkIf (!p) no)
+ ];
- mkIfElse = p: yes: no: if p then yes else no;
+ mkIfElse = p: yes: no: if p then yes else no;
- forAllSystems = lib.genAttrs [
- "x86_64-linux"
- "aarch64-linux"
- "x86_64-darwin"
- "aarch64-darwin"
- ];
+ forAllSystems = lib.genAttrs [
+ "x86_64-linux"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
+ ];
- pkgsFor = lib.genAttrs (import systems) (system:
- import inputs.nixpkgs {
- inherit system;
- config.allowUnfree = true;
- }
- );
+ pkgsFor = lib.genAttrs (import systems) (system:
+ import inputs.nixpkgs {
+ inherit system;
+ config.allowUnfree = true;
+ }
+ );
- forEachSystem = f: lib.genAttrs (import systems) (system: f lib.swarselsystems.pkgsFor.${system});
+ forEachSystem = f: lib.genAttrs (import systems) (system: f lib.swarselsystems.pkgsFor.${system});
- mkFullHost = host: type: {
- ${host} =
- let
- systemFunc = if (type == "nixos") then lib.nixosSystem else inputs.nix-darwin.lib.darwinSystem;
- in
- systemFunc {
- specialArgs = { inherit inputs outputs lib self; };
- modules = [ "${self}/hosts/${type}/${host}" ];
- };
- };
+ mkFullHost = host: type: {
+ ${host} =
+ let
+ systemFunc = if (type == "nixos") then lib.nixosSystem else inputs.nix-darwin.lib.darwinSystem;
+ in
+ systemFunc {
+ specialArgs = { inherit inputs outputs lib self; };
+ modules = [ "${self}/hosts/${type}/${host}" ];
+ };
+ };
- mkHalfHost = host: type: pkgs: {
- ${host} =
- let
- systemFunc = if (type == "home") then inputs.home-manager.lib.homeManagerConfiguration else inputs.nix-on-droid.lib.nixOnDroidConfiguration;
- in
- systemFunc {
- inherit pkgs;
- extraSpecialArgs = { inherit inputs outputs; };
- modules = [ "${self}/hosts/${type}/${host}" ];
- };
- };
+ mkHalfHost = host: type: pkgs: {
+ ${host} =
+ let
+ systemFunc = if (type == "home") then inputs.home-manager.lib.homeManagerConfiguration else inputs.nix-on-droid.lib.nixOnDroidConfiguration;
+ in
+ systemFunc {
+ inherit pkgs;
+ extraSpecialArgs = { inherit inputs outputs; };
+ modules = [ "${self}/hosts/${type}/${host}" ];
+ };
+ };
- mkFullHostConfigs = hosts: type: lib.foldl (acc: set: acc // set) { } (lib.map (host: lib.swarselsystems.mkFullHost host type) hosts);
+ mkFullHostConfigs = hosts: type: lib.foldl (acc: set: acc // set) { } (lib.map (host: lib.swarselsystems.mkFullHost host type) hosts);
- mkHalfHostConfigs = hosts: type: pkgs: lib.foldl (acc: set: acc // set) { } (lib.map (host: lib.swarselsystems.mkHalfHost host type pkgs) hosts);
+ mkHalfHostConfigs = hosts: type: pkgs: lib.foldl (acc: set: acc // set) { } (lib.map (host: lib.swarselsystems.mkHalfHost host type pkgs) hosts);
- readHosts = type: lib.attrNames (builtins.readDir "${self}/hosts/${type}");
+ readHosts = type: lib.attrNames (builtins.readDir "${self}/hosts/${type}");
- mkApps = system: names: self: builtins.listToAttrs (map
- (name: {
- inherit name;
- value = {
- type = "app";
- program = "${self.packages.${system}.${name}}/bin/${name}";
- };
- })
- names);
+ mkApps = system: names: self: builtins.listToAttrs (map
+ (name: {
+ inherit name;
+ value = {
+ type = "app";
+ program = "${self.packages.${system}.${name}}/bin/${name}";
+ };
+ })
+ names);
- mkPackages = names: pkgs: builtins.listToAttrs (map
- (name: {
- inherit name;
- value = pkgs.callPackage "${self}/pkgs/${name}" { inherit self name; };
- })
- names);
+ mkPackages = names: pkgs: builtins.listToAttrs (map
+ (name: {
+ inherit name;
+ value = pkgs.callPackage "${self}/pkgs/${name}" { inherit self name; };
+ })
+ names);
- mkModules = names: type: builtins.listToAttrs (map
- (name: {
- inherit name;
- value = import "${self}/modules/${type}/${name}.nix";
- })
- names);
+ mkModules = names: type: builtins.listToAttrs (map
+ (name: {
+ inherit name;
+ value = import "${self}/modules/${type}/${name}.nix";
+ })
+ names);
- eachMonitor = _: monitor: {
- inherit (monitor) name;
- value = builtins.removeAttrs monitor [ "workspace" "name" "output" ];
- };
+ eachMonitor = _: monitor: {
+ inherit (monitor) name;
+ value = builtins.removeAttrs monitor [ "workspace" "name" "output" ];
+ };
- eachOutput = _: monitor: {
- inherit (monitor) name;
- value = builtins.removeAttrs monitor [ "mode" "name" "scale" "transform" "position" ];
- };
+ eachOutput = _: monitor: {
+ inherit (monitor) name;
+ value = builtins.removeAttrs monitor [ "mode" "name" "scale" "transform" "position" ];
+ };
-}
+ }
#+end_src
** NixOS
@@ -4451,7 +4405,7 @@ This section is for setting things that should be used on hosts that are using t
}
- #+end_src
+#+end_src
**** General NixOS settings (stateVersion)
:PROPERTIES:
@@ -4491,7 +4445,7 @@ Also, the system state version is set here. No need to touch it.
system.stateVersion = lib.mkDefault "23.05";
}
- #+end_src
+#+end_src
**** System Packages
:PROPERTIES:
@@ -4634,7 +4588,7 @@ We enable the use of =home-manager= as a NixoS module. A nice trick here is the
extraSpecialArgs = inputs; # used mainly for inputs.self
};
}
- #+end_src
+#+end_src
**** Setup login keymap
:PROPERTIES:
@@ -4653,7 +4607,7 @@ Next, we setup the keymap in case we are not in a graphical session. At this poi
};
};
}
- #+end_src
+#+end_src
**** User setup, Make users non-mutable
:PROPERTIES:
@@ -5212,19 +5166,19 @@ I use sops-nix to handle secrets that I want to have available on my machines at
WIREGUARDPUB=${config.sops.placeholder.wireguardpub}
WIREGUARDENDPOINT=${config.sops.placeholder.wireguardendpoint}
'';
- ".authinfo" = {
- owner = "swarsel";
- path = "${config.users.users.swarsel.home}/.emacs.d/.authinfo";
- content = ''
- machine stash.swarsel.win:443 port https login ${config.sops.placeholder.stashuser} password ${config.sops.placeholder.stashpass}
- machine gitlab.com/api/v4 login ${config.sops.placeholder.githubforgeuser} password ${config.sops.placeholder.githubforgepass}
- machine api.github.com login ${config.sops.placeholder.gitlabforgeuser} password ${config.sops.placeholder.gitlabforgepass}
- '';
- };
+ # ".authinfo" = {
+ # owner = "swarsel";
+ # path = "${config.users.users.swarsel.home}/.emacs.d/.authinfo";
+ # content = ''
+ # machine stash.swarsel.win:443 port https login ${config.sops.placeholder.stashuser} password ${config.sops.placeholder.stashpass}
+ # machine gitlab.com/api/v4 login ${config.sops.placeholder.githubforgeuser} password ${config.sops.placeholder.githubforgepass}
+ # machine api.github.com login ${config.sops.placeholder.gitlabforgeuser} password ${config.sops.placeholder.gitlabforgepass}
+ # '';
+ # };
};
};
}
- #+end_src
+#+end_src
**** Theme (stylix)
:PROPERTIES:
@@ -5387,7 +5341,6 @@ This allows me to use my big scanner/printer's scanning function over the networ
enable = true;
extraBackends = [ pkgs.sane-airscan ];
};
-
#+end_src
****** Printers
@@ -5414,7 +5367,6 @@ This allows me to use my big scanner/printer's printing function over the networ
BrowseProtocols all
'';
};
-
#+end_src
****** Avahi (device discovery)
@@ -5425,7 +5377,6 @@ This allows me to use my big scanner/printer's printing function over the networ
Avahi is the service used for the network discovery.
#+begin_src nix :tangle profiles/common/nixos/networkdevices.nix
-
services.avahi = {
enable = true;
nssmdns4 = true;
@@ -5786,10 +5737,10 @@ Normally, doing that also resets the lecture that happens on the first use of =s
];
files = [
- "/etc/ssh/ssh_host_ed25519_key"
- "/etc/ssh/ssh_host_ed25519_key.pub"
- "/etc/ssh/ssh_host_rsa_key"
- "/etc/ssh/ssh_host_rsa_key.pub"
+ "/etc/ssh/ssh_host_ed25519_key"
+ "/etc/ssh/ssh_host_ed25519_key.pub"
+ "/etc/ssh/ssh_host_rsa_key"
+ "/etc/ssh/ssh_host_rsa_key.pub"
];
};
@@ -5842,29 +5793,29 @@ Used for storing sessions in e.g. Nextcloud. Using this on a system level keeps
This is used to better integrate Sway into the system on NixOS hosts. On the home-manager side, the =package= attribute will be =null= for such an host, using the systems derivation instead.
#+begin_src nix :tangle profiles/common/nixos/sway.nix
- { pkgs, ... }:
- {
+ { pkgs, ... }:
+ {
- programs.sway = {
- enable = true;
- package = pkgs.swayfx;
- wrapperFeatures = {
- base = true;
- gtk = true;
- };
-
- extraSessionCommands = ''
- export XDG_SESSION_DESKTOP=sway
- export SDL_VIDEODRIVER=wayland
- export QT_QPA_PLATFORM=wayland-egl
- export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
- export QT_QPA_PLATFORM_PLUGIN_PATH="${pkgs.libsForQt5.qt5.qtbase.bin}/lib/qt-${pkgs.libsForQt5.qt5.qtbase.version}/plugins";
- export MOZ_ENABLE_WAYLAND=1
- export MOZ_DISABLE_RDD_SANDBOX=1
- '';
+ programs.sway = {
+ enable = true;
+ package = pkgs.swayfx;
+ wrapperFeatures = {
+ base = true;
+ gtk = true;
};
- }
+ extraSessionCommands = ''
+ export XDG_SESSION_DESKTOP=sway
+ export SDL_VIDEODRIVER=wayland
+ export QT_QPA_PLATFORM=wayland-egl
+ export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
+ export QT_QPA_PLATFORM_PLUGIN_PATH="${pkgs.libsForQt5.qt5.qtbase.bin}/lib/qt-${pkgs.libsForQt5.qt5.qtbase.version}/plugins";
+ export MOZ_ENABLE_WAYLAND=1
+ export MOZ_DISABLE_RDD_SANDBOX=1
+ '';
+ };
+
+ }
#+end_src
**** xdg-portal
@@ -6046,42 +5997,42 @@ Also, the system state version is set here. No need to touch it.
in
{
imports = [
- "${profilesPath}/common/nixos/settings.nix"
- "${profilesPath}/common/nixos/home-manager.nix"
- "${profilesPath}/common/nixos/xserver.nix"
- "${profilesPath}/common/nixos/gc.nix"
- "${profilesPath}/common/nixos/store.nix"
- "${profilesPath}/common/nixos/time.nix"
- "${profilesPath}/common/nixos/users.nix"
- "${profilesPath}/common/nixos/nix-ld.nix"
- ./settings.nix
- ./packages.nix
- ./sops.nix
- ./ssh.nix
- ./nfs.nix
- ./nginx.nix
- ./kavita.nix
- ./jellyfin.nix
- ./navidrome.nix
- ./spotifyd.nix
- ./mpd.nix
- ./matrix.nix
- ./pipewire.nix
- ./nextcloud.nix
- ./immich.nix
- ./paperless.nix
- ./transmission.nix
- ./syncthing.nix
- ./restic.nix
- ./monitoring.nix
- ./jenkins.nix
- ./emacs.nix
- ./forgejo.nix
- ./ankisync.nix
- ./freshrss.nix
+ "${profilesPath}/common/nixos/settings.nix"
+ "${profilesPath}/common/nixos/home-manager.nix"
+ "${profilesPath}/common/nixos/xserver.nix"
+ "${profilesPath}/common/nixos/gc.nix"
+ "${profilesPath}/common/nixos/store.nix"
+ "${profilesPath}/common/nixos/time.nix"
+ "${profilesPath}/common/nixos/users.nix"
+ "${profilesPath}/common/nixos/nix-ld.nix"
+ ./settings.nix
+ ./packages.nix
+ ./sops.nix
+ ./ssh.nix
+ ./nfs.nix
+ ./nginx.nix
+ ./kavita.nix
+ ./jellyfin.nix
+ ./navidrome.nix
+ ./spotifyd.nix
+ ./mpd.nix
+ ./matrix.nix
+ ./pipewire.nix
+ ./nextcloud.nix
+ ./immich.nix
+ ./paperless.nix
+ ./transmission.nix
+ ./syncthing.nix
+ ./restic.nix
+ ./monitoring.nix
+ ./jenkins.nix
+ ./emacs.nix
+ ./forgejo.nix
+ ./ankisync.nix
+ ./freshrss.nix
];
}
- #+end_src
+#+end_src
**** General NixOS Server settings
:PROPERTIES:
@@ -6334,50 +6285,50 @@ Here we just define some aliases for rebuilding the system, and we allow some in
:END:
#+begin_src nix :tangle profiles/server/nixos/jellyfin.nix
-{ pkgs, lib, config, ... }:
-{
- config = lib.mkIf config.swarselsystems.server.jellyfin {
- users.users.jellyfin = {
- extraGroups = [ "video" "render" "users" ];
- };
- nixpkgs.config.packageOverrides = pkgs: {
- vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
- };
- hardware.graphics = {
- enable = true;
- extraPackages = with pkgs; [
- intel-media-driver # LIBVA_DRIVER_NAME=iHD
- vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
- vaapiVdpau
- libvdpau-va-gl
- ];
- };
- services.jellyfin = {
- enable = true;
- user = "jellyfin";
- openFirewall = true; # this works only for the default ports
- };
+ { pkgs, lib, config, ... }:
+ {
+ config = lib.mkIf config.swarselsystems.server.jellyfin {
+ users.users.jellyfin = {
+ extraGroups = [ "video" "render" "users" ];
+ };
+ nixpkgs.config.packageOverrides = pkgs: {
+ vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
+ };
+ hardware.graphics = {
+ enable = true;
+ extraPackages = with pkgs; [
+ intel-media-driver # LIBVA_DRIVER_NAME=iHD
+ vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
+ vaapiVdpau
+ libvdpau-va-gl
+ ];
+ };
+ services.jellyfin = {
+ enable = true;
+ user = "jellyfin";
+ openFirewall = true; # this works only for the default ports
+ };
- services.nginx = {
- virtualHosts = {
- "screen.swarsel.win" = {
- enableACME = true;
- forceSSL = true;
- acmeRoot = null;
- locations = {
- "/" = {
- proxyPass = "http://localhost:8096";
- extraConfig = ''
- client_max_body_size 0;
- '';
+ services.nginx = {
+ virtualHosts = {
+ "screen.swarsel.win" = {
+ enableACME = true;
+ forceSSL = true;
+ acmeRoot = null;
+ locations = {
+ "/" = {
+ proxyPass = "http://localhost:8096";
+ extraConfig = ''
+ client_max_body_size 0;
+ '';
+ };
};
};
};
};
};
- };
-}
+ }
#+end_src
**** navidrome
@@ -6532,57 +6483,57 @@ Here we just define some aliases for rebuilding the system, and we allow some in
:END:
#+begin_src nix :tangle profiles/server/nixos/mpd.nix
-{ pkgs, lib, config, ... }:
-{
- config = lib.mkIf config.swarselsystems.server.mpd {
- users = {
- groups = {
- mpd = { };
- };
-
+ { pkgs, lib, config, ... }:
+ {
+ config = lib.mkIf config.swarselsystems.server.mpd {
users = {
- mpd = {
- isSystemUser = true;
- group = "mpd";
- extraGroups = [ "audio" "utmp" ];
+ groups = {
+ mpd = { };
};
- };
- };
- sops = {
- secrets.mpdpass = { owner = "mpd"; };
- };
+ users = {
+ mpd = {
+ isSystemUser = true;
+ group = "mpd";
+ extraGroups = [ "audio" "utmp" ];
+ };
+ };
+ };
- environment.systemPackages = with pkgs; [
- pciutils
- alsa-utils
- mpv
- ];
+ sops = {
+ secrets.mpdpass = { owner = "mpd"; };
+ };
- services.mpd = {
- enable = true;
- musicDirectory = "/media";
- user = "mpd";
- group = "mpd";
- network = {
- port = 3254;
- listenAddress = "any";
- };
- credentials = [
- {
- passwordFile = config.sops.secrets.mpdpass.path;
- permissions = [
- "read"
- "add"
- "control"
- "admin"
- ];
- }
+ environment.systemPackages = with pkgs; [
+ pciutils
+ alsa-utils
+ mpv
];
+
+ services.mpd = {
+ enable = true;
+ musicDirectory = "/media";
+ user = "mpd";
+ group = "mpd";
+ network = {
+ port = 3254;
+ listenAddress = "any";
+ };
+ credentials = [
+ {
+ passwordFile = config.sops.secrets.mpdpass.path;
+ permissions = [
+ "read"
+ "add"
+ "control"
+ "admin"
+ ];
+ }
+ ];
+ };
};
- };
-}
+ }
#+end_src
**** pipewire
@@ -7262,7 +7213,7 @@ Here we just define some aliases for rebuilding the system, and we allow some in
isSystemUser = true;
};
- users.groups.syncthing = {};
+ users.groups.syncthing = { };
services.syncthing = {
enable = true;
@@ -7642,7 +7593,7 @@ It serves both a Greader API at https://signpost.swarsel.win/api/greader.php, as
isSystemUser = true;
};
- users.groups.freshrss = {};
+ users.groups.freshrss = { };
sops.secrets.fresh = { owner = "freshrss"; };
@@ -7730,47 +7681,47 @@ It serves both a Greader API at https://signpost.swarsel.win/api/greader.php, as
:END:
#+begin_src nix :tangle profiles/server/nixos/ankisync.nix
-{ lib, config, ... }:
-{
- config = lib.mkIf config.swarselsystems.server.ankisync {
+ { lib, config, ... }:
+ {
+ config = lib.mkIf config.swarselsystems.server.ankisync {
- networking.firewall.allowedTCPPorts = [ 22701 ];
+ networking.firewall.allowedTCPPorts = [ 22701 ];
- sops.secrets.swarsel = { owner = "root"; };
+ sops.secrets.swarsel = { owner = "root"; };
- services.anki-sync-server = {
- enable = true;
- port = 27701;
- address = "0.0.0.0";
- openFirewall = true;
- users = [
- {
- username = "Swarsel";
- passwordFile = config.sops.secrets.swarsel.path;
- }
- ];
- };
+ services.anki-sync-server = {
+ enable = true;
+ port = 27701;
+ address = "0.0.0.0";
+ openFirewall = true;
+ users = [
+ {
+ username = "Swarsel";
+ passwordFile = config.sops.secrets.swarsel.path;
+ }
+ ];
+ };
- services.nginx = {
- virtualHosts = {
- "synki.swarsel.win" = {
- enableACME = true;
- forceSSL = true;
- acmeRoot = null;
- locations = {
- "/" = {
- proxyPass = "http://localhost:27701";
- extraConfig = ''
- client_max_body_size 0;
- '';
+ services.nginx = {
+ virtualHosts = {
+ "synki.swarsel.win" = {
+ enableACME = true;
+ forceSSL = true;
+ acmeRoot = null;
+ locations = {
+ "/" = {
+ proxyPass = "http://localhost:27701";
+ extraConfig = ''
+ client_max_body_size 0;
+ '';
+ };
};
};
};
};
};
- };
-}
+ }
#+end_src
*** Darwin
@@ -7828,41 +7779,41 @@ These sets of configuration do not need to be deployed on every host, for a mult
This opens a few gaming ports and installs the steam configuration suite for gaming. There are more options in [[#h:84fd7029-ecb6-4131-9333-289982f24ffa][Gaming]] (home-manager side).
#+begin_src nix :tangle profiles/optional/nixos/gaming.nix
-{ pkgs, ... }:
-{
- specialisation = {
- gaming.configuration = {
- networking = {
- firewall = {
- allowedUDPPorts = [ 4380 27036 14242 34197 ]; # 34197: factorio; 4380 27036 14242: barotrauma;
- allowedTCPPorts = [ ]; # 34197: factorio; 4380 27036 14242: barotrauma; 51820: wireguard
- allowedTCPPortRanges = [
- { from = 27015; to = 27030; } # barotrauma
- { from = 27036; to = 27037; } # barotrauma
- ];
- allowedUDPPortRanges = [
- { from = 27000; to = 27031; } # barotrauma
- { from = 58962; to = 58964; } # barotrauma
+ { pkgs, ... }:
+ {
+ specialisation = {
+ gaming.configuration = {
+ networking = {
+ firewall = {
+ allowedUDPPorts = [ 4380 27036 14242 34197 ]; # 34197: factorio; 4380 27036 14242: barotrauma;
+ allowedTCPPorts = [ ]; # 34197: factorio; 4380 27036 14242: barotrauma; 51820: wireguard
+ allowedTCPPortRanges = [
+ { from = 27015; to = 27030; } # barotrauma
+ { from = 27036; to = 27037; } # barotrauma
+ ];
+ allowedUDPPortRanges = [
+ { from = 27000; to = 27031; } # barotrauma
+ { from = 58962; to = 58964; } # barotrauma
+ ];
+ };
+ };
+
+ programs.steam = {
+ enable = true;
+ extraCompatPackages = [
+ pkgs.proton-ge-bin
];
};
- };
- programs.steam = {
- enable = true;
- extraCompatPackages = [
- pkgs.proton-ge-bin
+ hardware.xone.enable = true;
+
+ environment.systemPackages = [
+ pkgs.linuxKernel.packages.linux_6_12.xone
];
};
-
- hardware.xone.enable = true;
-
- environment.systemPackages = [
- pkgs.linuxKernel.packages.linux_6_12.xone
- ];
};
- };
-}
+ }
#+end_src
@@ -8018,10 +7969,12 @@ Options that I need specifically at work. There are more options at [[#h:f0b2ea9
vhostUserPackages = with pkgs; [ virtiofsd ];
ovmf = {
enable = true;
- packages = [(pkgs.OVMFFull.override {
- secureBoot = true;
- tpmSupport = true;
- }).fd];
+ packages = [
+ (pkgs.OVMFFull.override {
+ secureBoot = true;
+ tpmSupport = true;
+ }).fd
+ ];
};
};
};
@@ -8057,7 +8010,7 @@ Options that I need specifically at work. There are more options at [[#h:f0b2ea9
openssh = {
enable = true;
extraConfig = ''
- '';
+ '';
};
syncthing = {
@@ -8094,7 +8047,7 @@ Options that I need specifically at work. There are more options at [[#h:f0b2ea9
:CUSTOM_ID: h:3fc1d301-7bae-4678-9085-d12c23eed8ac
:END:
- These options are really only to be used on the iso image in order to run nixos-anywhere.
+These options are really only to be used on the iso image in order to run nixos-anywhere.
#+begin_src nix :tangle profiles/iso/minimal.nix
{ lib, pkgs, ... }:
@@ -8188,7 +8141,7 @@ This section sets up all the imports that are used in the home-manager section.
#+begin_src nix :tangle profiles/common/home/default.nix
_:
{
- imports = [
+ imports = [
./settings.nix
./packages.nix
./custom-packages.nix
@@ -8231,7 +8184,7 @@ This section sets up all the imports that are used in the home-manager section.
:CUSTOM_ID: h:4af4f67f-7c48-4754-b4bd-6800e3a66664
:END:
- Again, we adapt =nix= to our needs, enable the home-manager command for non-NixOS machines (NixOS machines are using it as a module) and setting user information that I always keep the same.
+Again, we adapt =nix= to our needs, enable the home-manager command for non-NixOS machines (NixOS machines are using it as a module) and setting user information that I always keep the same.
#+begin_src nix :tangle profiles/common/home/settings.nix
{ lib, config, pkgs, ... }:
@@ -8530,7 +8483,7 @@ I use sops-nix to handle secrets that I want to have available on my machines at
- cp ~/.ssh/sops.pub ~/.dotfiles/secrets/keys/NAME.pub
- update entry for sops.age.sshKeyPaths
- Since we are using the home-manager implementation here, we need to specify the runtime path.
+ Since we are using the home-manager implementation here, we need to specify the runtime path.
#+begin_src nix :tangle profiles/common/home/sops.nix
{ config, lib, ... }:
@@ -8725,7 +8678,7 @@ TODO: Non-NixOS machines (=sp3) should not use these by default, but instead the
}
#+end_src
-**** Linking dotfiles
+**** Linking dotfiles (Symlinks home.file)
:PROPERTIES:
:CUSTOM_ID: h:5ef03803-e150-41bc-b603-e80d60d96efc
:END:
@@ -8735,31 +8688,31 @@ This section should be used in order to symlink already existing configuration f
As for the `home.sessionVariables`, it should be noted that environment variables that are needed at system start should NOT be loaded here, but instead in `programs.zsh.config.extraSessionCommands` (in the home-manager programs section). This is also where all the wayland related variables are stored.
#+begin_src nix :tangle profiles/common/home/symlink.nix
- { self, ... }:
- {
- home.file = {
- "init.el" = {
- source = self + /programs/emacs/init.el;
- target = ".emacs.d/init.el";
- };
- "early-init.el" = {
- source = self + /programs/emacs/early-init.el;
- target = ".emacs.d/early-init.el";
- };
- # on NixOS, Emacs does not find the aspell dicts easily. Write the configuration manually
- ".aspell.conf" = {
- source = self + /programs/config/.aspell.conf;
- target = ".aspell.conf";
- };
- ".gitmessage" = {
- source = self + /programs/git/.gitmessage;
- target = ".gitmessage";
- };
- "swayidle/config" = {
- source = self + /programs/swayidle/config;
- target = ".config/swayidle/config";
- };
+ { self, ... }:
+ {
+ home.file = {
+ "init.el" = {
+ source = self + /programs/emacs/init.el;
+ target = ".emacs.d/init.el";
};
+ "early-init.el" = {
+ source = self + /programs/emacs/early-init.el;
+ target = ".emacs.d/early-init.el";
+ };
+ # on NixOS, Emacs does not find the aspell dicts easily. Write the configuration manually
+ ".aspell.conf" = {
+ source = self + /programs/config/.aspell.conf;
+ target = ".aspell.conf";
+ };
+ ".gitmessage" = {
+ source = self + /programs/git/.gitmessage;
+ target = ".gitmessage";
+ };
+ "swayidle/config" = {
+ source = self + /programs/swayidle/config;
+ target = ".config/swayidle/config";
+ };
+ };
#+end_src
@@ -8767,10 +8720,10 @@ Also, we link some files to the users XDG configuration home:
Also in firefox `about:config > toolkit.legacyUserProfileCustomizations.stylesheets` to true.
#+begin_src nix :tangle profiles/common/home/symlink.nix
- xdg.configFile = {
- "tridactyl/tridactylrc".source = self + /programs/firefox/tridactyl/tridactylrc;
- "tridactyl/themes/base16-codeschool.css".source = self + /programs/firefox/tridactyl/themes/base16-codeschool.css;
- };
+ xdg.configFile = {
+ "tridactyl/tridactylrc".source = self + /programs/firefox/tridactyl/tridactylrc;
+ "tridactyl/themes/base16-codeschool.css".source = self + /programs/firefox/tridactyl/themes/base16-codeschool.css;
+ };
}
#+end_src
@@ -9230,34 +9183,6 @@ Here we set some aliases (some of them should be shellApplications instead) as w
zle -N my-backward-delete-whole-word
# bind this new widget to `ctrl+alt+w`
bindkey '^W' my-backward-delete-whole-word
-
- vterm_printf() {
- if [ -n "$TMUX" ] && ([ "''${TERM%%-*}" = "tmux" ] || [ "''${TERM%%-*}" = "screen" ]); then
- # Tell tmux to pass the escape sequences through
- printf "\ePtmux;\e\e]%s\007\e\\" "$1"
- elif [ "''${TERM%%-*}" = "screen" ]; then
- # GNU screen (screen, screen-256color, screen-256color-bce)
- printf "\eP\e]%s\007\e\\" "$1"
- else
- printf "\e]%s\e\\" "$1"
- fi
- }
- vterm_prompt_end() {
- vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"
- }
- setopt PROMPT_SUBST
- PROMPT=$PROMPT'%{$(vterm_prompt_end)%}'
-
- vterm_cmd() {
- local vterm_elisp
- vterm_elisp=""
- while [ $# -gt 0 ]; do
- vterm_elisp="$vterm_elisp""$(printf '"%s" ' "$(printf "%s" "$1" | sed -e 's|\\|\\\\|g' -e 's|"|\\"|g')")"
- shift
- done
- vterm_printf "51;E$vterm_elisp"
- }
-
'';
};
}
@@ -9476,7 +9401,7 @@ Here we set some aliases (some of them should be shellApplications instead) as w
:END:
#+begin_src nix :tangle profiles/common/home/tmux.nix
- { pkgs, ... }:
+ { pkgs, ... }:
let
tmux-super-fingers = pkgs.tmuxPlugins.mkTmuxPlugin
{
@@ -10773,30 +10698,29 @@ Currently, I am too lazy to explain every option here, but most of it is very se
swayfxSettings = config.swarselsystems.swayfxConfig;
in
"
- exec_always autotiling
- set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\"
- mode $exit {
-
- bindsym --to-code {
- s exec \"systemctl suspend\", mode \"default\"
- l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize && systemctl suspend \", mode \"default \"
- p exec \"systemctl poweroff\"
- r exec \"systemctl reboot\"
- u exec \"swaymsg exit\"
-
- Return mode \"default\"
- Escape mode \"default\"
- ${modifier}+Escape mode \"default\"
- }
+ exec_always autotiling
+ set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\"
+
+ mode $exit {
+ bindsym --to-code {
+ s exec \"systemctl suspend\", mode \"default\"
+ l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize && systemctl suspend \", mode \"default \"
+ p exec \"systemctl poweroff\"
+ r exec \"systemctl reboot\"
+ u exec \"swaymsg exit\"
+
+ Return mode \"default\"
+ Escape mode \"default\"
+ ${modifier}+Escape mode \"default\"
}
+ }
- exec systemctl --user import-environment
- exec swayidle -w
-
+ exec systemctl --user import-environment
+ exec swayidle -w
- ${swayfxSettings}
- ";
+ ${swayfxSettings}
+ ";
};
}
#+end_src
@@ -10882,7 +10806,7 @@ This section sets up all the imports that are used in the home-manager section.
profilesPath = "${self}/profiles";
in
{
- imports = [
+ imports = [
"${profilesPath}/common/home/settings.nix"
./symlink.nix
];
@@ -11082,38 +11006,38 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]]
xdg = {
mimeApps = {
defaultApplications = {
- "x-scheme-handler/msteams" = [ "teams-for-linux.desktop"] ;
+ "x-scheme-handler/msteams" = [ "teams-for-linux.desktop" ];
};
};
desktopEntries =
- let
- terminal = false;
- categories = [ "Application" ];
- icon = "firefox";
- in
- {
- firefox_dc = {
- name = "Firefox (dc_adm)";
- genericName = "Firefox dc";
- exec = "firefox -p dc_adm";
- inherit terminal categories icon;
- };
+ let
+ terminal = false;
+ categories = [ "Application" ];
+ icon = "firefox";
+ in
+ {
+ firefox_dc = {
+ name = "Firefox (dc_adm)";
+ genericName = "Firefox dc";
+ exec = "firefox -p dc_adm";
+ inherit terminal categories icon;
+ };
- firefox_ws = {
- name = "Firefox (ws_adm)";
- genericName = "Firefox ws";
- exec = "firefox -p ws_adm";
- inherit terminal categories icon;
- };
+ firefox_ws = {
+ name = "Firefox (ws_adm)";
+ genericName = "Firefox ws";
+ exec = "firefox -p ws_adm";
+ inherit terminal categories icon;
+ };
- firefox_cl = {
- name = "Firefox (cl_adm)";
- genericName = "Firefox cl";
- exec = "firefox -p cl_adm";
- inherit terminal categories icon;
- };
+ firefox_cl = {
+ name = "Firefox (cl_adm)";
+ genericName = "Firefox cl";
+ exec = "firefox -p cl_adm";
+ inherit terminal categories icon;
+ };
- };
+ };
};
}
@@ -11156,9 +11080,7 @@ Also packed into the hook function is the line =(fset 'epg-wait-for-status 'igno
(add-hook 'emacs-startup-hook
(lambda ()
(progn
- ;; (setq gc-cons-threshold (* 1000 1000 8)
- ;; (setq gc-cons-threshold #x40000000
- (setq gc-cons-threshold (* 32 1024 1024)
+ (setq gc-cons-threshold (* 32 1024 1024)
gc-cons-percentage 0.1
jit-lock-defer-time 0.05
read-process-output-max (* 1024 1024)
@@ -11543,14 +11465,7 @@ Used here: [[#h:877c9401-a354-4e44-a235-db1a90d19e00][General org-mode]]
#+begin_src emacs-lisp
(defun swarsel/org-mode-setup ()
- ;; (org-indent-mode)
(variable-pitch-mode 1)
- ;;(auto-fill-mode 0)
- ;; (setq display-line-numbers-type 'relative
- ;; display-line-numbers-current-absolute 1
- ;; display-line-numbers-width-start nil
- ;; display-line-numbers-width 6
- ;; display-line-numbers-grow-only 1)
(add-hook 'org-tab-first-hook 'org-end-of-line)
(visual-line-mode 1))
@@ -11587,25 +11502,25 @@ This section handles everything that shoudld happen when I save =SwarselSystems.
We set a hook that runs everytime we save the file. It would be a bit more efficient to only export and format when we enter a magit window for instance (since especially the html export takes times), however, since I cannot be sure to only ever commit from magit (I do indeed sometimes use git from the command line), I prefer this approach.
#+begin_src emacs-lisp
- (defun swarsel/run-formatting ()
- (interactive)
- (let ((default-directory (expand-file-name "~/.dotfiles")))
- (shell-command "nixpkgs-fmt . > /dev/null")))
+ (defun swarsel/run-formatting ()
+ (interactive)
+ (let ((default-directory (expand-file-name "~/.dotfiles")))
+ (shell-command "nixpkgs-fmt . > /dev/null")))
- (defun swarsel/org-babel-tangle-config ()
- (interactive)
- (when (string-equal (buffer-file-name)
- swarsel-swarsel-org-filepath)
- ;; Dynamic scoping to the rescue
- (let ((org-confirm-babel-evaluate nil))
- ;; (org-html-export-to-html)
- (org-babel-tangle)
- (swarsel/run-formatting)
- )))
+ (defun swarsel/org-babel-tangle-config ()
+ (interactive)
+ (when (string-equal (buffer-file-name)
+ swarsel-swarsel-org-filepath)
+ ;; Dynamic scoping to the rescue
+ (let ((org-confirm-babel-evaluate nil))
+ ;; (org-html-export-to-html)
+ (org-babel-tangle)
+ (swarsel/run-formatting)
+ )))
- (setq org-html-htmlize-output-type nil)
+ (setq org-html-htmlize-output-type nil)
- ;; (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config)))
+ ;; (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config)))
#+end_src
@@ -11663,46 +11578,6 @@ These functions are used here: [[#h:5653d693-ecca-4c95-9633-66b9e3241070][Corfu]
#+end_src
-**** python shell reloading
-:PROPERTIES:
-:CUSTOM_ID: h:291e43d9-eae2-4e23-8e38-160e223bf314
-:END:
-
-The standard Emacs behaviour for the Python process shell is a bit annoying. This is my attempt at making it show automatically on opening a python buffer and making it refresh on its own as well. This does not nicely work yet.
-
-#+begin_src emacs-lisp
-
- ;; run the python inferior shell immediately upon entering a python buffer
- ;; (add-hook 'python-mode-hook 'swarsel/run-python)
-
- ;; (defun swarsel/run-python ()
- ;; (save-selected-window
- ;; (switch-to-buffer-other-window (process-buffer (python-shell-get-or-create-process (python-shell-parse-command))))))
-
- ;; reload python shell automatically
- (defun my-python-shell-run ()
- (interactive)
- (when (get-buffer-process "*Python*")
- (set-process-query-on-exit-flag (get-buffer-process "*Python*") nil)
- (kill-process (get-buffer-process "*Python*"))
- ;; Uncomment If you want to clean the buffer too.
- ;;(kill-buffer "*Python*")
- ;; Not so fast!
- (sleep-for 0.5))
- (run-python (python-shell-parse-command) nil nil)
- (python-shell-send-buffer)
- ;; Pop new window only if shell isnt visible
- ;; in any frame.
- (unless (get-buffer-window "*Python*" t)
- (python-shell-switch-to-shell)))
-
- (defun my-python-shell-run-region ()
- (interactive)
- (python-shell-send-region (region-beginning) (region-end))
- (python-shell-switch-to-shell))
-
-#+end_src
-
**** Nix common prefix bracketer
:PROPERTIES:
:CUSTOM_ID: h:79288251-3b8d-4bc4-ae2c-448fce709fbd
@@ -11712,26 +11587,26 @@ This function searches for common delimiters in region and removes them, summari
#+begin_src emacs-lisp
-(defun swarsel/prefix-block (start end)
- (interactive "r")
- (save-excursion
- (goto-char start)
- (setq start (line-beginning-position))
- (goto-char end)
- (setq end (line-end-position))
- (let ((common-prefix (save-excursion
- (goto-char start)
- (if (re-search-forward "^\\([^.\n]+\\)\\." end t)
- (match-string 1)
- (error "No common prefix found")))))
- (save-excursion
- (goto-char start)
- (insert common-prefix " = {\n")
- (goto-char (+ end (length common-prefix) 6))
- (insert "};\n")
- (goto-char start)
- (while (re-search-forward (concat "^" (regexp-quote common-prefix) "\\.") end t)
- (replace-match ""))))))
+ (defun swarsel/prefix-block (start end)
+ (interactive "r")
+ (save-excursion
+ (goto-char start)
+ (setq start (line-beginning-position))
+ (goto-char end)
+ (setq end (line-end-position))
+ (let ((common-prefix (save-excursion
+ (goto-char start)
+ (if (re-search-forward "^\\([^.\n]+\\)\\." end t)
+ (match-string 1)
+ (error "No common prefix found")))))
+ (save-excursion
+ (goto-char start)
+ (insert common-prefix " = {\n")
+ (goto-char (+ end (length common-prefix) 6))
+ (insert "};\n")
+ (goto-char start)
+ (while (re-search-forward (concat "^" (regexp-quote common-prefix) "\\.") end t)
+ (replace-match ""))))))
#+end_src
@@ -11750,24 +11625,24 @@ This formats the org code block at =point= in accordance to the =nixpkgs-fmt= fo
(call-interactively 'nixpkgs-fmt-region))
- (defun swarsel/org-nixpkgs-fmt-block ()
- (interactive)
- (save-excursion
- (let* ((element (org-element-at-point))
- (begin (org-element-property :begin element))
- (end (org-element-property :end element))
- (lang (org-element-property :language element)))
- (when lang
- (goto-char begin)
- (forward-line)
- (insert "{")
- (goto-char end)
- (forward-line -1)
- (beginning-of-line)
- (forward-char -1)
- (insert "}")
- (org-babel-mark-block)
- (call-interactively 'nixpkgs-fmt-region)))))
+ (defun swarsel/org-nixpkgs-fmt-block ()
+ (interactive)
+ (save-excursion
+ (let* ((element (org-element-at-point))
+ (begin (org-element-property :begin element))
+ (end (org-element-property :end element))
+ (lang (org-element-property :language element)))
+ (when lang
+ (goto-char begin)
+ (forward-line)
+ (insert "{")
+ (goto-char end)
+ (forward-line -1)
+ (beginning-of-line)
+ (forward-char -1)
+ (insert "}")
+ (org-babel-mark-block)
+ (call-interactively 'nixpkgs-fmt-region)))))
#+end_src
**** Disable garbace collection while minibuffer is active
@@ -11778,14 +11653,14 @@ This formats the org code block at =point= in accordance to the =nixpkgs-fmt= fo
#+begin_src emacs-lisp
- (defun swarsel/minibuffer-setup-hook ()
- (setq gc-cons-threshold most-positive-fixnum))
+ (defun swarsel/minibuffer-setup-hook ()
+ (setq gc-cons-threshold most-positive-fixnum))
- (defun swarsel/minibuffer-exit-hook ()
- (setq gc-cons-threshold (* 32 1024 1024)))
+ (defun swarsel/minibuffer-exit-hook ()
+ (setq gc-cons-threshold (* 32 1024 1024)))
- (add-hook 'minibuffer-setup-hook #'swarsel/minibuffer-setup-hook)
- (add-hook 'minibuffer-exit-hook #'swarsel/minibuffer-exit-hook)
+ (add-hook 'minibuffer-setup-hook #'swarsel/minibuffer-setup-hook)
+ (add-hook 'minibuffer-exit-hook #'swarsel/minibuffer-exit-hook)
#+end_src
@@ -11801,126 +11676,112 @@ I also define some keybinds to some combinations directly. Those are used mostly
#+begin_src emacs-lisp
- ;; Make ESC quit prompts
- (global-set-key (kbd "") 'keyboard-escape-quit)
-
- ;; Set up general keybindings
- (use-package general
- :config
- (general-create-definer swarsel/leader-keys
- :keymaps '(normal insert visual emacs)
- :prefix "SPC"
- :global-prefix "C-SPC")
-
- (swarsel/leader-keys
- "e" '(:ignore e :which-key "evil")
- "eo" '(evil-jump-backward :which-key "cursor jump backwards")
- "eO" '(evil-jump-forward :which-key "cursor jump forwards")
- "t" '(:ignore t :which-key "toggles")
- "ts" '(hydra-text-scale/body :which-key "scale text")
- "te" '(swarsel/toggle-evil-state :which-key "emacs/evil")
- "tl" '(display-line-numbers-mode :which-key "line numbers")
- "tp" '(evil-cleverparens-mode :wk "cleverparens")
- "to" '(olivetti-mode :wk "olivetti")
- "td" '(darkroom-tentative-mode :wk "darkroom")
- "tw" '((lambda () (interactive) (toggle-truncate-lines)) :which-key "line wrapping")
- "m" '(:ignore m :which-key "modes/programs")
- "mm" '((lambda () (interactive) (mu4e)) :which-key "mu4e")
- "mg" '((lambda () (interactive) (magit-list-repositories)) :which-key "magit-list-repos")
- "mc" '((lambda () (interactive) (swarsel/open-calendar)) :which-key "calendar")
- "mp" '(popper-toggle :which-key "popper")
- "md" '(dirvish :which-key "dirvish")
- "mr" '(bjm/elfeed-load-db-and-open :which-key "elfeed")
- "o" '(:ignore o :which-key "org")
- "op" '((lambda () (interactive) (org-present)) :which-key "org-present")
- "oa" '((lambda () (interactive) (org-agenda)) :which-key "org-agenda")
- "oa" '((lambda () (interactive) (org-refile)) :which-key "org-refile")
- "ob" '((lambda () (interactive) (org-babel-mark-block)) :which-key "Mark whole src-block")
- "ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link")
- "oc" '((lambda () (interactive) (org-store-link)) :which-key "copy (=store) link")
- "os" '(shfmt-region :which-key "format sh-block")
- "od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block")
- "on" '(nixpkgs-fmt-region :which-key "format nix-block")
- "ot" '(swarsel/org-babel-tangle-config :which-key "tangle file")
- "oe" '(org-html-export-to-html :which-key "export to html")
- "c" '(:ignore c :which-key "capture")
- "ct" '((lambda () (interactive) (org-capture nil "tt")) :which-key "task")
- ;; "cj" '((lambda () (interactive) (org-capture nil "jj")) :which-key "journal")
- ;; "cs" '(markdown-download-screenshot :which-key "screenshot")
- "l" '(:ignore l :which-key "links")
- "lc" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (org-overview) )) :which-key "SwarselSystems.org")
- "le" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "Emacs") ) (org-overview) (org-cycle) )) :which-key "Emacs.org")
- "ln" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "System") ) (org-overview) (org-cycle))) :which-key "Nixos.org")
- "ls" '((lambda () (interactive) (find-file "/smb:Swarsel@winters:")) :which-key "Server")
- "lo" '(dired swarsel-obsidian-vault-directory :which-key "obsidian")
- ;; "la" '((lambda () (interactive) (find-file swarsel-org-anki-filepath)) :which-key "anki")
- ;; "ln" '((lambda () (interactive) (find-file swarsel-nix-org-filepath)) :which-key "Nix.org")
- "lp" '((lambda () (interactive) (projectile-switch-project)) :which-key "switch project")
- "lg" '((lambda () (interactive) (magit-list-repositories)) :which-key "list git repos")
- ;; "a" '(:ignore a :which-key "anki")
- ;; "ap" '(anki-editor-push-tree :which-key "push new cards")
- ;; "an" '((lambda () (interactive) (org-capture nil "a")) :which-key "new card")
- ;; "as" '(swarsel-anki-set-deck-and-notetype :which-key "change deck and notetype")
- "h" '(:ignore h :which-key "help")
- "hy" '(yas-describe-tables :which-key "yas tables")
- "hb" '(embark-bindings :which-key "current key bindings")
- "h" '(:ignore t :which-key "describe")
- "he" 'view-echo-area-messages
- "hf" 'describe-function
- "hF" 'describe-face
- "hl" '(view-lossage :which-key "show command keypresses")
- "hL" 'find-library
- "hm" 'describe-mode
- "ho" 'describe-symbol
- "hk" 'describe-key
- "hK" 'describe-keymap
- "hp" 'describe-package
- "hv" 'describe-variable
- "hd" 'devdocs-lookup
- "w" '(:ignore t :which-key "window")
- "wl" 'windmove-right
- "w " 'windmove-right
- "wh" 'windmove-left
- "w " 'windmove-left
- "wk" 'windmove-up
- "w " 'windmove-up
- "wj" 'windmove-down
- "w " 'windmove-down
- "wr" 'winner-redo
- "wd" 'delete-window
- "w=" 'balance-windows-area
- "wD" 'kill-buffer-and-window
- "wu" 'winner-undo
- "wr" 'winner-redo
- "w/" 'evil-window-vsplit
- "w\\" 'evil-window-vsplit
- "w-" 'evil-window-split
- "wm" '(delete-other-windows :wk "maximize")
- "" 'up-list
- "" 'down-list
- ))
-
- ;; General often used hotkeys
- (general-define-key
- "C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card
- ;; "C-M-d" 'swarsel-obsidian-daily ; open daily obsidian file and create if not exist
- ;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetype for new anki cards
- ;; "C-M-s" 'markdown-download-screenshot ; wrapper for org-download-screenshot
- "C-c d" 'crux-duplicate-current-line-or-region
- "C-c D" 'crux-duplicate-and-comment-current-line-or-region
- "" 'swarsel/last-buffer
- "M-\\" 'indent-region
- "C-" 'my-python-shell-run
- "" 'yank
- "" 'kill-region
- "" 'kill-ring-save
- "" 'evil-undo
- "" 'evil-redo
- "C-S-c C-S-c" 'mc/edit-lines
- "C->" 'mc/mark-next-like-this
- "C-<" 'mc/mark-previous-like-this
- "C-c C-<" 'mc/mark-all-like-this
- )
+ ;; Make ESC quit prompts
+ (global-set-key (kbd "") 'keyboard-escape-quit)
+
+ ;; Set up general keybindings
+ (use-package general
+ :config
+ (general-create-definer swarsel/leader-keys
+ :keymaps '(normal insert visual emacs)
+ :prefix "SPC"
+ :global-prefix "C-SPC")
+
+ (swarsel/leader-keys
+ "e" '(:ignore e :which-key "evil")
+ "eo" '(evil-jump-backward :which-key "cursor jump backwards")
+ "eO" '(evil-jump-forward :which-key "cursor jump forwards")
+ "t" '(:ignore t :which-key "toggles")
+ "ts" '(hydra-text-scale/body :which-key "scale text")
+ "te" '(swarsel/toggle-evil-state :which-key "emacs/evil")
+ "tl" '(display-line-numbers-mode :which-key "line numbers")
+ "tp" '(evil-cleverparens-mode :wk "cleverparens")
+ "to" '(olivetti-mode :wk "olivetti")
+ "td" '(darkroom-tentative-mode :wk "darkroom")
+ "tw" '((lambda () (interactive) (toggle-truncate-lines)) :which-key "line wrapping")
+ "m" '(:ignore m :which-key "modes/programs")
+ "mm" '((lambda () (interactive) (mu4e)) :which-key "mu4e")
+ "mg" '((lambda () (interactive) (magit-list-repositories)) :which-key "magit-list-repos")
+ "mc" '((lambda () (interactive) (swarsel/open-calendar)) :which-key "calendar")
+ "mp" '(popper-toggle :which-key "popper")
+ "md" '(dirvish :which-key "dirvish")
+ "mr" '(bjm/elfeed-load-db-and-open :which-key "elfeed")
+ "o" '(:ignore o :which-key "org")
+ "op" '((lambda () (interactive) (org-present)) :which-key "org-present")
+ "oa" '((lambda () (interactive) (org-agenda)) :which-key "org-agenda")
+ "oa" '((lambda () (interactive) (org-refile)) :which-key "org-refile")
+ "ob" '((lambda () (interactive) (org-babel-mark-block)) :which-key "Mark whole src-block")
+ "ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link")
+ "oc" '((lambda () (interactive) (org-store-link)) :which-key "copy (=store) link")
+ "os" '(shfmt-region :which-key "format sh-block")
+ "od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block")
+ "on" '(nixpkgs-fmt-region :which-key "format nix-block")
+ "ot" '(swarsel/org-babel-tangle-config :which-key "tangle file")
+ "oe" '(org-html-export-to-html :which-key "export to html")
+ "c" '(:ignore c :which-key "capture")
+ "ct" '((lambda () (interactive) (org-capture nil "tt")) :which-key "task")
+ "l" '(:ignore l :which-key "links")
+ "lc" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (org-overview) )) :which-key "SwarselSystems.org")
+ "le" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "Emacs") ) (org-overview) (org-cycle) )) :which-key "Emacs.org")
+ "ln" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "System") ) (org-overview) (org-cycle))) :which-key "Nixos.org")
+ "lp" '((lambda () (interactive) (projectile-switch-project)) :which-key "switch project")
+ "lg" '((lambda () (interactive) (magit-list-repositories)) :which-key "list git repos")
+ "h" '(:ignore h :which-key "help")
+ "hy" '(yas-describe-tables :which-key "yas tables")
+ "hb" '(embark-bindings :which-key "current key bindings")
+ "h" '(:ignore t :which-key "describe")
+ "he" 'view-echo-area-messages
+ "hf" 'describe-function
+ "hF" 'describe-face
+ "hl" '(view-lossage :which-key "show command keypresses")
+ "hL" 'find-library
+ "hm" 'describe-mode
+ "ho" 'describe-symbol
+ "hk" 'describe-key
+ "hK" 'describe-keymap
+ "hp" 'describe-package
+ "hv" 'describe-variable
+ "hd" 'devdocs-lookup
+ "w" '(:ignore t :which-key "window")
+ "wl" 'windmove-right
+ "w " 'windmove-right
+ "wh" 'windmove-left
+ "w " 'windmove-left
+ "wk" 'windmove-up
+ "w " 'windmove-up
+ "wj" 'windmove-down
+ "w " 'windmove-down
+ "wr" 'winner-redo
+ "wd" 'delete-window
+ "w=" 'balance-windows-area
+ "wD" 'kill-buffer-and-window
+ "wu" 'winner-undo
+ "wr" 'winner-redo
+ "w/" 'evil-window-vsplit
+ "w\\" 'evil-window-vsplit
+ "w-" 'evil-window-split
+ "wm" '(delete-other-windows :wk "maximize")
+ "" 'up-list
+ "" 'down-list
+ ))
+
+ ;; General often used hotkeys
+ (general-define-key
+ "C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card
+ "C-c d" 'crux-duplicate-current-line-or-region
+ "C-c D" 'crux-duplicate-and-comment-current-line-or-region
+ "" 'swarsel/last-buffer
+ "M-\\" 'indent-region
+ "" 'yank
+ "" 'kill-region
+ "" 'kill-ring-save
+ "" 'evil-undo
+ "" 'evil-redo
+ "C-S-c C-S-c" 'mc/edit-lines
+ "C->" 'mc/mark-next-like-this
+ "C-<" 'mc/mark-previous-like-this
+ "C-c C-<" 'mc/mark-all-like-this
+ )
#+end_src
@@ -11934,41 +11795,15 @@ In this section I setup some aliases that I use for various directories on my sy
#+begin_src emacs-lisp
;; set Nextcloud directory for journals etc.
- (setq swarsel-sync-directory "~/Nextcloud"
- swarsel-emacs-directory "~/.emacs.d"
- swarsel-dotfiles-directory "~/.dotfiles"
- swarsel-projects-directory "~/Documents/GitHub")
-
- (setq swarsel-emacs-org-filepath (expand-file-name "Emacs.org" swarsel-dotfiles-directory)
- swarsel-nix-org-filepath (expand-file-name "Nix.org" swarsel-dotfiles-directory)
- swarsel-swarsel-org-filepath (expand-file-name "SwarselSystems.org" swarsel-dotfiles-directory)
- )
-
-
- ;; set Emacs main configuration .org names
- (setq swarsel-emacs-org-file "Emacs.org"
- swarsel-anki-org-file "Anki.org"
- swarsel-tasks-org-file "Tasks.org"
- swarsel-archive-org-file "Archive.org"
- swarsel-org-folder-name "Org"
- swarsel-obsidian-daily-folder-name "⭐ Personal/Journal"
- swarsel-obsidian-folder-name "Obsidian"
- swarsel-obsidian-vault-name "Main")
-
-
- ;; set directory paths
- (setq swarsel-org-directory (expand-file-name swarsel-org-folder-name swarsel-sync-directory)) ; path to org folder
- (setq swarsel-obsidian-directory (expand-file-name swarsel-obsidian-folder-name swarsel-sync-directory)) ; path to obsidian
- (setq swarsel-obsidian-vault-directory (expand-file-name swarsel-obsidian-vault-name swarsel-obsidian-directory)) ; path to obsidian vault
- (setq swarsel-obsidian-daily-directory (expand-file-name swarsel-obsidian-daily-folder-name swarsel-obsidian-vault-directory)) ; path to obsidian daily folder
-
- ;; filepaths to certain documents
- (setq swarsel-org-anki-filepath (expand-file-name swarsel-anki-org-file swarsel-org-directory) ; path to anki export file
- swarsel-org-tasks-filepath (expand-file-name swarsel-tasks-org-file swarsel-org-directory)
- swarsel-org-archive-filepath (expand-file-name swarsel-archive-org-file swarsel-org-directory))
-
-
-
+ (setq
+ swarsel-emacs-directory "~/.emacs.d"
+ swarsel-dotfiles-directory "~/.dotfiles"
+ swarsel-swarsel-org-filepath (expand-file-name "SwarselSystems.org" swarsel-dotfiles-directory)
+ swarsel-tasks-org-file "Tasks.org"
+ swarsel-archive-org-file "Archive.org"
+ swarsel-work-projects-directory "~/Documents/Work"
+ swarsel-private-projects-directory "~/Documents/Private"
+ )
#+end_src
*** Unclutter .emacs.d
@@ -12025,7 +11860,7 @@ Many people dislike the Emacs backup files; I do enjoy them, but have to admit t
:CUSTOM_ID: h:786b447d-03ad-4c1d-b114-c37caa2d591c
:END:
-In this general section I have settings that I either consider to be integral to my experience when using emacs or have no other section that I feel they belong to.
+In this general section I have settings that I either consider to be integral to my experience when using Emacs or have no other section that I feel they belong to.
*** General setup
:PROPERTIES:
@@ -12041,56 +11876,56 @@ Here I set up some things that are too minor to put under other categories.
#+begin_src emacs-lisp
- ;; use UTF-8 everywhere
- (set-language-environment "UTF-8")
- (profiler-start 'cpu)
- ;; set default font size
- (defvar swarsel/default-font-size 130)
- (setq swarsel-standard-font "FiraCode Nerd Font Mono"
- swarsel-alt-font "FiraCode Nerd Font Mono")
-
- ;; (defalias 'yes-or-no-p 'y-or-n-p)
- ;;(setq-default show-trailing-whitespace t)
- (add-hook 'before-save-hook 'delete-trailing-whitespace)
- (global-hl-line-mode 1)
- ;; (setq redisplay-dont-pause t) ;; obsolete
- (setq blink-cursor-mode nil) ;; blink-cursor is an unexpected source of slowdown
- (global-subword-mode 1) ; Iterate through CamelCase words
- (setq blink-matching-paren nil) ;; this makes the cursor jump around annoyingly
- (delete-selection-mode 1)
- (setq vc-follow-symlinks t)
- (setq require-final-newline t)
- (winner-mode 1)
- (setq load-prefer-newer t)
- (setq-default bidi-paragraph-direction 'left-to-right
- bidi-display-reordering 'left-to-right
- bidi-inhibit-bpa t)
- (global-so-long-mode)
- (setq process-adaptive-read-buffering nil) ;; not sure if this is a good idea
- (setq fast-but-imprecise-scrolling t
- redisplay-skip-fontification-on-input t
- inhibit-compacting-font-caches t)
- (setq idle-update-delay 1.0
- which-func-update-delay 1.0)
- (setq undo-limit 80000000
- evil-want-fine-undo t
- auto-save-default t
- password-cache-expiry nil
- )
- (setq browse-url-browser-function 'browse-url-firefox)
- ;; disable a keybind that does more harm than good
- (global-set-key [remap suspend-frame]
- (lambda ()
- (interactive)
- (message "This keybinding is disabled (was 'suspend-frame')")))
+ ;; use UTF-8 everywhere
+ (set-language-environment "UTF-8")
+ (profiler-start 'cpu)
+ ;; set default font size
+ (defvar swarsel/default-font-size 130)
+ (setq swarsel-standard-font "FiraCode Nerd Font Mono"
+ swarsel-alt-font "FiraCode Nerd Font Mono")
+
+ ;; (defalias 'yes-or-no-p 'y-or-n-p)
+ ;;(setq-default show-trailing-whitespace t)
+ (add-hook 'before-save-hook 'delete-trailing-whitespace)
+ (global-hl-line-mode 1)
+ ;; (setq redisplay-dont-pause t) ;; obsolete
+ (setq blink-cursor-mode nil) ;; blink-cursor is an unexpected source of slowdown
+ (global-subword-mode 1) ; Iterate through CamelCase words
+ (setq blink-matching-paren nil) ;; this makes the cursor jump around annoyingly
+ (delete-selection-mode 1)
+ (setq vc-follow-symlinks t)
+ (setq require-final-newline t)
+ (winner-mode 1)
+ (setq load-prefer-newer t)
+ (setq-default bidi-paragraph-direction 'left-to-right
+ bidi-display-reordering 'left-to-right
+ bidi-inhibit-bpa t)
+ (global-so-long-mode)
+ (setq process-adaptive-read-buffering nil) ;; not sure if this is a good idea
+ (setq fast-but-imprecise-scrolling t
+ redisplay-skip-fontification-on-input t
+ inhibit-compacting-font-caches t)
+ (setq idle-update-delay 1.0
+ which-func-update-delay 1.0)
+ (setq undo-limit 80000000
+ evil-want-fine-undo t
+ auto-save-default t
+ password-cache-expiry nil
+ )
+ (setq browse-url-browser-function 'browse-url-firefox)
+ ;; disable a keybind that does more harm than good
+ (global-set-key [remap suspend-frame]
+ (lambda ()
+ (interactive)
+ (message "This keybinding is disabled (was 'suspend-frame')")))
- (setq visible-bell nil)
- (setq initial-major-mode 'fundamental-mode
- initial-scratch-message nil)
+ (setq visible-bell nil)
+ (setq initial-major-mode 'fundamental-mode
+ initial-scratch-message nil)
- (add-hook 'prog-mode-hook 'display-line-numbers-mode)
- ;; (add-hook 'text-mode-hook 'display-line-numbers-mode)
- ;; (global-visual-line-mode 1)
+ (add-hook 'prog-mode-hook 'display-line-numbers-mode)
+ ;; (add-hook 'text-mode-hook 'display-line-numbers-mode)
+ ;; (global-visual-line-mode 1)
#+end_src
@@ -12143,8 +11978,8 @@ This sets up automatic garbage collection when the frame is unused.
(run-with-idle-timer 15 t
(lambda ()
;; (message "Garbage Collector has run for %.06fsec"
- (k-time (garbage-collect)))))
- ;; )
+ (k-time (garbage-collect)))))
+ ;; )
#+end_src
*** Indentation
@@ -12228,46 +12063,46 @@ Also, I setup initial modes for several major-modes depending on what I deem fit
#+begin_src emacs-lisp
- ;; Emulate vim in emacs
- (use-package evil
- :init
- (setq evil-want-integration t) ; loads evil
- (setq evil-want-keybinding nil) ; loads "helpful bindings" for other modes
- (setq evil-want-C-u-scroll t) ; scrolling using C-u
- (setq evil-want-C-i-jump nil) ; jumping with C-i
- (setq evil-want-Y-yank-to-eol t) ; give Y some utility
- (setq evil-shift-width 2) ; uniform indent
- (setq evil-respect-visual-line-mode nil) ; i am torn on this one
- (setq evil-split-window-below t)
- (setq evil-vsplit-window-right t)
- :config
- (evil-mode 1)
-
- ;; make normal mode respect wrapped lines
- (define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line)
- (define-key evil-normal-state-map (kbd "") 'evil-next-visual-line)
- (define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line)
- (define-key evil-normal-state-map (kbd "") 'evil-previous-visual-line)
-
- (define-key evil-normal-state-map (kbd "C-z") nil)
- (define-key evil-insert-state-map (kbd "C-z") nil)
- (define-key evil-visual-state-map (kbd "C-z") nil)
- (define-key evil-motion-state-map (kbd "C-z") nil)
- (define-key evil-operator-state-map (kbd "C-z") nil)
- (define-key evil-replace-state-map (kbd "C-z") nil)
- (define-key global-map (kbd "C-z") nil)
- (evil-set-undo-system 'undo-tree)
-
- ;; Don't use evil-mode in these contexts, or use it in a specific mode
- (evil-set-initial-state 'messages-buffer-mode 'emacs)
- (evil-set-initial-state 'dashboard-mode 'emacs)
- (evil-set-initial-state 'dired-mode 'emacs)
- (evil-set-initial-state 'cfw:details-mode 'emacs)
- (evil-set-initial-state 'Custom-mode 'emacs) ; god knows why this mode is in uppercase
- (evil-set-initial-state 'mu4e-headers-mode 'normal)
- (evil-set-initial-state 'python-inferior-mode 'normal)
- (add-hook 'org-capture-mode-hook 'evil-insert-state)
- (add-to-list 'evil-buffer-regexps '("COMMIT_EDITMSG" . insert)))
+ ;; Emulate vim in emacs
+ (use-package evil
+ :init
+ (setq evil-want-integration t) ; loads evil
+ (setq evil-want-keybinding nil) ; loads "helpful bindings" for other modes
+ (setq evil-want-C-u-scroll t) ; scrolling using C-u
+ (setq evil-want-C-i-jump nil) ; jumping with C-i
+ (setq evil-want-Y-yank-to-eol t) ; give Y some utility
+ (setq evil-shift-width 2) ; uniform indent
+ (setq evil-respect-visual-line-mode nil) ; i am torn on this one
+ (setq evil-split-window-below t)
+ (setq evil-vsplit-window-right t)
+ :config
+ (evil-mode 1)
+
+ ;; make normal mode respect wrapped lines
+ (define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line)
+ (define-key evil-normal-state-map (kbd "") 'evil-next-visual-line)
+ (define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line)
+ (define-key evil-normal-state-map (kbd "") 'evil-previous-visual-line)
+
+ (define-key evil-normal-state-map (kbd "C-z") nil)
+ (define-key evil-insert-state-map (kbd "C-z") nil)
+ (define-key evil-visual-state-map (kbd "C-z") nil)
+ (define-key evil-motion-state-map (kbd "C-z") nil)
+ (define-key evil-operator-state-map (kbd "C-z") nil)
+ (define-key evil-replace-state-map (kbd "C-z") nil)
+ (define-key global-map (kbd "C-z") nil)
+ (evil-set-undo-system 'undo-tree)
+
+ ;; Don't use evil-mode in these contexts, or use it in a specific mode
+ (evil-set-initial-state 'messages-buffer-mode 'emacs)
+ (evil-set-initial-state 'dashboard-mode 'emacs)
+ (evil-set-initial-state 'dired-mode 'emacs)
+ (evil-set-initial-state 'cfw:details-mode 'emacs)
+ (evil-set-initial-state 'Custom-mode 'emacs) ; god knows why this mode is in uppercase
+ (evil-set-initial-state 'mu4e-headers-mode 'normal)
+ (evil-set-initial-state 'python-inferior-mode 'normal)
+ (add-hook 'org-capture-mode-hook 'evil-insert-state)
+ (add-to-list 'evil-buffer-regexps '("COMMIT_EDITMSG" . insert)))
#+end_src
**** evil-collection
@@ -12332,6 +12167,14 @@ This minor-mode adds functionality for doing better surround-commands; for examp
#+end_src
+**** evil-visual-mark-mode
+
+#+begin_src emacs-lisp
+
+ (use-package evil-visual-mark-mode
+ :config (evil-visual-mark-mode))
+
+#+end_src
*** ispell
:PROPERTIES:
:CUSTOM_ID: h:e888d7a7-1755-4109-af11-5358b8cf140e
@@ -12368,7 +12211,6 @@ Here I define my fonts to be used. Honestly I do not understand the face-attribu
:weight 'regular
:height 1.06)
- ;; these settings used to be in custom.el
#+end_src
@@ -12429,7 +12271,6 @@ This minor mode allows mixing fixed and variable pitch fonts within the same buf
:hook
(text-mode . mixed-pitch-mode))
-
#+end_src
*** Modeline
@@ -12452,7 +12293,6 @@ I have currently disabled this in favor of [[#h:80ed2431-9c9a-4bfc-a3c0-08a2a058
(doom-modeline-indent-info nil)
(doom-modeline-buffer-encoding nil)))
-
#+end_src
*** mini-modeline
@@ -12464,31 +12304,31 @@ I have found that the doom-modeline, while very useful, consumes too much screen
#+begin_src emacs-lisp
- (use-package mini-modeline
- :after smart-mode-line
- :config
- (mini-modeline-mode t)
- (setq mini-modeline-display-gui-line nil)
- (setq mini-modeline-enhance-visual nil)
- (setq mini-modeline-truncate-p nil)
- (setq mini-modeline-l-format nil)
- (setq mini-modeline-right-padding 5)
- (setq window-divider-mode t)
- (setq window-divider-default-places t)
- (setq window-divider-default-bottom-width 1)
- (setq window-divider-default-right-width 1)
- (setq mini-modeline-r-format '("%e" mode-line-front-space mode-line-mule-info mode-line-client
- mode-line-modified mode-line-remote mode-line-frame-identification
- mode-line-buffer-identification " " mode-line-position " " mode-name evil-mode-line-tag ))
- )
-
- (use-package smart-mode-line
- :config
- (sml/setup)
- (add-to-list 'sml/replacer-regexp-list '("^~/Documents/Work/" ":WK:"))
- (add-to-list 'sml/replacer-regexp-list '("^~/Documents/Private/" ":PR:"))
- (add-to-list 'sml/replacer-regexp-list '("^~/.dotfiles/" ":D:") t)
- )
+ (use-package mini-modeline
+ :after smart-mode-line
+ :config
+ (mini-modeline-mode t)
+ (setq mini-modeline-display-gui-line nil)
+ (setq mini-modeline-enhance-visual nil)
+ (setq mini-modeline-truncate-p nil)
+ (setq mini-modeline-l-format nil)
+ (setq mini-modeline-right-padding 5)
+ (setq window-divider-mode t)
+ (setq window-divider-default-places t)
+ (setq window-divider-default-bottom-width 1)
+ (setq window-divider-default-right-width 1)
+ (setq mini-modeline-r-format '("%e" mode-line-front-space mode-line-mule-info mode-line-client
+ mode-line-modified mode-line-remote mode-line-frame-identification
+ mode-line-buffer-identification " " mode-line-position " " mode-name evil-mode-line-tag ))
+ )
+
+ (use-package smart-mode-line
+ :config
+ (sml/setup)
+ (add-to-list 'sml/replacer-regexp-list '("^~/Documents/Work/" ":WK:"))
+ (add-to-list 'sml/replacer-regexp-list '("^~/Documents/Private/" ":PR:"))
+ (add-to-list 'sml/replacer-regexp-list '("^~/.dotfiles/" ":D:") t)
+ )
#+end_src
@@ -12681,7 +12521,6 @@ As stated above, this simply provides nerd-icons to the completion framework.
:init
(nerd-icons-completion-mode))
-
#+end_src
**** Helpful + which-key: Better help defaults
@@ -12809,7 +12648,7 @@ This defines the authentication sources used by =org-calfw= ([[#h:c760f04e-622f-
#+begin_src emacs-lisp
;; (setq auth-sources '( "~/.emacs.d/.caldav" "~/.emacs.d/.authinfo.gpg")
- ;; auth-source-cache-expiry nil) ; default is 2h
+ ;; auth-source-cache-expiry nil) ; default is 2h
(setq auth-sources '( "~/.emacs.d/.authinfo")
auth-source-cache-expiry nil)
@@ -12856,145 +12695,24 @@ This part of the configuration mostly makes some aesthetic changes, enables neat
(setq org-startup-folded t)
(setq org-support-shift-select t)
- ;; (setq org-agenda-start-with-log-mode t)
- ;; (setq org-log-done 'time)
- ;; (setq org-log-into-drawer t)
+ (setq org-agenda-start-with-log-mode t)
+ (setq org-log-done 'time)
+ (setq org-log-into-drawer t)
(setq org-startup-with-inline-images t)
(setq org-export-headline-levels 6)
(setq org-image-actual-width nil)
(setq org-format-latex-options '(:foreground "White" :background default :scale 2.0 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")))
-#+end_src
-**** org-agenda
-:PROPERTIES:
-:CUSTOM_ID: h:2b3b4eb6-68a1-476d-b5d1-940a21484f1d
-:END:
-
-Here I setup a plethora of keywords, keybinds and paths to give my org-agenda more power.
-
-#+begin_src emacs-lisp
+ (setq org-agenda-files '("/home/swarsel/Nextcloud/Org/Tasks.org"
+ "/home/swarsel/Nextcloud/Org/Archive.org"
+ ))
- (setq org-agenda-files '("/home/swarsel/Nextcloud/Org/Tasks.org"
- "/home/swarsel/Nextcloud/Org/Archive.org"
- "/home/swarsel/Nextcloud/Org/Anki.org"
- "/home/swarsel/Calendars/leon_cal.org"))
-
- (setq org-refile-targets
- '((swarsel-archive-org-file :maxlevel . 1)
- (swarsel-anki-org-file :maxlevel . 1)
- (swarsel-tasks-org-file :maxlevel . 1)))
-
- (setq org-todo-keywords
- '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
- (sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANC(k@)")))
-
-
- ;; Configure custom agenda views
- (setq org-agenda-custom-commands
- '(("d" "Dashboard"
- ((agenda "" ((org-deadline-warning-days 7)))
- (todo "NEXT"
- ((org-agenda-overriding-header "Next Tasks")))
- (tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects")))))
-
- ("n" "Next Tasks"
- ((todo "NEXT"
- ((org-agenda-overriding-header "Next Tasks")))))
-
- ("W" "Work Tasks" tags-todo "+work-email")
-
-
- ("w" "Workflow Status"
- ((todo "WAIT"
- ((org-agenda-overriding-header "Waiting on External")
- (org-agenda-files org-agenda-files)))
- (todo "REVIEW"
- ((org-agenda-overriding-header "In Review")
- (org-agenda-files org-agenda-files)))
- (todo "PLAN"
- ((org-agenda-overriding-header "In Planning")
- (org-agenda-todo-list-sublevels nil)
- (org-agenda-files org-agenda-files)))
- (todo "BACKLOG"
- ((org-agenda-overriding-header "Project Backlog")
- (org-agenda-todo-list-sublevels nil)
- (org-agenda-files org-agenda-files)))
- (todo "READY"
- ((org-agenda-overriding-header "Ready for Work")
- (org-agenda-files org-agenda-files)))
- (todo "ACTIVE"
- ((org-agenda-overriding-header "Active Projects")
- (org-agenda-files org-agenda-files)))
- (todo "COMPLETED"
- ((org-agenda-overriding-header "Completed Projects")
- (org-agenda-files org-agenda-files)))
- (todo "CANC"
- ((org-agenda-overriding-header "Cancelled Projects")
- (org-agenda-files org-agenda-files)))))))
-
-
-#+end_src
-**** org capture templates
-:PROPERTIES:
-:CUSTOM_ID: h:23183635-3d46-4d7d-8eda-e0a085b335ef
-:END:
-
-I wrote these capture templates to allow myself to quickly create Anki cards from within Emacs. I nearly never use this feature, but it cannot hurt to have.
-
-#+begin_src emacs-lisp
-
- (setq org-capture-templates
- `(
- ("a" "Anki basic"
- entry
- (file+headline swarsel-org-anki-filepath "Dispatch")
- (function swarsel-anki-make-template-string))
-
- ("A" "Anki cloze"
- entry
- (file+headline org-swarsel-anki-file "Dispatch")
- "* %<%H:%M>\n:PROPERTIES:\n:ANKI_NOTE_TYPE: Cloze\n:ANKI_DECK: 🦁 All::01 ❤️ Various::00 ✨ Allgemein\n:END:\n** Text\n%?\n** Extra\n")
- ("t" "Tasks / Projects")
- ("tt" "Task" entry (file+olp swarsel-org-tasks-filepath "Inbox")
- "* TODO %?\n %U\n %a\n %i" :empty-lines 1)
- ))
- )
-#+end_src
-
-**** Font Faces
-:PROPERTIES:
-:CUSTOM_ID: h:40528f5a-c8cd-471b-b862-4088e8e61860
-:END:
-
-Again, my understanding of the font-faces in Emacs is limited. This is mostly just tuned so that my org-files look acceptable.
-
-#+begin_src emacs-lisp
-
-
-
- ;; Set faces for heading levels
- (with-eval-after-load 'org-faces (dolist (face '((org-level-1 . 1.1)
- (org-level-2 . 0.9)
- (org-level-3 . 0.9)
- (org-level-4 . 0.9)
- (org-level-5 . 0.9)
- (org-level-6 . 0.9)
- (org-level-7 . 0.9)
- (org-level-8 . 0.9)))
- (set-face-attribute (car face) nil :font swarsel-alt-font :weight 'medium :height (cdr face)))
-
- ;; Ensure that anything that should be fixed-pitch in Org files appears that way
- (set-face-attribute 'org-block nil :inherit 'fixed-pitch)
- (set-face-attribute 'org-table nil :inherit 'fixed-pitch)
- (set-face-attribute 'org-formula nil :inherit 'fixed-pitch)
- (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
- (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
- (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
- (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
- (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch))
+ (setq org-refile-targets
+ '((swarsel-archive-org-file :maxlevel . 1)
+ (swarsel-tasks-org-file :maxlevel . 1)))
+ )
#+end_src
-
**** org-appear
:PROPERTIES:
:CUSTOM_ID: h:62829574-a069-44b8-afb3-401a268d2747
@@ -13062,18 +12780,32 @@ It also offers a very useful utility of exporting org-mode buffers to different
#+begin_src emacs-lisp
(setq org-src-preserve-indentation nil)
- (org-babel-do-load-languages
- 'org-babel-load-languages
- '((emacs-lisp . t)
- (python . t)
- (js . t)
- (shell . t)
- ))
+ (org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((emacs-lisp . t)
+ (python . t)
+ (js . t)
+ (shell . t)
+ ))
- (push '("conf-unix" . conf-unix) org-src-lang-modes)
+ (push '("conf-unix" . conf-unix) org-src-lang-modes)
+
+ (setq org-export-with-broken-links 'mark)
+ (setq org-confirm-babel-evaluate nil)
+
+ ;; tangle is too slow, try to speed it up
+ (defadvice org-babel-tangle-single-block (around inhibit-redisplay activate protect compile)
+ "inhibit-redisplay and inhibit-message to avoid flicker."
+ (let ((inhibit-redisplay t)
+ (inhibit-message t))
+ ad-do-it))
+
+ (defadvice org-babel-tangle (around time-it activate compile)
+ "Display the execution time"
+ (let ((tim (current-time)))
+ ad-do-it
+ (message "org-tangle took %f sec" (float-time (time-subtract (current-time) tim)))))
- (setq org-export-with-broken-links 'mark)
- (setq org-confirm-babel-evaluate nil)
#+end_src
@@ -13086,15 +12818,15 @@ It also offers a very useful utility of exporting org-mode buffers to different
Usage: Type =<=, followed by one of the below keywords and press =RET=. The corresponding source block should appear.
- #+begin_src emacs-lisp
+ #+begin_src emacs-lisp
- (require 'org-tempo)
- (add-to-list 'org-structure-template-alist '("sh" . "src shell"))
- (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
- (add-to-list 'org-structure-template-alist '("py" . "src python :results output"))
- (add-to-list 'org-structure-template-alist '("nix" . "src nix :tangle"))
+ (require 'org-tempo)
+ (add-to-list 'org-structure-template-alist '("sh" . "src shell"))
+ (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
+ (add-to-list 'org-structure-template-alist '("py" . "src python :results output"))
+ (add-to-list 'org-structure-template-alist '("nix" . "src nix :tangle"))
- #+end_src
+ #+end_src
**** aucTex
:PROPERTIES:
@@ -13131,20 +12863,6 @@ This package allows to download and copy images into org-mode buffers. Sadly it
#+begin_src emacs-lisp
- (use-package org-download
- :after org
- :defer nil
- :custom
- (org-download-method 'directory)
- (org-download-image-dir "./images")
- (org-download-heading-lvl 0)
- (org-download-timestamp "org_%Y%m%d-%H%M%S_")
- ;;(org-image-actual-width 500)
- (org-download-screenshot-method "grim -g \"$(slurp)\" %s")
- :bind
- ("C-M-y" . org-download-screenshot)
- :config
- (require 'org-download))
#+end_src
@@ -13433,24 +13151,6 @@ Adds functions for formatting shellscripts.
#+end_src
-*** Olivetti
-:PROPERTIES:
-:CUSTOM_ID: h:65e69741-9860-4ed0-bbed-7b7be9a2a9d6
-:END:
-
-Olivetti is a mode specialized for writing prose in Emacs. I went for a very simple setup with little distractions.
-
-This mode is not automatically activated anywhere because I only rarely need it.
-
-#+begin_src emacs-lisp
-
- (use-package olivetti
- :init
- (setq olivetti-body-width 100)
- (setq olivetti-recall-visual-line-mode-entry-state t))
-
-#+end_src
-
*** elfeed
:PROPERTIES:
:CUSTOM_ID: h:a83c5820-2016-44ae-90a0-4756bb471c01
@@ -13488,23 +13188,6 @@ This mode is not automatically activated anywhere because I only rarely need it.
#+end_src
-
-*** darkroom
-:PROPERTIES:
-:CUSTOM_ID: h:94d4a0dc-b0d7-4702-b760-beeaa6da2b8f
-:END:
-
-Darkroom is package that reduces all forms of distraction to a minimum - this can be useful when simply reading a file for example. For this mode I have increased the text scale by a large margin to make for comfortable reading
-This mode is not automatically activated anywhere because I only rarely need it.
-
-#+begin_src emacs-lisp
-
- (use-package darkroom
- :init
- (setq darkroom-text-scale-increase 3))
-
-#+end_src
-
*** Ripgrep
:PROPERTIES:
:CUSTOM_ID: h:87453f1c-8ea5-4d0a-862d-8973d5bc5405
@@ -13604,19 +13287,6 @@ In order to update the language grammars, run the next command below.
#+end_src
-*** crdt (Collaborative Editing)
-:PROPERTIES:
-:CUSTOM_ID: h:1c1821c6-98de-4079-a4f3-6ba6e6dcb668
-:END:
-
-With this it is possible to work on the same file collaboratively. I have never tried it out, but it sounds cool.
-
-#+begin_src emacs-lisp
-
- (use-package crdt)
-
-#+end_src
-
*** devdocs
:PROPERTIES:
:CUSTOM_ID: h:d9a6cb44-736e-4608-951f-e928e1b757c0
@@ -13667,7 +13337,7 @@ projectile is useful for keeping track of your git projects within Emacs. I most
:init
;; NOTE: Set this to the folder where you keep your Git repos!
(when (file-directory-p swarsel-projects-directory)
- (setq projectile-project-search-path (list swarsel-projects-directory)))
+ (setq projectile-project-search-path (list swarsel-work-projects-directory swarsel-private-projects-directory)))
(setq projectile-switch-project-action #'magit-status))
#+end_src
@@ -13685,9 +13355,8 @@ Also, Emacs needs a little extra love to accept my Yubikey for git commits etc.
(use-package magit
:config
- (setq magit-repository-directories `((,swarsel-projects-directory . 1)
- (,swarsel-emacs-directory . 0)
- (,swarsel-obsidian-directory . 0)
+ (setq magit-repository-directories `((,swarsel-work-projects-directory . 1)
+ (,swarsel-private-projects-directory . 1)
("~/.dotfiles/" . 0)))
:custom
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) ; stay in the same window
@@ -13724,9 +13393,7 @@ NOTE: Make sure to configure a GitHub token before using this package!
(1) in practice: github -<> settings -<> developer option -<>
create classic token with repo; user; read:org permissions
- (2) install GnuGP (and add to PATH)
- (3) create ~/.authinfo.gpg with the following info scheme:
- machine api.github.com login USERNAME^forge password 012345abcdef...
+ (2)machine api.github.com login USERNAME^forge password 012345abcdef...
#+begin_src emacs-lisp
@@ -13735,10 +13402,7 @@ NOTE: Make sure to configure a GitHub token before using this package!
(with-eval-after-load 'forge
(add-to-list 'forge-alist
- '("sgit.iue.tuwien.ac.at"
- "sgit.iue.tuwien.ac.at/api/v1"
- "sgit.iue.tuwien.ac.at"
- forge-gitea-repository)))
+ ))
#+end_src
*** git-timemachine
@@ -13822,12 +13486,6 @@ Navigation functions defined here: [[#h:a1802f9b-bb71-4fd5-86fa-945da18e8b81][co
#+begin_src emacs-lisp
- ;; (use-package corfu
- ;; :custom
- ;; (corfu-cycle t)
- ;; :init
- ;; (global-corfu-mode))
-
(use-package corfu
:init
(global-corfu-mode)
@@ -13836,7 +13494,7 @@ Navigation functions defined here: [[#h:a1802f9b-bb71-4fd5-86fa-945da18e8b81][co
:custom
(corfu-auto t)
(corfu-auto-prefix 3)
- (corfu-auto-delay 0.3)
+ (corfu-auto-delay 1)
(corfu-cycle t)
(corfu-quit-no-match 'separator)
(corfu-separator ?\s)
@@ -13901,22 +13559,6 @@ I leave the commented out alist extensions here in case I want to try them out a
("C-z ^" . cape-tex)
("C-z &" . cape-sgml)
("C-z r" . cape-rfc1345)
- ;; Add to the global default value of `completion-at-point-functions' which is
- ;; used by `completion-at-point'. The order of the functions matters, the
- ;; first function returning a result wins. Note that the list of buffer-local
- ;; completion functions takes precedence over the global list.
- ;; (add-to-list 'completion-at-point-functions #'cape-dabbrev)
- ;; (add-to-list 'completion-at-point-functions #'cape-file)
- ;; (add-to-list 'completion-at-point-functions #'cape-elisp-block)
- ;; (add-to-list 'completion-at-point-functions #'cape-history)
- ;; (add-to-list 'completion-at-point-functions #'cape-keyword)
- ;; (add-to-list 'completion-at-point-functions #'cape-tex)
- ;; (add-to-list 'completion-at-point-functions #'cape-sgml)
- ;; (add-to-list 'completion-at-point-functions #'cape-rfc1345)
- ;; (add-to-list 'completion-at-point-functions #'cape-abbrev)
- ;; (add-to-list 'completion-at-point-functions #'cape-dict)
- ;; (add-to-list 'completion-at-point-functions #'cape-elisp-symbol)
- ;; (add-to-list 'completion-at-point-functions #'cape-line)
)
#+end_src
@@ -14019,86 +13661,6 @@ Still, this is avery convenient package.
#+end_src
-*** yasnippet
-:PROPERTIES:
-:CUSTOM_ID: h:9ec11ee4-2250-414a-87b5-73ee680a3a4a
-:END:
-
-yasnippet allows to define snippets that can be quickly expanded by hitting the =TAB= key after inputting a keyword.
-
-I used to run this together with the =yasnippet-snippets= package, but the snippets in there I did not find all too useful for myself. I need to create some custom snippets here one day.
-
-#+begin_src emacs-lisp
-
- (use-package yasnippet
- :init (yas-global-mode 1)
- :config
- (yas-reload-all))
-
-#+end_src
-
-***** yasnippet math-snippets
-:PROPERTIES:
-:CUSTOM_ID: h:af0a78a5-17c2-4e13-b64a-772c27c4dee2
-:END:
-
-The following block is mostly inspired from [[https://code.kulupu.party/thesuess/WTFmacs/]] and sets up a few prefixes that make LaTeX-math-mode nicer to use even with auctex and cape enabled.
-
-#+begin_src emacs-lisp
-
-
- (setq wtf/latex-mathbb-prefix "''")
- (setq swarsel/latex-mathcal-prefix "``")
-
- (use-package yasnippet
- :config
-
- (setq wtf/english-alphabet
- '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"))
-
- (dolist (elem wtf/english-alphabet)
- (when (string-equal elem (downcase elem))
- (add-to-list 'wtf/english-alphabet (upcase elem))))
-
-
- (yas-define-snippets
- 'latex-mode
- (mapcar
- (lambda (elem)
- (list (concat wtf/latex-mathbb-prefix elem) (concat "\\mathbb{" elem "}") (concat "Mathbb letter " elem)))
- wtf/english-alphabet))
-
- (yas-define-snippets
- 'latex-mode
- (mapcar
- (lambda (elem)
- (list (concat swarsel/latex-mathcal-prefix elem) (concat "\\mathcal{" elem "}") (concat "Mathcal letter " elem)))
- wtf/english-alphabet))
-
- (setq swtf/latex-math-symbols
- '(("x" . "\\times")
- ("*" . "\\cdot")
- ("." . "\\ldots")
- ("op" . "\\operatorname{$1}$0")
- ("o" . "\\circ")
- ("V" . "\\forall")
- ("v" . "\\vee")
- ("w" . "\\wedge")
- ("q" . "\\quad")
- ("f" . "\\frac{$1}{$2}$0")
- ("s" . "\\sum_{$1}^{$2}$0")
- ("p" . "\\prod_{$1}^{$2}$0")
- ("e" . "\\exists")
- ("i" . "\\int_{$1}^{$2}$0")
- ("c" . "\\cap")
- ("u" . "\\cup")
- ("0" . "\\emptyset")))
-
- )
-
-
-#+end_src
-
*** eglot
:PROPERTIES:
:CUSTOM_ID: h:6cf0310b-2fdf-45f0-9845-4704649777eb
@@ -14112,7 +13674,7 @@ After having tried out =lsp-mode= and =lsp-bridge= for a while each, I must say
(use-package eglot
:config
(add-to-list 'eglot-server-programs
- '(yaml-ts-mode . ("ansible-language-server" "--stdio")))
+ '(yaml-ts-mode . ("ansible-language-server" "--stdio")))
:hook
((python-mode
python-ts-mode
@@ -14165,26 +13727,11 @@ This brings back warnings and errors on the sideline for eglot; a feature that I
:hook (flymake-mode . sideline-mode)
:init
(setq sideline-flymake-display-mode 'point) ; 'point to show errors only on point
- ; 'line to show errors on the current line
+ ; 'line to show errors on the current line
(setq sideline-backends-right '(sideline-flymake)))
#+end_src
-*** Breadcrumb
-:PROPERTIES:
-:CUSTOM_ID: h:1de35f27-335d-4cbd-beb6-f85cf5496173
-:END:
-
-This simple shows the path to the current file on the top of the buffer - I just think it looks kind of neat, even though it is not extremely useful :)
-
-#+begin_src emacs-lisp
-
- (use-package breadcrumb
- ;; :config (breadcrumb-mode)
- )
-
-#+end_src
-
*** Prevent breaking of hardlinks
:PROPERTIES:
:CUSTOM_ID: h:e9a30d0f-423f-4e85-af4b-f8560f1c1b53
@@ -14259,36 +13806,6 @@ Dirvish is an improvement upon the dired-framework and has more features like fi
("M-j" . dirvish-fd-jump)))
#+end_src
-*** pdf-tools: pdf-viewer and support for dirvish
-:PROPERTIES:
-:CUSTOM_ID: h:b108dd3e-f34d-4ed3-98df-0bf9de055889
-:END:
-
-This enables pdf-previewing in dirvish and gives a much better pdf-viewer than is shipped normally by emacs.
-
-#+begin_src emacs-lisp
-
- ;; (use-package pdf-tools
- ;; :init
- ;; (if (not (boundp 'pdf-tools-directory))
- ;; (pdf-tools-install))
- ;; :mode ("\\.pdf" . pdf-view-mode))
-
-#+end_src
-
-*** Jupyter
-:PROPERTIES:
-:CUSTOM_ID: h:c15efae7-b884-4c97-8367-ccc7e7ed9ba8
-:END:
-
-This is a jupyter client. Using it is a bit cumbersome though, so I have not fully explored all features.
-
-#+begin_src emacs-lisp
-
- (use-package ein)
-
-#+end_src
-
*** undo-tree
:PROPERTIES:
:CUSTOM_ID: h:1fc538d1-8c53-48b2-8652-66046f4bbbf8
@@ -14314,10 +13831,6 @@ While we are at it, we are also setting up a persistent undo-file for every file
:config
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo"))))
- ;; (add-hook 'prog-mode-hook 'undo-tree-mode)
- ;; (add-hook 'text-mode-hook 'undo-tree-mode)
- ;; (add-hook 'org-mode-hook 'undo-tree-mode)
- ;; (add-hook 'latex-mode-hook 'undo-tree-mode)
#+end_src
*** Hydra
:PROPERTIES:
@@ -14350,167 +13863,10 @@ I only wrote this in order to try out hydra; rarely do I really need this. Howev
("f" nil "finished" :exit t))
#+end_src
-*** External Applications
-:PROPERTIES:
-:CUSTOM_ID: h:fff816a0-6d70-4bda-abab-833345e51100
-:END:
-**** Obsidian
-:PROPERTIES:
-:CUSTOM_ID: h:9335d32d-bf08-4601-820d-f3d1f33f876f
-:END:
-
-This provides an interface to Obsidian for Emacs - as much as I want to like it, I actually enjoy using the official Obsidian app more - even though that cannot be used by Emacs directly.
-
-My workflow for Obsidian is now as follows:
-
-1) create notes either in Emacs or Obsidian
-2) look at them in the official client
-
- I hope that this package will improve, then I will come back to it one day.
-
-#+begin_src emacs-lisp
-
- ;; (use-package obsidian
- ;; :ensure t
- ;; :demand t
- ;; :config
- ;; (obsidian-specify-path swarsel-obsidian-vault-directory)
- ;; (global-obsidian-mode t)
- ;; :custom
- ;; ;; This directory will be used for `obsidian-capture' if set.
- ;; (obsidian-inbox-directory "Inbox")
- ;; (bind-key (kbd "C-c M-o") 'obsidian-hydra/body 'obsidian-mode-map)
- ;; :bind (:map obsidian-mode-map
- ;; ;; Replace C-c C-o with Obsidian.el's implementation. It's ok to use another key binding.
- ;; ("C-c C-o" . obsidian-follow-link-at-point)
- ;; ;; Jump to backlinks
- ;; ("C-c C-b" . obsidian-backlink-jump)
- ;; ;; If you prefer you can use `obsidian-insert-link'
- ;; ("C-c C-l" . obsidian-insert-wikilink)))
-
-#+end_src
-
-**** Anki
-:PROPERTIES:
-:CUSTOM_ID: h:5854c9a6-1319-4961-a112-75b1bf2e1f69
-:END:
-
-This section is here to make Anki usable from within Emacs - an endeavour that I have mostly given up on.
-
-***** Basic Anki setup
-:PROPERTIES:
-:CUSTOM_ID: h:d20559ed-7ada-4fea-a964-33bfd64b4549
-:END:
-
-#+begin_src emacs-lisp
-
- ;; (use-package anki-editor
- ;; :after org
- ;; :bind (:map org-mode-map
- ;; ("" . anki-editor-cloze-region-auto-incr)
- ;; ("" . anki-editor-cloze-region-dont-incr)
- ;; ("" . anki-editor-reset-cloze-number)
- ;; ("" . anki-editor-push-tree))
- ;; :hook (org-capture-after-finalize . anki-editor-reset-cloze-number) ; Reset cloze-number after each capture.
- ;; :config
- ;; (setq anki-editor-create-decks t ;; Allow anki-editor to create a new deck if it doesn't exist
- ;; anki-editor-org-tags-as-anki-tags t)
-
- ;; (defun anki-editor-cloze-region-auto-incr (&optional arg)
- ;; "Cloze region without hint and increase card number."
- ;; (interactive)
- ;; (anki-editor-cloze-region swarsel-anki-editor-cloze-number "")
- ;; (setq swarsel-anki-editor-cloze-number (1+ swarsel-anki-editor-cloze-number))
- ;; (forward-sexp))
- ;; (defun anki-editor-cloze-region-dont-incr (&optional arg)
- ;; "Cloze region without hint using the previous card number."
- ;; (interactive)
- ;; (anki-editor-cloze-region (1- swarsel-anki-editor-cloze-number) "")
- ;; (forward-sexp))
- ;; (defun anki-editor-reset-cloze-number (&optional arg)
- ;; "Reset cloze number to ARG or 1"
- ;; (interactive)
- ;; (setq swarsel-anki-editor-cloze-number (or arg 1)))
- ;; (defun anki-editor-push-tree ()
- ;; "Push all notes under a tree."
- ;; (interactive)
- ;; (anki-editor-push-notes '(4))
- ;; (anki-editor-reset-cloze-number))
- ;; ;; Initialize
- ;; (anki-editor-reset-cloze-number)
- ;; )
-
- ;; (require 'anki-editor)
-
-#+end_src
-
-***** Own Anki functions
-:PROPERTIES:
-:CUSTOM_ID: h:64242e95-6454-4330-bcb9-15353083bade
-:END:
-
-- These functions enable you to quickly set the destination note type and deck
-
-#+begin_src emacs-lisp
-
- ;; (defvar swarsel-anki-deck nil)
- ;; (defvar swarsel-anki-notetype nil)
- ;; (defvar swarsel-anki-fields nil)
-
- ;; (defun swarsel-anki-set-deck-and-notetype ()
- ;; (interactive)
- ;; (setq swarsel-anki-deck (completing-read "Choose a deck: "
- ;; (sort (anki-editor-deck-names) #'string-lessp)))
- ;; (setq swarsel-anki-notetype (completing-read "Choose a note type: "
- ;; (sort (anki-editor-note-types) #'string-lessp)))
- ;; (setq swarsel-anki-fields (progn
- ;; (anki-editor--anki-connect-invoke-result "modelFieldNames" `((modelName . ,swarsel-anki-notetype)))))
- ;; )
-
- ;; (defun swarsel-anki-make-template-string ()
- ;; (if (not swarsel-anki-deck)
- ;; (call-interactively 'swarsel-anki-set-deck-and-notetype))
- ;; (setq swarsel-temp swarsel-anki-fields)
- ;; (concat (concat "* %<%H:%M>\n:PROPERTIES:\n:ANKI_NOTE_TYPE: " swarsel-anki-notetype "\n:ANKI_DECK: " swarsel-anki-deck "\n:END:\n** ")(pop swarsel-temp) "\n%?\n** " (mapconcat 'identity swarsel-temp "\n\n** ") "\n\n"))
-
- ;; (defun swarsel-today()
- ;; (format-time-string "%Y-%m-%d"))
-
- ;; (defun swarsel-obsidian-daily ()
- ;; (interactive)
- ;; (if (not (file-exists-p (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory)))
- ;; (write-region "" nil (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory))
- ;; )
- ;; (find-file (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory)))
-
-#+end_src
-
*** Email
:PROPERTIES:
:CUSTOM_ID: h:2f333330-b19d-4f64-85ea-146ff28667e8
:END:
-**** make sure mu4e is found
-:PROPERTIES:
-:CUSTOM_ID: h:48fde614-7cd0-4764-a7ac-0dae60d8b65a
-:END:
-
-This seems not to be needed - I do not yet dare to delete it though.
-
-#+begin_src emacs-lisp
-
- ;; (let ((mu4epath
- ;; (concat
- ;; (f-dirname
- ;; (file-truename
- ;; (executable-find "mu")))
- ;; "/../share/emacs/site-lisp/mu4e")))
- ;; (when (and
- ;; (string-prefix-p "/nix/store/" mu4epath)
- ;; (file-directory-p mu4epath))
- ;; (add-to-list 'load-path mu4epath)))
-
-#+end_src
-
**** mu4e
:PROPERTIES:
:CUSTOM_ID: h:b92a18cf-eec3-4605-a8c2-37133ade3574
@@ -14730,115 +14086,8 @@ This sets up the =dashboard=, which is really quite useless. But, it looks cool
#+begin_src emacs-lisp
(use-package vterm
- :ensure t)
-
- (defun sudo-find-file (file-name)
- "Like find file, but opens the file as root."
- (interactive "FSudo Find File: ")
- (let ((tramp-file-name (concat "/sudo::" (expand-file-name file-name))))
- (find-file tramp-file-name)))
- ;;; vterm/config.el -*- lexical-binding: t; -*-
-
- ;; Original functions overwrites tramp path with a guessed path.
- ;; However it breaks if remote fqdn/hostname is not resolvale by local machine
- ;; could also break on port forwarding, multihops,
- ;; custom protocol such as: docker, vagrant, ...
- ;; *if* you try to shell-side configure them.
- ;; Easily testable with vagrant ssh port on localhost.
- ;; My workflow is to open a tramp dired on / of the remote to get a
- ;; "foothold" then open vterms from there.
- (defun vterm--get-directory (path)
- "[OVERLOADED] Get normalized directory to PATH."
- (when path
- (let (directory)
- (if (string-match "^\\(.*?\\)@\\(.*?\\):\\(.*?\\)$" path)
- (progn
- (let ((user (match-string 1 path))
- (host (match-string 2 path))
- (dir (match-string 3 path)))
- (if (and (string-equal user user-login-name)
- (string-equal host (system-name)))
- (progn
- (when (file-directory-p dir)
- (setq directory (file-name-as-directory dir))))
- (setq directory
- ;; Bellow is what i altered
- (file-name-as-directory (concat (file-remote-p default-directory) dir))))))
- (when (file-directory-p path)
- (setq directory (file-name-as-directory path))))
- directory)))
- ;; Injects the payload to the vterm buffer.
- (defun me/vterm-load-config ()
- "Pass local configuration files to vterm.
-
- Allows remote vterm to be shell-side configured,
- without altering remote config.
- Also adds my personal configuration that does not rely
- too much on external packages.
- Prints a reasuring message to proove good faith."
- (interactive)
- (let (;; Bellow messages to reassure other users that look at history
- (reasuring-message (format "Configuring shell of user %s to be emacs comptible"
- user-full-name))
- (reasuring-notice "This action is shell local, it will not affect other shells")
- ;; Bellow lies my configuration
- (basic-func-script (f-read-text (concat (getenv "HOME")
- "/.emacs.d/shells/sources/functions.sh")))
- ;; Bellow lies the vterm shell-side configuration
- ;; Must be sourced last
- (vterm-func-script (f-read-text (concat
- (file-name-directory (find-library-name "vterm"))
- "/etc/emacs-vterm-bash.sh"))))
- (vterm-insert (format "# START: %s\n" reasuring-message))
- (vterm-insert (format "# %s\n" reasuring-notice))
- ;; Create one single block in history
- (vterm-insert "{\n")
- (vterm-insert basic-func-script)
- (vterm-insert vterm-func-script)
- (vterm-insert "}\n")
- ;; End the single block in history
- (vterm-insert (format "# %s\n" reasuring-notice))
- (vterm-insert (format "# STOP: %s\n" reasuring-message))
- )
- )
-
- ;; find-file-other-window does not works great on remote:
- ;; if given an absolute path on a remote host,
- ;; the path will be understood as a local file since no
- ;; tramp prefix is present, and bash does not care
- ;; about tramp prefixes.
- ;; Bellow we solve context before sending it to
- ;; ffow
- (defun me/vterm--find-file-other-window-wrapper (file)
- "Help vterm find a FILE."
- (find-file-other-window (me/vterm--ffow-resolver file)))
- (defun me/vterm--ffow-resolver (file)
- "Help vterm resolve FILE."
- (cond
- ;; "/sudo::"
- ;; doom--sudo-file-path do the trick for us
- ((s-starts-with-p "/sudo::" file)
- (sudo-find-file
- (concat (file-remote-p default-directory)
- (substring-no-properties file 7))))
- ;; "/" means we want the "Relative root"
- ;; try appending the remote prefix if relevent
- ((s-starts-with-p "/" file)
- (concat (file-remote-p default-directory) file))
- ;; we got a relative path
- ;; we don't need to help ffow to find it
- (t
- file)))
-
- ;; The variable vterm-eval-cmds is a SERIOUSLY SENSIBLE variable !
- ;; Do not be the guy that adds RCE into their config !
-
- ;; Allow customed ffow to be called from vterm
- ;; ffow should be as safe as find-file which is already trusted
- ;; we append our resolver that only manipulate strings,
- ;; Proove me wrong but i think it's safe.
- (add-to-list 'vterm-eval-cmds '("find-file-other-window"
- me/vterm--find-file-other-window-wrapper))
+ :ensure t)
+
#+end_src
*** multiple cursors
@@ -14848,7 +14097,17 @@ This sets up the =dashboard=, which is really quite useless. But, it looks cool
#+begin_src emacs-lisp
-(use-package multiple-cursors)
+ (use-package multiple-cursors)
+
+#+end_src
+*** Less logging
+
+#+begin_src emacs-lisp
+
+ (setq mu4e--log-max-size 1000)
+ (setq message-log-max 30)
+ (setq comint-buffer-maximum-size 50)
+ (add-hook 'comint-output-filter-functions 'comint-truncate-buffer)
#+end_src
* Appendix A: Noweb-Ref blocks
@@ -14874,7 +14133,6 @@ This is where the theme for the whole OS is defined. Originally, this noweb-ref
#+begin_src nix :tangle no :noweb-ref theme
-
enable = true;
base16Scheme = "${self}/wallpaper/swarsel.yaml";
# base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
@@ -14898,7 +14156,6 @@ This is where the theme for the whole OS is defined. Originally, this noweb-ref
# name = "FiraCode Nerd Font Propo";
# name = "Montserrat";
};
-
sansSerif = {
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
package = pkgs.cantarell-fonts;
@@ -14907,19 +14164,15 @@ This is where the theme for the whole OS is defined. Originally, this noweb-ref
# name = "FiraCode Nerd Font Propo";
# name = "Montserrat";
};
-
monospace = {
package = pkgs.nerd-fonts.fira-mono; # has overrides
-
name = "FiraCode Nerd Font Mono";
};
-
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
};
-
#+end_src
* Appendix B: Supplementary Files
@@ -14934,86 +14187,86 @@ On my server, I use a reduced, self-contained emacs configuration that only serv
#+begin_src emacs-lisp :tangle programs/emacs/server.el
-(require 'package)
+ (require 'package)
-(package-initialize nil)
-(setq package-enable-at-startup nil)
+ (package-initialize nil)
+ (setq package-enable-at-startup nil)
-(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
+ (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
-(add-to-list 'package-archives
- '("melpa" . "https://melpa.org/packages/") t)
+ (add-to-list 'package-archives
+ '("melpa" . "https://melpa.org/packages/") t)
-(package-initialize)
+ (package-initialize)
-(let ((default-directory "~/.emacs.d/elpa/"))
- (normal-top-level-add-subdirs-to-load-path))
+ (let ((default-directory "~/.emacs.d/elpa/"))
+ (normal-top-level-add-subdirs-to-load-path))
-(unless (package-installed-p 'use-package)
- (package-refresh-contents)
- (package-install 'use-package))
+ (unless (package-installed-p 'use-package)
+ (package-refresh-contents)
+ (package-install 'use-package))
-(require 'use-package)
+ (require 'use-package)
-(use-package elfeed
- :ensure t
- :bind (:map elfeed-search-mode-map
- ("q" . bjm/elfeed-save-db-and-bury)))
+ (use-package elfeed
+ :ensure t
+ :bind (:map elfeed-search-mode-map
+ ("q" . bjm/elfeed-save-db-and-bury)))
-(require 'elfeed)
+ (require 'elfeed)
-(use-package elfeed-org
- :ensure t
- :config
- (elfeed-org)
- (setq rmh-elfeed-org-files (list "/var/lib/syncthing/.elfeed/elfeed.org")))
+ (use-package elfeed-org
+ :ensure t
+ :config
+ (elfeed-org)
+ (setq rmh-elfeed-org-files (list "/var/lib/syncthing/.elfeed/elfeed.org")))
-(use-package elfeed-goodies
- :ensure t)
+ (use-package elfeed-goodies
+ :ensure t)
-(elfeed-goodies/setup)
+ (elfeed-goodies/setup)
-(use-package elfeed-web
- :ensure t)
+ (use-package elfeed-web
+ :ensure t)
-(global-set-key (kbd "C-x w") 'bjm/elfeed-load-db-and-open)
+ (global-set-key (kbd "C-x w") 'bjm/elfeed-load-db-and-open)
-(define-key elfeed-show-mode-map (kbd "j") 'elfeed-goodies/split-show-next)
-(define-key elfeed-show-mode-map (kbd "k") 'elfeed-goodies/split-show-prev)
-(define-key elfeed-search-mode-map (kbd "j") 'next-line)
-(define-key elfeed-search-mode-map (kbd "k") 'previous-line)
-(define-key elfeed-show-mode-map (kbd "S-SPC") 'scroll-down-command)
+ (define-key elfeed-show-mode-map (kbd "j") 'elfeed-goodies/split-show-next)
+ (define-key elfeed-show-mode-map (kbd "k") 'elfeed-goodies/split-show-prev)
+ (define-key elfeed-search-mode-map (kbd "j") 'next-line)
+ (define-key elfeed-search-mode-map (kbd "k") 'previous-line)
+ (define-key elfeed-show-mode-map (kbd "S-SPC") 'scroll-down-command)
-(defun bjm/elfeed-save-db-and-bury ()
- "Wrapper to save the elfeed db to disk before burying buffer"
- (interactive)
- (elfeed-db-save)
- (quit-window))
+ (defun bjm/elfeed-save-db-and-bury ()
+ "Wrapper to save the elfeed db to disk before burying buffer"
+ (interactive)
+ (elfeed-db-save)
+ (quit-window))
-(defun bjm/elfeed-load-db-and-open ()
- "Wrapper to load the elfeed db from disk before opening"
- (interactive)
- (elfeed-db-load)
- (elfeed)
- (elfeed-search-update--force)
- (elfeed-update))
+ (defun bjm/elfeed-load-db-and-open ()
+ "Wrapper to load the elfeed db from disk before opening"
+ (interactive)
+ (elfeed-db-load)
+ (elfeed)
+ (elfeed-search-update--force)
+ (elfeed-update))
-(defun bjm/elfeed-updater ()
- "Wrapper to load the elfeed db from disk before opening"
- (interactive)
- (elfeed-db-load))
+ (defun bjm/elfeed-updater ()
+ "Wrapper to load the elfeed db from disk before opening"
+ (interactive)
+ (elfeed-db-load))
-(run-with-timer 0 (* 1 60) 'bjm/elfeed-updater)
+ (run-with-timer 0 (* 1 60) 'bjm/elfeed-updater)
-(setq httpd-port 9812)
-(setq httpd-host "0.0.0.0")
-(setq httpd-root "/root/.emacs.d/elpa/elfeed-web-20240729.1741/")
-(setq elfeed-db-directory "/var/lib/syncthing/.elfeed/db/")
+ (setq httpd-port 9812)
+ (setq httpd-host "0.0.0.0")
+ (setq httpd-root "/root/.emacs.d/elpa/elfeed-web-20240729.1741/")
+ (setq elfeed-db-directory "/var/lib/syncthing/.elfeed/db/")
-(httpd-start)
-(elfeed-web-start)
+ (httpd-start)
+ (elfeed-web-start)
#+end_src
** tridactylrc
@@ -15132,309 +14385,309 @@ autocmd DocStart vc-impimba-1.m.imp.ac.at/ui/webconsole mode ignore
This is the stylesheet used by waybar.
#+begin_src css :tangle programs/waybar/style.css :mkdirp yes
-@define-color foreground #fdf6e3;
-@define-color background #1a1a1a;
-@define-color background-alt #292b2e;
-@define-color foreground-warning #268bd2;
-@define-color background-warning @background;
-@define-color foreground-error red;
-@define-color background-error @background;
-@define-color foreground-critical gold;
-@define-color background-critical blue;
-
-
- * {
- border: none;
- border-radius: 0;
- font-family: "FiraCode Nerd Font Propo", "Font Awesome 5 Free";
- font-size: 14px;
- min-height: 0;
- margin: -1px 0px;
-}
-
-window#waybar {
- background: transparent;
- color: @foreground;
- transition-duration: .5s;
-}
+ @define-color foreground #fdf6e3;
+ @define-color background #1a1a1a;
+ @define-color background-alt #292b2e;
+ @define-color foreground-warning #268bd2;
+ @define-color background-warning @background;
+ @define-color foreground-error red;
+ @define-color background-error @background;
+ @define-color foreground-critical gold;
+ @define-color background-critical blue;
-window#waybar.hidden {
- opacity: 0.2;
-}
+ ,* {
+ border: none;
+ border-radius: 0;
+ font-family: "FiraCode Nerd Font Propo", "Font Awesome 5 Free";
+ font-size: 14px;
+ min-height: 0;
+ margin: -1px 0px;
+ }
-#mpris {
- padding: 0 10px;
- background-color: transparent;
- color: #1DB954;
- font-family: Monospace;
- font-size: 12px;
-}
+ window#waybar {
+ background: transparent;
+ color: @foreground;
+ transition-duration: .5s;
+ }
-#custom-right-arrow-dark,
-#custom-left-arrow-dark {
- color: @background;
- background: @background-alt;
- font-size: 24px;
-}
+ window#waybar.hidden {
+ opacity: 0.2;
+ }
-#window {
- font-size: 12px;
- padding: 0 20px;
-}
-#mode {
- background: @background-critical;
- color: @foreground-critical;
- padding: 0 3px;
-}
+ #mpris {
+ padding: 0 10px;
+ background-color: transparent;
+ color: #1DB954;
+ font-family: Monospace;
+ font-size: 12px;
+ }
-#privacy,
-#custom-configwarn {
- color: black;
- padding: 0 3px;
- animation-name: configblink;
- animation-duration: 0.5s;
- animation-timing-function: linear;
- animation-iteration-count: infinite;
- animation-direction: alternate;
-}
+ #custom-right-arrow-dark,
+ #custom-left-arrow-dark {
+ color: @background;
+ background: @background-alt;
+ font-size: 24px;
+ }
-#custom-nix-updates {
- color: white;
- padding: 0 3px;
-}
+ #window {
+ font-size: 12px;
+ padding: 0 20px;
+ }
-#custom-outer-right-arrow-dark,
-#custom-outer-left-arrow-dark {
- color: @background;
- font-size: 24px;
-}
+ #mode {
+ background: @background-critical;
+ color: @foreground-critical;
+ padding: 0 3px;
+ }
-#custom-outer-left-arrow-dark,
-#custom-left-arrow-dark,
-#custom-left-arrow-light {
- margin: 0 -1px;
-}
+ #privacy,
+ #custom-configwarn {
+ color: black;
+ padding: 0 3px;
+ animation-name: configblink;
+ animation-duration: 0.5s;
+ animation-timing-function: linear;
+ animation-iteration-count: infinite;
+ animation-direction: alternate;
+ }
-#custom-right-arrow-light,
-#custom-left-arrow-light {
- color: @background-alt;
- background: @background;
- font-size: 24px;
-}
+ #custom-nix-updates {
+ color: white;
+ padding: 0 3px;
+ }
-#workspaces,
-#clock.1,
-#clock.2,
-#clock.3,
-#pulseaudio,
-#memory,
-#cpu,
-#temperature,
-#custom-scratchpad-indicator,
-#power-profiles-daemon,
-#idle_inhibitor,
-#backlight-slider,
-#mpris,
-#tray {
- background: @background;
-}
+ #custom-outer-right-arrow-dark,
+ #custom-outer-left-arrow-dark {
+ color: @background;
+ font-size: 24px;
+ }
-#network,
-#custom-vpn,
-#clock.2,
-#battery,
-#cpu,
-#custom-pseudobat,
-#disk {
- background: @background-alt;
-}
+ #custom-outer-left-arrow-dark,
+ #custom-left-arrow-dark,
+ #custom-left-arrow-light {
+ margin: 0 -1px;
+ }
+ #custom-right-arrow-light,
+ #custom-left-arrow-light {
+ color: @background-alt;
+ background: @background;
+ font-size: 24px;
+ }
-#workspaces button {
- padding: 0 2px;
- color: #fdf6e3;
-}
-#workspaces button.focused {
- color: @foreground-warning;
-}
+ #workspaces,
+ #clock.1,
+ #clock.2,
+ #clock.3,
+ #pulseaudio,
+ #memory,
+ #cpu,
+ #temperature,
+ #custom-scratchpad-indicator,
+ #power-profiles-daemon,
+ #idle_inhibitor,
+ #backlight-slider,
+ #mpris,
+ #tray {
+ background: @background;
+ }
-#workspaces button:hover {
- background: @foreground;
- color: @background;
- border: @foreground;
- padding: 0 2px;
- box-shadow: inherit;
- text-shadow: inherit;
-}
+ #network,
+ #custom-vpn,
+ #clock.2,
+ #battery,
+ #cpu,
+ #custom-pseudobat,
+ #disk {
+ background: @background-alt;
+ }
-#workspaces button.urgent {
- color: @background-critical;
- background: @foreground-critical;
-}
-#custom-vpn,
-#network {
- color: #cc99c9;
-}
+ #workspaces button {
+ padding: 0 2px;
+ color: #fdf6e3;
+ }
+ #workspaces button.focused {
+ color: @foreground-warning;
+ }
-#temperature,
-#power-profiles-daemon {
- color: #9ec1cf;
-}
+ #workspaces button:hover {
+ background: @foreground;
+ color: @background;
+ border: @foreground;
+ padding: 0 2px;
+ box-shadow: inherit;
+ text-shadow: inherit;
+ }
-#disk {
- /*color: #b58900;*/
- color: #9ee09e;
-}
+ #workspaces button.urgent {
+ color: @background-critical;
+ background: @foreground-critical;
+ }
-#custom-scratchpad-indicator {
- color: #ffffff;
-}
+ #custom-vpn,
+ #network {
+ color: #cc99c9;
+ }
-#disk.warning {
- color: @foreground-error;
- background-color: @background-error;
-}
-#disk.critical,
-#temperature.critical {
- color: @foreground-critical;
- background-color: @background-critical;
- animation-name: blink;
- animation-duration: 0.5s;
- animation-timing-function: linear;
- animation-iteration-count: infinite;
- animation-direction: alternate;
-}
-#pulseaudio.muted {
- color: @foreground-error;
-}
-#memory {
- /*color: #2aa198;*/
- color: #fdfd97;
-}
-#cpu {
- /*color: #6c71c4;*/
- color: #feb144;
-}
+ #temperature,
+ #power-profiles-daemon {
+ color: #9ec1cf;
+ }
-#pulseaudio {
- /*color: #268bd2;*/
- color: #ff6663;
-}
+ #disk {
+ /*color: #b58900;*/
+ color: #9ee09e;
+ }
-#battery,
-#custom-pseudobat {
- color: cyan;
-}
-#battery.discharging {
- color: #859900;
-}
+ #custom-scratchpad-indicator {
+ color: #ffffff;
+ }
-@keyframes blink {
- to {
- color: @foreground-error;
- background-color: @background-error;
- }
-}
-@keyframes configblink {
- to {
- color: @foreground-error;
- background-color: transparent;
- }
-}
+ #disk.warning {
+ color: @foreground-error;
+ background-color: @background-error;
+ }
+ #disk.critical,
+ #temperature.critical {
+ color: @foreground-critical;
+ background-color: @background-critical;
+ animation-name: blink;
+ animation-duration: 0.5s;
+ animation-timing-function: linear;
+ animation-iteration-count: infinite;
+ animation-direction: alternate;
+ }
+ #pulseaudio.muted {
+ color: @foreground-error;
+ }
+ #memory {
+ /*color: #2aa198;*/
+ color: #fdfd97;
+ }
+ #cpu {
+ /*color: #6c71c4;*/
+ color: #feb144;
+ }
-#battery.critical:not(.charging) {
- color: @foreground-critical;
- background-color: @background-critical;
- animation-name: blink;
- animation-duration: 0.5s;
- animation-timing-function: linear;
- animation-iteration-count: infinite;
- animation-direction: alternate;
-}
+ #pulseaudio {
+ /*color: #268bd2;*/
+ color: #ff6663;
+ }
-#backlight-slider slider {
- min-height: 0px;
- min-width: 0px;
- opacity: 0;
- background-image: none;
- border: none;
- box-shadow: none;
-}
-#backlight-slider trough {
- min-height: 5px;
- min-width: 80px;
- border-radius: 5px;
- background-color: black;
-}
-#backlight-slider highlight {
- min-width: 0px;
- border-radius: 5px;
- background-color: grey;
-}
+ #battery,
+ #custom-pseudobat {
+ color: cyan;
+ }
+ #battery.discharging {
+ color: #859900;
+ }
-#clock.1,
-#clock.2,
-#clock.3 {
- font-family: Monospace;
-}
+ @keyframes blink {
+ to {
+ color: @foreground-error;
+ background-color: @background-error;
+ }
+ }
+ @keyframes configblink {
+ to {
+ color: @foreground-error;
+ background-color: transparent;
+ }
+ }
-#clock,
-#pulseaudio,
-#memory,
-#cpu,
-#tray,
-#temperature,
-#power-profiles-daemon,
-#network,
-#custom-vpn,
-#mpris,
-#battery,
-#custom-scratchpad-indicator,
-#custom-pseudobat,
-#disk {
- padding: 0 3px;
-}
+ #battery.critical:not(.charging) {
+ color: @foreground-critical;
+ background-color: @background-critical;
+ animation-name: blink;
+ animation-duration: 0.5s;
+ animation-timing-function: linear;
+ animation-iteration-count: infinite;
+ animation-direction: alternate;
+ }
+
+ #backlight-slider slider {
+ min-height: 0px;
+ min-width: 0px;
+ opacity: 0;
+ background-image: none;
+ border: none;
+ box-shadow: none;
+ }
+ #backlight-slider trough {
+ min-height: 5px;
+ min-width: 80px;
+ border-radius: 5px;
+ background-color: black;
+ }
+ #backlight-slider highlight {
+ min-width: 0px;
+ border-radius: 5px;
+ background-color: grey;
+ }
+
+ #clock.1,
+ #clock.2,
+ #clock.3 {
+ font-family: Monospace;
+ }
+
+ #clock,
+ #pulseaudio,
+ #memory,
+ #cpu,
+ #tray,
+ #temperature,
+ #power-profiles-daemon,
+ #network,
+ #custom-vpn,
+ #mpris,
+ #battery,
+ #custom-scratchpad-indicator,
+ #custom-pseudobat,
+ #disk {
+ padding: 0 3px;
+ }
#+end_src
** justfile
- This file defines a few workflows that I often need to run when working on my configuration. This works similar to =make=, but is geared towards general tasks and as such requires no extra handling (as long as there are no dependencies involved) or =.PHONY= recipes.
+This file defines a few workflows that I often need to run when working on my configuration. This works similar to =make=, but is geared towards general tasks and as such requires no extra handling (as long as there are no dependencies involved) or =.PHONY= recipes.
- (In the org-src block I still call it a Makefile in order to get syntax highlighting)
+(In the org-src block I still call it a Makefile in order to get syntax highlighting)
- #+begin_src makefile :tangle justfile
+#+begin_src makefile :tangle justfile
-default:
+ default:
@just --list
-check:
+ check:
nix flake check --keep-going
-check-trace:
+ check-trace:
nix flake check --show-trace
-update:
+ update:
nix flake update
-iso:
+ iso:
rm -rf result
nix build .#nixosConfigurations.iso.config.system.build.isoImage && ln -sf result/iso/*.iso latest.iso
-iso-flake FLAKE SYSTEM="x86_64" FORMAT="iso":
+ iso-flake FLAKE SYSTEM="x86_64" FORMAT="iso":
nixos-generate --flake .#{{FLAKE}} -f {{FORMAT}} --system {{SYSTEM}}
-iso-install DRIVE: iso
+ iso-install DRIVE: iso
sudo dd if=$(eza --sort changed result/iso/*.iso | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
-dd DRIVE ISO:
+ dd DRIVE ISO:
sudo dd if=$(eza --sort changed {{ISO}} | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
-sync USER HOST:
+ sync USER HOST:
rsync -av --filter=':- .gitignore' -e "ssh -l {{USER}}" . {{USER}}@{{HOST}}:.dotfiles/
- #+end_src
+#+end_src
** statix.toml
This file is used to tell =statix= which checks and folders/fiels to ignore, as well as to specify the nix version that it should use.
@@ -15444,7 +14697,7 @@ I need this mainly to disable the =repeated_keys= check, which checks if there i
#+begin_src toml :tangle statix.toml
disabled = [
- "repeated_keys"
+ "repeated_keys"
]
nix_version = '2.4'
ignore = ['.direnv']
diff --git a/flake.nix b/flake.nix
index 43b32d9..daf4471 100644
--- a/flake.nix
+++ b/flake.nix
@@ -6,119 +6,78 @@
"https://nix-community.cachix.org"
"https://cache.ngi0.nixos.org/"
];
-
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA="
];
};
-
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
-
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
-
systems.url = "github:nix-systems/default-linux";
-
- # user-level configuration
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
-
- # overlay to access bleeding edge emacs
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
-
- # nix user repository
- # i use this mainly to not have to build all firefox extensions
- # myself as well as for the emacs-init package (tbd)
nur.url = "github:nix-community/NUR";
-
- # provides GL to non-NixOS hosts
nixgl.url = "github:guibou/nixGL";
-
- # manages all theming using Home-Manager
stylix.url = "github:danth/stylix";
-
- # nix secrets management
sops-nix.url = "github:Mic92/sops-nix";
-
- # enable secure boot on NixOS
lanzaboote.url = "github:nix-community/lanzaboote";
-
- # nix for android
nix-on-droid = {
url = "github:nix-community/nix-on-droid/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
-
- # generate NixOS images
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
-
- # hardware quirks on nix
nixos-hardware = {
url = "github:NixOS/nixos-hardware/master";
};
-
- # dynamic library loading
nix-alien = {
url = "github:thiagokokada/nix-alien";
};
-
- # automatic nintendo switch payload injection
nswitch-rcm-nix = {
url = "github:Swarsel/nswitch-rcm-nix";
};
-
- # weekly updated nix-index database
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
-
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
-
impermanence.url = "github:nix-community/impermanence";
-
zjstatus = {
url = "github:dj95/zjstatus";
};
-
fw-fanctrl = {
url = "github:TamtamHero/fw-fanctrl/packaging/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
-
nix-darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
-
pre-commit-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
-
nix-secrets = {
url = "git+ssh://git@github.com/Swarsel/nix-secrets.git?ref=main&shallow=1";
flake = false;
inputs = { };
};
-
nix-topology.url = "github:oddlama/nix-topology";
};
-
outputs =
inputs@{ self
, nixpkgs
@@ -215,10 +174,8 @@
import ./checks { inherit self inputs system pkgs; }
);
-
nixosConfigurations =
lib.swarselsystems.mkFullHostConfigs (lib.swarselsystems.readHosts "nixos") "nixos";
-
homeConfigurations =
# "swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration {
@@ -230,11 +187,8 @@
# };
lib.swarselsystems.mkHalfHostConfigs (lib.swarselsystems.readHosts "home") "home" lib.swarselsystems.pkgsFor.x86_64-linux;
-
-
darwinConfigurations =
lib.swarselsystems.mkFullHostConfigs (lib.swarselsystems.readHosts "darwin") "darwin";
-
nixOnDroidConfigurations =
# magicant = inputs.nix-on-droid.lib.nixOnDroidConfiguration {
@@ -246,8 +200,6 @@
lib.swarselsystems.mkHalfHostConfigs (lib.swarselsystems.readHosts "android") "android" lib.swarselsystems.pkgsFor.aarch64-linux;
-
-
topology =
lib.swarselsystems.forEachSystem (pkgs: import inputs.nix-topology {
@@ -259,6 +211,5 @@
];
});
-
};
}
diff --git a/justfile b/justfile
index afde561..68264e2 100644
--- a/justfile
+++ b/justfile
@@ -1,27 +1,27 @@
default:
- @just --list
+@just --list
check:
- nix flake check --keep-going
+nix flake check --keep-going
check-trace:
- nix flake check --show-trace
+nix flake check --show-trace
update:
- nix flake update
+nix flake update
iso:
- rm -rf result
- nix build .#nixosConfigurations.iso.config.system.build.isoImage && ln -sf result/iso/*.iso latest.iso
+rm -rf result
+nix build .#nixosConfigurations.iso.config.system.build.isoImage && ln -sf result/iso/*.iso latest.iso
iso-flake FLAKE SYSTEM="x86_64" FORMAT="iso":
- nixos-generate --flake .#{{FLAKE}} -f {{FORMAT}} --system {{SYSTEM}}
+nixos-generate --flake .#{{FLAKE}} -f {{FORMAT}} --system {{SYSTEM}}
iso-install DRIVE: iso
- sudo dd if=$(eza --sort changed result/iso/*.iso | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
+sudo dd if=$(eza --sort changed result/iso/*.iso | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
dd DRIVE ISO:
- sudo dd if=$(eza --sort changed {{ISO}} | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
+sudo dd if=$(eza --sort changed {{ISO}} | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
sync USER HOST:
- rsync -av --filter=':- .gitignore' -e "ssh -l {{USER}}" . {{USER}}@{{HOST}}:.dotfiles/
+rsync -av --filter=':- .gitignore' -e "ssh -l {{USER}}" . {{USER}}@{{HOST}}:.dotfiles/
diff --git a/profiles/common/home/stylix.nix b/profiles/common/home/stylix.nix
index ca45688..5c97d45 100644
--- a/profiles/common/home/stylix.nix
+++ b/profiles/common/home/stylix.nix
@@ -1,7 +1,6 @@
{ self, lib, config, pkgs, ... }:
{
stylix = lib.mkIf (!config.swarselsystems.isNixos) {
-
enable = true;
base16Scheme = "${self}/wallpaper/swarsel.yaml";
# base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
@@ -25,7 +24,6 @@
# name = "FiraCode Nerd Font Propo";
# name = "Montserrat";
};
-
sansSerif = {
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
package = pkgs.cantarell-fonts;
@@ -34,19 +32,15 @@
# name = "FiraCode Nerd Font Propo";
# name = "Montserrat";
};
-
monospace = {
package = pkgs.nerd-fonts.fira-mono; # has overrides
-
name = "FiraCode Nerd Font Mono";
};
-
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
};
-
image = config.swarselsystems.wallpaper;
targets = {
emacs.enable = false;
diff --git a/profiles/common/home/sway.nix b/profiles/common/home/sway.nix
index 2f5a73f..153ed9c 100644
--- a/profiles/common/home/sway.nix
+++ b/profiles/common/home/sway.nix
@@ -262,29 +262,28 @@ in
swayfxSettings = config.swarselsystems.swayfxConfig;
in
"
- exec_always autotiling
- set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\"
- mode $exit {
+ exec_always autotiling
+ set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\"
- bindsym --to-code {
- s exec \"systemctl suspend\", mode \"default\"
- l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize && systemctl suspend \", mode \"default \"
- p exec \"systemctl poweroff\"
- r exec \"systemctl reboot\"
- u exec \"swaymsg exit\"
+ mode $exit {
+ bindsym --to-code {
+ s exec \"systemctl suspend\", mode \"default\"
+ l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize && systemctl suspend \", mode \"default \"
+ p exec \"systemctl poweroff\"
+ r exec \"systemctl reboot\"
+ u exec \"swaymsg exit\"
- Return mode \"default\"
- Escape mode \"default\"
- ${modifier}+Escape mode \"default\"
- }
+ Return mode \"default\"
+ Escape mode \"default\"
+ ${modifier}+Escape mode \"default\"
}
+ }
- exec systemctl --user import-environment
- exec swayidle -w
+ exec systemctl --user import-environment
+ exec swayidle -w
- ${swayfxSettings}
-
- ";
+ ${swayfxSettings}
+ ";
};
}
diff --git a/profiles/common/home/zsh.nix b/profiles/common/home/zsh.nix
index 6b4a7e7..b2429b9 100644
--- a/profiles/common/home/zsh.nix
+++ b/profiles/common/home/zsh.nix
@@ -91,34 +91,6 @@
zle -N my-backward-delete-whole-word
# bind this new widget to `ctrl+alt+w`
bindkey '^W' my-backward-delete-whole-word
-
- vterm_printf() {
- if [ -n "$TMUX" ] && ([ "''${TERM%%-*}" = "tmux" ] || [ "''${TERM%%-*}" = "screen" ]); then
- # Tell tmux to pass the escape sequences through
- printf "\ePtmux;\e\e]%s\007\e\\" "$1"
- elif [ "''${TERM%%-*}" = "screen" ]; then
- # GNU screen (screen, screen-256color, screen-256color-bce)
- printf "\eP\e]%s\007\e\\" "$1"
- else
- printf "\e]%s\e\\" "$1"
- fi
- }
- vterm_prompt_end() {
- vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"
- }
- setopt PROMPT_SUBST
- PROMPT=$PROMPT'%{$(vterm_prompt_end)%}'
-
- vterm_cmd() {
- local vterm_elisp
- vterm_elisp=""
- while [ $# -gt 0 ]; do
- vterm_elisp="$vterm_elisp""$(printf '"%s" ' "$(printf "%s" "$1" | sed -e 's|\\|\\\\|g' -e 's|"|\\"|g')")"
- shift
- done
- vterm_printf "51;E$vterm_elisp"
- }
-
'';
};
}
diff --git a/profiles/common/nixos/sops.nix b/profiles/common/nixos/sops.nix
index 6e88071..8649158 100644
--- a/profiles/common/nixos/sops.nix
+++ b/profiles/common/nixos/sops.nix
@@ -45,15 +45,15 @@ in
WIREGUARDPUB=${config.sops.placeholder.wireguardpub}
WIREGUARDENDPOINT=${config.sops.placeholder.wireguardendpoint}
'';
- ".authinfo" = {
- owner = "swarsel";
- path = "${config.users.users.swarsel.home}/.emacs.d/.authinfo";
- content = ''
- machine stash.swarsel.win:443 port https login ${config.sops.placeholder.stashuser} password ${config.sops.placeholder.stashpass}
- machine gitlab.com/api/v4 login ${config.sops.placeholder.githubforgeuser} password ${config.sops.placeholder.githubforgepass}
- machine api.github.com login ${config.sops.placeholder.gitlabforgeuser} password ${config.sops.placeholder.gitlabforgepass}
- '';
- };
+ # ".authinfo" = {
+ # owner = "swarsel";
+ # path = "${config.users.users.swarsel.home}/.emacs.d/.authinfo";
+ # content = ''
+ # machine stash.swarsel.win:443 port https login ${config.sops.placeholder.stashuser} password ${config.sops.placeholder.stashpass}
+ # machine gitlab.com/api/v4 login ${config.sops.placeholder.githubforgeuser} password ${config.sops.placeholder.githubforgepass}
+ # machine api.github.com login ${config.sops.placeholder.gitlabforgeuser} password ${config.sops.placeholder.gitlabforgepass}
+ # '';
+ # };
};
};
}
diff --git a/profiles/common/nixos/stylix.nix b/profiles/common/nixos/stylix.nix
index 6754089..6b52b1e 100644
--- a/profiles/common/nixos/stylix.nix
+++ b/profiles/common/nixos/stylix.nix
@@ -1,7 +1,6 @@
{ self, pkgs, home-manager, config, ... }:
{
stylix = {
-
enable = true;
base16Scheme = "${self}/wallpaper/swarsel.yaml";
# base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
@@ -25,7 +24,6 @@
# name = "FiraCode Nerd Font Propo";
# name = "Montserrat";
};
-
sansSerif = {
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
package = pkgs.cantarell-fonts;
@@ -34,19 +32,15 @@
# name = "FiraCode Nerd Font Propo";
# name = "Montserrat";
};
-
monospace = {
package = pkgs.nerd-fonts.fira-mono; # has overrides
-
name = "FiraCode Nerd Font Mono";
};
-
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
};
-
targets.grub.enable = false; # the styling makes grub more ugly
image = config.swarselsystems.wallpaper;
};
diff --git a/profiles/optional/nixos/work.nix b/profiles/optional/nixos/work.nix
index 76f08b3..696c214 100644
--- a/profiles/optional/nixos/work.nix
+++ b/profiles/optional/nixos/work.nix
@@ -97,7 +97,7 @@ in
openssh = {
enable = true;
extraConfig = ''
- '';
+ '';
};
syncthing = {
diff --git a/programs/emacs/early-init.el b/programs/emacs/early-init.el
index b7045d0..7156518 100644
--- a/programs/emacs/early-init.el
+++ b/programs/emacs/early-init.el
@@ -9,9 +9,7 @@
(add-hook 'emacs-startup-hook
(lambda ()
(progn
- ;; (setq gc-cons-threshold (* 1000 1000 8)
- ;; (setq gc-cons-threshold #x40000000
- (setq gc-cons-threshold (* 32 1024 1024)
+ (setq gc-cons-threshold (* 32 1024 1024)
gc-cons-percentage 0.1
jit-lock-defer-time 0.05
read-process-output-max (* 1024 1024)
diff --git a/programs/emacs/init.el b/programs/emacs/init.el
index de87fe2..ad36b4c 100644
--- a/programs/emacs/init.el
+++ b/programs/emacs/init.el
@@ -157,14 +157,7 @@ create a new one."
[C-backspace] #'up-directory)
(defun swarsel/org-mode-setup ()
- ;; (org-indent-mode)
(variable-pitch-mode 1)
- ;;(auto-fill-mode 0)
- ;; (setq display-line-numbers-type 'relative
- ;; display-line-numbers-current-absolute 1
- ;; display-line-numbers-width-start nil
- ;; display-line-numbers-width 6
- ;; display-line-numbers-grow-only 1)
(add-hook 'org-tab-first-hook 'org-end-of-line)
(visual-line-mode 1))
@@ -178,20 +171,20 @@ create a new one."
(let ((default-directory (expand-file-name "~/.dotfiles")))
(shell-command "nixpkgs-fmt . > /dev/null")))
- (defun swarsel/org-babel-tangle-config ()
+(defun swarsel/org-babel-tangle-config ()
(interactive)
- (when (string-equal (buffer-file-name)
- swarsel-swarsel-org-filepath)
- ;; Dynamic scoping to the rescue
- (let ((org-confirm-babel-evaluate nil))
- ;; (org-html-export-to-html)
- (org-babel-tangle)
- (swarsel/run-formatting)
- )))
+ (when (string-equal (buffer-file-name)
+ swarsel-swarsel-org-filepath)
+ ;; Dynamic scoping to the rescue
+ (let ((org-confirm-babel-evaluate nil))
+ ;; (org-html-export-to-html)
+ (org-babel-tangle)
+ (swarsel/run-formatting)
+ )))
- (setq org-html-htmlize-output-type nil)
+(setq org-html-htmlize-output-type nil)
- ;; (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config)))
+;; (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config)))
(defun org-fold-outer ()
(interactive)
@@ -217,35 +210,6 @@ create a new one."
(corfu-quit)
(evil-next-visual-line))
-;; run the python inferior shell immediately upon entering a python buffer
-;; (add-hook 'python-mode-hook 'swarsel/run-python)
-
-;; (defun swarsel/run-python ()
-;; (save-selected-window
-;; (switch-to-buffer-other-window (process-buffer (python-shell-get-or-create-process (python-shell-parse-command))))))
-
-;; reload python shell automatically
-(defun my-python-shell-run ()
- (interactive)
- (when (get-buffer-process "*Python*")
- (set-process-query-on-exit-flag (get-buffer-process "*Python*") nil)
- (kill-process (get-buffer-process "*Python*"))
- ;; Uncomment If you want to clean the buffer too.
- ;;(kill-buffer "*Python*")
- ;; Not so fast!
- (sleep-for 0.5))
- (run-python (python-shell-parse-command) nil nil)
- (python-shell-send-buffer)
- ;; Pop new window only if shell isnt visible
- ;; in any frame.
- (unless (get-buffer-window "*Python*" t)
- (python-shell-switch-to-shell)))
-
-(defun my-python-shell-run-region ()
- (interactive)
- (python-shell-send-region (region-beginning) (region-end))
- (python-shell-switch-to-shell))
-
(defun swarsel/prefix-block (start end)
(interactive "r")
(save-excursion
@@ -273,24 +237,24 @@ create a new one."
(call-interactively 'nixpkgs-fmt-region))
- (defun swarsel/org-nixpkgs-fmt-block ()
- (interactive)
- (save-excursion
- (let* ((element (org-element-at-point))
- (begin (org-element-property :begin element))
- (end (org-element-property :end element))
- (lang (org-element-property :language element)))
- (when lang
- (goto-char begin)
- (forward-line)
- (insert "{")
- (goto-char end)
- (forward-line -1)
- (beginning-of-line)
- (forward-char -1)
- (insert "}")
- (org-babel-mark-block)
- (call-interactively 'nixpkgs-fmt-region)))))
+(defun swarsel/org-nixpkgs-fmt-block ()
+ (interactive)
+ (save-excursion
+ (let* ((element (org-element-at-point))
+ (begin (org-element-property :begin element))
+ (end (org-element-property :end element))
+ (lang (org-element-property :language element)))
+ (when lang
+ (goto-char begin)
+ (forward-line)
+ (insert "{")
+ (goto-char end)
+ (forward-line -1)
+ (beginning-of-line)
+ (forward-char -1)
+ (insert "}")
+ (org-babel-mark-block)
+ (call-interactively 'nixpkgs-fmt-region)))))
(defun swarsel/minibuffer-setup-hook ()
(setq gc-cons-threshold most-positive-fixnum))
@@ -302,159 +266,122 @@ create a new one."
(add-hook 'minibuffer-exit-hook #'swarsel/minibuffer-exit-hook)
;; Make ESC quit prompts
- (global-set-key (kbd "") 'keyboard-escape-quit)
-
- ;; Set up general keybindings
- (use-package general
- :config
- (general-create-definer swarsel/leader-keys
- :keymaps '(normal insert visual emacs)
- :prefix "SPC"
- :global-prefix "C-SPC")
-
- (swarsel/leader-keys
- "e" '(:ignore e :which-key "evil")
- "eo" '(evil-jump-backward :which-key "cursor jump backwards")
- "eO" '(evil-jump-forward :which-key "cursor jump forwards")
- "t" '(:ignore t :which-key "toggles")
- "ts" '(hydra-text-scale/body :which-key "scale text")
- "te" '(swarsel/toggle-evil-state :which-key "emacs/evil")
- "tl" '(display-line-numbers-mode :which-key "line numbers")
- "tp" '(evil-cleverparens-mode :wk "cleverparens")
- "to" '(olivetti-mode :wk "olivetti")
- "td" '(darkroom-tentative-mode :wk "darkroom")
- "tw" '((lambda () (interactive) (toggle-truncate-lines)) :which-key "line wrapping")
- "m" '(:ignore m :which-key "modes/programs")
- "mm" '((lambda () (interactive) (mu4e)) :which-key "mu4e")
- "mg" '((lambda () (interactive) (magit-list-repositories)) :which-key "magit-list-repos")
- "mc" '((lambda () (interactive) (swarsel/open-calendar)) :which-key "calendar")
- "mp" '(popper-toggle :which-key "popper")
- "md" '(dirvish :which-key "dirvish")
- "mr" '(bjm/elfeed-load-db-and-open :which-key "elfeed")
- "o" '(:ignore o :which-key "org")
- "op" '((lambda () (interactive) (org-present)) :which-key "org-present")
- "oa" '((lambda () (interactive) (org-agenda)) :which-key "org-agenda")
- "oa" '((lambda () (interactive) (org-refile)) :which-key "org-refile")
- "ob" '((lambda () (interactive) (org-babel-mark-block)) :which-key "Mark whole src-block")
- "ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link")
- "oc" '((lambda () (interactive) (org-store-link)) :which-key "copy (=store) link")
- "os" '(shfmt-region :which-key "format sh-block")
- "od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block")
- "on" '(nixpkgs-fmt-region :which-key "format nix-block")
- "ot" '(swarsel/org-babel-tangle-config :which-key "tangle file")
- "oe" '(org-html-export-to-html :which-key "export to html")
- "c" '(:ignore c :which-key "capture")
- "ct" '((lambda () (interactive) (org-capture nil "tt")) :which-key "task")
- ;; "cj" '((lambda () (interactive) (org-capture nil "jj")) :which-key "journal")
- ;; "cs" '(markdown-download-screenshot :which-key "screenshot")
- "l" '(:ignore l :which-key "links")
- "lc" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (org-overview) )) :which-key "SwarselSystems.org")
- "le" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "Emacs") ) (org-overview) (org-cycle) )) :which-key "Emacs.org")
- "ln" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "System") ) (org-overview) (org-cycle))) :which-key "Nixos.org")
- "ls" '((lambda () (interactive) (find-file "/smb:Swarsel@winters:")) :which-key "Server")
- "lo" '(dired swarsel-obsidian-vault-directory :which-key "obsidian")
- ;; "la" '((lambda () (interactive) (find-file swarsel-org-anki-filepath)) :which-key "anki")
- ;; "ln" '((lambda () (interactive) (find-file swarsel-nix-org-filepath)) :which-key "Nix.org")
- "lp" '((lambda () (interactive) (projectile-switch-project)) :which-key "switch project")
- "lg" '((lambda () (interactive) (magit-list-repositories)) :which-key "list git repos")
- ;; "a" '(:ignore a :which-key "anki")
- ;; "ap" '(anki-editor-push-tree :which-key "push new cards")
- ;; "an" '((lambda () (interactive) (org-capture nil "a")) :which-key "new card")
- ;; "as" '(swarsel-anki-set-deck-and-notetype :which-key "change deck and notetype")
- "h" '(:ignore h :which-key "help")
- "hy" '(yas-describe-tables :which-key "yas tables")
- "hb" '(embark-bindings :which-key "current key bindings")
- "h" '(:ignore t :which-key "describe")
- "he" 'view-echo-area-messages
- "hf" 'describe-function
- "hF" 'describe-face
- "hl" '(view-lossage :which-key "show command keypresses")
- "hL" 'find-library
- "hm" 'describe-mode
- "ho" 'describe-symbol
- "hk" 'describe-key
- "hK" 'describe-keymap
- "hp" 'describe-package
- "hv" 'describe-variable
- "hd" 'devdocs-lookup
- "w" '(:ignore t :which-key "window")
- "wl" 'windmove-right
- "w " 'windmove-right
- "wh" 'windmove-left
- "w " 'windmove-left
- "wk" 'windmove-up
- "w " 'windmove-up
- "wj" 'windmove-down
- "w " 'windmove-down
- "wr" 'winner-redo
- "wd" 'delete-window
- "w=" 'balance-windows-area
- "wD" 'kill-buffer-and-window
- "wu" 'winner-undo
- "wr" 'winner-redo
- "w/" 'evil-window-vsplit
-"w\\" 'evil-window-vsplit
- "w-" 'evil-window-split
- "wm" '(delete-other-windows :wk "maximize")
- "" 'up-list
- "" 'down-list
- ))
-
- ;; General often used hotkeys
- (general-define-key
- "C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card
- ;; "C-M-d" 'swarsel-obsidian-daily ; open daily obsidian file and create if not exist
- ;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetype for new anki cards
- ;; "C-M-s" 'markdown-download-screenshot ; wrapper for org-download-screenshot
- "C-c d" 'crux-duplicate-current-line-or-region
- "C-c D" 'crux-duplicate-and-comment-current-line-or-region
- "" 'swarsel/last-buffer
- "M-\\" 'indent-region
- "C-" 'my-python-shell-run
- "" 'yank
- "" 'kill-region
- "" 'kill-ring-save
- "" 'evil-undo
- "" 'evil-redo
- "C-S-c C-S-c" 'mc/edit-lines
- "C->" 'mc/mark-next-like-this
- "C-<" 'mc/mark-previous-like-this
- "C-c C-<" 'mc/mark-all-like-this
- )
-
-;; set Nextcloud directory for journals etc.
-(setq swarsel-sync-directory "~/Nextcloud"
- swarsel-emacs-directory "~/.emacs.d"
- swarsel-dotfiles-directory "~/.dotfiles"
- swarsel-projects-directory "~/Documents/GitHub")
-
-(setq swarsel-emacs-org-filepath (expand-file-name "Emacs.org" swarsel-dotfiles-directory)
- swarsel-nix-org-filepath (expand-file-name "Nix.org" swarsel-dotfiles-directory)
- swarsel-swarsel-org-filepath (expand-file-name "SwarselSystems.org" swarsel-dotfiles-directory)
- )
-
-
-;; set Emacs main configuration .org names
-(setq swarsel-emacs-org-file "Emacs.org"
- swarsel-anki-org-file "Anki.org"
- swarsel-tasks-org-file "Tasks.org"
- swarsel-archive-org-file "Archive.org"
- swarsel-org-folder-name "Org"
- swarsel-obsidian-daily-folder-name "⭐ Personal/Journal"
- swarsel-obsidian-folder-name "Obsidian"
- swarsel-obsidian-vault-name "Main")
+(global-set-key (kbd "") 'keyboard-escape-quit)
+;; Set up general keybindings
+(use-package general
+ :config
+ (general-create-definer swarsel/leader-keys
+ :keymaps '(normal insert visual emacs)
+ :prefix "SPC"
+ :global-prefix "C-SPC")
+
+ (swarsel/leader-keys
+ "e" '(:ignore e :which-key "evil")
+ "eo" '(evil-jump-backward :which-key "cursor jump backwards")
+ "eO" '(evil-jump-forward :which-key "cursor jump forwards")
+ "t" '(:ignore t :which-key "toggles")
+ "ts" '(hydra-text-scale/body :which-key "scale text")
+ "te" '(swarsel/toggle-evil-state :which-key "emacs/evil")
+ "tl" '(display-line-numbers-mode :which-key "line numbers")
+ "tp" '(evil-cleverparens-mode :wk "cleverparens")
+ "to" '(olivetti-mode :wk "olivetti")
+ "td" '(darkroom-tentative-mode :wk "darkroom")
+ "tw" '((lambda () (interactive) (toggle-truncate-lines)) :which-key "line wrapping")
+ "m" '(:ignore m :which-key "modes/programs")
+ "mm" '((lambda () (interactive) (mu4e)) :which-key "mu4e")
+ "mg" '((lambda () (interactive) (magit-list-repositories)) :which-key "magit-list-repos")
+ "mc" '((lambda () (interactive) (swarsel/open-calendar)) :which-key "calendar")
+ "mp" '(popper-toggle :which-key "popper")
+ "md" '(dirvish :which-key "dirvish")
+ "mr" '(bjm/elfeed-load-db-and-open :which-key "elfeed")
+ "o" '(:ignore o :which-key "org")
+ "op" '((lambda () (interactive) (org-present)) :which-key "org-present")
+ "oa" '((lambda () (interactive) (org-agenda)) :which-key "org-agenda")
+ "oa" '((lambda () (interactive) (org-refile)) :which-key "org-refile")
+ "ob" '((lambda () (interactive) (org-babel-mark-block)) :which-key "Mark whole src-block")
+ "ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link")
+ "oc" '((lambda () (interactive) (org-store-link)) :which-key "copy (=store) link")
+ "os" '(shfmt-region :which-key "format sh-block")
+ "od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block")
+ "on" '(nixpkgs-fmt-region :which-key "format nix-block")
+ "ot" '(swarsel/org-babel-tangle-config :which-key "tangle file")
+ "oe" '(org-html-export-to-html :which-key "export to html")
+ "c" '(:ignore c :which-key "capture")
+ "ct" '((lambda () (interactive) (org-capture nil "tt")) :which-key "task")
+ "l" '(:ignore l :which-key "links")
+ "lc" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (org-overview) )) :which-key "SwarselSystems.org")
+ "le" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "Emacs") ) (org-overview) (org-cycle) )) :which-key "Emacs.org")
+ "ln" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "System") ) (org-overview) (org-cycle))) :which-key "Nixos.org")
+ "lp" '((lambda () (interactive) (projectile-switch-project)) :which-key "switch project")
+ "lg" '((lambda () (interactive) (magit-list-repositories)) :which-key "list git repos")
+ "h" '(:ignore h :which-key "help")
+ "hy" '(yas-describe-tables :which-key "yas tables")
+ "hb" '(embark-bindings :which-key "current key bindings")
+ "h" '(:ignore t :which-key "describe")
+ "he" 'view-echo-area-messages
+ "hf" 'describe-function
+ "hF" 'describe-face
+ "hl" '(view-lossage :which-key "show command keypresses")
+ "hL" 'find-library
+ "hm" 'describe-mode
+ "ho" 'describe-symbol
+ "hk" 'describe-key
+ "hK" 'describe-keymap
+ "hp" 'describe-package
+ "hv" 'describe-variable
+ "hd" 'devdocs-lookup
+ "w" '(:ignore t :which-key "window")
+ "wl" 'windmove-right
+ "w " 'windmove-right
+ "wh" 'windmove-left
+ "w " 'windmove-left
+ "wk" 'windmove-up
+ "w " 'windmove-up
+ "wj" 'windmove-down
+ "w " 'windmove-down
+ "wr" 'winner-redo
+ "wd" 'delete-window
+ "w=" 'balance-windows-area
+ "wD" 'kill-buffer-and-window
+ "wu" 'winner-undo
+ "wr" 'winner-redo
+ "w/" 'evil-window-vsplit
+ "w\\" 'evil-window-vsplit
+ "w-" 'evil-window-split
+ "wm" '(delete-other-windows :wk "maximize")
+ "" 'up-list
+ "" 'down-list
+ ))
-;; set directory paths
-(setq swarsel-org-directory (expand-file-name swarsel-org-folder-name swarsel-sync-directory)) ; path to org folder
-(setq swarsel-obsidian-directory (expand-file-name swarsel-obsidian-folder-name swarsel-sync-directory)) ; path to obsidian
-(setq swarsel-obsidian-vault-directory (expand-file-name swarsel-obsidian-vault-name swarsel-obsidian-directory)) ; path to obsidian vault
-(setq swarsel-obsidian-daily-directory (expand-file-name swarsel-obsidian-daily-folder-name swarsel-obsidian-vault-directory)) ; path to obsidian daily folder
+;; General often used hotkeys
+(general-define-key
+ "C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card
+ "C-c d" 'crux-duplicate-current-line-or-region
+ "C-c D" 'crux-duplicate-and-comment-current-line-or-region
+ "" 'swarsel/last-buffer
+ "M-\\" 'indent-region
+ "" 'yank
+ "" 'kill-region
+ "" 'kill-ring-save
+ "" 'evil-undo
+ "" 'evil-redo
+ "C-S-c C-S-c" 'mc/edit-lines
+ "C->" 'mc/mark-next-like-this
+ "C-<" 'mc/mark-previous-like-this
+ "C-c C-<" 'mc/mark-all-like-this
+ )
-;; filepaths to certain documents
-(setq swarsel-org-anki-filepath (expand-file-name swarsel-anki-org-file swarsel-org-directory) ; path to anki export file
- swarsel-org-tasks-filepath (expand-file-name swarsel-tasks-org-file swarsel-org-directory)
- swarsel-org-archive-filepath (expand-file-name swarsel-archive-org-file swarsel-org-directory))
+;; set Nextcloud directory for journals etc.
+(setq
+ swarsel-emacs-directory "~/.emacs.d"
+ swarsel-dotfiles-directory "~/.dotfiles"
+ swarsel-swarsel-org-filepath (expand-file-name "SwarselSystems.org" swarsel-dotfiles-directory)
+ swarsel-tasks-org-file "Tasks.org"
+ swarsel-archive-org-file "Archive.org"
+ swarsel-work-projects-directory "~/Documents/Work"
+ swarsel-private-projects-directory "~/Documents/Private"
+ )
;; Change the user-emacs-directory to keep unwanted things out of ~/.emacs.d
(setq user-emacs-directory (expand-file-name "~/.cache/emacs/")
@@ -554,8 +481,8 @@ create a new one."
(run-with-idle-timer 15 t
(lambda ()
;; (message "Garbage Collector has run for %.06fsec"
- (k-time (garbage-collect)))))
- ;; )
+ (k-time (garbage-collect)))))
+;; )
(setq-default indent-tabs-mode nil
tab-width 2)
@@ -660,6 +587,9 @@ create a new one."
:config
(global-evil-surround-mode 1))
+(use-package evil-visual-mark-mode
+ :config (evil-visual-mark-mode))
+
;; set the NixOS wordlist by hand
(setq ispell-alternate-dictionary (getenv "WORDLIST"))
@@ -676,8 +606,6 @@ create a new one."
:weight 'regular
:height 1.06)
-;; these settings used to be in custom.el
-
(use-package solaire-mode
:custom
(solaire-global-mode +1))
@@ -900,7 +828,7 @@ create a new one."
(setq-default indicate-buffer-boundaries t)
;; (setq auth-sources '( "~/.emacs.d/.caldav" "~/.emacs.d/.authinfo.gpg")
- ;; auth-source-cache-expiry nil) ; default is 2h
+;; auth-source-cache-expiry nil) ; default is 2h
(setq auth-sources '( "~/.emacs.d/.authinfo")
auth-source-cache-expiry nil)
@@ -918,109 +846,23 @@ create a new one."
(setq org-startup-folded t)
(setq org-support-shift-select t)
- ;; (setq org-agenda-start-with-log-mode t)
- ;; (setq org-log-done 'time)
- ;; (setq org-log-into-drawer t)
+ (setq org-agenda-start-with-log-mode t)
+ (setq org-log-done 'time)
+ (setq org-log-into-drawer t)
(setq org-startup-with-inline-images t)
(setq org-export-headline-levels 6)
(setq org-image-actual-width nil)
(setq org-format-latex-options '(:foreground "White" :background default :scale 2.0 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")))
-(setq org-agenda-files '("/home/swarsel/Nextcloud/Org/Tasks.org"
- "/home/swarsel/Nextcloud/Org/Archive.org"
- "/home/swarsel/Nextcloud/Org/Anki.org"
- "/home/swarsel/Calendars/leon_cal.org"))
-
-(setq org-refile-targets
- '((swarsel-archive-org-file :maxlevel . 1)
- (swarsel-anki-org-file :maxlevel . 1)
- (swarsel-tasks-org-file :maxlevel . 1)))
-
-(setq org-todo-keywords
- '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
- (sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANC(k@)")))
-
-
-;; Configure custom agenda views
-(setq org-agenda-custom-commands
- '(("d" "Dashboard"
- ((agenda "" ((org-deadline-warning-days 7)))
- (todo "NEXT"
- ((org-agenda-overriding-header "Next Tasks")))
- (tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects")))))
-
- ("n" "Next Tasks"
- ((todo "NEXT"
- ((org-agenda-overriding-header "Next Tasks")))))
-
- ("W" "Work Tasks" tags-todo "+work-email")
-
-
- ("w" "Workflow Status"
- ((todo "WAIT"
- ((org-agenda-overriding-header "Waiting on External")
- (org-agenda-files org-agenda-files)))
- (todo "REVIEW"
- ((org-agenda-overriding-header "In Review")
- (org-agenda-files org-agenda-files)))
- (todo "PLAN"
- ((org-agenda-overriding-header "In Planning")
- (org-agenda-todo-list-sublevels nil)
- (org-agenda-files org-agenda-files)))
- (todo "BACKLOG"
- ((org-agenda-overriding-header "Project Backlog")
- (org-agenda-todo-list-sublevels nil)
- (org-agenda-files org-agenda-files)))
- (todo "READY"
- ((org-agenda-overriding-header "Ready for Work")
- (org-agenda-files org-agenda-files)))
- (todo "ACTIVE"
- ((org-agenda-overriding-header "Active Projects")
- (org-agenda-files org-agenda-files)))
- (todo "COMPLETED"
- ((org-agenda-overriding-header "Completed Projects")
- (org-agenda-files org-agenda-files)))
- (todo "CANC"
- ((org-agenda-overriding-header "Cancelled Projects")
- (org-agenda-files org-agenda-files)))))))
-
-(setq org-capture-templates
- `(
- ("a" "Anki basic"
- entry
- (file+headline swarsel-org-anki-filepath "Dispatch")
- (function swarsel-anki-make-template-string))
-
- ("A" "Anki cloze"
- entry
- (file+headline org-swarsel-anki-file "Dispatch")
- "* %<%H:%M>\n:PROPERTIES:\n:ANKI_NOTE_TYPE: Cloze\n:ANKI_DECK: 🦁 All::01 ❤️ Various::00 ✨ Allgemein\n:END:\n** Text\n%?\n** Extra\n")
- ("t" "Tasks / Projects")
- ("tt" "Task" entry (file+olp swarsel-org-tasks-filepath "Inbox")
- "* TODO %?\n %U\n %a\n %i" :empty-lines 1)
- ))
-)
-
-;; Set faces for heading levels
-(with-eval-after-load 'org-faces (dolist (face '((org-level-1 . 1.1)
- (org-level-2 . 0.9)
- (org-level-3 . 0.9)
- (org-level-4 . 0.9)
- (org-level-5 . 0.9)
- (org-level-6 . 0.9)
- (org-level-7 . 0.9)
- (org-level-8 . 0.9)))
- (set-face-attribute (car face) nil :font swarsel-alt-font :weight 'medium :height (cdr face)))
-
- ;; Ensure that anything that should be fixed-pitch in Org files appears that way
- (set-face-attribute 'org-block nil :inherit 'fixed-pitch)
- (set-face-attribute 'org-table nil :inherit 'fixed-pitch)
- (set-face-attribute 'org-formula nil :inherit 'fixed-pitch)
- (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
- (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
- (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
- (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
- (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch))
+ (setq org-agenda-files '("/home/swarsel/Nextcloud/Org/Tasks.org"
+ "/home/swarsel/Nextcloud/Org/Archive.org"
+ ))
+
+ (setq org-refile-targets
+ '((swarsel-archive-org-file :maxlevel . 1)
+ (swarsel-tasks-org-file :maxlevel . 1)))
+
+ )
(use-package org-appear
:hook (org-mode . org-appear-mode)
@@ -1037,18 +879,31 @@ create a new one."
(setq org-src-preserve-indentation nil)
- (org-babel-do-load-languages
- 'org-babel-load-languages
- '((emacs-lisp . t)
- (python . t)
- (js . t)
- (shell . t)
- ))
+(org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((emacs-lisp . t)
+ (python . t)
+ (js . t)
+ (shell . t)
+ ))
+
+(push '("conf-unix" . conf-unix) org-src-lang-modes)
- (push '("conf-unix" . conf-unix) org-src-lang-modes)
+(setq org-export-with-broken-links 'mark)
+(setq org-confirm-babel-evaluate nil)
- (setq org-export-with-broken-links 'mark)
- (setq org-confirm-babel-evaluate nil)
+;; tangle is too slow, try to speed it up
+(defadvice org-babel-tangle-single-block (around inhibit-redisplay activate protect compile)
+ "inhibit-redisplay and inhibit-message to avoid flicker."
+ (let ((inhibit-redisplay t)
+ (inhibit-message t))
+ ad-do-it))
+
+(defadvice org-babel-tangle (around time-it activate compile)
+ "Display the execution time"
+ (let ((tim (current-time)))
+ ad-do-it
+ (message "org-tangle took %f sec" (float-time (time-subtract (current-time) tim)))))
(require 'org-tempo)
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
@@ -1071,20 +926,7 @@ create a new one."
(setq TeX-electric-sub-and-superscript t)
;; (setq reftex-plug-into-AUCTeX t)
-(use-package org-download
- :after org
- :defer nil
- :custom
- (org-download-method 'directory)
- (org-download-image-dir "./images")
- (org-download-heading-lvl 0)
- (org-download-timestamp "org_%Y%m%d-%H%M%S_")
- ;;(org-image-actual-width 500)
- (org-download-screenshot-method "grim -g \"$(slurp)\" %s")
- :bind
- ("C-M-y" . org-download-screenshot)
- :config
- (require 'org-download))
+
(use-package org-fragtog)
(add-hook 'org-mode-hook 'org-fragtog-mode)
@@ -1246,11 +1088,6 @@ create a new one."
(local-set-key (kbd "C-c C-x C-u") 'markdown-toggle-url-hiding)
))
-(use-package olivetti
- :init
- (setq olivetti-body-width 100)
- (setq olivetti-recall-visual-line-mode-entry-state t))
-
(use-package elfeed)
(use-package elfeed-goodies)
@@ -1279,10 +1116,6 @@ create a new one."
(define-key elfeed-search-mode-map (kbd "k") 'previous-line)
(define-key elfeed-show-mode-map (kbd "S-SPC") 'scroll-down-command)
-(use-package darkroom
- :init
- (setq darkroom-text-scale-increase 3))
-
(use-package rg)
(use-package emacs
@@ -1329,8 +1162,6 @@ create a new one."
:config
(setq avy-all-windows 'all-frames))
-(use-package crdt)
-
(use-package devdocs)
(add-hook 'python-mode-hook
@@ -1359,14 +1190,13 @@ create a new one."
:init
;; NOTE: Set this to the folder where you keep your Git repos!
(when (file-directory-p swarsel-projects-directory)
- (setq projectile-project-search-path (list swarsel-projects-directory)))
+ (setq projectile-project-search-path (list swarsel-work-projects-directory swarsel-private-projects-directory)))
(setq projectile-switch-project-action #'magit-status))
(use-package magit
:config
- (setq magit-repository-directories `((,swarsel-projects-directory . 1)
- (,swarsel-emacs-directory . 0)
- (,swarsel-obsidian-directory . 0)
+ (setq magit-repository-directories `((,swarsel-work-projects-directory . 1)
+ (,swarsel-private-projects-directory . 1)
("~/.dotfiles/" . 0)))
:custom
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) ; stay in the same window
@@ -1383,10 +1213,7 @@ create a new one."
(with-eval-after-load 'forge
(add-to-list 'forge-alist
- '("sgit.iue.tuwien.ac.at"
- "sgit.iue.tuwien.ac.at/api/v1"
- "sgit.iue.tuwien.ac.at"
- forge-gitea-repository)))
+ ))
(use-package git-timemachine
:hook (git-time-machine-mode . evil-normalize-keymaps)
@@ -1417,12 +1244,6 @@ create a new one."
(use-package rainbow-mode
:config (rainbow-mode))
-;; (use-package corfu
-;; :custom
-;; (corfu-cycle t)
-;; :init
-;; (global-corfu-mode))
-
(use-package corfu
:init
(global-corfu-mode)
@@ -1431,7 +1252,7 @@ create a new one."
:custom
(corfu-auto t)
(corfu-auto-prefix 3)
- (corfu-auto-delay 0.3)
+ (corfu-auto-delay 1)
(corfu-cycle t)
(corfu-quit-no-match 'separator)
(corfu-separator ?\s)
@@ -1483,22 +1304,6 @@ create a new one."
("C-z ^" . cape-tex)
("C-z &" . cape-sgml)
("C-z r" . cape-rfc1345)
- ;; Add to the global default value of `completion-at-point-functions' which is
- ;; used by `completion-at-point'. The order of the functions matters, the
- ;; first function returning a result wins. Note that the list of buffer-local
- ;; completion functions takes precedence over the global list.
- ;; (add-to-list 'completion-at-point-functions #'cape-dabbrev)
- ;; (add-to-list 'completion-at-point-functions #'cape-file)
- ;; (add-to-list 'completion-at-point-functions #'cape-elisp-block)
- ;; (add-to-list 'completion-at-point-functions #'cape-history)
- ;; (add-to-list 'completion-at-point-functions #'cape-keyword)
- ;; (add-to-list 'completion-at-point-functions #'cape-tex)
- ;; (add-to-list 'completion-at-point-functions #'cape-sgml)
- ;; (add-to-list 'completion-at-point-functions #'cape-rfc1345)
- ;; (add-to-list 'completion-at-point-functions #'cape-abbrev)
- ;; (add-to-list 'completion-at-point-functions #'cape-dict)
- ;; (add-to-list 'completion-at-point-functions #'cape-elisp-symbol)
- ;; (add-to-list 'completion-at-point-functions #'cape-line)
)
(use-package rustic
@@ -1549,64 +1354,10 @@ create a new one."
(use-package evil-nerd-commenter
:bind ("M-/" . evilnc-comment-or-uncomment-lines))
-(use-package yasnippet
- :init (yas-global-mode 1)
- :config
- (yas-reload-all))
-
-(setq wtf/latex-mathbb-prefix "''")
-(setq swarsel/latex-mathcal-prefix "``")
-
-(use-package yasnippet
- :config
-
- (setq wtf/english-alphabet
- '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"))
-
- (dolist (elem wtf/english-alphabet)
- (when (string-equal elem (downcase elem))
- (add-to-list 'wtf/english-alphabet (upcase elem))))
-
-
- (yas-define-snippets
- 'latex-mode
- (mapcar
- (lambda (elem)
- (list (concat wtf/latex-mathbb-prefix elem) (concat "\\mathbb{" elem "}") (concat "Mathbb letter " elem)))
- wtf/english-alphabet))
-
- (yas-define-snippets
- 'latex-mode
- (mapcar
- (lambda (elem)
- (list (concat swarsel/latex-mathcal-prefix elem) (concat "\\mathcal{" elem "}") (concat "Mathcal letter " elem)))
- wtf/english-alphabet))
-
- (setq swtf/latex-math-symbols
- '(("x" . "\\times")
- ("*" . "\\cdot")
- ("." . "\\ldots")
- ("op" . "\\operatorname{$1}$0")
- ("o" . "\\circ")
- ("V" . "\\forall")
- ("v" . "\\vee")
- ("w" . "\\wedge")
- ("q" . "\\quad")
- ("f" . "\\frac{$1}{$2}$0")
- ("s" . "\\sum_{$1}^{$2}$0")
- ("p" . "\\prod_{$1}^{$2}$0")
- ("e" . "\\exists")
- ("i" . "\\int_{$1}^{$2}$0")
- ("c" . "\\cap")
- ("u" . "\\cup")
- ("0" . "\\emptyset")))
-
- )
-
(use-package eglot
:config
(add-to-list 'eglot-server-programs
- '(yaml-ts-mode . ("ansible-language-server" "--stdio")))
+ '(yaml-ts-mode . ("ansible-language-server" "--stdio")))
:hook
((python-mode
python-ts-mode
@@ -1648,13 +1399,9 @@ create a new one."
:hook (flymake-mode . sideline-mode)
:init
(setq sideline-flymake-display-mode 'point) ; 'point to show errors only on point
- ; 'line to show errors on the current line
+ ; 'line to show errors on the current line
(setq sideline-backends-right '(sideline-flymake)))
-(use-package breadcrumb
- ;; :config (breadcrumb-mode)
- )
-
(setq backup-by-copying-when-linked t)
(use-package dirvish
@@ -1708,14 +1455,6 @@ create a new one."
("M-e" . dirvish-emerge-menu)
("M-j" . dirvish-fd-jump)))
-;; (use-package pdf-tools
-;; :init
-;; (if (not (boundp 'pdf-tools-directory))
-;; (pdf-tools-install))
-;; :mode ("\\.pdf" . pdf-view-mode))
-
-(use-package ein)
-
(use-package undo-tree
:init (global-undo-tree-mode)
:bind (:map undo-tree-visualizer-mode-map
@@ -1726,11 +1465,6 @@ create a new one."
:config
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo"))))
-;; (add-hook 'prog-mode-hook 'undo-tree-mode)
-;; (add-hook 'text-mode-hook 'undo-tree-mode)
-;; (add-hook 'org-mode-hook 'undo-tree-mode)
-;; (add-hook 'latex-mode-hook 'undo-tree-mode)
-
(use-package hydra)
;; change the text size of the current buffer
@@ -1740,103 +1474,6 @@ create a new one."
("k" text-scale-decrease "out")
("f" nil "finished" :exit t))
-;; (use-package obsidian
-;; :ensure t
-;; :demand t
-;; :config
-;; (obsidian-specify-path swarsel-obsidian-vault-directory)
-;; (global-obsidian-mode t)
-;; :custom
-;; ;; This directory will be used for `obsidian-capture' if set.
-;; (obsidian-inbox-directory "Inbox")
-;; (bind-key (kbd "C-c M-o") 'obsidian-hydra/body 'obsidian-mode-map)
-;; :bind (:map obsidian-mode-map
-;; ;; Replace C-c C-o with Obsidian.el's implementation. It's ok to use another key binding.
-;; ("C-c C-o" . obsidian-follow-link-at-point)
-;; ;; Jump to backlinks
-;; ("C-c C-b" . obsidian-backlink-jump)
-;; ;; If you prefer you can use `obsidian-insert-link'
-;; ("C-c C-l" . obsidian-insert-wikilink)))
-
-;; (use-package anki-editor
-;; :after org
-;; :bind (:map org-mode-map
-;; ("" . anki-editor-cloze-region-auto-incr)
-;; ("" . anki-editor-cloze-region-dont-incr)
-;; ("" . anki-editor-reset-cloze-number)
-;; ("" . anki-editor-push-tree))
-;; :hook (org-capture-after-finalize . anki-editor-reset-cloze-number) ; Reset cloze-number after each capture.
-;; :config
-;; (setq anki-editor-create-decks t ;; Allow anki-editor to create a new deck if it doesn't exist
-;; anki-editor-org-tags-as-anki-tags t)
-
-;; (defun anki-editor-cloze-region-auto-incr (&optional arg)
-;; "Cloze region without hint and increase card number."
-;; (interactive)
-;; (anki-editor-cloze-region swarsel-anki-editor-cloze-number "")
-;; (setq swarsel-anki-editor-cloze-number (1+ swarsel-anki-editor-cloze-number))
-;; (forward-sexp))
-;; (defun anki-editor-cloze-region-dont-incr (&optional arg)
-;; "Cloze region without hint using the previous card number."
-;; (interactive)
-;; (anki-editor-cloze-region (1- swarsel-anki-editor-cloze-number) "")
-;; (forward-sexp))
-;; (defun anki-editor-reset-cloze-number (&optional arg)
-;; "Reset cloze number to ARG or 1"
-;; (interactive)
-;; (setq swarsel-anki-editor-cloze-number (or arg 1)))
-;; (defun anki-editor-push-tree ()
-;; "Push all notes under a tree."
-;; (interactive)
-;; (anki-editor-push-notes '(4))
-;; (anki-editor-reset-cloze-number))
-;; ;; Initialize
-;; (anki-editor-reset-cloze-number)
-;; )
-
-;; (require 'anki-editor)
-
-;; (defvar swarsel-anki-deck nil)
-;; (defvar swarsel-anki-notetype nil)
-;; (defvar swarsel-anki-fields nil)
-
-;; (defun swarsel-anki-set-deck-and-notetype ()
-;; (interactive)
-;; (setq swarsel-anki-deck (completing-read "Choose a deck: "
-;; (sort (anki-editor-deck-names) #'string-lessp)))
-;; (setq swarsel-anki-notetype (completing-read "Choose a note type: "
-;; (sort (anki-editor-note-types) #'string-lessp)))
-;; (setq swarsel-anki-fields (progn
-;; (anki-editor--anki-connect-invoke-result "modelFieldNames" `((modelName . ,swarsel-anki-notetype)))))
-;; )
-
-;; (defun swarsel-anki-make-template-string ()
-;; (if (not swarsel-anki-deck)
-;; (call-interactively 'swarsel-anki-set-deck-and-notetype))
-;; (setq swarsel-temp swarsel-anki-fields)
-;; (concat (concat "* %<%H:%M>\n:PROPERTIES:\n:ANKI_NOTE_TYPE: " swarsel-anki-notetype "\n:ANKI_DECK: " swarsel-anki-deck "\n:END:\n** ")(pop swarsel-temp) "\n%?\n** " (mapconcat 'identity swarsel-temp "\n\n** ") "\n\n"))
-
-;; (defun swarsel-today()
-;; (format-time-string "%Y-%m-%d"))
-
-;; (defun swarsel-obsidian-daily ()
-;; (interactive)
-;; (if (not (file-exists-p (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory)))
-;; (write-region "" nil (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory))
-;; )
-;; (find-file (expand-file-name (concat (swarsel-today) ".md") swarsel-obsidian-daily-directory)))
-
-;; (let ((mu4epath
-;; (concat
-;; (f-dirname
-;; (file-truename
-;; (executable-find "mu")))
-;; "/../share/emacs/site-lisp/mu4e")))
-;; (when (and
-;; (string-prefix-p "/nix/store/" mu4epath)
-;; (file-directory-p mu4epath))
-;; (add-to-list 'load-path mu4epath)))
-
(use-package mu4e
:ensure nil
;; :load-path "/usr/share/emacs/site-lisp/mu4e/"
@@ -2002,114 +1639,11 @@ create a new one."
)))
(use-package vterm
- :ensure t)
-
-(defun sudo-find-file (file-name)
-"Like find file, but opens the file as root."
-(interactive "FSudo Find File: ")
-(let ((tramp-file-name (concat "/sudo::" (expand-file-name file-name))))
- (find-file tramp-file-name)))
-;;; vterm/config.el -*- lexical-binding: t; -*-
-
- ;; Original functions overwrites tramp path with a guessed path.
- ;; However it breaks if remote fqdn/hostname is not resolvale by local machine
- ;; could also break on port forwarding, multihops,
- ;; custom protocol such as: docker, vagrant, ...
- ;; *if* you try to shell-side configure them.
- ;; Easily testable with vagrant ssh port on localhost.
- ;; My workflow is to open a tramp dired on / of the remote to get a
- ;; "foothold" then open vterms from there.
- (defun vterm--get-directory (path)
- "[OVERLOADED] Get normalized directory to PATH."
- (when path
- (let (directory)
- (if (string-match "^\\(.*?\\)@\\(.*?\\):\\(.*?\\)$" path)
- (progn
- (let ((user (match-string 1 path))
- (host (match-string 2 path))
- (dir (match-string 3 path)))
- (if (and (string-equal user user-login-name)
- (string-equal host (system-name)))
- (progn
- (when (file-directory-p dir)
- (setq directory (file-name-as-directory dir))))
- (setq directory
- ;; Bellow is what i altered
- (file-name-as-directory (concat (file-remote-p default-directory) dir))))))
- (when (file-directory-p path)
- (setq directory (file-name-as-directory path))))
- directory)))
- ;; Injects the payload to the vterm buffer.
- (defun me/vterm-load-config ()
- "Pass local configuration files to vterm.
-
-Allows remote vterm to be shell-side configured,
-without altering remote config.
-Also adds my personal configuration that does not rely
-too much on external packages.
-Prints a reasuring message to proove good faith."
- (interactive)
- (let (;; Bellow messages to reassure other users that look at history
- (reasuring-message (format "Configuring shell of user %s to be emacs comptible"
- user-full-name))
- (reasuring-notice "This action is shell local, it will not affect other shells")
- ;; Bellow lies my configuration
- (basic-func-script (f-read-text (concat (getenv "HOME")
- "/.emacs.d/shells/sources/functions.sh")))
- ;; Bellow lies the vterm shell-side configuration
- ;; Must be sourced last
- (vterm-func-script (f-read-text (concat
- (file-name-directory (find-library-name "vterm"))
- "/etc/emacs-vterm-bash.sh"))))
- (vterm-insert (format "# START: %s\n" reasuring-message))
- (vterm-insert (format "# %s\n" reasuring-notice))
- ;; Create one single block in history
- (vterm-insert "{\n")
- (vterm-insert basic-func-script)
- (vterm-insert vterm-func-script)
- (vterm-insert "}\n")
- ;; End the single block in history
- (vterm-insert (format "# %s\n" reasuring-notice))
- (vterm-insert (format "# STOP: %s\n" reasuring-message))
- )
- )
-
- ;; find-file-other-window does not works great on remote:
- ;; if given an absolute path on a remote host,
- ;; the path will be understood as a local file since no
- ;; tramp prefix is present, and bash does not care
- ;; about tramp prefixes.
- ;; Bellow we solve context before sending it to
- ;; ffow
- (defun me/vterm--find-file-other-window-wrapper (file)
- "Help vterm find a FILE."
- (find-file-other-window (me/vterm--ffow-resolver file)))
- (defun me/vterm--ffow-resolver (file)
- "Help vterm resolve FILE."
- (cond
- ;; "/sudo::"
- ;; doom--sudo-file-path do the trick for us
- ((s-starts-with-p "/sudo::" file)
- (sudo-find-file
- (concat (file-remote-p default-directory)
- (substring-no-properties file 7))))
- ;; "/" means we want the "Relative root"
- ;; try appending the remote prefix if relevent
- ((s-starts-with-p "/" file)
- (concat (file-remote-p default-directory) file))
- ;; we got a relative path
- ;; we don't need to help ffow to find it
- (t
- file)))
-
- ;; The variable vterm-eval-cmds is a SERIOUSLY SENSIBLE variable !
- ;; Do not be the guy that adds RCE into their config !
-
- ;; Allow customed ffow to be called from vterm
- ;; ffow should be as safe as find-file which is already trusted
- ;; we append our resolver that only manipulate strings,
- ;; Proove me wrong but i think it's safe.
- (add-to-list 'vterm-eval-cmds '("find-file-other-window"
- me/vterm--find-file-other-window-wrapper))
+ :ensure t)
(use-package multiple-cursors)
+
+(setq mu4e--log-max-size 1000)
+(setq message-log-max 30)
+(setq comint-buffer-maximum-size 50)
+(add-hook 'comint-output-filter-functions 'comint-truncate-buffer)
diff --git a/programs/etc/issue b/programs/etc/issue
index 630729c..f05e80d 100644
--- a/programs/etc/issue
+++ b/programs/etc/issue
@@ -1,5 +1,5 @@
[32m~SwarselSystems~[0m
-IP of primary interface: [31m\4[0m
-The Password for all users & root is '[31msetup[0m'.
-Install the system remotely by running '[33mbootstrap -n -d [0m' on a machine with deployed secrets.
-Alternatively, run '[33mswarsel-install -n [0m' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access).
+ IP of primary interface: [31m\4[0m
+ The Password for all users & root is '[31msetup[0m'.
+ Install the system remotely by running '[33mbootstrap -n -d [0m' on a machine with deployed secrets.
+ Alternatively, run '[33mswarsel-install -n [0m' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access).
diff --git a/programs/waybar/style.css b/programs/waybar/style.css
index 21c3cad..0148893 100644
--- a/programs/waybar/style.css
+++ b/programs/waybar/style.css
@@ -9,7 +9,7 @@
@define-color background-critical blue;
- * {
+* {
border: none;
border-radius: 0;
font-family: "FiraCode Nerd Font Propo", "Font Awesome 5 Free";
@@ -19,9 +19,9 @@
}
window#waybar {
- background: transparent;
- color: @foreground;
- transition-duration: .5s;
+ background: transparent;
+ color: @foreground;
+ transition-duration: .5s;
}
window#waybar.hidden {
@@ -39,14 +39,14 @@ window#waybar.hidden {
#custom-right-arrow-dark,
#custom-left-arrow-dark {
- color: @background;
- background: @background-alt;
- font-size: 24px;
+ color: @background;
+ background: @background-alt;
+ font-size: 24px;
}
#window {
- font-size: 12px;
- padding: 0 20px;
+ font-size: 12px;
+ padding: 0 20px;
}
#mode {
@@ -73,21 +73,21 @@ window#waybar.hidden {
#custom-outer-right-arrow-dark,
#custom-outer-left-arrow-dark {
- color: @background;
- font-size: 24px;
+ color: @background;
+ font-size: 24px;
}
#custom-outer-left-arrow-dark,
#custom-left-arrow-dark,
#custom-left-arrow-light {
- margin: 0 -1px;
+ margin: 0 -1px;
}
#custom-right-arrow-light,
#custom-left-arrow-light {
- color: @background-alt;
- background: @background;
- font-size: 24px;
+ color: @background-alt;
+ background: @background;
+ font-size: 24px;
}
#workspaces,
@@ -119,20 +119,20 @@ window#waybar.hidden {
#workspaces button {
- padding: 0 2px;
- color: #fdf6e3;
+ padding: 0 2px;
+ color: #fdf6e3;
}
#workspaces button.focused {
- color: @foreground-warning;
+ color: @foreground-warning;
}
#workspaces button:hover {
background: @foreground;
color: @background;
- border: @foreground;
- padding: 0 2px;
- box-shadow: inherit;
- text-shadow: inherit;
+ border: @foreground;
+ padding: 0 2px;
+ box-shadow: inherit;
+ text-shadow: inherit;
}
#workspaces button.urgent {
@@ -177,8 +177,8 @@ window#waybar.hidden {
color: @foreground-error;
}
#memory {
- /*color: #2aa198;*/
- color: #fdfd97;
+ /*color: #2aa198;*/
+ color: #fdfd97;
}
#cpu {
/*color: #6c71c4;*/
@@ -192,7 +192,7 @@ window#waybar.hidden {
#battery,
#custom-pseudobat {
- color: cyan;
+ color: cyan;
}
#battery.discharging {
color: #859900;
diff --git a/scripts/swarsel-bootstrap.sh b/scripts/swarsel-bootstrap.sh
index bec1046..336cd61 100644
--- a/scripts/swarsel-bootstrap.sh
+++ b/scripts/swarsel-bootstrap.sh
@@ -78,14 +78,14 @@ function update_sops_file() {
SOPS_FILE=".sops.yaml"
sed -i "{
- # Remove any * and & entries for this host
- /[*&]$key_name/ d;
- # Inject a new age: entry
- # n matches the first line following age: and p prints it, then we transform it while reusing the spacing
- /age:/{n; p; s/\(.*- \*\).*/\1$key_name/};
- # Inject a new hosts or user: entry
- /&$key_type/{n; p; s/\(.*- &\).*/\1$key_name $key/}
- }" $SOPS_FILE
+ # Remove any * and & entries for this host
+ /[*&]$key_name/ d;
+ # Inject a new age: entry
+ # n matches the first line following age: and p prints it, then we transform it while reusing the spacing
+ /age:/{n; p; s/\(.*- \*\).*/\1$key_name/};
+ # Inject a new hosts or user: entry
+ /&$key_type/{n; p; s/\(.*- &\).*/\1$key_name $key/}
+ }" $SOPS_FILE
green "Updating .sops.yaml"
cd -
}
diff --git a/statix.toml b/statix.toml
index 190b092..87445cf 100644
--- a/statix.toml
+++ b/statix.toml
@@ -1,5 +1,5 @@
disabled = [
- "repeated_keys"
+"repeated_keys"
]
nix_version = '2.4'
ignore = ['.direnv']