├── .envrc ├── .gitignore ├── README.md ├── flake.lock ├── flake.nix ├── hosts ├── base │ └── default.nix ├── bifrost │ ├── .gitkeep │ ├── README.md │ ├── default.nix │ └── hardware-configuration.nix └── yggdrasil │ ├── default.nix │ └── hardware-configuration.nix ├── lib ├── lib.nix └── stdlib-extended.nix ├── modules ├── desktopEnvironment │ └── gnome │ │ └── default.nix ├── nix │ ├── converters.nix │ ├── default.nix │ └── palettes.nix ├── programs │ ├── bash │ │ ├── config │ │ │ ├── bashrc │ │ │ ├── completions │ │ │ └── starship.toml │ │ └── default.nix │ ├── emacs │ │ ├── config │ │ │ ├── ebn-init.el │ │ │ └── site-start.el │ │ └── default.nix │ ├── kitty │ │ ├── config │ │ │ └── kitty.conf │ │ └── default.nix │ ├── neovim │ │ ├── config │ │ │ ├── ebn.vim │ │ │ ├── init.vim │ │ │ ├── lua │ │ │ │ ├── README.md │ │ │ │ ├── ebn │ │ │ │ │ ├── init.lua │ │ │ │ │ ├── keys.lua │ │ │ │ │ ├── lsp.lua │ │ │ │ │ ├── lualine.lua │ │ │ │ │ └── nnn.lua │ │ │ │ └── lualine │ │ │ │ │ └── themes │ │ │ │ │ └── aurora.lua │ │ │ └── plugin.nix │ │ └── default.nix │ └── rofi │ │ ├── config │ │ └── rofi.rasi │ │ └── default.nix ├── services │ ├── intercept-tools │ │ └── default.nix │ ├── polybar │ │ ├── config │ │ │ └── polybarrc │ │ └── default.nix │ ├── pulseeffects │ │ └── default.nix │ ├── syncthing │ │ └── default.nix │ └── tint2 │ │ ├── config │ │ └── tint2rc │ │ └── default.nix └── windowManagers │ ├── stumpwm │ └── default.nix │ └── xmonad │ ├── default.nix │ ├── scripts │ └── dmenu_files.sh │ └── xcompmgr.nix ├── packages ├── aurora-vim │ └── default.nix ├── default.nix ├── ebn-core.el │ ├── default.nix │ └── src │ │ └── ebn-core.el ├── ebn-stumpwm │ └── default.nix ├── ebn-xmonad │ ├── .gitignore │ ├── CHANGELOG.md │ ├── build │ ├── default.nix │ ├── ebn-xmonad.cabal │ ├── hie.yaml │ ├── lib │ │ ├── Config.hs │ │ └── Config │ │ │ ├── Applications.hs │ │ │ ├── Dbus.hs │ │ │ ├── Keybinds.hs │ │ │ └── Polybar.hs │ ├── xmonad.hs │ └── xpm │ │ └── haskell_20.xpm ├── emacs-kaolin-themes │ └── default.nix ├── iosevka-custom │ └── default.nix ├── material-design-iconic │ └── default.nix ├── modus-theme-vim │ └── default.nix ├── modus-themes │ └── default.nix ├── pop-shell │ └── default.nix └── zathura │ ├── config │ └── zathurarc │ └── default.nix └── shell.nix /.envrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | ## This will be supported in the future 5 | export NIX_USER_CONF_FILES=$PWD/etc/nix.conf 6 | 7 | watch_file devshell.toml 8 | if nix flake info &>/dev/null; then 9 | # Flake! 10 | watch_file flake.lock 11 | watch_file flake.nix 12 | eval "$(nix print-dev-env)" 13 | else 14 | use nix 15 | fi 16 | 17 | #use flake 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | tmp/ 3 | result 4 | result-doc 5 | .direnv/ 6 | bin-tmp 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My NixOS Configuration 2 | 3 | ![https://nixos.org/](https://img.shields.io/badge/NixOS-v21.11-blue.svg?style=flat-square&logo=NixOS&logoColor=white) 4 | ![https://builtwithnix.org](https://img.shields.io/badge/Built_With-Nix-5277C3.svg?style=flat-square&logo=nixos&labelColor=41439a&logoColor=white) 5 | 6 | **I no longer use NixOS. Everything here is outdated** 7 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "emacs-overlay": { 4 | "inputs": { 5 | "flake-utils": "flake-utils", 6 | "nixpkgs": "nixpkgs" 7 | }, 8 | "locked": { 9 | "lastModified": 1655466057, 10 | "narHash": "sha256-hKU7xPIfCFrKu9wch2rjGmhmHQRD6AcONx72ErvBXyQ=", 11 | "owner": "nix-community", 12 | "repo": "emacs-overlay", 13 | "rev": "dd569be57258f80a7d1ef924e6ae00323bd2319e", 14 | "type": "github" 15 | }, 16 | "original": { 17 | "owner": "nix-community", 18 | "repo": "emacs-overlay", 19 | "type": "github" 20 | } 21 | }, 22 | "flake-utils": { 23 | "locked": { 24 | "lastModified": 1653893745, 25 | "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", 26 | "owner": "numtide", 27 | "repo": "flake-utils", 28 | "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", 29 | "type": "github" 30 | }, 31 | "original": { 32 | "owner": "numtide", 33 | "repo": "flake-utils", 34 | "type": "github" 35 | } 36 | }, 37 | "flake-utils_2": { 38 | "locked": { 39 | "lastModified": 1644229661, 40 | "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", 41 | "owner": "numtide", 42 | "repo": "flake-utils", 43 | "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", 44 | "type": "github" 45 | }, 46 | "original": { 47 | "owner": "numtide", 48 | "repo": "flake-utils", 49 | "type": "github" 50 | } 51 | }, 52 | "neovim-git": { 53 | "inputs": { 54 | "flake-utils": "flake-utils_2", 55 | "nixpkgs": "nixpkgs_2" 56 | }, 57 | "locked": { 58 | "dir": "contrib", 59 | "lastModified": 1655429638, 60 | "narHash": "sha256-u2uLjvcK7r9pKohts3hV8HaCmsKm1a1SrvsGpxfn8s4=", 61 | "owner": "neovim", 62 | "repo": "neovim", 63 | "rev": "98e2da7d50b8f22edb20cdb744788ef0085d0cb6", 64 | "type": "github" 65 | }, 66 | "original": { 67 | "dir": "contrib", 68 | "owner": "neovim", 69 | "repo": "neovim", 70 | "type": "github" 71 | } 72 | }, 73 | "nixos-hardware": { 74 | "locked": { 75 | "lastModified": 1654057797, 76 | "narHash": "sha256-mXo7C4v7Jj2feBzcReu1Eu/3Rnw5b023E9kOyFsHZQw=", 77 | "owner": "NixOS", 78 | "repo": "nixos-hardware", 79 | "rev": "0cab18a48de7914ef8cad35dca0bb36868f3e1af", 80 | "type": "github" 81 | }, 82 | "original": { 83 | "owner": "NixOS", 84 | "ref": "master", 85 | "repo": "nixos-hardware", 86 | "type": "github" 87 | } 88 | }, 89 | "nixpkgs": { 90 | "locked": { 91 | "lastModified": 1655390681, 92 | "narHash": "sha256-SXGZ7jJWsySMlNEpbxi8nq3QYDbtcAl+QHwsXlWq2g0=", 93 | "owner": "NixOS", 94 | "repo": "nixpkgs", 95 | "rev": "29769d2a1390d294469bcc6518f17931953545e1", 96 | "type": "github" 97 | }, 98 | "original": { 99 | "id": "nixpkgs", 100 | "type": "indirect" 101 | } 102 | }, 103 | "nixpkgs-unstable": { 104 | "locked": { 105 | "lastModified": 1655477820, 106 | "narHash": "sha256-BvmRcmqQPYnJC4VDkN72e76yL6tnKrN3wyiqzBqXhf0=", 107 | "owner": "NixOS", 108 | "repo": "nixpkgs", 109 | "rev": "8dd255b886d2bd73ec41ebc671966dea8578a68f", 110 | "type": "github" 111 | }, 112 | "original": { 113 | "id": "nixpkgs", 114 | "ref": "master", 115 | "type": "indirect" 116 | } 117 | }, 118 | "nixpkgs_2": { 119 | "locked": { 120 | "lastModified": 1646254136, 121 | "narHash": "sha256-8nQx02tTzgYO21BP/dy5BCRopE8OwE8Drsw98j+Qoaw=", 122 | "owner": "nixos", 123 | "repo": "nixpkgs", 124 | "rev": "3e072546ea98db00c2364b81491b893673267827", 125 | "type": "github" 126 | }, 127 | "original": { 128 | "owner": "nixos", 129 | "ref": "nixos-unstable", 130 | "repo": "nixpkgs", 131 | "type": "github" 132 | } 133 | }, 134 | "nixpkgs_3": { 135 | "locked": { 136 | "lastModified": 1655390681, 137 | "narHash": "sha256-SXGZ7jJWsySMlNEpbxi8nq3QYDbtcAl+QHwsXlWq2g0=", 138 | "owner": "NixOS", 139 | "repo": "nixpkgs", 140 | "rev": "29769d2a1390d294469bcc6518f17931953545e1", 141 | "type": "github" 142 | }, 143 | "original": { 144 | "id": "nixpkgs", 145 | "ref": "nixpkgs-unstable", 146 | "type": "indirect" 147 | } 148 | }, 149 | "root": { 150 | "inputs": { 151 | "emacs-overlay": "emacs-overlay", 152 | "neovim-git": "neovim-git", 153 | "nixos-hardware": "nixos-hardware", 154 | "nixpkgs": "nixpkgs_3", 155 | "nixpkgs-unstable": "nixpkgs-unstable" 156 | } 157 | } 158 | }, 159 | "root": "root", 160 | "version": 7 161 | } 162 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "ebn nixos configuration"; 3 | 4 | inputs = { 5 | nixpkgs.url = "nixpkgs/nixpkgs-unstable"; 6 | nixpkgs-unstable.url = "nixpkgs/master"; 7 | emacs-overlay.url = "github:nix-community/emacs-overlay"; 8 | neovim-git.url = "github:neovim/neovim?dir=contrib"; 9 | nixos-hardware.url = "github:NixOS/nixos-hardware/master"; 10 | }; 11 | 12 | outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, emacs-overlay, neovim-git, nixos-hardware, ... }: 13 | let 14 | system = "x86_64-linux"; 15 | make-packages = ps: attrs: 16 | import ps ({ 17 | inherit system; 18 | config.allowUnfree = true; 19 | config.permittedInsecurePackages = [ 20 | "electron-6.1.12" # for geogebra 21 | "electron-14.2.9" # for geogebra 22 | ]; 23 | } // attrs); 24 | 25 | pkgs = make-packages nixpkgs { 26 | overlays = [ 27 | emacs-overlay.overlay 28 | neovim-git.overlay 29 | (import ./packages) 30 | (final: prev: 31 | let unstable = make-packages nixpkgs-unstable { }; 32 | in { 33 | steam = unstable.steam; 34 | #discord = unstable.discord; 35 | #electron = prev.electron_14; 36 | }) 37 | ]; 38 | }; 39 | 40 | my-lib = import ./lib/lib.nix pkgs.lib; 41 | my-modules = my-lib.listModulesRec ./modules; 42 | 43 | make-system = extra-modules: nixpkgs.lib.nixosSystem { 44 | inherit system; 45 | specialArgs = { inherit pkgs; }; 46 | modules = pkgs.lib.lists.flatten (extra-modules ++ my-modules); 47 | }; 48 | 49 | in { 50 | inherit pkgs my-lib; # exporting these for access in nix repl 51 | devShell.${system} = import ./shell.nix { inherit pkgs; }; 52 | 53 | nixosConfigurations = { 54 | 55 | yggdrasil = make-system [ 56 | ./hosts/base 57 | ./hosts/yggdrasil 58 | ./hosts/yggdrasil/hardware-configuration.nix 59 | ]; 60 | 61 | bifrost = make-system [ 62 | ./hosts/base 63 | ./hosts/bifrost 64 | ./hosts/bifrost/hardware-configuration.nix 65 | nixos-hardware.nixosModules.lenovo-thinkpad-t480 66 | ]; 67 | }; 68 | }; 69 | } 70 | -------------------------------------------------------------------------------- /hosts/base/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: { 2 | 3 | users.users.ebn = { 4 | isNormalUser = true; 5 | extraGroups = [ "wheel" "networkmanager" "audio" "video" ]; 6 | shell = pkgs.bash; 7 | }; 8 | 9 | boot = { 10 | #kernelPackages = pkgs.linuxPackages_5_14; 11 | loader = { 12 | efi.canTouchEfiVariables = true; 13 | systemd-boot.configurationLimit = 10; 14 | systemd-boot.enable = true; 15 | }; 16 | }; 17 | 18 | console = { 19 | font = "Lat2-Terminus16"; 20 | keyMap = "sv-latin1"; 21 | }; 22 | 23 | time.timeZone = "Europe/Stockholm"; 24 | i18n.defaultLocale = "en_US.UTF-8"; 25 | 26 | location = { latitude = 59.4022; longitude = 13.5115; }; 27 | 28 | environment.systemPackages = with pkgs; [ 29 | cachix 30 | git 31 | ispell 32 | ncpamixer 33 | (pass.withExtensions (exts: [ exts.pass-import ])) 34 | w3m 35 | wget 36 | nnn 37 | ]; 38 | 39 | sound.enable = true; 40 | hardware.pulseaudio = { 41 | enable = true; 42 | extraConfig = '' 43 | load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1; ### Needed by mpd 44 | ''; 45 | daemon.config = { 46 | default-sample-rate = 48000; 47 | }; 48 | }; 49 | 50 | fonts.fontconfig = { 51 | enable = true; 52 | antialias = true; 53 | hinting = { 54 | enable = true; 55 | }; 56 | }; 57 | 58 | nix = { 59 | gc = { 60 | automatic = true; 61 | dates = "monthly"; 62 | options = "--delete-older-than 90d"; 63 | }; 64 | autoOptimiseStore = true; 65 | 66 | trustedUsers = [ "ebn" "root" ]; 67 | 68 | binaryCaches = [ 69 | "https://nix-community.cachix.org/" 70 | #"https://hydra.iohk.io" # Haskell.nix 71 | "https://ebn.cachix.org" 72 | ]; 73 | 74 | binaryCachePublicKeys = [ 75 | "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 76 | #"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" # Haskell.nix 77 | "ebn.cachix.org-1:Z8QlCh2aXXURAyMpMgDh7VaHo/iTJ7P8r52fxpjJ5JA=" 78 | ]; 79 | 80 | package = pkgs.nixFlakes; 81 | # Enable the nix 2.0 CLI and flakes support feature-flags 82 | extraOptions = '' 83 | experimental-features = nix-command flakes 84 | ''; 85 | }; 86 | } 87 | -------------------------------------------------------------------------------- /hosts/bifrost/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erikbackman/nixos-config/0522e9597793a653e4e90e682b2045473e49787b/hosts/bifrost/.gitkeep -------------------------------------------------------------------------------- /hosts/bifrost/README.md: -------------------------------------------------------------------------------- 1 | # Bifrost 2 | 3 | Thinkpad t480 4 | -------------------------------------------------------------------------------- /hosts/bifrost/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: 2 | { 3 | networking.hostName = "bifrost"; 4 | networking.wireless = { 5 | enable = true; 6 | userControlled.enable = true; 7 | }; 8 | 9 | ebn.themes = { 10 | enable = true; 11 | palette = "aurora"; 12 | }; 13 | 14 | nixpkgs.config.allowUnfree = true; 15 | programs.ebn.nvim.enable = true; 16 | programs.ebn.kitty.enable = true; 17 | programs.ebn.rofi.enable = true; 18 | programs.ebn.bash.enable = true; 19 | programs.ebn.bash.starship.enable = true; 20 | programs.ebn.emacs.enable = true; 21 | programs.ebn.emacs.package = pkgs.emacsNativeComp; 22 | 23 | services.redshift = { 24 | enable = true; 25 | inherit (config location); 26 | }; 27 | 28 | # Xmonad 29 | windowManager.ebn.xmonad.enable = true; 30 | 31 | services.ebn.polybar.enable = true; 32 | services.fstrim.enable = true; 33 | 34 | services.ebn.syncthing.enable = true; 35 | services.xserver.layout = "se"; 36 | services.dbus = { 37 | enable = true; 38 | packages = [ pkgs.gnome3.dconf ]; 39 | }; 40 | 41 | fonts.fonts = with pkgs; [ 42 | etBook 43 | google-fonts 44 | hack-font 45 | iosevka jetbrains-mono 46 | oldstandard 47 | siji 48 | ]; 49 | 50 | 51 | environment.systemPackages = with pkgs; [ 52 | zathura 53 | texlive.combined.scheme-full 54 | libreoffice 55 | firefox 56 | playerctl 57 | gsettings-desktop-schemas 58 | gnumake 59 | neofetch 60 | feh 61 | rofi-pass 62 | cowsay 63 | ncspot 64 | pavucontrol 65 | anki 66 | gnome.gucharmap 67 | wpa_supplicant 68 | man-pages 69 | ]; 70 | } 71 | -------------------------------------------------------------------------------- /hosts/bifrost/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, modulesPath, ... }: 5 | 6 | { 7 | imports = 8 | [ (modulesPath + "/installer/scan/not-detected.nix") 9 | ]; 10 | 11 | boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; 12 | boot.initrd.kernelModules = [ ]; 13 | boot.kernelModules = [ "kvm-intel" ]; 14 | boot.extraModulePackages = [ ]; 15 | 16 | fileSystems."/" = 17 | { device = "/dev/disk/by-label/nixos"; 18 | fsType = "ext4"; 19 | }; 20 | 21 | fileSystems."/boot" = 22 | { device = "/dev/disk/by-label/boot"; 23 | fsType = "vfat"; 24 | }; 25 | 26 | swapDevices = 27 | [ { device = "/dev/disk/by-label/swap"; } 28 | ]; 29 | 30 | powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; 31 | } 32 | -------------------------------------------------------------------------------- /hosts/yggdrasil/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: { 2 | 3 | networking.hostName = "yggdrasil"; 4 | 5 | nixpkgs.config.allowUnfree = true; 6 | 7 | programs.steam.enable = true; 8 | programs.ebn.nvim.enable = true; 9 | programs.ebn.kitty.enable = false; 10 | programs.ebn.bash.enable = true; 11 | programs.ebn.bash.starship.enable = false; 12 | programs.ebn.emacs.enable = true; 13 | programs.ebn.emacs.package = pkgs.emacsNativeComp; 14 | 15 | gtk.iconCache.enable = true; 16 | 17 | services.urxvtd.enable = true; 18 | services.redshift = { 19 | enable = true; 20 | temperature.night = 3200; 21 | temperature.day = 3400; 22 | inherit (config location); 23 | }; 24 | 25 | services.earlyoom.enable = true; 26 | 27 | # GnuPG 28 | programs.gnupg.agent = { 29 | enable = true; 30 | enableSSHSupport = true; 31 | }; 32 | services.pcscd.enable = true; 33 | 34 | services.clamav = { 35 | daemon.enable = true; 36 | updater.enable = true; 37 | }; 38 | 39 | windowManager.ebn.xmonad.enable = true; 40 | windowManager.ebn.stumpwm.enable = false; 41 | services.ebn.tint2.enable = true; 42 | services.ebn.polybar.enable = false; 43 | services.xserver.enable = true; 44 | 45 | services.xserver.displayManager.sessionCommands = '' 46 | xrandr --output DP-0 --mode 3440x1440 --rate 99.98 47 | hsetroot -solid '#ebebeb' 48 | xset r rate 150 25 49 | ${pkgs.xorg.xrdb}/bin/xrdb -merge <${pkgs.writeText "Xresources" '' 50 | Emacs.menuBar: false 51 | Emacs.toolBar: false 52 | Emacs.verticalScrollBars: false 53 | Xft.dpi: 96 54 | URxvt*geometry: 240x84 55 | URxvt.font: xft:Iosevka:size=13 56 | URxvt.scrollBar: false 57 | URxvt.clipboard.autocopy: true 58 | URxvt.keysym.M-c: perl:clipboard:copy 59 | URxvt.keysym.M-v: perl:clipboard:paste 60 | 61 | ! special 62 | *.foreground: #2e3338 63 | *.background: #f7f7f7 64 | *.cursorColor: #464646 65 | 66 | ! black 67 | *.color0: #101010 68 | *.color8: #2e3338 69 | 70 | ! red 71 | *.color1: #7c7c7c 72 | *.color9: #7c7c7c 73 | 74 | ! green 75 | *.color2: #8e8e8e 76 | *.color10: #8e8e8e 77 | 78 | ! yellow 79 | *.color3: #a0a0a0 80 | *.color11: #a0a0a0 81 | 82 | ! blue 83 | *.color4: #525252 84 | *.color12: #525252 85 | 86 | ! magenta 87 | *.color5: #5c3e99 88 | *.color13: #5c3e99 89 | 90 | ! cyan 91 | *.color6: #868686 92 | *.color14: #868686 93 | 94 | ! white 95 | *.color7: #b9b9b9 96 | *.color15: #f7f7f7 97 | ''} 98 | ''; 99 | 100 | services.ebn.syncthing.enable = true; 101 | services.ebn.pulseeffects.enable = true; 102 | services.xserver.videoDrivers = [ "nvidia" ]; 103 | services.xserver.layout = "se"; 104 | services.fstrim.enable = true; 105 | 106 | fonts.fonts = with pkgs; [ 107 | #etBook 108 | eb-garamond 109 | google-fonts 110 | hack-font 111 | iosevka 112 | #ebn.iosevka-custom 113 | jetbrains-mono 114 | #victor-mono 115 | oldstandard 116 | gyre-fonts 117 | #libre-baskerville 118 | siji 119 | cm_unicode 120 | bakoma_ttf 121 | lmmath 122 | #proggyfonts 123 | #tamsyn 124 | #julia-mono 125 | #recursive 126 | fantasque-sans-mono 127 | monoid 128 | ]; 129 | 130 | # environment.variables.WEBKIT_DISABLE_COMPOSITING_MODE = "1"; # nyxt 131 | 132 | environment.systemPackages = with pkgs; [ 133 | zathura 134 | maxima 135 | #wxmaxima 136 | texlive.combined.scheme-full 137 | libreoffice 138 | playerctl 139 | gsettings-desktop-schemas 140 | gnumake 141 | obs-studio 142 | neofetch 143 | mpc_cli 144 | mpv 145 | feh 146 | discord 147 | gnome.gucharmap 148 | gimp 149 | rofi-pass 150 | kdenlive 151 | cowsay 152 | ncspot 153 | spotify-tui 154 | pavucontrol 155 | sage 156 | man-pages 157 | firefox 158 | qutebrowser 159 | tor 160 | tor-browser-bundle-bin 161 | trash-cli 162 | spotify 163 | guile_3_0 164 | texlab 165 | geogebra6 166 | gnome.gnome-boxes 167 | qemu_kvm 168 | lxappearance 169 | paper-icon-theme 170 | papirus-icon-theme 171 | lounge-gtk-theme 172 | pinentry 173 | pinentry-gtk2 174 | maim 175 | hsetroot 176 | ] 177 | ++ 178 | lib.lists.optional (! config.desktopEnvironment.ebn.gnome.enable) claws-mail; 179 | 180 | system.stateVersion = "20.03"; 181 | } 182 | -------------------------------------------------------------------------------- /hosts/yggdrasil/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, modulesPath, ... }: 2 | { 3 | imports = [ "${modulesPath}/installer/scan/not-detected.nix" 4 | ]; 5 | 6 | boot = { 7 | initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; 8 | initrd.kernelModules = [ ]; 9 | kernelModules = [ "kvm-intel" ]; 10 | extraModulePackages = [ ]; 11 | kernel.sysctl."net.ipv4.icmp_echo_ignore_broadcasts" = 1; 12 | }; 13 | 14 | # CPU 15 | nix.maxJobs = lib.mkDefault 8; 16 | powerManagement.cpuFreqGovernor = "performance"; 17 | hardware.cpu.intel.updateMicrocode = true; 18 | 19 | fileSystems."/" = 20 | { device = "/dev/disk/by-label/nixos"; 21 | fsType = "ext4"; 22 | }; 23 | 24 | fileSystems."/boot" = 25 | { device = "/dev/disk/by-label/boot"; 26 | fsType = "vfat"; 27 | }; 28 | 29 | swapDevices = 30 | [ { device = "/dev/disk/by-label/swap"; } 31 | ]; 32 | 33 | # High-DPI console 34 | console.font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz"; 35 | } 36 | -------------------------------------------------------------------------------- /lib/lib.nix: -------------------------------------------------------------------------------- 1 | lib: 2 | 3 | with lib; 4 | with lib.filesystem; 5 | with builtins; 6 | { 7 | listModulesRec = dir: filter (hasSuffix "default.nix") (listFilesRecursive dir); 8 | } 9 | -------------------------------------------------------------------------------- /lib/stdlib-extended.nix: -------------------------------------------------------------------------------- 1 | lib: 2 | let myLib = import ./.; 3 | in lib.extend (self: super: { ebn = myLib { lib = super; }; }) 4 | -------------------------------------------------------------------------------- /modules/desktopEnvironment/gnome/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let cfg = config.desktopEnvironment.ebn.gnome; 5 | usesNvidia = lib.lists.elem "nvidia" config.services.xserver.videoDrivers; 6 | in { 7 | options.desktopEnvironment.ebn.gnome = { 8 | enable = mkEnableOption "Enable Gnome"; 9 | withPopShell = mkEnableOption "Enable Pop-Shell"; 10 | }; 11 | 12 | config = mkIf cfg.enable { 13 | fonts.fonts = with pkgs; [ 14 | jetbrains-mono 15 | ]; 16 | 17 | hardware.nvidia.modesetting.enable = usesNvidia; 18 | hardware.opengl.enable = true; 19 | 20 | services.xserver = { 21 | enable = true; 22 | layout = "se"; 23 | displayManager.gdm = { 24 | enable = true; 25 | nvidiaWayland = usesNvidia; 26 | autoSuspend = false; 27 | }; 28 | desktopManager.gnome.enable = true; 29 | }; 30 | 31 | environment.etc."/egl/egl_external_platform.d/nvidia_wayland.json".text = '' 32 | "file_format_version" : "1.0.0", 33 | "ICD" : { 34 | "library_path" : "/run/opengl-driver/lib/libnvidia-egl-wayland.so" 35 | } 36 | ''; 37 | 38 | services.dbus.packages = [ pkgs.gnome3.dconf ]; 39 | services.udev.packages = [ pkgs.gnome3.gnome-settings-daemon ]; 40 | 41 | programs.xwayland.enable = true; 42 | programs.xwayland.package = pkgs.xwayland; 43 | environment.gnome.excludePackages = [ 44 | pkgs.gnome.cheese pkgs.gnome-photos pkgs.gnome.gnome-music 45 | #pkgs.gnome.gnome-terminal 46 | pkgs.gnome.gedit pkgs.epiphany pkgs.evince pkgs.gnome.gnome-characters pkgs.gnome.totem 47 | pkgs.gnome.tali pkgs.gnome.iagno pkgs.gnome.hitori pkgs.gnome.atomix pkgs.gnome-tour 48 | ]; 49 | 50 | programs.dconf.enable = true; 51 | 52 | environment.systemPackages = with pkgs; [ 53 | gnome.adwaita-icon-theme 54 | gnome.gnome-tweaks 55 | xwayland 56 | 57 | materia-theme 58 | orchis-theme 59 | nordic 60 | papirus-icon-theme 61 | gnome-breeze 62 | maia-icon-theme 63 | 64 | ] ++ lib.optionals cfg.withPopShell [ ebn.pop-shell ]; 65 | }; 66 | } 67 | -------------------------------------------------------------------------------- /modules/nix/converters.nix: -------------------------------------------------------------------------------- 1 | { 2 | paletteToKitty = p: '' 3 | active_tab_background #eee 4 | active_tab_foreground #000 5 | background ${p.background} 6 | color0 ${p.black} 7 | color1 ${p.red} 8 | color10 ${p.green} 9 | color11 ${p.yellow} 10 | color12 ${p.blue} 11 | color13 ${p.purple} 12 | color14 ${p.cyan} 13 | color15 ${p.white} 14 | color2 ${p.green} 15 | color3 ${p.yellow} 16 | color4 ${p.blue} 17 | color5 ${p.purple} 18 | color6 ${p.cyan} 19 | color7 ${p.white} 20 | color8 ${p.black} 21 | color9 ${p.red} 22 | cursor ${p.white} 23 | foreground ${p.foreground} 24 | ''; 25 | 26 | paletteToPolybar = p: '' 27 | [colors] 28 | background = ${p.background} 29 | purple = ${p.purple} 30 | white = ${p.white} 31 | foreground = ${p.foreground} 32 | foreground-alt = ${p.foreground-alt} 33 | black = ${p.black} 34 | yellow = ${p.yellow} 35 | alert = ${p.yellow} 36 | accent = ${p.accent} 37 | gray = ${p.gray} 38 | bg-dark = ${p.bg-dark} 39 | ''; 40 | } 41 | -------------------------------------------------------------------------------- /modules/nix/default.nix: -------------------------------------------------------------------------------- 1 | { config, options, lib, ... }: 2 | 3 | let 4 | mkOpt = type: default: lib.mkOption { inherit type default; }; 5 | palettes = import ./palettes.nix; 6 | converters = import ./converters.nix; 7 | cfg = config.ebn.themes; 8 | 9 | in 10 | { 11 | options = with lib; with types; { 12 | ebn.themes.enable = mkEnableOption "Enable themes"; 13 | ebn.themes.palette = mkOpt str "aurora"; 14 | }; 15 | 16 | config = 17 | let 18 | palette = 19 | if lib.hasAttr cfg.palette palettes then 20 | palettes.${cfg.palette} 21 | else palettes.aurora; 22 | in 23 | with converters; lib.mkIf cfg.enable { 24 | programs.ebn.kitty.extraConfig = paletteToKitty palette; 25 | services.ebn.polybar.extraConfig = paletteToPolybar palette; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /modules/nix/palettes.nix: -------------------------------------------------------------------------------- 1 | { 2 | aurora = { 3 | accent = "#bd93f9"; 4 | alert = "#ddb566"; 5 | # Old backgrounds 6 | #background = "#0a0d10"; 7 | #background = "#14191e"; 8 | #background = "#0c0f12"; 9 | background = "#080B0E"; 10 | bg-dark = "#181a23"; 11 | black = "#000"; 12 | foreground = "#e6e8ee"; 13 | foreground-alt = "#ebdbb2"; 14 | gray = "#7F7F7F"; 15 | purple = "#9d81ba"; 16 | white = "#e6e8ee"; 17 | yellow = "#ddb566"; 18 | red = "#b53f36"; 19 | green = "#5ab977"; 20 | blue = "#6C8BC9"; 21 | cyan = "#0D9C94"; 22 | }; 23 | 24 | modus-operandi = { 25 | accent = "#1111ee"; 26 | background = "#f6f8fa"; 27 | bg-dark = "#000000"; 28 | black = "#222222"; 29 | blue = "#1111ee"; 30 | cyan = "#205b93"; 31 | foreground = "#000000"; 32 | foreground-alt = "#1111ee"; 33 | gray = "#7F7F7F"; 34 | green = "#006800"; 35 | purple = "#7000e0"; 36 | red = "#b60000"; 37 | white = "#fff"; 38 | yellow = "#904200"; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /modules/programs/bash/config/bashrc: -------------------------------------------------------------------------------- 1 | # /etc/bash/bashrc 2 | # 3 | # This file is sourced by all *interactive* bash shells on startup, 4 | # including some apparently interactive shells such as scp and rcp 5 | # that can't tolerate any output. So make sure this doesn't display 6 | # anything or bad things will happen ! 7 | 8 | # Test for an interactive shell. There is no need to set anything 9 | # past this point for scp and rcp, and it's important to refrain from 10 | # outputting anything in those cases. 11 | if [[ $- != *i* ]]; then 12 | # Shell is non-interactive. Be done now! 13 | return 14 | fi 15 | 16 | # Bash won't get SIGWINCH if another process is in the foreground. 17 | # Enable checkwinsize so that bash will check the terminal size when 18 | # it regains control. #65623 19 | # http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11) 20 | shopt -s checkwinsize 21 | 22 | # Disable completion when the input buffer is empty. i.e. Hitting tab 23 | # and waiting a long time for bash to expand all of $PATH. 24 | # shopt -s no_empty_cmd_completion 25 | 26 | # Enable history appending instead of overwriting when exiting. #139609 27 | shopt -s histappend 28 | 29 | # Env Vars 30 | export PATH="$HOME/.local/bin:$PATH" 31 | export PATH="$HOME/.emacs.d/bin:$PATH" 32 | 33 | export GITUSER="$(git config -f $HOME/.config/git/config --get user.name)" 34 | export DOTFILES="$HOME/repos/github.com/$GITUSER/nixos-config" 35 | export GHREPOS="$HOME/repos/github.com/$GITUSER/" 36 | 37 | alias grep='grep --colour=auto' 38 | alias egrep='egrep --colour=auto' 39 | alias fgrep='fgrep --colour=auto' 40 | alias du='du -h -a --total' 41 | alias la='ls -al' 42 | alias free='free -h' 43 | alias dots='cd ${DOTFILES}' 44 | alias nb='nix build' 45 | alias v='nvim' 46 | alias vim='nvim' 47 | alias vi='nvim' 48 | alias gs='git status' 49 | alias ga='git add' 50 | alias gc='git commit' 51 | alias gp='git push' 52 | 53 | p() { 54 | cd $(find $GHREPOS -maxdepth 1 ! -path $GHREPOS -type d | fzf) 55 | } 56 | 57 | # Prompt 58 | PROMPT_LONG=70 59 | PROMPT_MAX=95 60 | 61 | __ps1() { 62 | PS1="┌─[\[\e[01;35m\]\u\[\e[00m\]@\[\e[01;35m\]\h\[\e[00m\]:\[\e[1;34m\]\w\[\e[0m\]]\n└─╼ " 63 | } 64 | 65 | PROMPT_COMMAND="__ps1" 66 | -------------------------------------------------------------------------------- /modules/programs/bash/config/completions: -------------------------------------------------------------------------------- 1 | _starship() { 2 | local i cur prev opts cmds 3 | COMPREPLY=() 4 | cur="${COMP_WORDS[COMP_CWORD]}" 5 | prev="${COMP_WORDS[COMP_CWORD-1]}" 6 | cmd="" 7 | opts="" 8 | 9 | for i in ${COMP_WORDS[@]} 10 | do 11 | case "${i}" in 12 | starship) 13 | cmd="starship" 14 | ;; 15 | 16 | bug-report) 17 | cmd+="__bug__report" 18 | ;; 19 | completions) 20 | cmd+="__completions" 21 | ;; 22 | config) 23 | cmd+="__config" 24 | ;; 25 | configure) 26 | cmd+="__configure" 27 | ;; 28 | explain) 29 | cmd+="__explain" 30 | ;; 31 | help) 32 | cmd+="__help" 33 | ;; 34 | init) 35 | cmd+="__init" 36 | ;; 37 | module) 38 | cmd+="__module" 39 | ;; 40 | print-config) 41 | cmd+="__print__config" 42 | ;; 43 | prompt) 44 | cmd+="__prompt" 45 | ;; 46 | session) 47 | cmd+="__session" 48 | ;; 49 | time) 50 | cmd+="__time" 51 | ;; 52 | timings) 53 | cmd+="__timings" 54 | ;; 55 | toggle) 56 | cmd+="__toggle" 57 | ;; 58 | *) 59 | ;; 60 | esac 61 | done 62 | 63 | case "${cmd}" in 64 | starship) 65 | opts=" -h -V --help --version init prompt module config print-config toggle bug-report time explain timings completions session help configure" 66 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then 67 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 68 | return 0 69 | fi 70 | case "${prev}" in 71 | 72 | *) 73 | COMPREPLY=() 74 | ;; 75 | esac 76 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 77 | return 0 78 | ;; 79 | 80 | starship__bug__report) 81 | opts=" -h -V --help --version " 82 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 83 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 84 | return 0 85 | fi 86 | case "${prev}" in 87 | 88 | *) 89 | COMPREPLY=() 90 | ;; 91 | esac 92 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 93 | return 0 94 | ;; 95 | starship__completions) 96 | opts=" -h -V --help --version " 97 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 98 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 99 | return 0 100 | fi 101 | case "${prev}" in 102 | 103 | *) 104 | COMPREPLY=() 105 | ;; 106 | esac 107 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 108 | return 0 109 | ;; 110 | starship__config) 111 | opts=" -h -V --help --version " 112 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 113 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 114 | return 0 115 | fi 116 | case "${prev}" in 117 | 118 | *) 119 | COMPREPLY=() 120 | ;; 121 | esac 122 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 123 | return 0 124 | ;; 125 | starship__configure) 126 | opts=" -h -V --help --version " 127 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 128 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 129 | return 0 130 | fi 131 | case "${prev}" in 132 | 133 | *) 134 | COMPREPLY=() 135 | ;; 136 | esac 137 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 138 | return 0 139 | ;; 140 | starship__explain) 141 | opts=" -h -V --help --version " 142 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 143 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 144 | return 0 145 | fi 146 | case "${prev}" in 147 | 148 | *) 149 | COMPREPLY=() 150 | ;; 151 | esac 152 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 153 | return 0 154 | ;; 155 | starship__help) 156 | opts=" -h -V --help --version " 157 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 158 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 159 | return 0 160 | fi 161 | case "${prev}" in 162 | 163 | *) 164 | COMPREPLY=() 165 | ;; 166 | esac 167 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 168 | return 0 169 | ;; 170 | starship__init) 171 | opts=" -h -V --print-full-init --help --version " 172 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 173 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 174 | return 0 175 | fi 176 | case "${prev}" in 177 | 178 | *) 179 | COMPREPLY=() 180 | ;; 181 | esac 182 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 183 | return 0 184 | ;; 185 | starship__module) 186 | opts=" -l -h -V -s -p -P -d -k -j --list --help --version --status --path --logical-path --cmd-duration --keymap --jobs " 187 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 188 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 189 | return 0 190 | fi 191 | case "${prev}" in 192 | 193 | --status) 194 | COMPREPLY=($(compgen -f "${cur}")) 195 | return 0 196 | ;; 197 | -s) 198 | COMPREPLY=($(compgen -f "${cur}")) 199 | return 0 200 | ;; 201 | --path) 202 | COMPREPLY=($(compgen -f "${cur}")) 203 | return 0 204 | ;; 205 | -p) 206 | COMPREPLY=($(compgen -f "${cur}")) 207 | return 0 208 | ;; 209 | --logical-path) 210 | COMPREPLY=($(compgen -f "${cur}")) 211 | return 0 212 | ;; 213 | -P) 214 | COMPREPLY=($(compgen -f "${cur}")) 215 | return 0 216 | ;; 217 | --cmd-duration) 218 | COMPREPLY=($(compgen -f "${cur}")) 219 | return 0 220 | ;; 221 | -d) 222 | COMPREPLY=($(compgen -f "${cur}")) 223 | return 0 224 | ;; 225 | --keymap) 226 | COMPREPLY=($(compgen -f "${cur}")) 227 | return 0 228 | ;; 229 | -k) 230 | COMPREPLY=($(compgen -f "${cur}")) 231 | return 0 232 | ;; 233 | --jobs) 234 | COMPREPLY=($(compgen -f "${cur}")) 235 | return 0 236 | ;; 237 | -j) 238 | COMPREPLY=($(compgen -f "${cur}")) 239 | return 0 240 | ;; 241 | *) 242 | COMPREPLY=() 243 | ;; 244 | esac 245 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 246 | return 0 247 | ;; 248 | starship__print__config) 249 | opts=" -d -h -V --default --help --version " 250 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 251 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 252 | return 0 253 | fi 254 | case "${prev}" in 255 | 256 | *) 257 | COMPREPLY=() 258 | ;; 259 | esac 260 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 261 | return 0 262 | ;; 263 | starship__prompt) 264 | opts=" -h -V -s -p -P -d -k -j --help --version --status --path --logical-path --cmd-duration --keymap --jobs " 265 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 266 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 267 | return 0 268 | fi 269 | case "${prev}" in 270 | 271 | --status) 272 | COMPREPLY=($(compgen -f "${cur}")) 273 | return 0 274 | ;; 275 | -s) 276 | COMPREPLY=($(compgen -f "${cur}")) 277 | return 0 278 | ;; 279 | --path) 280 | COMPREPLY=($(compgen -f "${cur}")) 281 | return 0 282 | ;; 283 | -p) 284 | COMPREPLY=($(compgen -f "${cur}")) 285 | return 0 286 | ;; 287 | --logical-path) 288 | COMPREPLY=($(compgen -f "${cur}")) 289 | return 0 290 | ;; 291 | -P) 292 | COMPREPLY=($(compgen -f "${cur}")) 293 | return 0 294 | ;; 295 | --cmd-duration) 296 | COMPREPLY=($(compgen -f "${cur}")) 297 | return 0 298 | ;; 299 | -d) 300 | COMPREPLY=($(compgen -f "${cur}")) 301 | return 0 302 | ;; 303 | --keymap) 304 | COMPREPLY=($(compgen -f "${cur}")) 305 | return 0 306 | ;; 307 | -k) 308 | COMPREPLY=($(compgen -f "${cur}")) 309 | return 0 310 | ;; 311 | --jobs) 312 | COMPREPLY=($(compgen -f "${cur}")) 313 | return 0 314 | ;; 315 | -j) 316 | COMPREPLY=($(compgen -f "${cur}")) 317 | return 0 318 | ;; 319 | *) 320 | COMPREPLY=() 321 | ;; 322 | esac 323 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 324 | return 0 325 | ;; 326 | starship__session) 327 | opts=" -h -V --help --version " 328 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 329 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 330 | return 0 331 | fi 332 | case "${prev}" in 333 | 334 | *) 335 | COMPREPLY=() 336 | ;; 337 | esac 338 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 339 | return 0 340 | ;; 341 | starship__time) 342 | opts=" -h -V --help --version " 343 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 344 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 345 | return 0 346 | fi 347 | case "${prev}" in 348 | 349 | *) 350 | COMPREPLY=() 351 | ;; 352 | esac 353 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 354 | return 0 355 | ;; 356 | starship__timings) 357 | opts=" -h -V --help --version " 358 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 359 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 360 | return 0 361 | fi 362 | case "${prev}" in 363 | 364 | *) 365 | COMPREPLY=() 366 | ;; 367 | esac 368 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 369 | return 0 370 | ;; 371 | starship__toggle) 372 | opts=" -h -V --help --version " 373 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then 374 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 375 | return 0 376 | fi 377 | case "${prev}" in 378 | 379 | *) 380 | COMPREPLY=() 381 | ;; 382 | esac 383 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) 384 | return 0 385 | ;; 386 | esac 387 | } 388 | 389 | complete -F _starship -o bashdefault -o default starship 390 | -------------------------------------------------------------------------------- /modules/programs/bash/config/starship.toml: -------------------------------------------------------------------------------- 1 | # Warning: This config does not include keys that have an unset value 2 | format = '$all' 3 | scan_timeout = 30 4 | command_timeout = 500 5 | add_newline = true 6 | 7 | [aws] 8 | format = 'on [$symbol($profile )(\($region\) )(\[$duration\])]($style)' 9 | symbol = '☁️ ' 10 | style = 'bold yellow' 11 | disabled = true 12 | expiration_symbol = 'X' 13 | 14 | [aws.region_aliases] 15 | 16 | [battery] 17 | disabled = true 18 | 19 | [character] 20 | format = '$symbol ' 21 | success_symbol = '[λ](bold purple)' 22 | error_symbol = '[❯](bold red)' 23 | vicmd_symbol = '[❮](bold green)' 24 | disabled = false 25 | 26 | [cmake] 27 | format = 'via [$symbol($version )]($style)' 28 | version_format = 'v${raw}' 29 | symbol = '△ ' 30 | style = 'bold blue' 31 | disabled = false 32 | detect_extensions = [] 33 | detect_files = [ 34 | 'CMakeLists.txt', 35 | 'CMakeCache.txt', 36 | ] 37 | detect_folders = [] 38 | 39 | [cmd_duration] 40 | min_time = 2000 41 | format = 'took [$duration]($style) ' 42 | style = 'yellow bold' 43 | show_milliseconds = false 44 | disabled = true 45 | show_notifications = false 46 | min_time_to_notify = 45000 47 | 48 | [conda] 49 | truncation_length = 1 50 | format = 'via [$symbol$environment]($style) ' 51 | symbol = '🅒 ' 52 | style = 'green bold' 53 | ignore_base = true 54 | disabled = false 55 | 56 | [crystal] 57 | format = 'via [$symbol($version )]($style)' 58 | version_format = 'v${raw}' 59 | symbol = '🔮 ' 60 | style = 'bold red' 61 | disabled = false 62 | detect_extensions = ['cr'] 63 | detect_files = ['shard.yml'] 64 | detect_folders = [] 65 | 66 | [dart] 67 | format = 'via [$symbol($version )]($style)' 68 | version_format = 'v${raw}' 69 | symbol = '🎯 ' 70 | style = 'bold blue' 71 | disabled = false 72 | detect_extensions = ['dart'] 73 | detect_files = [ 74 | 'pubspec.yaml', 75 | 'pubspec.yml', 76 | 'pubspec.lock', 77 | ] 78 | detect_folders = ['.dart_tool'] 79 | 80 | [deno] 81 | format = 'via [$symbol($version )]($style)' 82 | version_format = 'v${raw}' 83 | symbol = '🦕 ' 84 | style = 'green bold' 85 | disabled = false 86 | detect_extensions = [] 87 | detect_files = [ 88 | 'mod.ts', 89 | 'deps.ts', 90 | 'mod.js', 91 | 'deps.js', 92 | ] 93 | detect_folders = [] 94 | 95 | [directory] 96 | truncation_length = 3 97 | truncate_to_repo = true 98 | fish_style_pwd_dir_length = 0 99 | use_logical_path = true 100 | format = '[$path]($style)[$read_only]($read_only_style) ' 101 | style = 'cyan bold' 102 | disabled = false 103 | read_only = '🔒' 104 | read_only_style = 'red' 105 | truncation_symbol = '' 106 | home_symbol = '~' 107 | 108 | [directory.substitutions] 109 | 110 | [docker_context] 111 | symbol = '🐳 ' 112 | style = 'blue bold' 113 | format = 'via [$symbol$context]($style) ' 114 | only_with_files = true 115 | disabled = false 116 | detect_extensions = [] 117 | detect_files = [ 118 | 'docker-compose.yml', 119 | 'docker-compose.yaml', 120 | 'Dockerfile', 121 | ] 122 | detect_folders = [] 123 | 124 | [dotnet] 125 | format = 'via [$symbol($version )(🎯 $tfm )]($style)' 126 | version_format = 'v${raw}' 127 | symbol = '.NET ' 128 | style = 'blue bold' 129 | heuristic = true 130 | disabled = false 131 | detect_extensions = [ 132 | 'csproj', 133 | 'fsproj', 134 | 'xproj', 135 | ] 136 | detect_files = [ 137 | 'global.json', 138 | 'project.json', 139 | 'Directory.Build.props', 140 | 'Directory.Build.targets', 141 | 'Packages.props', 142 | ] 143 | detect_folders = [] 144 | 145 | [elixir] 146 | format = 'via [$symbol($version \(OTP $otp_version\) )]($style)' 147 | version_format = 'v${raw}' 148 | symbol = '💧 ' 149 | style = 'bold purple' 150 | disabled = false 151 | detect_extensions = [] 152 | detect_files = ['mix.exs'] 153 | detect_folders = [] 154 | 155 | [elm] 156 | format = 'via [$symbol($version )]($style)' 157 | version_format = 'v${raw}' 158 | symbol = '🌳 ' 159 | style = 'cyan bold' 160 | disabled = false 161 | detect_extensions = ['elm'] 162 | detect_files = [ 163 | 'elm.json', 164 | 'elm-package.json', 165 | '.elm-version', 166 | ] 167 | detect_folders = ['elm-stuff'] 168 | 169 | [env_var] 170 | 171 | [erlang] 172 | format = 'via [$symbol($version )]($style)' 173 | version_format = 'v${raw}' 174 | symbol = ' ' 175 | style = 'bold red' 176 | disabled = false 177 | detect_extensions = [] 178 | detect_files = [ 179 | 'rebar.config', 180 | 'erlang.mk', 181 | ] 182 | detect_folders = [] 183 | 184 | [gcloud] 185 | format = 'on [$symbol$account(@$domain)(\($region\))]($style) ' 186 | symbol = '☁️ ' 187 | style = 'bold blue' 188 | disabled = false 189 | 190 | [gcloud.region_aliases] 191 | 192 | [git_branch] 193 | format = 'on [$symbol$branch]($style)(:[$remote]($style)) ' 194 | symbol = ' ' 195 | style = 'bold purple' 196 | truncation_length = 9223372036854775807 197 | truncation_symbol = '…' 198 | only_attached = false 199 | always_show_remote = false 200 | disabled = false 201 | 202 | [git_commit] 203 | commit_hash_length = 7 204 | format = '[\($hash$tag\)]($style) ' 205 | style = 'green bold' 206 | only_detached = true 207 | disabled = false 208 | tag_symbol = ' 🏷 ' 209 | tag_disabled = true 210 | 211 | [git_metrics] 212 | added_style = 'bold green' 213 | deleted_style = 'bold red' 214 | format = '[+$added]($added_style) [-$deleted]($deleted_style) ' 215 | disabled = true 216 | 217 | [git_state] 218 | rebase = 'REBASING' 219 | merge = 'MERGING' 220 | revert = 'REVERTING' 221 | cherry_pick = 'CHERRY-PICKING' 222 | bisect = 'BISECTING' 223 | am = 'AM' 224 | am_or_rebase = 'AM/REBASE' 225 | style = 'bold yellow' 226 | format = '\([$state( $progress_current/$progress_total)]($style)\) ' 227 | disabled = false 228 | 229 | [git_status] 230 | format = '([\[$all_status$ahead_behind\]]($style) )' 231 | style = 'red bold' 232 | stashed = '\$' 233 | ahead = '⇡' 234 | behind = '⇣' 235 | diverged = '⇕' 236 | conflicted = '=' 237 | deleted = '✘' 238 | renamed = '»' 239 | modified = '!' 240 | staged = '+' 241 | untracked = '?' 242 | disabled = false 243 | 244 | [golang] 245 | format = 'via [$symbol($version )]($style)' 246 | version_format = 'v${raw}' 247 | symbol = '🐹 ' 248 | style = 'bold cyan' 249 | disabled = false 250 | detect_extensions = ['go'] 251 | detect_files = [ 252 | 'go.mod', 253 | 'go.sum', 254 | 'glide.yaml', 255 | 'Gopkg.yml', 256 | 'Gopkg.lock', 257 | '.go-version', 258 | ] 259 | detect_folders = ['Godeps'] 260 | 261 | [helm] 262 | format = 'via [$symbol($version )]($style)' 263 | version_format = 'v${raw}' 264 | symbol = '⎈ ' 265 | style = 'bold white' 266 | disabled = false 267 | detect_extensions = [] 268 | detect_files = [ 269 | 'helmfile.yaml', 270 | 'Chart.yaml', 271 | ] 272 | detect_folders = [] 273 | 274 | [hg_branch] 275 | symbol = ' ' 276 | style = 'bold purple' 277 | format = 'on [$symbol$branch]($style) ' 278 | truncation_length = 9223372036854775807 279 | truncation_symbol = '…' 280 | disabled = true 281 | 282 | [hostname] 283 | ssh_only = true 284 | trim_at = '.' 285 | format = '[$hostname]($style) in ' 286 | style = 'green dimmed bold' 287 | disabled = false 288 | 289 | [java] 290 | disabled = false 291 | format = 'via [$symbol($version )]($style)' 292 | version_format = 'v${raw}' 293 | style = 'red dimmed' 294 | symbol = '☕ ' 295 | detect_extensions = [ 296 | 'java', 297 | 'class', 298 | 'jar', 299 | 'gradle', 300 | 'clj', 301 | 'cljc', 302 | ] 303 | detect_files = [ 304 | 'pom.xml', 305 | 'build.gradle.kts', 306 | 'build.sbt', 307 | '.java-version', 308 | 'deps.edn', 309 | 'project.clj', 310 | 'build.boot', 311 | ] 312 | detect_folders = [] 313 | 314 | [jobs] 315 | threshold = 1 316 | format = '[$symbol$number]($style) ' 317 | symbol = '✦' 318 | style = 'bold blue' 319 | disabled = false 320 | 321 | [julia] 322 | format = 'via [$symbol($version )]($style)' 323 | version_format = 'v${raw}' 324 | symbol = 'ஃ ' 325 | style = 'bold purple' 326 | disabled = false 327 | detect_extensions = ['jl'] 328 | detect_files = [ 329 | 'Project.toml', 330 | 'Manifest.toml', 331 | ] 332 | detect_folders = [] 333 | 334 | [kotlin] 335 | format = 'via [$symbol($version )]($style)' 336 | version_format = 'v${raw}' 337 | symbol = '🅺 ' 338 | style = 'bold blue' 339 | kotlin_binary = 'kotlin' 340 | disabled = false 341 | detect_extensions = [ 342 | 'kt', 343 | 'kts', 344 | ] 345 | detect_files = [] 346 | detect_folders = [] 347 | 348 | [kubernetes] 349 | symbol = '☸ ' 350 | format = '[$symbol$context( \($namespace\))]($style) in ' 351 | style = 'cyan bold' 352 | disabled = true 353 | 354 | [kubernetes.context_aliases] 355 | 356 | [lua] 357 | format = 'via [$symbol($version )]($style)' 358 | version_format = 'v${raw}' 359 | symbol = '🌙 ' 360 | style = 'bold blue' 361 | lua_binary = 'lua' 362 | disabled = false 363 | detect_extensions = ['lua'] 364 | detect_files = ['.lua-version'] 365 | detect_folders = ['lua'] 366 | 367 | [memory_usage] 368 | threshold = 75 369 | format = 'via $symbol[$ram( | $swap)]($style) ' 370 | style = 'white bold dimmed' 371 | symbol = '🐏 ' 372 | disabled = true 373 | 374 | [nim] 375 | format = 'via [$symbol($version )]($style)' 376 | version_format = 'v${raw}' 377 | symbol = '👑 ' 378 | style = 'yellow bold' 379 | disabled = false 380 | detect_extensions = [ 381 | 'nim', 382 | 'nims', 383 | 'nimble', 384 | ] 385 | detect_files = ['nim.cfg'] 386 | detect_folders = [] 387 | 388 | [nix_shell] 389 | format = 'via [$symbol$state(\($name\))]($style) ' 390 | symbol = '' 391 | style = 'black' 392 | impure_msg = '' 393 | pure_msg = 'pure' 394 | disabled = false 395 | 396 | [nodejs] 397 | format = 'via [$symbol($version )]($style)' 398 | version_format = 'v${raw}' 399 | symbol = ' ' 400 | style = 'bold green' 401 | disabled = false 402 | not_capable_style = 'bold red' 403 | detect_extensions = [ 404 | 'js', 405 | 'mjs', 406 | 'cjs', 407 | 'ts', 408 | ] 409 | detect_files = [ 410 | 'package.json', 411 | '.node-version', 412 | '.nvmrc', 413 | ] 414 | detect_folders = ['node_modules'] 415 | 416 | [ocaml] 417 | format = 'via [$symbol($version )(\($switch_indicator$switch_name\) )]($style)' 418 | version_format = 'v${raw}' 419 | global_switch_indicator = '' 420 | local_switch_indicator = '*' 421 | symbol = '🐫 ' 422 | style = 'bold yellow' 423 | disabled = false 424 | detect_extensions = [ 425 | 'opam', 426 | 'ml', 427 | 'mli', 428 | 're', 429 | 'rei', 430 | ] 431 | detect_files = [ 432 | 'dune', 433 | 'dune-project', 434 | 'jbuild', 435 | 'jbuild-ignore', 436 | '.merlin', 437 | ] 438 | detect_folders = [ 439 | '_opam', 440 | 'esy.lock', 441 | ] 442 | 443 | [openstack] 444 | format = 'on [$symbol$cloud(\($project\))]($style) ' 445 | symbol = '☁️ ' 446 | style = 'bold yellow' 447 | disabled = false 448 | 449 | [package] 450 | format = 'is [$symbol$version]($style) ' 451 | symbol = '📦 ' 452 | style = '208 bold' 453 | display_private = false 454 | disabled = false 455 | 456 | [perl] 457 | format = 'via [$symbol($version )]($style)' 458 | version_format = 'v${raw}' 459 | symbol = '🐪 ' 460 | style = '149 bold' 461 | disabled = false 462 | detect_extensions = [ 463 | 'pl', 464 | 'pm', 465 | 'pod', 466 | ] 467 | detect_files = [ 468 | 'Makefile.PL', 469 | 'Build.PL', 470 | 'cpanfile', 471 | 'cpanfile.snapshot', 472 | 'META.json', 473 | 'META.yml', 474 | '.perl-version', 475 | ] 476 | detect_folders = [] 477 | 478 | [php] 479 | format = 'via [$symbol($version )]($style)' 480 | version_format = 'v${raw}' 481 | symbol = '🐘 ' 482 | style = '147 bold' 483 | disabled = false 484 | detect_extensions = ['php'] 485 | detect_files = [ 486 | 'composer.json', 487 | '.php-version', 488 | ] 489 | detect_folders = [] 490 | 491 | [purescript] 492 | format = 'via [$symbol($version )]($style)' 493 | version_format = 'v${raw}' 494 | symbol = '<=> ' 495 | style = 'bold white' 496 | disabled = false 497 | detect_extensions = ['purs'] 498 | detect_files = ['spago.dhall'] 499 | detect_folders = [] 500 | 501 | [python] 502 | pyenv_version_name = false 503 | pyenv_prefix = 'pyenv ' 504 | python_binary = [ 505 | 'python', 506 | 'python3', 507 | 'python2', 508 | ] 509 | format = 'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)' 510 | version_format = 'v${raw}' 511 | style = 'yellow bold' 512 | symbol = '🐍 ' 513 | disabled = false 514 | detect_extensions = ['py'] 515 | detect_files = [ 516 | 'requirements.txt', 517 | '.python-version', 518 | 'pyproject.toml', 519 | 'Pipfile', 520 | 'tox.ini', 521 | 'setup.py', 522 | '__init__.py', 523 | ] 524 | detect_folders = [] 525 | 526 | [rlang] 527 | format = 'via [$symbol($version )]($style)' 528 | version_format = 'v${raw}' 529 | style = 'blue bold' 530 | symbol = '📐 ' 531 | disabled = false 532 | detect_extensions = [ 533 | 'R', 534 | 'Rd', 535 | 'Rmd', 536 | 'Rproj', 537 | 'Rsx', 538 | ] 539 | detect_files = ['.Rprofile'] 540 | detect_folders = ['.Rproj.user'] 541 | 542 | [red] 543 | format = 'via [$symbol($version )]($style)' 544 | symbol = '🔺 ' 545 | style = 'red bold' 546 | disabled = false 547 | detect_extensions = [ 548 | 'red', 549 | 'reds', 550 | ] 551 | detect_files = [] 552 | detect_folders = [] 553 | 554 | [ruby] 555 | format = 'via [$symbol($version )]($style)' 556 | version_format = 'v${raw}' 557 | symbol = '💎 ' 558 | style = 'bold red' 559 | disabled = false 560 | detect_extensions = ['rb'] 561 | detect_files = [ 562 | 'Gemfile', 563 | '.ruby-version', 564 | ] 565 | detect_folders = [] 566 | 567 | [rust] 568 | format = 'via [$symbol($version )]($style)' 569 | version_format = 'v${raw}' 570 | symbol = '🦀 ' 571 | style = 'bold red' 572 | disabled = false 573 | detect_extensions = ['rs'] 574 | detect_files = ['Cargo.toml'] 575 | detect_folders = [] 576 | 577 | [scala] 578 | format = 'via [$symbol($version )]($style)' 579 | version_format = 'v${raw}' 580 | disabled = false 581 | style = 'red bold' 582 | symbol = '🆂 ' 583 | detect_extensions = [ 584 | 'sbt', 585 | 'scala', 586 | ] 587 | detect_files = [ 588 | '.scalaenv', 589 | '.sbtenv', 590 | 'build.sbt', 591 | ] 592 | detect_folders = ['.metals'] 593 | 594 | [shell] 595 | format = '$indicator ' 596 | bash_indicator = 'bsh' 597 | fish_indicator = 'fsh' 598 | zsh_indicator = 'zsh' 599 | powershell_indicator = 'psh' 600 | ion_indicator = 'ion' 601 | elvish_indicator = 'esh' 602 | tcsh_indicator = 'tsh' 603 | nu_indicator = 'nu' 604 | unknown_indicator = '' 605 | disabled = true 606 | 607 | [shlvl] 608 | threshold = 2 609 | format = '[$symbol$shlvl]($style) ' 610 | symbol = '↕️ ' 611 | repeat = false 612 | style = 'bold yellow' 613 | disabled = true 614 | 615 | [singularity] 616 | symbol = '' 617 | format = '[$symbol\[$env\]]($style) ' 618 | style = 'blue bold dimmed' 619 | disabled = false 620 | 621 | [status] 622 | format = '[$symbol$status]($style) ' 623 | symbol = '✖' 624 | not_executable_symbol = '🚫' 625 | not_found_symbol = '🔍' 626 | sigint_symbol = '🧱' 627 | signal_symbol = '⚡' 628 | style = 'bold red' 629 | map_symbol = false 630 | recognize_signal_code = true 631 | disabled = true 632 | 633 | [swift] 634 | format = 'via [$symbol($version )]($style)' 635 | version_format = 'v${raw}' 636 | symbol = '🐦 ' 637 | style = 'bold 202' 638 | disabled = false 639 | detect_extensions = ['swift'] 640 | detect_files = ['Package.swift'] 641 | detect_folders = [] 642 | 643 | [terraform] 644 | format = 'via [$symbol$workspace]($style) ' 645 | version_format = 'v${raw}' 646 | symbol = '💠 ' 647 | style = 'bold 105' 648 | disabled = false 649 | detect_extensions = [ 650 | 'tf', 651 | 'hcl', 652 | ] 653 | detect_files = [] 654 | detect_folders = ['.terraform'] 655 | 656 | [time] 657 | format = 'at [$time]($style) ' 658 | style = 'bold yellow' 659 | use_12hr = false 660 | disabled = true 661 | utc_time_offset = 'local' 662 | time_range = '-' 663 | 664 | [username] 665 | format = '[$user]($style) in ' 666 | style_root = 'red bold' 667 | style_user = 'yellow bold' 668 | show_always = false 669 | disabled = false 670 | 671 | [vlang] 672 | format = 'via [$symbol($version )]($style)' 673 | symbol = 'V ' 674 | style = 'blue bold' 675 | disabled = false 676 | detect_extensions = ['v'] 677 | detect_files = [ 678 | 'v.mod', 679 | 'vpkg.json', 680 | '.vpkg-lock.json', 681 | ] 682 | detect_folders = [] 683 | 684 | [vagrant] 685 | format = 'via [$symbol($version )]($style)' 686 | version_format = 'v${raw}' 687 | symbol = '⍱ ' 688 | style = 'cyan bold' 689 | disabled = false 690 | detect_extensions = [] 691 | detect_files = ['Vagrantfile'] 692 | detect_folders = [] 693 | 694 | [zig] 695 | format = 'via [$symbol($version )]($style)' 696 | version_format = 'v${raw}' 697 | symbol = '↯ ' 698 | style = 'bold yellow' 699 | disabled = false 700 | detect_extensions = ['zig'] 701 | detect_files = [] 702 | detect_folders = [] 703 | 704 | [custom] 705 | 706 | -------------------------------------------------------------------------------- /modules/programs/bash/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.programs.ebn.bash; 6 | in { 7 | options.programs.ebn.bash = { 8 | enable = mkEnableOption "Enable Bash"; 9 | starship = { enable = mkEnableOption "Enable Starship Prompt"; }; 10 | extraConfig = mkOption { 11 | type = types.lines; 12 | default = ""; 13 | }; 14 | }; 15 | 16 | config = mkIf cfg.enable { 17 | 18 | fonts.fonts = 19 | (optionals cfg.starship.enable [ (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) ]); 20 | 21 | environment.systemPackages = [pkgs.direnv pkgs.nix-direnv pkgs.starship]; 22 | 23 | nix.extraOptions = '' 24 | keep-outputs = true 25 | keep-derivations = true 26 | ''; 27 | 28 | environment.pathsToLink = [ 29 | "/share/nix-direnv" 30 | ]; 31 | 32 | nixpkgs.overlays = [ 33 | (self: super: { nix-direnv = super.nix-direnv.override { enableFlakes = false; }; } ) 34 | ]; 35 | 36 | environment.etc.bashrc.text = 37 | if !cfg.starship.enable then 38 | builtins.readFile ./config/bashrc + '' 39 | eval "$(${pkgs.direnv}/bin/direnv hook bash)" 40 | ${cfg.extraConfig} 41 | '' 42 | else '' 43 | HISTSIZE=10000 44 | HISTFILESIZE=10000 45 | 46 | export GITUSER="$(git config -f $HOME/.config/git/config --get user.name)" 47 | export DOTFILES="$HOME/repos/github.com/$GITUSER/nixos-config" 48 | export GHREPOS="$HOME/repos/github.com/$GITUSER/" 49 | export STARSHIP_CONFIG=${pkgs.writeText "starship.toml" (builtins.readFile ./config/starship.toml)}; 50 | 51 | export EDITOR="emacs -nw" 52 | 53 | alias grep="grep --colour=auto" 54 | alias egrep="egrep --colour=auto" 55 | alias fgrep="fgrep --colour=auto" 56 | alias du="du -h -a --total" 57 | alias la="ls -al" 58 | alias nb="nix build" 59 | alias gs="git status" 60 | alias ga="git add" 61 | alias gc="git commit" 62 | alias gp="git push" 63 | alias free="free -h" 64 | 65 | p() { 66 | cd $(find $GHREPOS -maxdepth 1 ! -path $GHREPOS -type d | ${pkgs.fzf}/bin/fzf) 67 | } 68 | 69 | eval "$(${pkgs.direnv}/bin/direnv hook bash)" 70 | eval "$(${pkgs.starship}/bin/starship init bash)" 71 | source ${./config/completions} 72 | ''; 73 | }; 74 | 75 | } 76 | 77 | -------------------------------------------------------------------------------- /modules/programs/emacs/config/ebn-init.el: -------------------------------------------------------------------------------- 1 | ;;; ebn-init.el --- init -*- lexical-binding: t; no-byte-compile: nil; -*- 2 | ;;; Commentary: 3 | ;;; Code: 4 | 5 | ;;; Fonts: 6 | ;; This is much faster than using set-face-attribute 7 | (add-to-list 'default-frame-alist '(font . "Sarasa Mono CL-13.5")) 8 | (split-window-right (/ (window-width) 3)) 9 | 10 | ;;; Better defaults: 11 | (setq ring-bell-function 'ignore 12 | backup-directory-alist `((".*" . ,temporary-file-directory)) 13 | auto-save-file-name-transforms `((".*" ,temporary-file-directory t))) 14 | 15 | (setq-default 16 | fill-column 80 17 | left-margin-width 1 18 | sentence-end-double-space nil 19 | lisp-backquote-indentation nil 20 | blink-cursor-blinks 1 21 | fast-but-imprecise-scrolling t 22 | auto-save-interval 60 23 | kill-do-not-save-duplicates t 24 | bidi-paragraph-direction 'left-to-right 25 | bidi-inhibit-bpa t) 26 | 27 | (global-so-long-mode 1) 28 | (save-place-mode 1) 29 | (line-number-mode -1) 30 | ;(mouse-avoidance-mode 'cat-and-mouse) 31 | 32 | ;;; Functions: 33 | (defun ebn/--setup-variable-fonts () 34 | (interactive) 35 | (set-face-attribute 36 | 'variable-pitch nil 37 | :font (font-spec :family "Sarasa Mono CL" :size 18 :weight 'regular :slant 'normal)) 38 | 39 | (set-face-attribute 40 | 'fixed-pitch nil 41 | :font (font-spec :family "Sarasa Mono CL" :size 18))) 42 | 43 | (defun ebn/advice-unadvice (sym) 44 | "Remove all advices from symbol SYM." 45 | (interactive "aFunction symbol: ") 46 | (advice-mapc (lambda (advice _props) (advice-remove sym advice)) sym)) 47 | 48 | (cl-defmacro ebn/def-repeat-map (name &key keys exit-with) 49 | (declare (indent 0)) 50 | (let ((def-repeat-map-result nil)) 51 | (when exit-with 52 | (push `(define-key ,name ,(kbd exit-with) #'keyboard-quit) 53 | def-repeat-map-result)) 54 | (dolist (key (map-pairs keys)) 55 | (push `(define-key ,name ,(car key) ,(cdr key)) 56 | def-repeat-map-result) 57 | (push `(put ,(cdr key) 'repeat-map ',name) 58 | def-repeat-map-result)) 59 | `(progn 60 | (defvar ,name (make-sparse-keymap)) 61 | ,@def-repeat-map-result))) 62 | 63 | (defun ebn/open-line-below () 64 | "Open a newline below current line." 65 | (interactive) 66 | (move-end-of-line nil) 67 | (newline-and-indent)) 68 | 69 | (defun ebn/open-line-above () 70 | "Open a newline above current line." 71 | (interactive) 72 | (previous-line) 73 | (move-end-of-line nil) 74 | (newline-and-indent)) 75 | 76 | (defun ebn/kill-dwim () 77 | "Run the command `kill-region' on the current region 78 | or `kill-line' if there is no active region'" 79 | (interactive) 80 | (if (region-active-p) 81 | (kill-region (region-beginning) (region-end)) 82 | (kill-line))) 83 | 84 | (defun ebn/copy-dwim () 85 | "Run the command `kill-ring-save' on the current region 86 | or the current line if there is no active region." 87 | (interactive) 88 | (if (region-active-p) 89 | (kill-ring-save nil nil t) 90 | (kill-ring-save (point-at-bol) (point-at-eol)))) 91 | 92 | (defun ebn/wikipedia (query) 93 | "QUERY wikipedia" 94 | (interactive "sQuery: ") 95 | (eww (concat "https://en.wikipedia.org/wiki/" 96 | (replace-in-string query " " "_")))) 97 | 98 | (defun ebn/wikipedia-at-point () 99 | "Query wikipedia for thing at point." 100 | (interactive) 101 | (ebn/wikipedia (word-at-point))) 102 | 103 | (defun ebn/org-open-at-point () 104 | (interactive) 105 | (let ((browse-url-browser-function #'eww-browse-url)) 106 | (org-open-at-point))) 107 | 108 | (defun ebn/forward-to-paragraph () 109 | (interactive) 110 | (forward-paragraph) 111 | (forward-line 1)) 112 | 113 | (defun ebn/backward-to-paragraph () 114 | (interactive) 115 | (backward-paragraph 2) 116 | (forward-line 1)) 117 | 118 | (defun ebn/kill-dir-or-char () 119 | "Kill backward by word for directories else by char" 120 | (interactive) 121 | (if (looking-back "/") 122 | (backward-kill-word 1) 123 | (backward-delete-char 1))) 124 | 125 | (defun ebn/shell-command-on-region (command) 126 | (interactive "sCommand: ") 127 | (shell-command-on-region (region-beginning) (region-end) command nil t)) 128 | 129 | (defun ebn/comment-dwim () 130 | (interactive) 131 | (if (region-active-p) 132 | (comment-or-uncomment-region (region-beginning) (region-end)) 133 | (save-excursion 134 | (mark-paragraph) 135 | (comment-or-uncomment-region (region-beginning) (region-end))))) 136 | 137 | (defun ebn/bury-scratch-buffer () 138 | (if (string= (buffer-name) "*scratch*") 139 | (ignore (bury-buffer)) 140 | t)) 141 | (add-hook 'kill-buffer-query-functions 'ebn/bury-scratch-buffer) 142 | 143 | (defun ebn/dired-up-directory () 144 | "Up directory - killing current buffer." 145 | (interactive) 146 | (let ((cb (current-buffer))) 147 | (progn (dired-up-directory) 148 | (kill-buffer cb)))) 149 | 150 | (defun ebn/eval-and-replace () 151 | "Replace the preceding sexp with its value." 152 | (interactive) 153 | (let ((value (eval (elisp--preceding-sexp)))) 154 | (backward-kill-sexp) 155 | (insert (format "%S" value)))) 156 | 157 | (defun ebn/dired-open-file () 158 | "In dired, open the file named on this line." 159 | (interactive) 160 | (let* ((file (dired-get-filename nil t))) 161 | (message "Opening %s..." file) 162 | (call-process "xdg-open" nil 0 nil file) 163 | (message "Opening %s done" file))) 164 | 165 | (defun ebn/eval-prev-exp () 166 | (interactive) 167 | (unless (null command-history) (eval (car command-history)))) 168 | 169 | ;;; Packages: 170 | (use-package emacs 171 | :init 172 | ;; TAB cycle if there are only few candidates 173 | (setq completion-cycle-threshold 3) 174 | 175 | ;; Emacs 28: Hide commands in M-x which do not work in the current mode. 176 | ;; Corfu commands are hidden, since they are not supposed to be used via M-x. 177 | (setq read-extended-command-predicate 178 | #'command-completion-default-include-p) 179 | 180 | ;; Enable indentation+completion using the TAB key. 181 | ;; `completion-at-point' is often bound to M-TAB. 182 | (setq tab-always-indent 'complete) 183 | 184 | (setq tab-bar-close-button nil) 185 | (setq tab-bar-new-button nil) 186 | 187 | (put 'narrow-to-region 'disabled nil) 188 | 189 | (defun ebn/setup-minibuffer () 190 | (interactive) 191 | (electric-pair-local-mode -1)) 192 | (add-hook 'minibuffer-setup-hook 'ebn/setup-minibuffer) 193 | 194 | (defun ebn/back-to-mark () 195 | (interactive) 196 | (set-mark-command 0) 197 | (pulse-momentary-highlight-one-line)) 198 | 199 | :custom 200 | (delete-by-moving-to-trash t) 201 | (gdb-many-windows t) 202 | (gdb-show-main t) 203 | (delete-selection-mode t) 204 | (auto-save-visited-mode t) 205 | ;(save-place-mode t) 206 | (initial-scratch-message nil) 207 | 208 | :hook (((prog-mode minibuffer-mode) . superword-mode) 209 | ((fundamental-mode prog-mode) . repeat-mode) 210 | ((emacs-lisp lisp-mode scheme-mode) . prettify-symbols-mode) 211 | (prog-mode . (lambda () 212 | (setq show-trailing-whitespace t) 213 | (electric-pair-local-mode)))) 214 | 215 | :bind 216 | (:map minibuffer-mode-map 217 | ("" . ebn/kill-dir-or-char)) 218 | (:map isearch-mode-map 219 | ("TAB" . isearch-toggle-symbol) 220 | ("M-q" . isearch-query-replace)) 221 | (:map emacs-lisp-mode-map 222 | ("C-c C-e" . ebn/eval-and-replace)) 223 | (:map lisp-interaction-mode-map 224 | ("C-c C-e" . ebn/eval-and-replace)) 225 | (:map global-map 226 | ("" . kmacro-start-macro) 227 | ("" . kmacro-end-macro) 228 | ("" . call-last-kbd-macro) 229 | ("" . kmacro-insert-counter) 230 | ("" . eval-defun) 231 | ("" . eval-last-sexp) 232 | ("C-," . xref-go-back) 233 | ("C-." . repeat) 234 | ("C-0" . ebn/back-to-mark) 235 | ("C-8" . backward-sexp) 236 | ("C-9" . forward-sexp) 237 | ("C-6" . mark-sexp) 238 | ("C-" . ebn/forward-to-paragraph) 239 | ("C-" . backward-paragraph) 240 | ("C-b" . backward-to-word) 241 | ("C-c C-c" . ebn/comment-dwim) 242 | ("C-c d" . flymake-show-buffer-diagnostics) 243 | ("C-f" . forward-to-word) 244 | ("C-h ," . xref-find-definitions) 245 | ("C-h l" . ebn/wikipedia-at-point) 246 | ("C-h r" . xref-find-references) 247 | ("C-h t" . eldoc-doc-buffer) 248 | ("C-h w" . dictionary-search) 249 | ("C-x C-r" . undo-redo) 250 | ("C-j" . join-line) 251 | ("C-k" . ebn/kill-dwim) 252 | ("M-w" . ebn/copy-dwim) 253 | ("C-o" . ebn/open-line-below) 254 | ("C-t" . transpose-lines) 255 | ("C-x C-b" . ibuffer-other-window) 256 | ("C-x C-e" . eval-last-sexp) 257 | ("C-x C-f" . find-file-other-window) 258 | ("C-x SPC" . rectangle-mark-mode) 259 | ("C-x f" . find-file) 260 | ("C-x j" . jump-to-register) 261 | ("C-x k" . kill-current-buffer) 262 | ("C-x e" . eval-expression) 263 | ("C-x =" . describe-char) 264 | ("C-c n a" . org-agenda) 265 | ("C-c C-b" . eval-buffer) 266 | ("M-1" . delete-other-windows) 267 | ("M-2" . split-window-below) 268 | ("M-3" . split-window-right) 269 | ("M-4" . delete-window) 270 | ("M-5" . make-frame) 271 | ("M-" . (lambda () (interactive) (tab-select 1))) 272 | ("M-" . (lambda () (interactive) (tab-select 2))) 273 | ("M-g M-g" . jump-to-register) 274 | ("M-i" . back-to-indentation) 275 | ("M-o" . ebn/open-line-above) 276 | ("M-u" . upcase-dwim) 277 | ("M-z" . zap-up-to-char) 278 | ("M-§" . end-of-buffer) 279 | ("s-e" . electric-pair-local-mode) 280 | ("s-l" . ebn/org-open-at-point) 281 | ("s-r" . replace-string) 282 | ("C-" . hippie-expand))) 283 | 284 | (use-package debug 285 | :ensure nil 286 | :defer 10 287 | :bind 288 | (:map debugger-mode-map 289 | ("" . debugger-toggle-locals))) 290 | 291 | (use-package repeat 292 | :ensure nil 293 | :config 294 | (ebn/def-repeat-map to-word-repeat-map 295 | :keys ("f" #'forward-to-word 296 | "b" #'backward-to-word) 297 | :exit-with "RET") 298 | 299 | (ebn/def-repeat-map forward-word-repeat-map 300 | :keys ("f" #'forward-word 301 | "b" #'backward-word) 302 | :exit-with "RET") 303 | 304 | (ebn/def-repeat-map capitalize-word-repeat-map 305 | :keys ("c" #'capitalize-word)) 306 | 307 | (ebn/def-repeat-map downcase-word-repeat-map 308 | :keys ("l" #'downcase-word)) 309 | 310 | :bind (:map isearch-mode-map 311 | ("" . #'isearch-repeat-forward) 312 | ("" . #'isearch-repeat-backward))) 313 | 314 | (use-package mindre-theme 315 | :ensure nil 316 | :load-path "themes/" 317 | :custom 318 | (mindre-use-more-bold nil) 319 | (mindre-use-faded-lisp-parens t) 320 | :config 321 | (mindre-with-color-variables 322 | (setq highlight-parentheses-colors `("#AB47BC"))) 323 | (load-theme 'mindre t) 324 | ; (set-face-attribute 'mindre-keyword nil :foreground "#4f4472") 325 | ; (set-face-attribute 'mindre-block nil :background "#eeeeee") 326 | (set-face-attribute 'mindre-bar nil :height 0.9) 327 | (set-face-attribute 'mindre-bar-inactive nil :height 0.9)) 328 | 329 | (use-package hippie-exp 330 | :ensure nil 331 | :bind ([remap dabbrev-expand] . hippie-expand) 332 | :commands (hippie-expand) 333 | :config 334 | (setq hippie-expand-try-functions-list 335 | '(try-expand-dabbrev 336 | try-expand-dabbrev-all-buffers 337 | try-expand-dabbrev-from-kill 338 | try-complete-lisp-symbol-partially 339 | try-complete-lisp-symbol 340 | try-complete-file-name-partially 341 | try-complete-file-name 342 | try-expand-all-abbrevs 343 | try-expand-list 344 | try-expand-line))) 345 | 346 | (use-package vterm 347 | :defer t 348 | :bind ("C-c C-t" . vterm-other-window)) 349 | 350 | (use-package save-hist 351 | :ensure nil 352 | :defer 10 353 | :init 354 | (savehist-mode 1) 355 | :config 356 | (setq history-length 10)) 357 | 358 | (use-package gtags :ensure nil) 359 | 360 | (use-package erc 361 | :commands erc-tls 362 | :config 363 | (setq erc-server "irc.libera.chat" 364 | erc-port 6697 365 | erc-autojoin-channels-alist 366 | '((".*" "#emacs" "#systemcrafters" "#gentoo")) 367 | erc-hide-list '("JOIN" "PART" "QUIT") 368 | erc-nick "ebn" 369 | erc-prompt-for-password nil) 370 | (setq auth-sources '("~/.authinfo.gpg")) 371 | (set-face-attribute 'erc-prompt-face nil :background nil :foreground "#000") 372 | (setq erc-prompt (lambda () (concat "[" (buffer-name) "]")))) 373 | 374 | (use-package popper 375 | :ensure t 376 | :config 377 | (setq popper-reference-buffers 378 | '("\\*Messages\\*" 379 | "Output\\*$" 380 | "\\*Async Shell Command\\*" 381 | "\\*eldoc\\*" 382 | "\\*Ibuffer\\*" 383 | "\\*vc-git" 384 | "\\*Help\\*" 385 | "\\*RE-Builder\\*$" 386 | flymake-diagnostics-buffer-mode 387 | calendar-mode 388 | help-mode 389 | compilation-mode 390 | sage-shell-mode 391 | vterm-mode 392 | inferior-emacs-lisp-mode)) 393 | (popper-mode) 394 | (popper-echo-mode) 395 | :bind* ("C-å" . popper-toggle-type) 396 | ("C-+" . popper-toggle-latest)) 397 | 398 | (use-package ibuffer-project 399 | :config 400 | (setq ibuffer-truncate-lines nil) 401 | (defun ebn/ibuffer-setup () 402 | (setq ibuffer-filter-groups 403 | (ibuffer-project-generate-filter-groups))) 404 | (setq ibuffer-project-use-cache t) 405 | :hook ((ibuffer . ebn/ibuffer-setup))) 406 | 407 | (use-package eldoc 408 | :ensure nil 409 | :custom 410 | (eldoc-echo-area-prefer-doc-buffer nil)) 411 | 412 | (use-package dired 413 | :ensure nil 414 | :config 415 | (require 'dired-x) 416 | (setq dired-recursive-copies t 417 | dired-recursive-deletes t 418 | dired-dwim-target t 419 | ; dired-omit-files "^\\..*$" 420 | dired-omit-files "\\`[.]?#\\|\\`[.][.]?\\'" 421 | delete-by-moving-to-trash t) 422 | (add-hook 'dired-mode-hook #'dired-omit-mode) 423 | :bind* 424 | (:map dired-mode-map 425 | ("-" . ebn/dired-up-directory) 426 | ("o" . ebn/dired-open-file) 427 | (")" . dired-omit-mode) 428 | ("q" . (lambda () (interactive) (quit-window t))) 429 | ("e" . wdired-change-to-wdired-mode) 430 | ("f" . dired-create-empty-file))) 431 | 432 | ;;; Org: 433 | (use-package org 434 | :defer t 435 | :commands (org-agenda 436 | org-capture 437 | org-cdlatex-mode) 438 | :init (progn 439 | (defun ebn/diary-last-day-of-month (date) 440 | "Return `t` if DATE is the last day of the month." 441 | (let* ((day (calendar-extract-day date)) 442 | (month (calendar-extract-month date)) 443 | (year (calendar-extract-year date)) 444 | (last-day-of-month 445 | (calendar-last-day-of-month month year))) 446 | (= day last-day-of-month)))) 447 | 448 | :config (progn 449 | (require 'org-mouse) 450 | (defun ebn/org-eval-block () 451 | "Wrapper around org-ctrl-c-ctrl-c that previews latex." 452 | (interactive) 453 | (org-ctrl-c-ctrl-c) 454 | (when (string= "sage" (plist-get (cadr (org-element-at-point)) :language)) 455 | (org-latex-preview))) 456 | 457 | ;; Options 458 | (setq org-startup-indented t 459 | org-startup-with-latex-preview t 460 | org-pretty-entities t 461 | org-startup-with-inline-images t 462 | org-ellipsis " …" 463 | org-export-preserve-breaks t 464 | org-highlight-latex-and-related '(native) 465 | org-src-fontify-natively t 466 | org-fontify-quote-and-verse-blocks t 467 | org-startup-folded t 468 | org-hide-leading-stars t 469 | org-use-speed-commands t 470 | org-cycle-separator-lines 2 471 | org-catch-invisible-edits 'error 472 | org-ctrl-k-protect-subtree t 473 | org-image-actual-width nil 474 | org-return-follows-link t 475 | org-hide-emphasis-markers t 476 | org-format-latex-options (plist-put org-format-latex-options :scale 1.5) 477 | org-latex-listings 'minted 478 | org-latex-packages-alist '(("" "minted")) 479 | org-latex-tables-centered t 480 | org-insert-heading-respect-content t 481 | org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)") 482 | (sequence "BACKLOG(b)" "ACTIVE(a)" 483 | "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" 484 | "|" "DELEGATED(D)" "CANCELLED(c)")) 485 | org-agenda-current-time-string "← now ─────────────────" 486 | org-latex-pdf-process 487 | ;; The reason why this is a list is that it usually takes several 488 | ;; runs of ‘pdflatex’, maybe mixed with a call to ‘bibtex’. Org 489 | ;; does not have a clever mechanism to detect which of these 490 | ;; commands have to be run to get to a stable result, and it also 491 | ;; does not do any error checking. 492 | '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" 493 | "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" 494 | "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) 495 | 496 | ;; Org-babel languages 497 | (org-babel-do-load-languages 'org-babel-load-languages 498 | '((latex . t) 499 | (emacs-lisp . t) 500 | (haskell . t) 501 | (lisp . t) 502 | (calc . t) 503 | ;(maxima . t) 504 | (python . t) 505 | (sagemath . t))) 506 | 507 | ;; Org-agenda 508 | (setq org-agenda-files '("gtd.org" "someday.org" "tickler.org") 509 | org-agenda-include-diary t 510 | org-capture-templates 511 | '(("i" "Inbox" entry (file "~/org/inbox.org")) 512 | ("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks") 513 | "* TODO %?\n %i\n %a") 514 | ("s" "Someday" entry (file "~/org/someday.org") 515 | "* TODO %?\n %i\n %a") 516 | ("r" "Roam node" function #'org-roam-capture) 517 | ("j" "Journal: Today" function #'org-roam-dailies-capture-today) 518 | ("J" "Journal: Tomorrow" function #'org-roam-dailies-capture-tomorrow) 519 | ("d" "Journal: Date" function #'org-roam-dailies-capture-date)) 520 | org-refile-targets 521 | '((nil :maxlevel . 3) 522 | (org-agenda-files :maxlevel . 3))) 523 | 524 | (defun ebn/rectangle-number-lines () 525 | (interactive) 526 | (rectangle-number-lines (region-beginning) (region-end) 1 "%s. "))) 527 | 528 | :bind* 529 | (:map org-mode-map 530 | ("C-" . org-meta-return) 531 | ("C-c h" . consult-org-heading) 532 | ("C-j" . join-line) 533 | ("C-x r N" . ebn/rectangle-number-lines) 534 | ("C-x C-e" . ebn/org-eval-block)) 535 | (:map global-map 536 | ("C-c n n" . org-capture)) 537 | 538 | :hook ((org-mode . (lambda () 539 | (setq line-spacing .2) 540 | (setq cursor-type 'box) 541 | (org-cdlatex-mode) 542 | (ebn/--setup-variable-fonts))))) 543 | 544 | (use-package org-roam 545 | :defer t 546 | :commands (org-roam-node-find org-roam-capture) 547 | 548 | :init 549 | (setq org-roam-v2-ack t) ;; Disable v2-migration-prompt 550 | 551 | :custom 552 | (org-roam-directory "~/org/org-roam") 553 | (org-roam-completion-everywhere t) 554 | (org-roam-capture-templates 555 | `(("d" "default" plain "%?" 556 | :if-new (file+head 557 | "%<%Y%m%d%H%M%S>-${slug}.org" 558 | ,(let ((options '("#+options: _:{}" 559 | "#+options: ^:{}" 560 | "#+startup: latexpreview" 561 | "#+startup: entitiespretty" 562 | "#+startup: inlineimages" 563 | "#+title: ${title}"))) 564 | (mapconcat 'identity options "\n"))) 565 | :unnarrowed t))) 566 | ; (org-roam-node-display-template (concat "${type:15} ${title:*} " (propertize "${tags:10}" 'face 'org-tag))) 567 | (org-roam-node-display-template "${title}") 568 | :bind-keymap 569 | ("C-c n d" . org-roam-dailies-map) 570 | :bind (("C-c n l" . org-roam-buffer-toggle) 571 | ("C-c n f" . org-roam-node-find) 572 | ("C-c n g" . org-roam-graph) 573 | ("C-c n c" . org-roam-capture)) 574 | :config 575 | (org-roam-db-autosync-mode)) 576 | 577 | (use-package org-download 578 | :commands (org-mode org-download-clipboard) 579 | :custom 580 | (org-download-screenshot-method "flameshot gui -s --raw > %s") 581 | :bind ("" . org-download-screenshot)) 582 | 583 | (use-package ob-sagemath 584 | :ensure t 585 | :defer t 586 | :config 587 | (progn 588 | (setq org-babel-default-header-args:sage 589 | '((:session . t) 590 | (:results . "drawer replace"))) 591 | 592 | (with-eval-after-load "org" 593 | (define-key org-mode-map (kbd "C-c c") 'ob-sagemath-execute-async)) 594 | (setq org-confirm-babel-evaluate nil 595 | org-export-babel-evaluate nil 596 | org-startup-with-inline-images t) 597 | (add-hook 'org-babel-after-execute-hook 'org-display-inline-images))) 598 | 599 | (use-package sage-shell-mode 600 | :ensure t 601 | :defer t 602 | :config 603 | (setq sage-shell:set-ipython-version-on-startup nil) 604 | (setq sage-shell-sagetex:auctex-command-name "LaTeX") 605 | (add-hook 'sage-shell:sage-mode-hook (lambda () 606 | (setq-local prettify-symbols-alist 607 | '(("lambda" . 955) 608 | ("beta" . 120573) 609 | ("alpha" . 120572))) 610 | (sage-shell-view-mode)))) 611 | 612 | ;;; Languages: 613 | (use-package sh-mode 614 | :ensure nil 615 | :commands sh-mode 616 | :bind (:map sh-mode-map ("C-x C-e" . sh-execute-region))) 617 | 618 | (use-package haskell-mode 619 | :defer t 620 | :commands (haskell-mode) 621 | :init 622 | (defun ebn/haskell-mode-setup () 623 | (interactive) 624 | (setq-local eldoc-documentation-function #'haskell-doc-current-info 625 | tab-stop-list '(2) 626 | indent-line-function #'indent-relative 627 | tab-width 2) 628 | (interactive-haskell-mode) 629 | (haskell-indentation-mode) 630 | (electric-pair-mode)) 631 | (add-hook 'haskell-mode-hook #'ebn/haskell-mode-setup) 632 | 633 | :custom 634 | (haskell-process-type 'cabal-repl) 635 | (haskell-process-load-or-reload-prompt nil) 636 | (haskell-process-auto-import-loaded-modules t) 637 | (haskell-process-log t) 638 | (haskell-interactive-popup-errors nil) 639 | (haskell-font-lock-symbols t) 640 | 641 | :config 642 | (defun haskell-mode-after-save-handler () 643 | (let ((inhibit-message t)) 644 | (eglot-format-buffer))) 645 | 646 | :bind (:map haskell-mode-map 647 | ("C-h L" . haskell-hoogle-lookup-from-website) 648 | ("M-" . backward-sexp) 649 | ("M-" . forward-sexp))) 650 | 651 | (use-package agda2 652 | :ensure nil 653 | :disabled 654 | :init 655 | (add-to-list 'load-path (shell-command-to-string "agda-mode locate")) 656 | :mode ("\\agda\\'" . agda2-mode)) 657 | 658 | (use-package nix-mode 659 | :defer t) 660 | 661 | (use-package geiser-guile 662 | :ensure t 663 | :defer t) 664 | 665 | (use-package geiser-racket 666 | :ensure t 667 | :disabled t 668 | :defer t) 669 | 670 | (use-package racket-mode 671 | :config 672 | (defun setup-racket-eldoc () 673 | (eldoc-mode +1) 674 | (setq eldoc-documentation-function #'racket-xp-eldoc-function)) 675 | 676 | (add-hook 'racket-mode-hook #'racket-unicode-input-method-enable) 677 | (add-hook 'racket-repl-mode-hook #'racket-unicode-input-method-enable) 678 | (add-hook 'racket-mode-hook #'setup-racket-eldoc)) 679 | 680 | ;; (use-package ob-racket 681 | ;; :disabled 682 | ;; :commands 'org-ctrl-c-ctrl-c) 683 | 684 | (use-package yapfify 685 | :ensure t 686 | :defer t) 687 | 688 | (use-package cc-mode 689 | :ensure nil 690 | :config 691 | (setq c-default-style "cc-mode") 692 | :bind 693 | (:map c-mode-map 694 | ("C-c o" . ff-find-other-file) 695 | ("C-c c" . project-compile)) 696 | :hook (c-mode . electric-pair-mode)) 697 | 698 | (use-package markdown-mode 699 | :commands (markdown-mode gfm-mode) 700 | :mode (("README\\.md\\'" . gfm-mode)) 701 | :init (setq markdown-command "multimarkdown") 702 | :custom 703 | (markdown-enable-highlighting-syntax t) 704 | :config 705 | (set-face-attribute 'markdown-code-face nil :background nil) 706 | (setq markdown-enable-highlighting-syntax t)) 707 | 708 | (use-package cdlatex 709 | :commands 'turn-on-cdlatex) 710 | 711 | (use-package tex-mode 712 | :ensure nil 713 | :mode (("\\.tex\\'" . LaTeX-mode)) 714 | :custom 715 | (TeX-auto-save t) 716 | (TeX-parse-self t) 717 | (TeX-master nil) 718 | (TeX-PDF-mode t) 719 | :hook 720 | (LaTeX-mode . (lambda () 721 | (interactive) 722 | (visual-line-mode) 723 | (flyspell-mode) 724 | (LaTeX-math-mode) 725 | (turn-on-cdlatex) 726 | (yas-minor-mode-on) 727 | (eglot-ensure) 728 | (ebn/--setup-variable-fonts)))) 729 | 730 | ;;; LSP: 731 | (use-package eglot 732 | :defer t 733 | :hook 734 | (haskell-mode . eglot-ensure) 735 | (c-mode . eglot-ensure) 736 | (python-mode . eglot-ensure) 737 | (js-jsx-mode . eglot-ensure) 738 | (js-mode . eglot-ensure) 739 | :custom 740 | (eglot-autoshutdown t) 741 | (eglot-autoreconnect nil) 742 | (eglot-confirm-server-initiated-edits nil) 743 | (eldoc-idle-delay 1) 744 | (eldoc-echo-area-display-truncation-message nil) 745 | (eldoc-echo-area-use-multiline-p 2) 746 | 747 | :config 748 | (add-to-list 'eglot-server-programs 749 | '((tex-mode context-mode texinfo-mode bibtex-mode) . ("texlab"))) 750 | 751 | (define-key eglot-mode-map [remap display-local-help] nil) 752 | 753 | :bind (:map eglot-mode-map 754 | ("C-c C-a" . eglot-code-actions) 755 | ("C-c C-f" . eglot-format-buffer))) 756 | 757 | ;;; Completion: 758 | (use-package corfu 759 | :custom 760 | (corfu-auto-delay 0.2) 761 | (corfu-cycle t) 762 | (corfu-auto t) 763 | (corfu-commit-predicate nil) 764 | (corfu-quit-at-boundary t) 765 | (corfu-quit-no-match t) 766 | (corfu-echo-documentation nil) 767 | :init 768 | (global-corfu-mode)) 769 | 770 | (use-package cape 771 | :after corfu 772 | :bind (("C-c p i" . cape-ispell) 773 | ("C-c p w" . cape-dict) 774 | ("C-c p d" . cape-dabbrev) 775 | ("C-c p l" . cape-line) 776 | ("C-c p \\" . cape-tex)) 777 | :config 778 | (setq cape-dict-file "~/.local/share/dictionaries/my.dict") 779 | (setq-local completion-at-point-functions 780 | (list (cape-super-capf #'cape-dabbrev #'cape-dict #'cape-keyword #'cape-symbol))) 781 | 782 | ;; Silence then pcomplete capf, no errors or messages! 783 | (advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent) 784 | 785 | ;; Ensure that pcomplete does not write to the buffer 786 | ;; and behaves as a pure `completion-at-point-function'. 787 | (advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify) 788 | 789 | :init 790 | (add-to-list 'completion-at-point-functions #'cape-dabbrev) 791 | (add-to-list 'completion-at-point-functions #'cape-dict) 792 | (add-to-list 'completion-at-point-functions #'cape-file)) 793 | 794 | (use-package vertico 795 | :init 796 | (use-package orderless 797 | :commands (orderless) 798 | :custom (completion-styles '(orderless flex))) 799 | 800 | (use-package consult 801 | :init 802 | (setq consult-preview-key nil) 803 | :bind 804 | ("C-c r" . consult-recent-file) 805 | ("C-c f" . consult-ripgrep) 806 | ("C-c l" . consult-line) 807 | ("C-c i" . consult-imenu) 808 | ("C-c t" . gtags-find-tag) 809 | ("C-x b" . consult-buffer) 810 | ("C-c x" . consult-complex-command) 811 | (:map comint-mode-map 812 | ("C-c C-l" . consult-history))) 813 | :config 814 | (recentf-mode t) 815 | (vertico-mode t)) 816 | 817 | (use-package yasnippet 818 | :defer 10 819 | :commands yas-minor-mode-on 820 | :hook ((org-mode prog-mode) . #'yas-minor-mode-on) 821 | :config 822 | (yas-reload-all)) 823 | 824 | ;; Load environments (nix-shell) 825 | (use-package envrc 826 | :diminish 827 | :config 828 | (add-hook 'envrc-reload-hook #'eglot-reconnect) 829 | :hook 830 | (prog-mode . envrc-mode)) 831 | 832 | ;;; Better editing 833 | (use-package multiple-cursors 834 | :ensure t 835 | :bind 836 | (:map global-map 837 | ("s-" . mc/mark-next-like-this) 838 | ("s-," . mc/mark-all-in-region-regexp) 839 | ("s-." . mc/edit-lines))) 840 | 841 | (use-package expand-region 842 | :ensure t 843 | :commands 'er/expand-region 844 | :bind 845 | ("C-" . er/expand-region)) 846 | 847 | (use-package paredit 848 | :ensure t 849 | :config 850 | (defun ebn/paredit-semicolon (f &rest args) 851 | (if (region-active-p) 852 | (comment-region (region-beginning) (region-end)) 853 | (apply f args))) 854 | (advice-add 'paredit-semicolon :around #'ebn/paredit-semicolon) 855 | :hook ((scheme-mode emacs-lisp-mode racket-mode racket-repl-mode) . enable-paredit-mode) 856 | :bind (:map paredit-mode-map 857 | ("M-" . paredit-backward-barf-sexp) 858 | ("M-" . paredit-forward-barf-sexp) 859 | ("M-7" . paredit-wrap-curly) 860 | ("M-8" . paredit-wrap-round) 861 | ("C-8" . paredit-backward) 862 | ("C-9" . paredit-forward) 863 | ("C-c w" . (lambda () (interactive) (paredit-wrap-round 4))))) 864 | 865 | (use-package avy 866 | :ensure t 867 | :defer t 868 | :commands 'avy-goto-char-timer 869 | :config 870 | (setq avy-timeout-seconds 0.4) 871 | (setq avy-all-windows nil) 872 | :bind 873 | ("M-g g" . avy-goto-line) 874 | ("M-g c" . avy-goto-char-in-line) 875 | ("M-g m" . avy-move-line) 876 | ("C-ö" . avy-goto-char-timer)) 877 | 878 | ;;; Misc 879 | (use-package keycast 880 | :ensure t 881 | :defer 10 882 | :commands 'keycast-mode) 883 | 884 | (use-package pdf-tools 885 | :ensure t 886 | :defer t 887 | :mode ("\\.pdf\\'" . pdf-view-mode) 888 | :config 889 | (setq TeX-view-program-selection '((output-pdf "PDF Tools")) 890 | TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view)) 891 | TeX-source-correlate-start-server t) 892 | (add-hook 'TeX-after-compilation-finished-functions 893 | #'TeX-revert-document-buffer)) 894 | 895 | (use-package org-modern 896 | :commands (org-modern-mode org-modern-agenda) 897 | :custom 898 | (org-modern-table-vertical 1) 899 | (org-modern-table-horizontal 1) 900 | (org-modern-block t) 901 | 902 | :init 903 | (setq org-modern-todo t 904 | org-modern-variable-pitch nil) 905 | (global-org-modern-mode)) 906 | 907 | (use-package rainbow-mode 908 | :commands rainbow-mode) 909 | 910 | (use-package rainbow-delimiters 911 | :disabled) 912 | 913 | (use-package highlight-parentheses) 914 | 915 | (use-package package-lint 916 | :commands package-lint-current-buffer) 917 | 918 | (use-package clipmon 919 | :defer 10 920 | :commands clipmon-mode-start) 921 | 922 | (use-package sv-kalender 923 | :load-path "lisp/sv-kalender/") 924 | 925 | (use-package focus 926 | :disabled 927 | :commands focus-mode 928 | :config 929 | (add-to-list 'focus-mode-to-thing '(emacs-lisp-mode . list)) 930 | (add-to-list 'focus-mode-to-thing '(scheme-mode . list))) 931 | 932 | (use-package imaxima 933 | :disabled 934 | :ensure nil 935 | :commands (maxima imaxima) 936 | :init 937 | (setq imaxima-scale-factor 1.5 938 | maxima-command "maxima")) 939 | 940 | (use-package olivetti 941 | :disabled 942 | :commands olivetti-mode) 943 | 944 | (use-package emacs-everywhere 945 | :disabled 946 | :defer 10) 947 | 948 | (use-package diredfl 949 | :disabled 950 | :init 951 | (diredfl-global-mode)) 952 | 953 | (use-package elfeed 954 | :commands elfeed 955 | :config 956 | (setq elfeed-feeds 957 | '(("https://sachachua.com/blog/feed/" blog emacs) 958 | ("https://www.youtube.com/feeds/videos.xml?channel_id=UCAiiOTio8Yu69c3XnR7nQBQ" emacs)))) 959 | 960 | 961 | ;;; ebn-init.el ends here 962 | -------------------------------------------------------------------------------- /modules/programs/emacs/config/site-start.el: -------------------------------------------------------------------------------- 1 | ;; -*- lexical-binding: t; -*- 2 | (defun nix--profile-paths () 3 | "Return a list of all paths in NIX_PROFILES. 4 | The list is ordered from more-specific (the user profile) to the 5 | least specific (the system profile)" 6 | (reverse (split-string (or (getenv "NIX_PROFILES") "")))) 7 | 8 | ;;; Extend `load-path' to search for elisp files in subdirectories of 9 | ;;; all folders in `NIX_PROFILES'. Also search for one level of 10 | ;;; subdirectories in these directories to handle multi-file libraries 11 | ;;; like `mu4e'.' 12 | (require 'seq) 13 | (let* ((subdirectory-sites (lambda (site-lisp) 14 | (when (file-exists-p site-lisp) 15 | (seq-filter (lambda (f) (file-directory-p (file-truename f))) 16 | ;; Returns all files in `site-lisp', excluding `.' and `..' 17 | (directory-files site-lisp 'full "^\\([^.]\\|\\.[^.]\\|\\.\\..\\)"))))) 18 | (paths (apply #'append 19 | (mapcar (lambda (profile-dir) 20 | (let ((site-lisp (concat profile-dir "/share/emacs/site-lisp/"))) 21 | (cons site-lisp (funcall subdirectory-sites site-lisp)))) 22 | (nix--profile-paths))))) 23 | (setq load-path (append paths load-path))) 24 | 25 | ;;; Remove wrapper site-lisp from EMACSLOADPATH so it's not propagated 26 | ;;; to any other Emacsen that might be started as subprocesses. 27 | (let ((wrapper-site-lisp (getenv "emacsWithPackages_siteLisp")) 28 | (env-load-path (getenv "EMACSLOADPATH"))) 29 | (when wrapper-site-lisp 30 | (setenv "emacsWithPackages_siteLisp" nil)) 31 | (when (and wrapper-site-lisp env-load-path) 32 | (let* ((env-list (split-string env-load-path ":")) 33 | (new-env-list (delete wrapper-site-lisp env-list))) 34 | (setenv "EMACSLOADPATH" (when new-env-list 35 | (mapconcat 'identity new-env-list ":")))))) 36 | 37 | (let ((wrapper-site-lisp (getenv "emacsWithPackages_siteLispNative")) 38 | (env-load-path (getenv "EMACSNATIVELOADPATH"))) 39 | (when wrapper-site-lisp 40 | (setenv "emacsWithPackages_siteLispNative" nil)) 41 | (when (and wrapper-site-lisp env-load-path) 42 | (let* ((env-list (split-string env-load-path ":")) 43 | (new-env-list (delete wrapper-site-lisp env-list))) 44 | (setenv "EMACSNATIVELOADPATH" (when new-env-list 45 | (mapconcat 'identity new-env-list ":")))))) 46 | 47 | ;;; Set up native-comp load path. 48 | (when (featurep 'comp) 49 | ;; Append native-comp subdirectories from `NIX_PROFILES'. 50 | (setq native-comp-eln-load-path 51 | (append (mapcar (lambda (profile-dir) 52 | (concat profile-dir "/share/emacs/native-lisp/")) 53 | (nix--profile-paths)) 54 | native-comp-eln-load-path))) 55 | 56 | ;;; Make `woman' find the man pages 57 | (defvar woman-manpath) 58 | (eval-after-load 'woman 59 | '(setq woman-manpath 60 | (append (mapcar (lambda (x) (concat x "/share/man/")) 61 | (nix--profile-paths)) 62 | woman-manpath))) 63 | 64 | ;;; Make tramp work for remote NixOS machines 65 | (defvar tramp-remote-path) 66 | (eval-after-load 'tramp-sh 67 | ;; TODO: We should also add the other `NIX_PROFILES' to this path. 68 | ;; However, these are user-specific, so we would need to discover 69 | ;; them dynamically after connecting via `tramp' 70 | '(add-to-list 'tramp-remote-path "/run/current-system/sw/bin")) 71 | 72 | ;;; C source directory 73 | ;;; 74 | ;;; Computes the location of the C source directory from the path of 75 | ;;; the current file: 76 | ;;; from: /nix/store/-emacs-/share/emacs/site-lisp/site-start.el 77 | ;;; to: /nix/store/-emacs-/share/emacs//src/ 78 | (defvar find-function-C-source-directory) 79 | (let ((emacs 80 | (file-name-directory ; .../emacs/ 81 | (directory-file-name ; .../emacs/site-lisp 82 | (file-name-directory load-file-name)))) ; .../emacs/site-lisp/ 83 | (version 84 | (file-name-as-directory 85 | emacs-version)) 86 | (src (file-name-as-directory "src"))) 87 | (setq find-function-C-source-directory (concat emacs version src))) 88 | 89 | 90 | ;;; Copied from early-init.el 91 | ;;; 92 | ;;; Emacs only reads early-init.el the first directory in it's preferred 93 | ;;; list of directories which means if the user has a .emacs.d or .config/emacs.d directory 94 | ;;; it will try to load early-init.el from one of those and ignore early-init.el existing in 95 | ;;; any other directory in it's load-path. 96 | ;;; To fix this I override the emacs site-start.el and append the code below. 97 | ;;; 98 | ;; Packages will be initialized by use-package later. 99 | (setq package-enable-at-startup nil) 100 | (setq package-archives nil) 101 | 102 | (defvar last-file-name-handler-alist file-name-handler-alist) 103 | 104 | ;; Defer garbage collection further back in the startup process 105 | ;; (setq gc-cons-threshold most-positive-fixnum) 106 | ;;(setq gc-cons-threshold 134217728) ; 128mb 107 | (setq gc-cons-threshold most-positive-fixnum 108 | file-name-handler-alist nil) 109 | 110 | (add-hook 'emacs-startup-hook 111 | (lambda () 112 | (setq gc-cons-threshold (* 2 1000 1000) 113 | file-name-handler-alist last-file-name-handler-alist))) 114 | 115 | ;; Ignore X resources 116 | (advice-add #'x-apply-session-resources :override #'ignore) 117 | ;; TODO: Probably the better approach is: 118 | ;; (setq inhibit-x-resources t) 119 | 120 | ;; Do not resize the frame at this early stage. 121 | (setq frame-inhibit-implied-resize t) 122 | 123 | ;; In noninteractive sessions, prioritize non-byte-compiled source files to 124 | ;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time 125 | ;; to skip the mtime checks on every *.elc file. 126 | (setq load-prefer-newer noninteractive) 127 | 128 | ;; Prevent unwanted runtime builds; packages are compiled ahead-of-time when 129 | ;; they are installed and site files are compiled when gccemacs is installed. 130 | (setq comp-deferred-compilation nil 131 | native-comp-deferred-compilation nil) 132 | 133 | ;; Prevent the glimpse of un-styled Emacs by disabling these UI elements early. 134 | (push '(menu-bar-lines . 0) default-frame-alist) 135 | (push '(tool-bar-lines . 0) default-frame-alist) 136 | (push '(vertical-scroll-bars) default-frame-alist) 137 | 138 | (setq fancy-startup-text nil) 139 | (setq fancy-about-text nil) 140 | -------------------------------------------------------------------------------- /modules/programs/emacs/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.programs.ebn.emacs; 6 | version = config.programs.ebn.emacs.version; 7 | emacsPackage = 8 | let 9 | configTxt = (builtins.readFile ./config/ebn-init.el); 10 | 11 | init = pkgs.runCommand "default.el" {} '' 12 | mkdir -p $out/share/emacs/site-lisp 13 | cp ${pkgs.writeText "default.el" configTxt} $out/share/emacs/site-lisp/default.el 14 | ''; 15 | 16 | package = cfg.package.override { 17 | siteStart = pkgs.writeText "site-start.el" ( 18 | builtins.readFile ./config/site-start.el 19 | ); 20 | }; 21 | 22 | in 23 | (pkgs.emacsWithPackagesFromUsePackage { 24 | config = configTxt; 25 | alwaysEnsure = true; 26 | package = package; 27 | extraEmacsPackages = epkgs: with epkgs; [ 28 | vterm init agda2-mode use-package pkgs.emacsPackages.auctex 29 | ]; 30 | override = epkgs: epkgs // { 31 | kaolin-themes = pkgs.ebn.kaolin-themes; 32 | }; 33 | }); 34 | in { 35 | 36 | options = { 37 | programs.ebn.emacs = { 38 | enable = mkEnableOption "Enable Emacs"; 39 | package = mkOption { 40 | type = lib.types.package; 41 | default = pkgs.emacsGit; 42 | }; 43 | }; 44 | }; 45 | 46 | config = mkIf cfg.enable { 47 | 48 | fonts.fonts = with pkgs; [ 49 | cm_unicode 50 | sarasa-gothic 51 | ]; 52 | 53 | services.dictd.enable = true; 54 | 55 | programs.git = { 56 | enable = true; 57 | config = { 58 | init.defaultBranch = "master"; 59 | core.editor = "emacsclient -nw -a 'emacs -nw'"; 60 | }; 61 | }; 62 | 63 | services.emacs = { 64 | enable = true; 65 | install = true; 66 | package = emacsPackage; 67 | defaultEditor = true; 68 | }; 69 | 70 | environment.systemPackages = with pkgs; [ 71 | emacsPackage 72 | 73 | ## Dependencies 74 | git 75 | (ripgrep.override { withPCRE2 = true; }) 76 | gnutls # for TLS connectivity 77 | emacs-all-the-icons-fonts 78 | coreutils 79 | binutils 80 | 81 | fd # faster projectile indexing 82 | imagemagick # for image-dired 83 | zstd # for undo-fu-session/undo-tree compression 84 | 85 | ## Package dependencies 86 | # Spellchecking 87 | (aspellWithDicts (ds: with ds; [ en en-computers en-science sv ])) 88 | 89 | # Grammar 90 | languagetool 91 | 92 | # editorconfig 93 | editorconfig-core-c # per-project style config 94 | 95 | # org 96 | gnuplot 97 | dot2tex 98 | graphviz 99 | 100 | # org-roam 101 | sqlite 102 | 103 | # cc 104 | ccls 105 | 106 | # nix 107 | nixfmt 108 | 109 | # vterm 110 | libtool 111 | gnumake 112 | libvterm 113 | 114 | # emacs everywhere 115 | xorg.xwininfo 116 | xclip 117 | xdotool 118 | 119 | # ob-jupyter 120 | #(python38.withPackages(ps: [ ps.jupyter ps.python-lsp-server ])) 121 | (python39.withPackages (ps: [ ps.epc ps.python-lsp-server ])) 122 | # agda 123 | haskellPackages.Agda 124 | 125 | # cc 126 | gcc 127 | ccls 128 | global 129 | 130 | # python 131 | yapf 132 | 133 | # racket 134 | racket 135 | ]; 136 | }; 137 | } 138 | -------------------------------------------------------------------------------- /modules/programs/kitty/config/kitty.conf: -------------------------------------------------------------------------------- 1 | #font_family JetBrains mono 2 | #font_family Sarasa Term CL 3 | font_family Iosevka 4 | # 5 | #bold_font VictorMono SemiBold 6 | #italic_font auto 7 | #bold_italic_font VictorMono SemiBold 8 | # 9 | #font_features Victor Mono Bold 10 | 11 | font_size 13 12 | 13 | tab_bar_style powerline 14 | tab_powerline_style round 15 | window_padding_width 10 16 | map ctrl+n next_tab 17 | 18 | # background #323232 19 | # foreground #ffffff 20 | # cursor #d6d6d6 21 | # selection_background #5b5b5b 22 | # selection_foreground #323232 23 | # color0 #353535 24 | # color8 #535353 25 | # color1 #d25252 26 | # color9 #f00c0c 27 | # color2 #a4c161 28 | # color10 #c1df74 29 | # color3 #ffc56d 30 | # color11 #e1e48a 31 | # color4 #6c99ba 32 | # color12 #8ab6d9 33 | # color5 #d096d9 34 | # color13 #efb5f7 35 | # color6 #bdd6ff 36 | # color14 #dbf4ff 37 | # color7 #ededec 38 | # color15 #ffffff 39 | # active_tab_foreground #ffffff 40 | # active_tab_background #535353 41 | # inactive_tab_foreground #ffffff 42 | # inactive_tab_background #353535 43 | 44 | # foreground #D8DEE9 45 | # background #2E3440 46 | # selection_foreground #000000 47 | # selection_background #FFFACD 48 | # url_color #0087BD 49 | # cursor #81A1C1 50 | 51 | # # black 52 | # color0 #3B4252 53 | # color8 #4C566A 54 | 55 | # # red 56 | # color1 #BF616A 57 | # color9 #BF616A 58 | 59 | # # green 60 | # color2 #A3BE8C 61 | # color10 #A3BE8C 62 | 63 | # # yellow 64 | # color3 #EBCB8B 65 | # color11 #EBCB8B 66 | 67 | # # blue 68 | # color4 #81A1C1 69 | # color12 #81A1C1 70 | 71 | # # magenta 72 | # color5 #B48EAD 73 | # color13 #B48EAD 74 | 75 | # # cyan 76 | # color6 #88C0D0 77 | # color14 #8FBCBB 78 | 79 | # # white 80 | # color7 #E5E9F0 81 | # color15 #ECEFF4 82 | 83 | 84 | foreground #37474F 85 | background #F5F5F5 86 | selection_foreground #37474F 87 | selection_background #CFD8DC 88 | url_color #5e429f 89 | cursor #37474F 90 | 91 | # black 92 | color0 #2E3440 93 | color8 #4C566A 94 | 95 | # red 96 | color1 #BF616A 97 | color9 #BF616A 98 | 99 | # green 100 | color2 #00625D 101 | color10 #537469 102 | 103 | # yellow 104 | color3 #54433a 105 | color11 #54433a 106 | 107 | # blue 108 | color4 #37474F 109 | color12 #37474F 110 | 111 | # magenta 112 | color5 #5e429f 113 | color13 #5e429f 114 | 115 | # cyan 116 | color6 #37474F 117 | color14 #37474F 118 | 119 | # white 120 | color7 #ECEFF1 121 | color15 #F5F5F5 -------------------------------------------------------------------------------- /modules/programs/kitty/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let cfg = config.programs.ebn.kitty; 5 | in { 6 | options.programs.ebn.kitty = { 7 | enable = mkEnableOption "Enable Kitty"; 8 | extraConfig = mkOption { 9 | type = lib.types.lines; 10 | default = ''''; 11 | }; 12 | }; 13 | 14 | config = mkIf cfg.enable { 15 | fonts.fonts = with pkgs; [ 16 | jetbrains-mono 17 | victor-mono 18 | ]; 19 | 20 | environment.systemPackages = 21 | let 22 | config = pkgs.writeText "kitty config" '' 23 | ${(builtins.readFile ./config/kitty.conf)} 24 | ${cfg.extraConfig} 25 | ''; 26 | 27 | wrapped = pkgs.writeShellScriptBin "kitty" '' 28 | exec ${pkgs.kitty}/bin/kitty -c ${config} 29 | ''; 30 | 31 | package = pkgs.symlinkJoin { 32 | name = "kitty"; 33 | paths = [ 34 | wrapped 35 | pkgs.kitty 36 | ]; 37 | }; 38 | in 39 | [ package ]; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /modules/programs/neovim/config/ebn.vim: -------------------------------------------------------------------------------- 1 | " Some sensible defaults before we load the lua configuration 2 | " 3 | set path+=** 4 | if exists('+termguicolors') 5 | let &t_8f = "\[38;2;%lu;%lu;%lum" 6 | let &t_8b = "\[48;2;%lu;%lu;%lum" 7 | set termguicolors 8 | endif 9 | 10 | colorscheme aurora 11 | 12 | set termguicolors 13 | set relativenumber 14 | set tabstop=2 softtabstop=2 15 | set shiftwidth=2 16 | set expandtab 17 | set smartindent 18 | set nu 19 | set termguicolors 20 | set scrolloff=8 21 | set signcolumn=yes 22 | set cmdheight=1 23 | set incsearch 24 | 25 | let mapleader = " " 26 | inoremap pumvisible() ? "\" : "\" 27 | inoremap pumvisible() ? "\" : "\" 28 | 29 | " Clear search on esc 30 | nnoremap :noh 31 | 32 | " Set completeopt to have a better completion experience 33 | set completeopt=menuone,noinsert,noselect 34 | 35 | " Avoid extra message when using completion 36 | set shortmess+=c 37 | 38 | " let g:completion_enable_auto_popup = 0 39 | let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy', 'all'] 40 | 41 | " only show recent files from current working directory on startup screen 42 | let g:startify_lists = [ { 'type': 'dir', 'header': ['MRU'. getcwd()] } ] 43 | 44 | autocmd TermOpen * startinsert 45 | 46 | " load lua configuration 47 | " 48 | if exists('g:loaded_ebn' | finish | endif 49 | lua require("ebn") 50 | let g:loaded_ebn = 1 51 | 52 | -------------------------------------------------------------------------------- /modules/programs/neovim/config/init.vim: -------------------------------------------------------------------------------- 1 | " Some sensible defaults before we load the lua configuration 2 | " 3 | set path+=** 4 | if exists('+termguicolors') 5 | let &t_8f = "\[38;2;%lu;%lu;%lum" 6 | let &t_8b = "\[48;2;%lu;%lu;%lum" 7 | set termguicolors 8 | endif 9 | 10 | colorscheme modus-vivendi 11 | 12 | set termguicolors 13 | set relativenumber 14 | set tabstop=2 softtabstop=2 15 | set shiftwidth=2 16 | set expandtab 17 | set smartindent 18 | set nu 19 | set termguicolors 20 | set scrolloff=8 21 | set signcolumn=yes 22 | set cmdheight=1 23 | set incsearch 24 | 25 | let mapleader = " " 26 | inoremap pumvisible() ? "\" : "\" 27 | inoremap pumvisible() ? "\" : "\" 28 | 29 | " Clear search on esc 30 | nnoremap :noh 31 | 32 | " Set completeopt to have a better completion experience 33 | set completeopt=menuone,noinsert,noselect 34 | 35 | " Avoid extra message when using completion 36 | set shortmess+=c 37 | 38 | " let g:completion_enable_auto_popup = 0 39 | let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy', 'all'] 40 | 41 | " only show recent files from current working directory on startup screen 42 | let g:startify_lists = [ { 'type': 'dir', 'header': ['MRU'. getcwd()] } ] 43 | 44 | autocmd TermOpen * startinsert 45 | 46 | " load lua configuration 47 | lua require("ebn") 48 | -------------------------------------------------------------------------------- /modules/programs/neovim/config/lua/README.md: -------------------------------------------------------------------------------- 1 | # Neovim lua configuration 2 | 3 | Nix [manages](https://github.com/erikbackman/nixos-config/blob/master/home/modules/programs/neovim/default.nix) 4 | my vim plugins and init.vim for some sane defaults then loads this lua configuration. 5 | 6 | I choose to not have Nix manage these files to avoid having to rebuild my system whenever I make modifications. 7 | -------------------------------------------------------------------------------- /modules/programs/neovim/config/lua/ebn/init.lua: -------------------------------------------------------------------------------- 1 | require("ebn.keys") 2 | require("ebn.lsp") 3 | require("ebn.lualine") 4 | require("ebn.nnn") 5 | -------------------------------------------------------------------------------- /modules/programs/neovim/config/lua/ebn/keys.lua: -------------------------------------------------------------------------------- 1 | local function keymap(mode, lhs, rhs, opts) 2 | local options = { noremap = true, silent = true } 3 | if opts then options = vim.tbl_extend('force', options, opts) end 4 | vim.api.nvim_set_keymap(mode, lhs, rhs, options) 5 | end 6 | 7 | -- Misc 8 | keymap('n', 'qq', 'qa') 9 | keymap('n', 'ot', 'term') 10 | keymap('n', 'Y', 'v$y') 11 | keymap('n', '', '80lbi') 12 | 13 | -- Buffer 14 | keymap('n', 'fs', 'w') 15 | keymap('n', 'bk', 'bd') 16 | keymap('n', 'eb', 'luafile %', { silent = false }) 17 | keymap('n', 'bb', 'Buffers') 18 | keymap('n', 'sb', ':BLines') 19 | 20 | -- Project 21 | keymap('n', 'sp', 'Rg') 22 | 23 | -- Files 24 | keymap('n', 'fp', 'FZF /home/ebn/.config/nvim/lua/') 25 | keymap('n', 'pp', 'FZF /home/ebn/repos/github.com/erikbackman/') 26 | keymap('n', 'pf', 'GitFiles') 27 | keymap('n', 'ff', 'Files %:p:h') -- Files in current file directory 28 | keymap('n', 'fd', 'NnnPicker %') 29 | keymap('n', 'fr', ':History') -- Recent files 30 | 31 | -- History 32 | keymap('n', 'h', ':History:') -- Command history 33 | keymap('n', 'hh', ':History/') -- Search history 34 | 35 | -- Docs 36 | keymap('n', 'H', ':Helptags') 37 | -------------------------------------------------------------------------------- /modules/programs/neovim/config/lua/ebn/lsp.lua: -------------------------------------------------------------------------------- 1 | local on_attach = function(client, bufnr) 2 | --require('completion').on_attach() 3 | local cmp = require'cmp' 4 | cmp.setup({ 5 | snippet = { 6 | -- REQUIRED - you must specify a snippet engine 7 | expand = function(args) 8 | --vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. 9 | require('luasnip').lsp_expand(args.body) -- For `luasnip` users. 10 | -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. 11 | -- require'snippy'.expand_snippet(args.body) -- For `snippy` users. 12 | end, 13 | }, 14 | mapping = { 15 | [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), 16 | [''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), 17 | [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), 18 | [''] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. 19 | [''] = cmp.mapping({ 20 | i = cmp.mapping.abort(), 21 | c = cmp.mapping.close(), 22 | }), 23 | [''] = cmp.mapping.confirm({ select = true }), 24 | }, 25 | sources = cmp.config.sources({ 26 | { name = 'nvim_lsp' }, 27 | --{ name = 'vsnip' }, -- For vsnip users. 28 | -- { name = 'luasnip' }, -- For luasnip users. 29 | -- { name = 'ultisnips' }, -- For ultisnips users. 30 | -- { name = 'snippy' }, -- For snippy users. 31 | }, { 32 | { name = 'buffer' }, 33 | }) 34 | }) 35 | 36 | local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end 37 | local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end 38 | 39 | buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') 40 | 41 | -- Mappings 42 | local opts = { noremap=true, silent=true } 43 | 44 | buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) 45 | buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) 46 | buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) 47 | buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) 48 | buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) 49 | buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) 50 | buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) 51 | buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) 52 | 53 | -- Client mappings 54 | if client.name == "hls" then 55 | buf_set_keymap('n', 'bf', '!ormolu % -m inplace', opts) 56 | print("haskell lsp") 57 | end 58 | end 59 | 60 | local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) 61 | require('lspconfig').hls.setup({ on_attach = on_attach, capabilities = capabilities }) 62 | require('lspconfig').rnix.setup({ on_attach = on_attach }) 63 | require('lspconfig').ccls.setup({ on_attach = on_attach }) 64 | --require('lspconfig').csharp_ls.setup({ on_attach = on_attach }) 65 | 66 | -- Lua LSP 67 | local runtime_path = vim.split(package.path, ';') 68 | table.insert(runtime_path, "lua/?.lua") 69 | table.insert(runtime_path, "lua/?/init.lua") 70 | 71 | --require('lspconfig').sumneko_lua.setup { 72 | -- cmd = { "lua-language-server" }; 73 | -- on_attach = on_attach, 74 | -- settings = { 75 | -- Lua = { 76 | -- runtime = { 77 | -- version = 'LuaJIT', 78 | -- path = runtime_path, 79 | -- }, 80 | -- diagnostics = { 81 | -- globals = {'vim'}, 82 | -- }, 83 | -- workspace = { 84 | -- library = vim.api.nvim_get_runtime_file("", true), 85 | -- }, 86 | -- telemetry = { 87 | -- enable = false, 88 | -- }, 89 | -- }, 90 | -- }, 91 | --} 92 | 93 | require'nvim-treesitter.configs'.setup { 94 | ensure_installed = { "c" }, -- one of "all", "maintained" (parsers with maintainers), or a list of languages 95 | sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) 96 | ignore_install = { }, -- List of parsers to ignore installing 97 | highlight = { 98 | enable = true, -- false will disable the whole extension 99 | disable = { }, -- list of language that will be disabled 100 | -- Setting this to true will run `:h syntax` and tree-sitter at the same time. 101 | -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). 102 | -- Using this option may slow down your editor, and you may see some duplicate highlights. 103 | -- Instead of true it can also be a list of languages 104 | additional_vim_regex_highlighting = false, 105 | }, 106 | } -------------------------------------------------------------------------------- /modules/programs/neovim/config/lua/ebn/lualine.lua: -------------------------------------------------------------------------------- 1 | local config = { 2 | options = { 3 | icons_enabled = true, 4 | theme = 'nord', 5 | --require 'lualine/themes/aurora', 6 | component_separators = {'', ''}, 7 | section_separators = {'', ''}, 8 | disabled_filetypes = {} 9 | }, 10 | sections = { 11 | lualine_a = {'filename'}, 12 | lualine_b = {'location', 'progress'}, 13 | lualine_c = {}, 14 | lualine_x = {}, 15 | lualine_y = {'filetype'}, 16 | lualine_z = {'branch'}, 17 | }, 18 | inactive_sections = { 19 | lualine_a = {'mode'}, 20 | lualine_b = {'branch'}, 21 | lualine_c = {'filename'}, 22 | lualine_x = {'encoding', 'fileformat'}, 23 | lualine_y = {'progress'}, 24 | lualine_z = {'location'} 25 | }, 26 | tabline = {}, 27 | extensions = {} 28 | } 29 | 30 | require 'lualine'.setup(config) 31 | -------------------------------------------------------------------------------- /modules/programs/neovim/config/lua/ebn/nnn.lua: -------------------------------------------------------------------------------- 1 | require('nnn').setup({ 2 | command = "nnn -o -C", 3 | layout = { window = { width = 1, height = 1, highlight = 'Debug' } } 4 | }) 5 | -------------------------------------------------------------------------------- /modules/programs/neovim/config/lua/lualine/themes/aurora.lua: -------------------------------------------------------------------------------- 1 | local aurora = {} 2 | 3 | local colors = { 4 | pureblack = '#000000', 5 | black = '#0C0F12', 6 | white = '#e6e8ee', 7 | red = '#b53f36', 8 | green = '#5ccc96', 9 | blue = '#62D2DB', 10 | blueAlt = '#6a7b92', 11 | purple = '#9d81ba', 12 | --yellow = '#f2ce00', 13 | yellow = '#e59d23', -- slightly more muted yellow 14 | gray = '#686f9a', 15 | darkgray = '#1E2029', 16 | lightgray = '#c1c3cc', 17 | cyan = '#0D9C94' 18 | } 19 | 20 | aurora.normal = { 21 | a = { bg = colors.darkgray, fg = colors.purple }, 22 | b = { bg = colors.darkgray, fg = colors.white }, 23 | c = { bg = colors.darkgray, fg = colors.white }, 24 | x = { bg = colors.darkgray, fg = colors.white }, 25 | y = { bg = colors.darkgray, fg = colors.yellow }, 26 | z = { bg = colors.darkgray, fg = colors.cyan }, 27 | } 28 | 29 | aurora.insert = { 30 | a = { bg = colors.darkgray, fg = colors.green }, 31 | b = { bg = colors.darkgray, fg = colors.white }, 32 | c = { bg = colors.darkgray, fg = colors.white }, 33 | x = { bg = colors.darkgray, fg = colors.white }, 34 | y = { bg = colors.darkgray, fg = colors.yellow }, 35 | z = { bg = colors.darkgray, fg = colors.cyan }, 36 | } 37 | 38 | aurora.visual = { 39 | a = { bg = colors.darkgray, fg = colors.yellow }, 40 | b = { bg = colors.darkgray, fg = colors.white }, 41 | c = { bg = colors.darkgray, fg = colors.white }, 42 | x = { bg = colors.darkgray, fg = colors.white }, 43 | y = { bg = colors.darkgray, fg = colors.yellow }, 44 | z = { bg = colors.darkgray, fg = colors.cyan }, 45 | } 46 | 47 | aurora.replace = { 48 | a = { bg = colors.darkgray, fg = colors.red }, 49 | b = { bg = colors.darkgray, fg = colors.white }, 50 | c = { bg = colors.darkgray, fg = colors.white }, 51 | x = { bg = colors.darkgray, fg = colors.white }, 52 | y = { bg = colors.darkgray, fg = colors.yellow }, 53 | z = { bg = colors.darkgray, fg = colors.cyan }, 54 | } 55 | 56 | aurora.command = { 57 | a = { bg = colors.darkgray, fg = colors.purple }, 58 | b = { bg = colors.darkgray, fg = colors.white }, 59 | c = { bg = colors.darkgray, fg = colors.white }, 60 | x = { bg = colors.darkgray, fg = colors.white }, 61 | y = { bg = colors.darkgray, fg = colors.yellow }, 62 | z = { bg = colors.darkgray, fg = colors.cyan }, 63 | } 64 | 65 | -- you can assign one colorscheme to another, if a colorscheme is 66 | -- undefined it falls back to normal 67 | aurora.terminal = aurora.normal 68 | 69 | aurora.inactive = { 70 | a = { bg = colors.darkgray, fg = colors.purple }, 71 | b = { bg = colors.darkgray, fg = colors.white }, 72 | c = { bg = colors.darkgray, fg = colors.white }, 73 | x = { bg = colors.darkgray, fg = colors.white }, 74 | y = { bg = colors.darkgray, fg = colors.yellow }, 75 | z = { bg = colors.darkgray, fg = colors.cyan }, 76 | } 77 | 78 | return aurora 79 | -------------------------------------------------------------------------------- /modules/programs/neovim/config/plugin.nix: -------------------------------------------------------------------------------- 1 | pkgs: 2 | 3 | pkgs.vimUtils.buildVimPluginFrom2Nix { 4 | pname = "ebn"; 5 | version = "1.0.0"; 6 | src = ./.; 7 | } 8 | -------------------------------------------------------------------------------- /modules/programs/neovim/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, inputs, ... }: 2 | let 3 | cfg = config.programs.ebn.nvim; 4 | ebn = import ./config/plugin.nix pkgs; 5 | in with lib; { 6 | options.programs.ebn.nvim = { 7 | enable = mkEnableOption "Enable ebn nvim"; 8 | }; 9 | 10 | config = mkIf cfg.enable { 11 | 12 | programs.neovim = { 13 | enable = true; 14 | package = pkgs.neovim; 15 | configure = { 16 | customRC = builtins.readFile ./config/init.vim; 17 | packages.myVimPackage = with pkgs.vimPlugins; { 18 | start = [ 19 | ebn 20 | #completion-nvim 21 | nvim-cmp 22 | cmp_luasnip 23 | cmp-nvim-lsp 24 | nvim-treesitter 25 | fennel-vim 26 | #aniseed 27 | fzf-vim 28 | haskell-vim 29 | lualine-nvim 30 | nnn-vim 31 | nvim-lspconfig 32 | vim-nix 33 | vim-sneak 34 | vim-startify 35 | pkgs.ebn.modus-theme-vim 36 | agda-vim 37 | ]; 38 | }; 39 | }; 40 | }; 41 | 42 | environment.systemPackages = with pkgs; [ 43 | fzf 44 | #agda 45 | haskellPackages.Agda 46 | ]; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /modules/programs/rofi/config/rofi.rasi: -------------------------------------------------------------------------------- 1 | configuration { 2 | text-font: "Roboto Mono 12"; 3 | text-mono-font: "Roboto Mono 12"; 4 | icon-font: "FontAwesome 20"; 5 | show-icons: true; 6 | icon-theme: "Paper"; 7 | display-drun: ""; 8 | drun-display-format: "{name}"; 9 | disable-history: false; 10 | sidebar-mode: false; 11 | } 12 | 13 | @theme "/dev/null" 14 | 15 | * { 16 | al: #1E2029FA; 17 | bg: #1E2029FA; 18 | se: #282a36; 19 | fg: #ffffffff; 20 | ac: #1E2029FA; 21 | 22 | background-color: transparent; 23 | } 24 | 25 | window { 26 | transparency: "real"; 27 | background-color: @bg; 28 | text-color: @fg; 29 | border: 0px; 30 | border-color: @ac; 31 | border-radius: 12px; 32 | width: 35%; 33 | location: center; 34 | x-offset: 0; 35 | y-offset: 0; 36 | } 37 | 38 | prompt { 39 | enabled: true; 40 | padding: 0.30% 1% 0% -0.5%; 41 | background-color: @ac; 42 | text-color: #9d81ba; 43 | font: "Material\-Design\-Iconic\-Font 15"; 44 | } 45 | 46 | entry { 47 | background-color: @al; 48 | text-color: @fg; 49 | placeholder-color: @fg; 50 | expand: true; 51 | horizontal-align: 0; 52 | placeholder: " Search"; 53 | padding: 0.10% 0% 0% 0%; 54 | blink: true; 55 | } 56 | 57 | inputbar { 58 | children: [ prompt, entry ]; 59 | background-color: @ac; 60 | text-color: @fg; 61 | expand: false; 62 | border: 0% 0% 0% 0%; 63 | border-radius: 0px; 64 | border-color: @ac; 65 | margin: 0% 0% 0% 0%; 66 | padding: 1.5%; 67 | } 68 | 69 | listview { 70 | background-color: @al; 71 | padding: 10px; 72 | columns: 5; 73 | lines: 3; 74 | spacing: 0%; 75 | cycle: false; 76 | dynamic: true; 77 | layout: vertical; 78 | } 79 | 80 | mainbox { 81 | background-color: @al; 82 | border: 0% 0% 0% 0%; 83 | border-radius: 0% 0% 0% 0%; 84 | border-color: @ac; 85 | children: [ inputbar, listview ]; 86 | spacing: 0%; 87 | padding: 0%; 88 | } 89 | 90 | element { 91 | background-color: @bg; 92 | text-color: @fg; 93 | orientation: vertical; 94 | border-radius: 0%; 95 | padding: 2% 0% 2% 0%; 96 | } 97 | 98 | element-icon { 99 | background-color: inherit; 100 | text-color: inherit; 101 | horizontal-align: 0.5; 102 | vertical-align: 0.5; 103 | size: 64px; 104 | border: 0px; 105 | } 106 | 107 | element-text { 108 | background-color: @al; 109 | text-color: inherit; 110 | expand: true; 111 | horizontal-align: 0.5; 112 | vertical-align: 0.5; 113 | margin: 0.5% 0.5% -0.5% 0.5%; 114 | } 115 | 116 | element-text selected { 117 | background-color: @se; 118 | text-color: inherit; 119 | expand: true; 120 | horizontal-align: 0.5; 121 | vertical-align: 0.5; 122 | margin: 0.5% 0.5% -0.5% 0.5%; 123 | 124 | } 125 | 126 | element selected { 127 | background-color: @se; 128 | text-color: @fg; 129 | border: 0% 0% 0% 0%; 130 | border-radius: 12px; 131 | border-color: @bg; 132 | } 133 | -------------------------------------------------------------------------------- /modules/programs/rofi/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.programs.ebn.rofi; 6 | rofiConfig = pkgs.writeText "rofi.rasi" (builtins.readFile ./config/rofi.rasi); 7 | wrapped = pkgs.writeShellScriptBin "rofi" '' 8 | exec ${pkgs.rofi}/bin/rofi -config ${rofiConfig} $@ 9 | ''; 10 | package = pkgs.symlinkJoin { 11 | name = "rofi"; 12 | paths = [ 13 | wrapped 14 | pkgs.rofi 15 | ]; 16 | }; 17 | in { 18 | options.programs.ebn.rofi = { 19 | enable = mkEnableOption "Enable Rofi"; 20 | }; 21 | 22 | config = mkIf cfg.enable { 23 | environment.systemPackages = with pkgs; [ 24 | paper-icon-theme 25 | font-awesome 26 | roboto-mono 27 | package 28 | ]; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /modules/services/intercept-tools/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: { 2 | services.interception-tools = { 3 | enable = true; 4 | plugins = with pkgs.interception-tools-plugins; 5 | [ dual-function-keys ]; 6 | udevmonConfig = 7 | let mappings = 8 | pkgs.writeText "dual-function-keys.yaml" '' 9 | TIMING: 10 | TAP_MILLISEC: 200 11 | DOUBLE_TAP_MILLISEC: 150 12 | 13 | MAPPINGS: 14 | - KEY: KEY_ENTER 15 | TAP: KEY_ENTER 16 | HOLD: KEY_LEFTALT 17 | - KEY: KEY_RIGHTALT 18 | TAP: [ KEY_RIGHTCTRL, KEY_X ] 19 | HOLD: KEY_RIGHTALT 20 | ''; 21 | uinput = "${pkgs.interception-tools}/bin/uinput"; 22 | intercept = "${pkgs.interception-tools}/bin/intercept"; 23 | dual-function-keys = "${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys"; 24 | in '' 25 | - JOB: "${intercept} -g $DEVNODE | ${dual-function-keys} -c ${mappings} | ${uinput} -d $DEVNODE" 26 | DEVICE: 27 | EVENTS: 28 | EV_KEY: [KEY_ENTER, KEY_RIGHTALT] 29 | LINK: .*-event-kbd 30 | ''; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /modules/services/polybar/config/polybarrc: -------------------------------------------------------------------------------- 1 | [layout] 2 | bar-format = %{T4}%fill%%indicator%%empty%%{F-}%{T-} 3 | 4 | [global/wm] 5 | margin-top = 0 6 | margin-bottom = 0 7 | 8 | [bar/main] 9 | enable-ipc = true 10 | override-redirect = true 11 | fixed-center = true 12 | 13 | background = ${colors.background} 14 | foreground = ${colors.foreground} 15 | 16 | width = 99.5% 17 | height = 27 18 | offset-x = 0.25% 19 | offset-y = 0 20 | radius-bottom = 6 21 | bottom = false 22 | 23 | overline-size = 0 24 | overline-color = #f00 25 | underline-size = 0 26 | underline-color = #00f 27 | 28 | border-size = 0 29 | border-color = ${colors.gray} 30 | 31 | padding-left = 0 32 | padding-right = 0 33 | module-margin-left = 0 34 | module-margin-right = 0 35 | 36 | font-0 = "JetBrains Mono:style=Medium:size=11;2" 37 | font-1 = "FontAwesome 5 Brands:size=11;3" 38 | font-2 = "Material\-Design\-Iconic\-Font:size=13;3" 39 | font-3 = "FontAwesome:size=10;2" 40 | font-4 = "Siji:pixelsize=10;3" 41 | 42 | modules-left = cpu pad memory pad pulseaudio pad 43 | modules-center = xmonad 44 | modules-right = network-up pad network-down pad date 45 | 46 | format = 47 | label-padding = 1 48 | 49 | label-focused = %icon% 50 | label-focused-background = ${colors.bg-dark} 51 | label-focused-foreground = ${colors.foreground} 52 | ; label-focused-underline = ${colors.magenta} 53 | ; label-focused-foreground = ${xrdb:color2} 54 | label-focused-padding = 1 55 | 56 | label-occupied = %icon% 57 | label-occupied-foreground = ${colors.black} 58 | label-occupied-padding = 1 59 | 60 | label-urgent-foreground = ${colors.alert} 61 | label-urgent-padding = 1 62 | 63 | label-empty = %icon% 64 | label-empty-foreground = ${colors.foreground-alt} 65 | label-empty-padding = 1 66 | 67 | [module/date] 68 | type = internal/date 69 | interval = 5 70 | label = %date% %time% 71 | date = %A, %h %d 72 | date-alt = %Y-%m-%d 73 | time = %I:%M %p 74 | time-alt = %H:%M:%S 75 | format-prefix = "" 76 | format-prefix-padding = 1 77 | format-prefix-foreground = ${colors.accent} 78 | 79 | [module/fs] 80 | type = internal/fs 81 | mount-0 = / 82 | mount-1 = /home 83 | interval = 30 84 | ; Available tags: 85 | ; (default) 86 | ; 87 | ; 88 | ; 89 | format-mounted = "" 90 | format-mounted-foreground = ${colors.black} 91 | ; Available tokens: 92 | ; %mountpoint% 93 | ; %type% 94 | ; %fsname% 95 | ; %percentage_free% 96 | ; %percentage_used% 97 | ; %total% 98 | ; %free% 99 | ; %used% 100 | ; Default: %mountpoint% %percentage_free%% 101 | 102 | ; Available tags: 103 | ; (default) 104 | format-unmounted = 105 | label-unmounted = 106 | label-unmounted-foreground = ${colors.foreground-alt} 107 | 108 | bar-used-indicator = 109 | bar-used-width = 8 110 | bar-used-foreground-0 = ${colors.foreground} 111 | bar-used-foreground-1 = ${colors.foreground} 112 | bar-used-foreground-2 = ${colors.yellow} 113 | bar-used-foreground-3 = ${colors.alert} 114 | bar-used-foreground-4 = ${colors.alert} 115 | bar-used-fill = | 116 | bar-used-empty = ¦ 117 | bar-used-empty-foreground = ${colors.foreground-alt} 118 | 119 | [module/xwindow] 120 | type = internal/xwindow 121 | label = %title:0:80:...% 122 | label-padding-left = 2 123 | 124 | [module/mpd] 125 | type = internal/mpd 126 | host = localhost 127 | 128 | format-online = 129 | format-padding = 5 130 | 131 | label-song-maxlen = 45 132 | label-song-ellipsis = true 133 | 134 | icon-prev =  135 | icon-seekb =  136 | icon-stop =  137 | icon-play =  138 | icon-pause =  139 | icon-next =  140 | icon-seekf =  141 | 142 | icon-random =  143 | icon-repeat =  144 | 145 | toggle-on-foreground = ${colors.foreground} 146 | toggle-off-foreground = #66 147 | 148 | [module/cpu] 149 | type = internal/cpu 150 | interval = 2 151 | format = 152 | format-prefix = " " 153 | format-prefix-foreground = ${colors.accent} 154 | format-foreground = ${colors.foreground} 155 | format-padding = 1 156 | bar-load-indicator = 157 | bar-load-width = 8 158 | bar-load-foreground-0 = ${colors.foreground} 159 | ;bar-load-foreground-1 = 160 | ;bar-load-foreground-2 = 161 | ;bar-load-foreground-3 = 162 | ;bar-load-foreground-4 = 163 | bar-load-fill = | 164 | bar-load-empty = ¦ 165 | bar-load-empty-foreground = ${colors.gray} 166 | 167 | [module/memory] 168 | type = internal/memory 169 | interval = 3 170 | format = 171 | format-prefix = " " 172 | format-prefix-foreground = ${colors.accent} 173 | format-padding-left = 1 174 | ; Only applies if is used 175 | bar-used-indicator = 176 | bar-used-width = 8 177 | bar-used-foreground-0 = ${colors.foreground} 178 | ;bar-used-foreground-1 = 179 | ;bar-used-foreground-2 = 180 | ;bar-used-foreground-3 = 181 | ;bar-used-foreground-4 = 182 | bar-used-fill = | 183 | bar-used-empty = ¦ 184 | bar-used-empty-foreground = ${colors.gray} 185 | 186 | [module/network-up] 187 | type = internal/network 188 | interface = eno1 189 | interval = 4.0 190 | label-connected = "%upspeed%" 191 | format-connected-prefix = " " 192 | format-connected-prefix-foreground = ${colors.accent} 193 | format-connected-foreground = ${colors.foreground} 194 | format-connected-background = 195 | format-connected-underline = 196 | format-disconnected-prefix-foreground = ${colors.alert} 197 | format-disconnected-foreground = ${colors.alert} 198 | 199 | [module/network-down] 200 | type = internal/network 201 | interface = eno1 202 | interval = 4.0 203 | label-connected = "%downspeed%" 204 | format-connected-prefix = " " 205 | format-connected-prefix-foreground = ${colors.accent} 206 | format-connected-foreground = ${colors.foreground} 207 | format-connected-background = 208 | format-connected-underline = 209 | format-disconnected-prefix = " " 210 | format-disconnected-prefix-foreground = ${colors.alert} 211 | format-disconnected-foreground = ${colors.alert} 212 | 213 | [module/pulseaudio] 214 | type = internal/pulseaudio 215 | format-volume = 216 | ramp-volume-foreground = ${colors.accent} 217 | ramp-volume-prefix-foreground = ${colors.accent} 218 | format-muted-foreground = ${colors.alert} 219 | label-muted =  220 | bar-volume-width = 8 221 | bar-volume-gradient = false 222 | bar-volume-indicator = | 223 | bar-volume-indicator-font = 1 224 | bar-volume-indicator-foreground = ${colors.gray} 225 | bar-volume-fill = ─ 226 | bar-volume-fill-font = 1 227 | bar-volume-empty = ─ 228 | bar-volume-empty-font = 1 229 | bar-volume-empty-foreground = ${colors.gray} 230 | ramp-volume-0 =  231 | ramp-volume-1 = "" 232 | ramp-volume-2 = "" 233 | 234 | [module/ewmh] 235 | type = internal/xworkspaces 236 | pin-workspaces = true 237 | enable-click = true 238 | enable-scroll = false 239 | 240 | [module/pad] 241 | type = custom/text 242 | content = " " 243 | ;content-foreground = ${colors.gray} 244 | 245 | [module/logo] 246 | type = custom/text 247 | content = " " -------------------------------------------------------------------------------- /modules/services/polybar/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | let 4 | cfg = config.services.ebn.polybar; 5 | package = pkgs.polybar.override { 6 | alsaSupport = true; 7 | pulseSupport = true; 8 | mpdSupport = true; 9 | }; 10 | 11 | polybarCfg = with config; '' 12 | ${builtins.readFile ./config/polybarrc} 13 | 14 | ${cfg.extraConfig} 15 | 16 | [module/xmonad] 17 | type = custom/script 18 | exec = ${pkgs.xmonad-log}/bin/xmonad-log 19 | tail = true 20 | ''; 21 | in with lib; { 22 | options.services.ebn.polybar = { 23 | enable = mkEnableOption "Enable polybar"; 24 | extraConfig = mkOption { 25 | type = lib.types.lines; 26 | default = ''''; 27 | }; 28 | }; 29 | 30 | config = mkIf cfg.enable { 31 | environment.systemPackages = [ package ]; 32 | fonts.fonts = with pkgs; [ 33 | font-awesome siji jetbrains-mono ebn.material-design-iconic 34 | ]; 35 | 36 | services.dbus = { 37 | enable = true; 38 | packages = [ pkgs.gnome3.dconf ]; 39 | }; 40 | 41 | environment.etc."polybar/polybarrc".text = polybarCfg; 42 | 43 | systemd.user.services.polybar = { 44 | description = "Polybar status bar"; 45 | partOf = [ "tray.target" ]; 46 | serviceConfig = { 47 | Type = "forking"; 48 | Environment = "PATH=${package}/bin:/run/wrappers/bin"; 49 | ExecStart = 50 | let scriptPkg = 51 | pkgs.writeShellScriptBin "polybar-start" "polybar main -c /etc/polybar/polybarrc &"; 52 | in "${scriptPkg}/bin/polybar-start"; 53 | Restart = "on-failure"; 54 | }; 55 | }; 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /modules/services/pulseeffects/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | let 4 | cfg = config.services.ebn.pulseeffects; 5 | in with lib; { 6 | options.services.ebn.pulseeffects = { 7 | enable = mkEnableOption "Enable PulseEffects"; 8 | package = mkOption { 9 | type = types.package; 10 | default = pkgs.pulseeffects-legacy; 11 | }; 12 | }; 13 | 14 | config = mkIf cfg.enable { 15 | environment.systemPackages = [ 16 | cfg.package 17 | pkgs.at-spi2-core 18 | pkgs.gdk-pixbuf 19 | ]; 20 | 21 | programs.dconf.enable = true; 22 | services.gnome.at-spi2-core.enable = true; 23 | systemd.user.services.pulseeffects = { 24 | description = "PulseEffects Daemon"; 25 | requires = [ "dbus.service" ]; 26 | wantedBy = [ "graphical-session.target" ]; 27 | after = [ "graphical-session-pre.target" ]; 28 | partOf = [ "graphical-session.target" "pulseaudio.service" ]; 29 | serviceConfig = { 30 | ExecStart = "${pkgs.pulseeffects-legacy}/bin/pulseeffects --gapplication-service --load-preset ebn-preset"; 31 | ExecStop = "${pkgs.pulseeffects-legacy}/bin/pulseeffects --quit"; 32 | Restart = "on-failure"; 33 | RestartSec = 5; 34 | }; 35 | }; 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /modules/services/syncthing/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let cfg = config.services.ebn.syncthing; 5 | in { 6 | options.services.ebn.syncthing = { 7 | enable = mkEnableOption "Enable Syncthing"; 8 | }; 9 | 10 | config = mkIf cfg.enable { 11 | services.syncthing = { 12 | enable = true; 13 | dataDir = "~"; 14 | openDefaultPorts = true; 15 | configDir = "/home/ebn/.config/syncthing"; 16 | user = "ebn"; 17 | group = "users"; 18 | #guiAddress = "127.0.0.1:8384"; 19 | overrideDevices = true; 20 | overrideFolders = true; 21 | 22 | devices = { 23 | "yggdrasil" = { id = "H6MQKQH-YTA3RSJ-T2U7YER-4BROWZD-AT5OESQ-RCNFWZ5-TPHGQTN-HVWWEQ2"; }; 24 | "bifrost" = { id = "7LCKHMQ-7EJNDGY-CUQK5M3-X5MGEV2-F7FIKL5-VQ3GZUL-MWL4CVN-3VVW2QX"; }; 25 | "eriksamsung" = { id = "GHO7G3N-4LEGH32-VZPODIB-6AK2P7R-RSQ2CX4-YSMWP3O-56SA7TB-HV7LQA7"; }; 26 | "erik-20fms1w30f" = { id = "DIULWPT-5JR4WBL-VIHXYI4-2P3KRBY-T4R2SKR-3FSD7LJ-VUBL7HA-VOSQQQ7"; }; 27 | }; 28 | folders = { 29 | #"roam" = { 30 | # path = "home/ebn/org-roam"; 31 | # devices = [ "yggdrasil" "bifrost" ]; 32 | #}; 33 | "labb-grupp7" = { 34 | id = "annyx-pi9vs"; 35 | path = "~/Documents/labb-grupp7"; 36 | devices = [ "yggdrasil" "bifrost" "eriksamsung" "erik-20fms1w30f" ]; 37 | versioning = { 38 | type = "staggered"; 39 | params = { 40 | cleanInterval = "3600"; # 1 hour in seconds 41 | maxAge = "15552000"; # 180 days in seconds 42 | }; 43 | }; 44 | }; 45 | }; 46 | }; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /modules/services/tint2/config/tint2rc: -------------------------------------------------------------------------------- 1 | #---- Generated by tint2conf 12b1 ---- 2 | # See https://gitlab.com/o9000/tint2/wikis/Configure for 3 | # full documentation of the configuration options. 4 | #------------------------------------- 5 | # Gradients 6 | #------------------------------------- 7 | # Backgrounds 8 | # Background 1: Active taskbar, Button, Clock, Inactive taskbar, Panel, Systray, Tooltip 9 | rounded = 0 10 | border_width = 1 11 | border_sides = B 12 | border_content_tint_weight = 0 13 | background_content_tint_weight = 0 14 | background_color = #303145 100 15 | border_color = #000000 50 16 | background_color_hover = #000000 0 17 | border_color_hover = #000000 0 18 | background_color_pressed = #000000 0 19 | border_color_pressed = #000000 0 20 | 21 | # Background 2: Active task 22 | rounded = 2 23 | border_width = 2 24 | border_sides = B 25 | border_content_tint_weight = 0 26 | background_content_tint_weight = 0 27 | background_color = #777777 0 28 | border_color = #9880ea 100 29 | background_color_hover = #9880ea 22 30 | border_color_hover = #62548f 44 31 | background_color_pressed = #555555 4 32 | border_color_pressed = #eaeaea 44 33 | 34 | # Background 3: Urgent task 35 | rounded = 0 36 | border_width = 0 37 | border_sides = 38 | border_content_tint_weight = 0 39 | background_content_tint_weight = 0 40 | background_color = #f2a65d 100 41 | border_color = #000000 0 42 | background_color_hover = #000000 0 43 | border_color_hover = #000000 0 44 | background_color_pressed = #000000 0 45 | border_color_pressed = #000000 0 46 | 47 | # Background 4: Default task 48 | rounded = 2 49 | border_width = 0 50 | border_sides = 51 | background_color = #5c3e99 0 52 | border_color = #5c3e99 100 53 | background_color_hover = #62548f 22 54 | border_color_hover = #eaeaea 44 55 | background_color_pressed = #555555 4 56 | border_color_pressed = #eaeaea 44 57 | 58 | #------------------------------------- 59 | # Panel 60 | panel_items = PTSC 61 | panel_size = 100% 32 62 | panel_margin = 0 0 63 | panel_padding = 0 0 0 64 | panel_background_id = 1 65 | wm_menu = 0 66 | panel_dock = 0 67 | panel_position = top center horizontal 68 | panel_layer = normal 69 | panel_monitor = all 70 | panel_shrink = 0 71 | autohide = 0 72 | autohide_show_timeout = 0 73 | autohide_hide_timeout = 0 74 | autohide_height = 1 75 | strut_policy = follow_size 76 | panel_window_name = tint2 77 | disable_transparency = 0 78 | mouse_effects = 0 79 | font_shadow = 0 80 | mouse_hover_icon_asb = 100 0 10 81 | mouse_pressed_icon_asb = 100 0 0 82 | scale_relative_to_dpi = 0 83 | scale_relative_to_screen_height = 0 84 | 85 | #------------------------------------- 86 | # Taskbar 87 | taskbar_mode = single_desktop 88 | taskbar_hide_if_empty = 0 89 | taskbar_padding = 6 6 24 90 | taskbar_background_id = 1 91 | taskbar_active_background_id = 1 92 | taskbar_name = 0 93 | taskbar_hide_inactive_tasks = 0 94 | taskbar_hide_different_monitor = 0 95 | taskbar_hide_different_desktop = 0 96 | taskbar_always_show_all_desktop_tasks = 0 97 | taskbar_name_padding = 8 4 98 | taskbar_name_background_id = 0 99 | taskbar_name_active_background_id = 0 100 | taskbar_name_font = Noto Sans 8 101 | taskbar_name_font_color = #664f3d 100 102 | taskbar_name_active_font_color = #f4ebd4 100 103 | taskbar_distribute_size = 0 104 | taskbar_sort_order = none 105 | task_align = left 106 | 107 | #------------------------------------- 108 | # Task 109 | task_text = 1 110 | task_icon = 1 111 | task_centered = 0 112 | urgent_nb_of_blink = 0 113 | task_maximum_size = 150 28 114 | task_padding = 24 4 4 115 | task_font = Noto Sans 8 116 | task_tooltip = 0 117 | task_thumbnail = 0 118 | task_thumbnail_size = 210 119 | task_font_color = #e0e0e0 100 120 | task_active_font_color = #e0e0e0 100 121 | task_urgent_font_color = #725f8f 100 122 | task_background_id = 4 123 | task_active_background_id = 2 124 | task_urgent_background_id = 3 125 | mouse_left = toggle_iconify 126 | mouse_middle = none 127 | mouse_right = close 128 | mouse_scroll_up = none 129 | mouse_scroll_down = none 130 | 131 | #------------------------------------- 132 | # System tray (notification area) 133 | systray_padding = 2 4 4 134 | # systray_padding = 8 12 4 135 | systray_background_id = 1 136 | systray_sort = ascending 137 | systray_icon_size = 24 138 | systray_icon_asb = 100 0 0 139 | systray_monitor = 1 140 | systray_name_filter = 141 | 142 | #------------------------------------- 143 | # Launcher 144 | launcher_padding = 0 0 0 145 | launcher_background_id = 0 146 | launcher_icon_background_id = 0 147 | launcher_icon_size = 0 148 | launcher_icon_asb = 100 0 0 149 | launcher_icon_theme_override = 0 150 | startup_notifications = 0 151 | launcher_tooltip = 0 152 | 153 | #------------------------------------- 154 | # Clock 155 | time1_format = %H:%M 156 | time2_format = %a %-d %b 157 | time1_font = Iosevka Bold 8 158 | time1_timezone = 159 | time2_timezone = 160 | time2_font = Iosevka 8 161 | clock_font_color = #e1e1e1 100 162 | clock_padding = 16 0 163 | clock_background_id = 1 164 | clock_tooltip = 165 | clock_tooltip_timezone = 166 | clock_lclick_command = 167 | clock_rclick_command = 168 | clock_mclick_command = 169 | clock_uwheel_command = 170 | clock_dwheel_command = 171 | 172 | #------------------------------------- 173 | # Battery 174 | battery_tooltip = 1 175 | battery_low_status = 0 176 | battery_low_cmd = 177 | battery_full_cmd = 178 | battery_font_color = #000000 100 179 | bat1_format = 180 | bat2_format = 181 | battery_padding = 0 0 182 | battery_background_id = 0 183 | battery_hide = 101 184 | battery_lclick_command = 185 | battery_rclick_command = 186 | battery_mclick_command = 187 | battery_uwheel_command = 188 | battery_dwheel_command = 189 | ac_connected_cmd = 190 | ac_disconnected_cmd = 191 | 192 | #------------------------------------- 193 | # Button 1 194 | # button = new 195 | # button_icon = /home/ebn/.config/tint2/logo.png 196 | # button_text = 197 | # button_lclick_command = ~/.config/tint2/launch 198 | # button_rclick_command = 199 | # button_mclick_command = 200 | # button_uwheel_command = 201 | # button_dwheel_command = 202 | # button_font_color = #000000 100 203 | # button_padding = 12 0 204 | # button_background_id = 1 205 | # button_centered = 0 206 | # button_max_icon_size = 24 207 | 208 | #------------------------------------- 209 | # Tooltip 210 | tooltip_show_timeout = 0 211 | tooltip_hide_timeout = 0 212 | tooltip_padding = 8 4 213 | tooltip_background_id = 1 214 | tooltip_font_color = #664f3d 100 215 | tooltip_font = Noto Sans 8 216 | 217 | -------------------------------------------------------------------------------- /modules/services/tint2/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | let 4 | cfg = config.services.ebn.tint2; 5 | 6 | in with lib; { 7 | options.services.ebn.tint2 = { 8 | enable = mkEnableOption "Enable tint2 bar"; 9 | }; 10 | 11 | config = mkIf cfg.enable { 12 | fonts.fonts = with pkgs; [ 13 | ]; 14 | environment.systemPackages = [ pkgs.tint2 pkgs.pasystray pkgs.paper-icon-theme pkgs.papirus-icon-theme ]; 15 | 16 | services.dbus = { 17 | enable = true; 18 | packages = [ pkgs.dconf ]; 19 | }; 20 | 21 | systemd.user.services.tint2 = { 22 | description = "Tint2 bar"; 23 | partOf = [ "tray.target" ]; 24 | serviceConfig = { 25 | Type = "forking"; 26 | Environment = "PATH=${pkgs.tint2}/bin:/run/wrappers/bin:${pkgs.pasystray}/bin"; 27 | ExecStart = 28 | let 29 | tint2rc = pkgs.writeText "tint2rc" (builtins.readFile ./config/tint2rc); 30 | scriptPkg = 31 | pkgs.writeShellScriptBin "tint2-start" "${pkgs.tint2}/bin/tint2 -c ${tint2rc} &"; 32 | in "${scriptPkg}/bin/tint2-start"; 33 | ExecStop = "pkill tint2"; 34 | Restart = "on-failure"; 35 | }; 36 | }; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /modules/windowManagers/stumpwm/default.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, lib, ... }: 2 | 3 | with lib; 4 | 5 | let 6 | cfg = config.windowManager.ebn.stumpwm; 7 | ebn-stumpwm = pkgs.ebn.ebn-stumpwm; 8 | in { 9 | options.windowManager.ebn.stumpwm = { 10 | enable = mkEnableOption "ebn stumpwm"; 11 | }; 12 | 13 | config = mkIf cfg.enable { 14 | services.xserver.windowManager.session = singleton { 15 | name = "ebn-stumpwm"; 16 | start = '' 17 | ${ebn-stumpwm}/bin/ebn-stumpwm.sh & 18 | waitPID=$! 19 | ''; 20 | }; 21 | environment.systemPackages = [ebn-stumpwm]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /modules/windowManagers/xmonad/default.nix: -------------------------------------------------------------------------------- 1 | input@{ config, pkgs, lib, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.windowManager.ebn.xmonad; 6 | ebn-xmonad = pkgs.ebn.ebn-xmonad; 7 | configDir = "xmonad/xmonad-x86_64-linux"; 8 | 9 | in { 10 | 11 | imports = [ ./xcompmgr.nix ]; 12 | 13 | options.windowManager.ebn.xmonad = { 14 | enable = mkEnableOption "Enable ebn xmonad config"; 15 | }; 16 | 17 | config = mkIf cfg.enable { 18 | environment.variables = { 19 | "XMONAD_CONFIG_DIR" = "/etc/xmonad"; 20 | "XMONAD_DATA_DIR" = "/etc/xmonad"; 21 | "XMONAD_CACHE_DIR" = "/etc/xmonad"; 22 | }; 23 | 24 | environment.etc."${configDir}".source = 25 | "${ebn-xmonad}/bin/ebn-xmonad-x86_64-linux"; 26 | 27 | environment.etc."xmonad/build" = { 28 | text = "# This file stops xmonad from recompiling on restart"; 29 | mode = "0774"; 30 | }; 31 | 32 | environment.systemPackages = with pkgs; [ 33 | flameshot 34 | feh 35 | xorg.xset 36 | xmonad-log 37 | nitrogen 38 | xcompmgr 39 | j4-dmenu-desktop 40 | dmenu 41 | (pkgs.writeScriptBin "dmenu-files" (builtins.readFile ./scripts/dmenu_files.sh)) 42 | rxvt-unicode 43 | ]; 44 | 45 | services = { 46 | xserver = { 47 | enable = true; 48 | 49 | displayManager = { 50 | defaultSession = "none+xmonad"; 51 | lightdm.greeters.mini = { 52 | enable = false; 53 | user = "ebn"; 54 | extraConfig = '' 55 | [greeter-theme] 56 | background-image = ""; 57 | background-color = "#0C0F12" 58 | text-color = "#ff79c6" 59 | password-background-color = "#1E2029" 60 | window-color = "#181a23" 61 | border-color = "#bd93f9" 62 | ''; 63 | }; 64 | }; 65 | 66 | displayManager.sessionCommands = '' 67 | xset r rate 500 33 68 | ''; 69 | 70 | windowManager.xmonad.enable = true; 71 | }; 72 | ebn.xcompmgr.enable = true; 73 | }; 74 | }; 75 | } 76 | -------------------------------------------------------------------------------- /modules/windowManagers/xmonad/scripts/dmenu_files.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | shopt -s lastpipe 3 | unset ARRAY; 4 | declare -a ARRAY 5 | ARRAY=() 6 | find $1 -maxdepth 1 ! -path $1 -type f -exec basename {} \; | readarray -t ARRAY 7 | LEN=${#ARRAY[@]} 8 | CHOICE=$(printf "%s\n" "${ARRAY[@]}" | dmenu -l $LEN -i) 9 | [ $? = 0 ] && zathura $(printf "%s/%s" $1 $CHOICE) 10 | -------------------------------------------------------------------------------- /modules/windowManagers/xmonad/xcompmgr.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.services.ebn.xcompmgr; 5 | in with lib; { 6 | options.services.ebn.xcompmgr = { 7 | enable = mkEnableOption "Enable xcompmgr Compositor"; 8 | }; 9 | 10 | config = mkIf cfg.enable { 11 | environment.systemPackages = [ pkgs.xcompmgr ]; 12 | 13 | systemd.user.services.xcompmgr = { 14 | description = "XCompmgr Compositor"; 15 | wantedBy = [ "graphical-session.target" ]; 16 | after = [ "graphical-session-pre.target" ]; 17 | partOf = [ "graphical-session.target" ]; 18 | serviceConfig = { 19 | ExecStart = "${pkgs.xcompmgr}/bin/xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55"; 20 | ExecStop = "pkill xcompmgr"; 21 | Restart = "on-failure"; 22 | RestartSec = 5; 23 | }; 24 | }; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /packages/aurora-vim/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.vimUtils.buildVimPluginFrom2Nix { 4 | pname = "aurora-vim"; 5 | version = "1.0.0"; 6 | src = pkgs.fetchFromGitHub { 7 | owner = "erikbackman"; 8 | repo = "aurora.vim"; 9 | rev = "84f0d8d3f2a0e21f3e1618fd747d1aea6bbf2840"; 10 | sha256 = "0qxv6wq34di7b88yl2982v9f42ijcb86gy320ivmp0ysabdc8gkd"; 11 | }; 12 | meta.homepage = "https://github.com/erikbackman/aurora.vim"; 13 | } 14 | -------------------------------------------------------------------------------- /packages/default.nix: -------------------------------------------------------------------------------- 1 | final: prev: { 2 | ebn = { 3 | ebn-xmonad = prev.callPackage ./ebn-xmonad {}; 4 | ebn-stumpwm = prev.callPackage ./ebn-stumpwm {}; 5 | aurora-vim = prev.callPackage ./aurora-vim {}; 6 | modus-theme-vim = prev.callPackage ./modus-theme-vim {}; 7 | pop-shell = prev.callPackage ./pop-shell {}; 8 | material-design-iconic = prev.callPackage ./material-design-iconic {}; 9 | ebn-core-el = prev.callPackage ./ebn-core.el { trivialBuild = prev.emacsPackages.trivialBuild; }; 10 | iosevka-custom = prev.callPackage ./iosevka-custom {}; 11 | kaolin-themes = prev.callPackage ./emacs-kaolin-themes { trivialBuild = prev.emacsPackages.trivialBuild; }; 12 | }; 13 | zathura = prev.callPackage ./zathura { pkgs = prev; }; 14 | } 15 | -------------------------------------------------------------------------------- /packages/ebn-core.el/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , trivialBuild 3 | , fetchFromGitHub 4 | , emacs 5 | }: 6 | 7 | trivialBuild rec { 8 | pname = "ebn-core-el"; 9 | version = "0.1"; 10 | 11 | src = ./src; 12 | 13 | buildInputs = [ 14 | emacs 15 | ]; 16 | 17 | meta = with lib; { 18 | maintainers = [ ebn ]; 19 | inherit (emacs.meta) platforms; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /packages/ebn-core.el/src/ebn-core.el: -------------------------------------------------------------------------------- 1 | ;;; ebn-core.el -- Random stuff I use -*- lexical-binding: t -*- 2 | 3 | ;; Author: Erik Bäckman 4 | ;; Package-Requires ((emacs "25")) 5 | 6 | ;;; Code: 7 | 8 | (defmacro ebn/font (&rest spec) 9 | `(let ((fs (funcall 'font-spec ,@spec))) 10 | (when (member (font-get fs :name) (font-family-list)) 11 | (set-face-attribute 'default nil :font fs) 12 | (set-face-attribute 'fixed-pitch nil :font fs)))) 13 | 14 | (defmacro ebn/font-variable-pitch (&rest spec) 15 | `(let ((fs (funcall 'font-spec ,@spec))) 16 | (when (member (font-get fs :name) (font-family-list)) 17 | (set-face-attribute 'variable-pitch nil :font fs)))) 18 | 19 | (defun ebn/kill-current-buffer () 20 | "Kill current buffer." 21 | (interactive) 22 | (kill-buffer (current-buffer))) 23 | 24 | (defun ebn/rename-current-file () 25 | "Rename current file to NEWNAME." 26 | (interactive) 27 | (let ((fname (buffer-file-name)) 28 | (bname (buffer-name))) 29 | (if (not (and bname (file-exists-p fname))) 30 | (error "Buffer '%s' is not visiting a file" bname) 31 | (let ((new-name (read-file-name "New name: " fname))) 32 | (if (get-buffer new-name) 33 | (error "Buffer with name %s already exists" new-name) 34 | (rename-file fname new-name t) 35 | (rename-buffer new-name) 36 | (set-visited-file-name new-name) 37 | (set-buffer-modified-p nil) 38 | (message "File renamed to %s" new-name)))))) 39 | 40 | (defun ebn/dired-up-directory () 41 | "Up directory - killing current buffer." 42 | (interactive) 43 | (let ((cb (current-buffer))) 44 | (progn (dired-up-directory) 45 | (kill-buffer cb)))) 46 | 47 | (defun ebn/project-rg () 48 | "Run ripgrep in current project" 49 | (interactive) 50 | (funcall-interactively #'consult-ripgrep (project-root (project-current)))) 51 | 52 | (defun ebn/open-line-below () 53 | "Open a newline below current line." 54 | (interactive) 55 | (move-end-of-line nil) 56 | (newline-and-indent)) 57 | 58 | (defun ebn/open-line-above () 59 | "Open a newline above current line." 60 | (interactive) 61 | (previous-line) 62 | (move-end-of-line nil) 63 | (newline-and-indent)) 64 | 65 | (defun ebn/copy-dwim () 66 | "Run the command `kill-ring-save' on the current region 67 | or the current line if there is no active region." 68 | (interactive) 69 | (if (region-active-p) 70 | (kill-ring-save nil nil t) 71 | (kill-ring-save (point-at-bol) (point-at-eol)))) 72 | 73 | (defun ebn/change-number-at-point (change increment) 74 | (let ((number (number-at-point)) 75 | (point (point))) 76 | (when number 77 | (progn 78 | (forward-word) 79 | (search-backward (number-to-string number)) 80 | (replace-match (number-to-string (funcall change number increment))) 81 | (goto-char point))))) 82 | 83 | (defun ebn/increment-number-at-point (&optional increment) 84 | "Increment number at point like vim's C-a" 85 | (interactive "p") 86 | (ebn/change-number-at-point '+ (or increment 1))) 87 | 88 | (defun ebn/decrement-number-at-point (&optional increment) 89 | "Decrement number at point like vim's C-x" 90 | (interactive "p") 91 | (ebn/change-number-at-point '- (or increment 1))) 92 | 93 | (provide 'ebn-core) 94 | ;;; ebn-core.el ends here 95 | -------------------------------------------------------------------------------- /packages/ebn-stumpwm/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, lib, stdenv, lispPackages, ... }: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "ebn-stumpwm"; 5 | version = "0.0.1"; 6 | unpackPhase = "true"; 7 | 8 | # FIXME propagatedInputs? 9 | buildInputs = [ lispPackages.stumpwm 10 | lispPackages.clwrapper 11 | lispPackages.swank 12 | lispPackages.asdf 13 | lispPackages.clx-truetype ]; 14 | 15 | buildPhase = '' 16 | ''; 17 | 18 | installPhase = '' 19 | mkdir -p $out/bin 20 | script="$out"/bin/ebn-stumpwm.sh 21 | mkdir -p "$(dirname "$script")" 22 | touch "$script" 23 | chmod a+x "$script" 24 | 25 | echo "#! ${stdenv.shell}" >> "$script" 26 | 27 | echo "source ${pkgs.lispPackages.stumpwm}/lib/common-lisp-settings/stumpwm-shell-config.sh" >> "$script" 28 | echo "source ${pkgs.lispPackages.clx-truetype}/lib/common-lisp-settings/clx-truetype-shell-config.sh" >> "$script" 29 | echo "source ${pkgs.lispPackages.swank}/lib/common-lisp-settings/swank-shell-config.sh" >> "$script" 30 | echo "source ${pkgs.lispPackages.asdf}/lib/common-lisp-settings/swank-shell-config.sh" >> "$script" 31 | 32 | echo '"${pkgs.lispPackages.clwrapper}/bin/common-lisp.sh" --quit --eval "(require :stumpwm)" --eval "(stumpwm:stumpwm)"' >> "$script" 33 | ''; 34 | 35 | meta = with lib; { 36 | homepage = https://github.com/stumpwm/stumpwm; 37 | description = "A wrapper to use common-lisp.sh to launch stumpwm"; 38 | license = licenses.gpl2; 39 | maintainers = [ maintainers.ebn ]; 40 | platforms = platforms.unix; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/.gitignore: -------------------------------------------------------------------------------- 1 | result 2 | result-doc 3 | 4 | xmonad.hi 5 | xmonad.o 6 | xmonad.errors 7 | xmonad-x86_64-linux 8 | 9 | dist-newstyle 10 | 11 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Revision history for xmonad 2 | 3 | ## 0.1.0.0 -- YYYY-mm-dd 4 | 5 | * First version. Released on an unsuspecting world. 6 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/build: -------------------------------------------------------------------------------- 1 | BIN=./result/bin/xmonad-x86_64-linux 2 | if test -f $BIN; then 3 | ln -s $BIN ./ -f 4 | else 5 | nix build .# 6 | ln -s $BIN ./ -f 7 | fi 8 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ...}: pkgs.haskell.packages.ghc902.callCabal2nix "ebn-xmonad" ./. { } 2 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/ebn-xmonad.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 2.4 2 | name: ebn-xmonad 3 | version: 0.1.0.0 4 | extra-source-files: CHANGELOG.md 5 | 6 | library 7 | hs-source-dirs: lib 8 | exposed-modules: 9 | Config 10 | Config.Keybinds 11 | Config.Applications 12 | Config.Polybar 13 | Config.Dbus 14 | build-depends: 15 | base, 16 | xmonad, 17 | xmonad-contrib, 18 | X11, 19 | containers, 20 | dbus, 21 | utf8-string, 22 | cpphs, 23 | mtl 24 | 25 | executable ebn-xmonad-x86_64-linux 26 | main-is: xmonad.hs 27 | build-depends: 28 | base, 29 | xmonad, 30 | xmonad-contrib, 31 | X11, 32 | containers, 33 | dbus, 34 | utf8-string, 35 | cpphs, 36 | mtl, 37 | ebn-xmonad 38 | -- hs-source-dirs: 39 | default-language: Haskell2010 40 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/hie.yaml: -------------------------------------------------------------------------------- 1 | cradle: 2 | cabal: 3 | - path: "./xmonad.hs" 4 | component: "exe:ebn-xmonad-x86_64-linux" 5 | - path: "./lib/Config.hs" 6 | component: "lib:ebn-xmonad" 7 | - path: "./lib/Config" 8 | component: "lib:ebn-xmonad" 9 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/lib/Config.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedStrings #-} 2 | {-# OPTIONS_GHC -Wunused-imports #-} 3 | 4 | module Config where 5 | 6 | import qualified Config.Applications as App 7 | import Config.Keybinds (keybinds) 8 | import XMonad 9 | import XMonad.Actions.MessageFeedback 10 | import XMonad.Actions.SpawnOn (manageSpawn) 11 | import XMonad.Hooks.EwmhDesktops (ewmh, fullscreenEventHook, ewmhFullscreen) 12 | import XMonad.Hooks.ManageDocks 13 | import XMonad.Layout.BinarySpacePartition 14 | import XMonad.Layout.MultiToggle (mkToggle, single) 15 | import XMonad.Layout.MultiToggle.Instances (StdTransformers (NBFULL)) 16 | import XMonad.Layout.Named (named) 17 | import XMonad.Layout.PerWorkspace (onWorkspace) 18 | import XMonad.Layout.Reflect 19 | import XMonad.Layout.SimpleFloat (simpleFloat) 20 | import XMonad.Layout.Spacing 21 | import XMonad.Layout.ThreeColumns 22 | import XMonad.Layout.WindowNavigation (configurableNavigation, noNavigateBorders) 23 | import XMonad.Util.Cursor (setDefaultCursor) 24 | 25 | main :: IO () 26 | main = xmonad . ewmh . docks $ cfg 27 | where 28 | cfg = 29 | def 30 | { manageHook = App.manageApps <+> manageSpawn, 31 | startupHook = myStartupHook, 32 | modMask = mod4Mask, 33 | borderWidth = 2, 34 | keys = keybinds, 35 | handleEventHook = handleEventHook def <+> fullscreenEventHook, 36 | layoutHook = myLayouts, 37 | focusedBorderColor = "#9880ea", 38 | normalBorderColor = "#B0BEC5", 39 | workspaces = workspaceIds 40 | } 41 | 42 | myStartupHook :: X () 43 | myStartupHook = do 44 | setDefaultCursor xC_left_ptr 45 | 46 | -- Workspaces --------------------------------------------------------------- 47 | 48 | webWs = "web" 49 | 50 | devWs = "dev" 51 | 52 | comWs = "com" 53 | 54 | wrkWs = "wrk" 55 | 56 | etcWs = "etc" 57 | 58 | workspaceIds :: [WorkspaceId] 59 | workspaceIds = [webWs, devWs, comWs, wrkWs, etcWs] 60 | 61 | myLayouts = 62 | avoidStruts 63 | . configurableNavigation noNavigateBorders 64 | -- . simpleDeco shrinkText (def { decoWidth = 100 }) 65 | . gapSpaced 66 | -- . smartBorders 67 | . fullScreenToggle 68 | . comLayout 69 | . devLayout 70 | . webLayout 71 | . etcLayout 72 | . wrkLayout 73 | $ (tiled ||| Mirror tiled ||| column3 ||| full) 74 | where 75 | tiled = 76 | named "Default" $ 77 | Tall nmaster ratio_increment ratio 78 | where 79 | ratio = 1 / 2 80 | 81 | full = named "Full" Full 82 | 83 | column3 = 84 | named "Three Col" $ 85 | ThreeColMid nmaster ratio_increment ratio 86 | where 87 | ratio = 1 / 3 88 | 89 | column2 = 90 | named "Master 2/3" $ 91 | reflectHoriz $ Tall nmaster ratio_increment ratio 92 | where 93 | ratio = 2 / 3 94 | 95 | nmaster = 1 96 | ratio_increment = 3 / 100 97 | 98 | gapSpaced = spacingRaw False (Border 2 2 2 2) True (Border 1 1 1 1) True 99 | fullScreenToggle = mkToggle (single NBFULL) 100 | 101 | comLayout = onWorkspace comWs (tiled ||| full) 102 | devLayout = onWorkspace devWs (column2 ||| full ||| column3) 103 | webLayout = onWorkspace webWs (tiled ||| full) 104 | wrkLayout = onWorkspace wrkWs (tiled ||| full) 105 | etcLayout = onWorkspace etcWs simpleFloat 106 | 107 | tryResize :: ResizeDirectional -> Resize -> X () 108 | tryResize x y = sequence_ [tryMessageWithNoRefreshToCurrent x y, refresh] 109 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/lib/Config/Applications.hs: -------------------------------------------------------------------------------- 1 | module Config.Applications where 2 | 3 | import Control.Monad.IO.Class (MonadIO) 4 | import XMonad 5 | ( ManageHook, 6 | Query, 7 | appName, 8 | className, 9 | doIgnore, 10 | resource, 11 | spawn, 12 | stringProperty, 13 | title, 14 | (<&&>), 15 | (<||>), 16 | (=?), 17 | ) 18 | import XMonad.Hooks.InsertPosition 19 | import XMonad.Hooks.ManageHelpers 20 | ( composeOne, 21 | doCenterFloat, 22 | doFullFloat, 23 | isDialog, 24 | isFullscreen, 25 | isInProperty, 26 | (-?>), 27 | ) 28 | 29 | type AppName = String 30 | 31 | type AppTitle = String 32 | 33 | type AppClassName = String 34 | 35 | type AppCommand = String 36 | 37 | data App 38 | = ClassApp AppClassName AppCommand 39 | | TitleApp AppTitle AppCommand 40 | | NameApp AppName AppCommand 41 | deriving (Show) 42 | 43 | maybeSpawn :: MonadIO m => Maybe App -> m () 44 | maybeSpawn = maybe (pure ()) (spawn . appCommand) 45 | 46 | manageApps :: ManageHook 47 | manageApps = 48 | composeOne 49 | [ resource =? "desktop_window" -?> doIgnore, 50 | resource =? "kdesktop" -?> doIgnore, 51 | anyOf 52 | [ isFileChooserDialog, 53 | isDialog, 54 | isPopup, 55 | isSplash 56 | ] 57 | -?> doCenterFloat, 58 | isFullscreen -?> doFullFloat, 59 | pure True -?> tileBelow 60 | ] 61 | 62 | appCommand :: App -> String 63 | appCommand (ClassApp _ s) = s 64 | appCommand (TitleApp _ s) = s 65 | appCommand (NameApp _ s) = s 66 | 67 | tileBelow :: ManageHook 68 | tileBelow = insertPosition Below Newer 69 | 70 | anyOf :: [Query Bool] -> Query Bool 71 | anyOf = foldl (<||>) (pure False) 72 | 73 | match :: [App] -> Query Bool 74 | match = anyOf . fmap isInstance 75 | 76 | isInstance :: App -> Query Bool 77 | isInstance (ClassApp c _) = className =? c 78 | isInstance (TitleApp t _) = title =? t 79 | isInstance (NameApp n _) = appName =? n 80 | 81 | isClassDialog :: String -> Query Bool 82 | isClassDialog name = isDialog <&&> className =? name 83 | 84 | isFileChooserDialog :: Query Bool 85 | isFileChooserDialog = isRole =? "GtkFileChooserDialog" 86 | 87 | isPopup :: Query Bool 88 | isPopup = isRole =? "pop-up" 89 | 90 | isSplash :: Query Bool 91 | isSplash = isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_SPLASH" 92 | 93 | isRole :: Query String 94 | isRole = stringProperty "WM_WINDOW_ROLE" 95 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/lib/Config/Dbus.hs: -------------------------------------------------------------------------------- 1 | module Config.Dbus where 2 | 3 | import qualified Codec.Binary.UTF8.String as UTF8 4 | import qualified DBus as D 5 | import qualified DBus.Client as D 6 | import qualified DBus.Internal.Types as D 7 | import Control.Applicative 8 | import Control.Monad 9 | 10 | data SignalConfig = SignalConfig 11 | { sObjectPath :: String 12 | , sInterfaceName :: String 13 | , sMemberName :: String 14 | } 15 | 16 | mkDbusClient :: String -> IO D.Client 17 | mkDbusClient busname = D.connectSession >>= \dbus -> requestBus dbus >> pure dbus 18 | where 19 | requestBus dbus = D.requestName dbus (D.busName_ busname) opts 20 | opts = [D.nameAllowReplacement, D.nameReplaceExisting, D.nameDoNotQueue] 21 | 22 | -- Emit a DBus signal on log updates 23 | dbusOutput :: SignalConfig -> D.Client -> String -> IO () 24 | dbusOutput sconf dbus str = 25 | let opath = D.objectPath_ $ sObjectPath sconf 26 | iname = D.interfaceName_ $ sInterfaceName sconf 27 | mname = D.memberName_ $ sMemberName sconf 28 | signal = D.signal opath iname mname 29 | body = [D.toVariant $ UTF8.decodeString str] 30 | 31 | in D.emit dbus $ signal {D.signalBody = body} 32 | 33 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/lib/Config/Keybinds.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE BlockArguments #-} 2 | {-# LANGUAGE NamedFieldPuns #-} 3 | {-# OPTIONS_GHC -Wunused-imports #-} 4 | 5 | module Config.Keybinds where 6 | 7 | import qualified Config.Applications as Apps 8 | import Config.Applications (App(..)) 9 | import Data.Map (Map) 10 | import qualified Data.Map as M 11 | import Graphics.X11 12 | import System.Exit 13 | import XMonad 14 | import XMonad.Actions.WindowGo (runOrRaise) 15 | import XMonad.Actions.WithAll (killAll) 16 | import XMonad.Layout.MultiToggle (Toggle (..)) 17 | import XMonad.Layout.MultiToggle.Instances (StdTransformers (NBFULL)) 18 | import qualified XMonad.StackSet as W 19 | 20 | keybinds :: XConfig l -> Map (KeyMask, KeySym) (X ()) 21 | keybinds conf@XConfig {XMonad.modMask = modm} = 22 | M.fromList $ 23 | [ ((modm, xK_q), restart'), 24 | ((modm .|. shiftMask, xK_q), io exitSuccess), 25 | ((modm .|. shiftMask, xK_Return), spawn $ Apps.appCommand terminal), 26 | ((modm, xK_c), kill), 27 | ((modm .|. shiftMask, xK_c), killAll), 28 | ((modm, xK_p), spawn launcher), 29 | ((modm, xK_o), spawn documents), 30 | ((modm, xK_6), spawn "emacsclient -c"), 31 | ((modm, xK_7), spawn "emacsclient -e '(emacs-everywhere)'"), 32 | ((modm, xK_8), runOrRaise' browser), 33 | ((modm, xK_space), sendMessage NextLayout), 34 | ((modm, xK_n), windows W.focusUp), 35 | ((modm, xK_m), windows W.focusDown), 36 | ((modm, xK_Return), windows W.swapMaster), 37 | ((modm, xK_f), sendMessage (Toggle NBFULL)), 38 | ((modm .|. shiftMask, xK_t), withFocused toggleFloat) 39 | ] 40 | <> switchWsById 41 | where 42 | restart' = restart "xmonad" True 43 | terminal = ClassApp "urxvt" "urxvt" 44 | editor = ClassApp "emacsclient" "emacsclient -c" 45 | browser = ClassApp "qutebrowser" "qutebrowser" 46 | launcher = "j4-dmenu-desktop" 47 | documents = "dmenu-files /home/ebn/Documents/books" 48 | 49 | switchWsById = 50 | [ ((m, k), windows $ f i) 51 | | (i, k) <- zip (XMonad.workspaces conf) [xK_F1 .. xK_F6], 52 | (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)] 53 | ] 54 | 55 | toggleFloat w = 56 | windows \s -> 57 | if M.member w (W.floating s) 58 | then W.sink w s 59 | else W.float w (W.RationalRect (1 / 3) (1 / 4) (1 / 2) (4 / 5)) s 60 | 61 | runOrRaise' :: App -> X () 62 | runOrRaise' app = runOrRaise (Apps.appCommand app) (Apps.isInstance app) 63 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/lib/Config/Polybar.hs: -------------------------------------------------------------------------------- 1 | module Config.Polybar where 2 | 3 | import qualified DBus.Client as D 4 | import XMonad.Hooks.DynamicLog (PP(..), wrap) 5 | import XMonad.Util.NamedScratchpad (namedScratchpadFilterOutWorkspacePP) 6 | import Config.Dbus (mkDbusClient, dbusOutput, SignalConfig(..)) 7 | import XMonad (def) 8 | import DBus.Client (Client) 9 | 10 | polybar :: IO Client 11 | polybar = mkDbusClient "org.xmonad.log" 12 | 13 | polybarHook :: D.Client -> PP 14 | polybarHook dbus = 15 | namedScratchpadFilterOutWorkspacePP $ 16 | def 17 | { ppOutput = dbusOutput signalConfig dbus, 18 | ppCurrent = wrapper focusedFg, 19 | ppVisible = wrapper fg, 20 | ppUrgent = wrapper red, 21 | ppHidden = wrapper gray, 22 | ppWsSep = "", 23 | ppSep = " :: ", 24 | ppTitle = const "" 25 | } 26 | where 27 | signalConfig = SignalConfig 28 | { sObjectPath = "/org/xmonad/Log", 29 | sInterfaceName = "org.xmonad.Log", 30 | sMemberName = "Update" 31 | } 32 | 33 | wrapper c s = wrap ("%{F" <> c <> "} ") " %{F-}" s 34 | blue = "#2E9AFE" 35 | gray = "#7F7F7F" 36 | orange = "#ea4300" 37 | purple = "#9058c7" 38 | focusedFg = "#bd93f9" 39 | fg = "#ebdbb2" 40 | bg = "#282828" 41 | bg1 = "#3c3836" 42 | red = "#fb4934" 43 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/xmonad.hs: -------------------------------------------------------------------------------- 1 | import qualified Config 2 | 3 | main :: IO () 4 | main = Config.main 5 | -------------------------------------------------------------------------------- /packages/ebn-xmonad/xpm/haskell_20.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * haskell_20_xpm[] = { 3 | "20 20 2 1", 4 | " c None", 5 | ". c #7c5295", 6 | " ", 7 | " ", 8 | " ", 9 | ".... .... ", 10 | " .... ... ", 11 | " ... .... ", 12 | " .... .... ", 13 | " .... ... ........", 14 | " ... .... .......", 15 | " .... .... ", 16 | " .... .... ", 17 | " ... ...... .....", 18 | " .... ....... ....", 19 | " .... .... ... ", 20 | " ... .... .... ", 21 | " .... ... .... ", 22 | ".... .... ... ", 23 | " ", 24 | " ", 25 | " "}; 26 | -------------------------------------------------------------------------------- /packages/emacs-kaolin-themes/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , trivialBuild 3 | , fetchFromGitHub 4 | , emacs 5 | , emacsPackages 6 | , pkgs 7 | }: 8 | 9 | emacsPackages.melpaBuild rec { 10 | pname = "kaolin-themes"; 11 | version = "1.6.4"; 12 | 13 | commit = "c5544e32ad799ad8d7204207e681f47a77c7b1e1"; 14 | 15 | src = fetchFromGitHub { 16 | owner = "erikbackman"; 17 | repo = "emacs-kaolin-themes"; 18 | rev = "c5544e32ad799ad8d7204207e681f47a77c7b1e1"; 19 | sha256 = "1dv7hdhchgfz7siqi6m15ljwjqwn8abpqch306rp8w0678yd8p0p"; 20 | }; 21 | 22 | buildInputs = [ 23 | emacs 24 | emacsPackages.cl-lib 25 | emacsPackages.autothemer 26 | ]; 27 | 28 | packageRequires = [ 29 | emacsPackages.cl-lib 30 | emacsPackages.autothemer 31 | ]; 32 | 33 | recipe = pkgs.writeText "recipe" '' 34 | (kaolin-themes 35 | :repo "erikbackman/emacs-kaolin-themes" 36 | :fetcher github 37 | :files ("*.el" "themes/*.el")) 38 | ''; 39 | 40 | meta = with lib; { 41 | maintainers = [ ebn ]; 42 | inherit (emacs.meta) platforms; 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /packages/iosevka-custom/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.iosevka.override { 4 | privateBuildPlan = '' 5 | [buildPlans.iosevka-custom] 6 | family = "Iosevka Custom" 7 | spacing = "normal" 8 | serifs = "sans" 9 | no-cv-ss = true 10 | 11 | [buildPlans.iosevka-custom.variants] 12 | inherits = "ss08" 13 | 14 | [buildPlans.iosevka-custom.ligations] 15 | inherits = "haskell" 16 | ''; 17 | set = "custom"; 18 | } 19 | -------------------------------------------------------------------------------- /packages/material-design-iconic/default.nix: -------------------------------------------------------------------------------- 1 | { lib, fetchzip }: 2 | 3 | let 4 | version = "2.2.0"; 5 | in fetchzip rec { 6 | name = "material-design-iconic-${version}"; 7 | url = "https://github.com/zavoloklom/material-design-iconic-font/archive/${version}/material-design-iconic-font.zip"; 8 | 9 | postFetch = '' 10 | mkdir -p $out/share/fonts/truetype 11 | unzip -j $downloadedFile \*.ttf -d $out/share/fonts/truetype 12 | ''; 13 | 14 | sha256 = "53FaCgXftIYB4lV6suHYiYqlgaPeIYHx/Y3WV46e8g8="; 15 | 16 | meta = with lib; { 17 | homepage = "https://zavoloklom.github.io/material-design-iconic-font"; 18 | description = "Full suite of material design icons"; 19 | longDescription = '' 20 | Material Design Iconic Font is a full suite of official material design icons (created and maintained by Google), 21 | with additional community-designed and brands icons for easy scalable vector graphics on websites or desktop 22 | ''; 23 | maintainers = with maintainers; [ ebn ]; 24 | license = licenses.cc-by-sa-40; 25 | platforms = platforms.all; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /packages/modus-theme-vim/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.vimUtils.buildVimPluginFrom2Nix { 4 | pname = "modus-theme-vim"; 5 | version = "1.0.0"; 6 | src = pkgs.fetchFromGitHub { 7 | owner = "ishan9299"; 8 | repo = "modus-theme-vim"; 9 | rev = "6b82be8589a590405c1347f17402d845e52d776f"; 10 | sha256 = "1qyw5n9ig8pj5wnh2ic7ap897ix6nzg00cn6mcmw91aryzmgpi25"; 11 | }; 12 | meta.homepage = "https://github.com/ishan9299/modus-theme-vim"; 13 | } 14 | -------------------------------------------------------------------------------- /packages/modus-themes/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , trivialBuild 3 | , fetchFromGitHub 4 | , emacs 5 | , emacsPackages 6 | , pkgs 7 | }: 8 | 9 | emacsPackages.melpaBuild rec { 10 | pname = "modus-themes"; 11 | version = "1.6.4"; 12 | 13 | commit = "1cff9f114526505b621111d7d68294c1d269bada"; 14 | 15 | src = fetchFromGitHub { 16 | owner = "erikbackman"; 17 | repo = "modus-themes"; 18 | rev = "2f5b7ccbc4d13500344b1e5c9fe1be88d3ca964b"; 19 | sha256 = "169ns1gy58a4gx3zl8kzg6ibxwr0vrfx2k6svyhyfv0xd1z0h404"; 20 | }; 21 | 22 | buildInputs = [ 23 | emacs 24 | emacsPackages.cl-lib 25 | emacsPackages.autothemer 26 | ]; 27 | 28 | packageRequires = [ 29 | emacsPackages.cl-lib 30 | emacsPackages.autothemer 31 | ]; 32 | 33 | recipe = pkgs.writeText "recipe" '' 34 | (modus-themes 35 | :repo "erikbackman/emacs-modus-themes" 36 | :fetcher github 37 | :branch "main") 38 | ''; 39 | 40 | meta = with lib; { 41 | maintainers = [ ebn ]; 42 | inherit (emacs.meta) platforms; 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /packages/pop-shell/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv, lib, fetchFromGitHub, nodejs, nodePackages, glib }: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "gnome-shell-extension-pop-shell"; 5 | version = "2021-10-13"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "pop-os"; 9 | repo = "shell"; 10 | rev = "e7f30249a18317de3a54dc185e3a547ee4a74022"; 11 | sha256 = "0z9dhcgm96bp7b15vng06bsv6dbyas4rxg1vyhzmvpdnxz0d2hjd"; 12 | }; 13 | 14 | uuid = "pop-shell@system76.com"; 15 | 16 | nativeBuildInputs = [ glib nodePackages.typescript]; 17 | 18 | makeFlags = [ 19 | "INSTALLBASE=$(out)/share/gnome-shell/extensions" 20 | "PLUGIN_BASE=$(out)/lib/pop-shell/launcher" 21 | "SCRIPTS_BASE=$(out)/lib/pop-shell/scripts" 22 | ]; 23 | 24 | postInstall = '' 25 | 26 | mkdir -p $out/share/gsettings-schemas/pop-shell-${version}/glib-2.0 27 | 28 | schemadir=${glib.makeSchemaPath "$out" "${pname}-${version}"} 29 | mkdir -p $schemadir 30 | cp -r $out/share/gnome-shell/extensions/$uuid/schemas/* $schemadir 31 | 32 | ''; 33 | 34 | meta = with lib; { 35 | description = "i3wm-like keyboard-driven layer for GNOME Shell"; 36 | homepage = "https://github.com/pop-os/shell"; 37 | license = licenses.gpl3; 38 | maintainers = with maintainers; [ ebn ]; 39 | platforms = platforms.linux; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /packages/zathura/config/zathurarc: -------------------------------------------------------------------------------- 1 | set default-fg "#2e3338" 2 | set default-bg "#F5F5F5" 3 | 4 | set completion-bg "#3b4252" 5 | set completion-fg "#eceff4" 6 | set completion-highlight-bg "#4c566a" 7 | set completion-highlight-fg "#eceff4" 8 | set completion-group-bg "#3b4252" 9 | set completion-group-fg "#88c0d0" 10 | 11 | set statusbar-fg "#2e3440" 12 | set statusbar-bg "#f2f3f5" 13 | set statusbar-h-padding 10 14 | set statusbar-v-padding 10 15 | 16 | set notification-bg "#eceff4" 17 | set notification-fg "#2e3440" 18 | set notification-error-bg "#eceff4" 19 | set notification-error-fg "#bf616a" 20 | set notification-warning-bg "#d8dee9" 21 | set notification-warning-fg "#ebcb8b" 22 | set selection-notification "true" 23 | 24 | set inputbar-fg "#3b4252" 25 | set inputbar-bg "#eceff4" 26 | 27 | set recolor "true" 28 | set recolor-lightcolor "#F5F5F5" 29 | set recolor-darkcolor "#161c20" 30 | 31 | set index-fg "#2e3440" 32 | set index-bg "#eceff4" 33 | set index-active-fg "#2e3440" 34 | set index-active-bg "#e5e9f0" 35 | 36 | set render-loading-bg "#eceff4" 37 | set render-loading-fg "#2e3440" 38 | 39 | set highlight-color "#88c0d0" 40 | set highlight-active-color "#5e81ac" 41 | 42 | set adjust-open width 43 | 44 | map \< goto top 45 | map \> goto bottom 46 | map b navigate previous 47 | map e follow 48 | map f navigate next 49 | map p goto top 50 | 51 | map zoom in 52 | map zoom out 53 | map zoom in 54 | map adjust_window best-fit 55 | map adjust_window width 56 | map scroll full-left 57 | map scroll left 58 | map scroll full-right 59 | map scroll right 60 | map abort 61 | map scroll down 62 | map scroll up 63 | map scroll full-down 64 | 65 | map goto top 66 | map > goto bottom 67 | map scroll full-up -------------------------------------------------------------------------------- /packages/zathura/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let config = pkgs.writeTextDir "zathurarc" (builtins.readFile ./config/zathurarc); 4 | wrapped = pkgs.writeShellScriptBin "zathura" ''exec ${pkgs.zathura}/bin/zathura -c ${config.outPath} $@''; 5 | package = pkgs.symlinkJoin rec { 6 | name = "zathura"; 7 | paths = [ 8 | wrapped 9 | pkgs.zathura 10 | ]; 11 | }; 12 | in package 13 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | 3 | with pkgs; 4 | let 5 | cLibsAndTools = [ 6 | clang 7 | zlib 8 | pkg-config 9 | xorg.libX11 10 | xorg.libXinerama 11 | xorg.libXrandr 12 | xorg.libXScrnSaver 13 | xorg.libXext 14 | ]; 15 | 16 | ebn-xmonad = import ./packages/ebn-xmonad pkgs; 17 | haskellTooling = [ 18 | cabal-install 19 | ghcid 20 | haskellPackages.hindent 21 | haskellPackages.ormolu 22 | haskellPackages.haskell-language-server 23 | ]; 24 | 25 | in mkShell { 26 | buildInputs = cLibsAndTools ++ haskellTooling ++ [ rnix-lsp ] 27 | ++ [ sumneko-lua-language-server ]; 28 | 29 | inputsFrom = [ ebn-xmonad.env ]; 30 | shellHook = '' 31 | alias nrb="nixos-rebuild build --flake ." 32 | alias nrt="sudo nixos-rebuild test --flake ." 33 | alias nrs="sudo nixos-rebuild switch --flake ." 34 | ''; 35 | } 36 | --------------------------------------------------------------------------------