diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..093e5f6 --- /dev/null +++ b/.envrc @@ -0,0 +1,2 @@ +use nix +watch_file deps/sources.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7b27fca --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.pre-commit-config.yaml +.direnv +result +result-* +nixmoxer.conf diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e6c56d1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Julien Malka + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 7e9f06c..63d8cb6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,24 @@ -# nix-config -My Machines configuration +# Snowfield ❄ +[![Build status](https://ci.julienmalka.me/badges/JulienMalka_snowfield_nix-eval.svg)](https://ci.julienmalka.me/#/builders/16) [![built with nix](https://img.shields.io/static/v1?logo=nixos&logoColor=white&label=&message=Built%20with%20Nix&color=41439a)](https://builtwithnix.org) + +This repository contains the configurations of my machines using NixOS. + +### *What is NixOS ?* + +NixOS is a linux distribution based on the Nix package manager. It allows fully reproducible builds and a declarative configuration style, using a functionnal langage called Nix (yes, it is the same name as the package manager and the OS). + +Machines configurations are located in the machines folder, and are using all the custom modules defined in this project. + +#### Modules + +This configuration defines a number of custom NixOS and home-manager modules. They are respectively defined in the modules and home-manager-modules folders. + +#### Secrets + +Secrets are stored in the secrets folder. They are uncrypted upon system activation using the host ssh key. Secrets are managed using agenix. + +### Inspirations + +This project is freely inspired by some really cool projects, including MayNiklas/nixos, pinox/nixos and ncfavier/config. + + diff --git a/base.nix b/base.nix deleted file mode 100644 index d6d0d1d..0000000 --- a/base.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, pkgs, ... }: - -{ - - imports = [ ./users/julien.nix ]; - luj.nix.enable = true; - - time.timeZone = "Europe/Paris"; - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "fr"; - }; - - - services.openssh.enable = true; - programs.mosh.enable = true; - programs.gnupg.agent.enable = true; - -} diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..b2b4032 --- /dev/null +++ b/default.nix @@ -0,0 +1,94 @@ +let + inputs = import ./lon.nix; + inputs_final = inputs; + dnsLib = (import inputs.dns).lib; + lib = (import "${inputs.nixpkgs}/lib").extend (import ./lib inputs_final self.profiles dnsLib); + mkLibForMachine = + machine: + (import "${lib.snowfield.${machine}.nixpkgs_version}/lib").extend ( + import ./lib inputs_final self.profiles dnsLib + ); + machines_plats = lib.lists.unique ( + lib.mapAttrsToList (_name: value: value.arch) ( + lib.filterAttrs (_n: v: builtins.hasAttr "arch" v) lib.snowfield + ) + ); + + nixpkgs_plats = builtins.listToAttrs ( + builtins.map (plat: { + name = plat; + value = import inputs.nixpkgs { system = plat; }; + }) machines_plats + ); + self = rec { + + nixosModules = builtins.listToAttrs ( + map (x: { + name = x; + value = import (./modules + "/${x}"); + }) (builtins.attrNames (builtins.readDir ./modules)) + ); + + profiles = builtins.listToAttrs ( + map (x: { + name = lib.strings.removeSuffix ".nix" x; + value = import (./profiles + "/${x}"); + }) (builtins.attrNames (builtins.readDir ./profiles)) + ); + + nixosConfigurations = builtins.mapAttrs ( + name: value: + (lib.mkMachine { + inherit name self dnsLib; + host-config = value; + modules = builtins.attrValues nixosModules ++ lib.snowfield.${name}.profiles; + nixpkgs = lib.snowfield.${name}.nixpkgs_version; + system = lib.snowfield.${name}.arch; + home-manager = lib.snowfield.${name}.hm_version; + }) + ) (lib.importConfig ./machines); + + colmena = { + meta = { + nodeNixpkgs = builtins.mapAttrs ( + n: _: import lib.snowfield.${n}.nixpkgs_version + ) nixosConfigurations; + nodeSpecialArgs = builtins.mapAttrs ( + n: v: v._module.specialArgs // { lib = mkLibForMachine n; } + ) nixosConfigurations; + }; + } // builtins.mapAttrs (_: v: { imports = v._module.args.modules; }) nixosConfigurations; + + packages = builtins.listToAttrs ( + builtins.map (plat: { + name = plat; + value = + lib.filterAttrs + ( + _name: value: + ( + !lib.hasAttrByPath [ + "meta" + "platforms" + ] value + ) + || builtins.elem plat value.meta.platforms + ) + ( + builtins.listToAttrs ( + builtins.map (e: { + name = e; + value = nixpkgs_plats.${plat}.callPackage (./packages + "/${e}") { }; + }) (builtins.attrNames (builtins.readDir ./packages)) + ) + ); + }) machines_plats + ); + + checks = { + inherit packages; + machines = lib.mapAttrs (_: v: v.config.system.build.toplevel) nixosConfigurations; + }; + }; +in +self diff --git a/flake.lock b/flake.lock deleted file mode 100644 index ca03e74..0000000 --- a/flake.lock +++ /dev/null @@ -1,237 +0,0 @@ -{ - "nodes": { - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1627913399, - "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "locked": { - "lastModified": 1629481132, - "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "997f7efcb746a9c140ce1f13c72263189225f482", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1640037534, - "narHash": "sha256-lbD5EEqu2tXq3qo6UN3cZkWZA0hEWQkhluctivMtLZY=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "aef97988dac0541747de8bcc85c7e27726eea4af", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "homepage": { - "flake": false, - "locked": { - "lastModified": 1639518131, - "narHash": "sha256-YuwHCXEbrzuEyRy1/2bX4Rux/nqmzRZ8H44+83JQNV8=", - "owner": "JulienMalka", - "repo": "homepage", - "rev": "29e779d8600b1c1e6235570a3614a54f8ec8126e", - "type": "github" - }, - "original": { - "owner": "JulienMalka", - "repo": "homepage", - "type": "github" - } - }, - "neovim-flake": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - }, - "locked": { - "dir": "contrib", - "lastModified": 1640040739, - "narHash": "sha256-uuG7GM/N5T+cOpJ55+NnWCC+GhzGQElIIUUELY13WII=", - "owner": "neovim", - "repo": "neovim", - "rev": "1062ea2cc532b32862346a1972073f1a8dd6d19d", - "type": "github" - }, - "original": { - "dir": "contrib", - "owner": "neovim", - "repo": "neovim", - "type": "github" - } - }, - "neovim-nightly-overlay": { - "inputs": { - "flake-compat": "flake-compat", - "neovim-flake": "neovim-flake", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1640074481, - "narHash": "sha256-AY6pRenvEJamWWYV+WfkEmF5KN+SNUjhj7EOaqEEGf0=", - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "rev": "d69c7f42edb31bf839373cabb8e834aab85b338c", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1640053112, - "narHash": "sha256-7C0UQssCdAMyCNSv8szLJfZ5xYMBr9mh27zYUmo8wHQ=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "c478eaf416411a7dedf773185b6d5bfc966a80ae", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1639966735, - "narHash": "sha256-FmVGFiyqE+pjQUTCTY0H75hqrnBnbEf3VVRB4dsd4KI=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "d87b72206aadebe6722944f541f55d33fd7046fb", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1640077788, - "narHash": "sha256-YMSDk3hlucJTTARaHNOeQEF6zEW3A/x4sXgrz94VbS0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9ab7d12287ced0e1b4c03b61c781901f178d9d77", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-21.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1638097282, - "narHash": "sha256-EXCzj9b8X/lqDPJapxZThIOKL5ASbpsJZ+8L1LnY1ig=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "78cb77b29d37a9663e05b61abb4fa09465da4b70", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nur": { - "locked": { - "lastModified": 1640109122, - "narHash": "sha256-IlbvQ+Grm8+qAEYW+a111+NsMeosjFF6GwYTSRXHOKk=", - "owner": "nix-community", - "repo": "NUR", - "rev": "b9810aabbd64485f31bea99096af5fae26177689", - "type": "github" - }, - "original": { - "id": "nur", - "type": "indirect" - } - }, - "root": { - "inputs": { - "home-manager": "home-manager", - "homepage": "homepage", - "neovim-nightly-overlay": "neovim-nightly-overlay", - "nixpkgs": "nixpkgs_3", - "nur": "nur", - "sops-nix": "sops-nix", - "unstable": "unstable" - } - }, - "sops-nix": { - "inputs": { - "nixpkgs": "nixpkgs_4" - }, - "locked": { - "lastModified": 1638821683, - "narHash": "sha256-oyqALhGijy2ZQxFSACrcC+Z8MzYLiomKCr9FQXVZ47U=", - "owner": "Mic92", - "repo": "sops-nix", - "rev": "afe00100b16648c1d79e62926caacac561df93a5", - "type": "github" - }, - "original": { - "owner": "Mic92", - "repo": "sops-nix", - "type": "github" - } - }, - "unstable": { - "locked": { - "lastModified": 1640053112, - "narHash": "sha256-7C0UQssCdAMyCNSv8szLJfZ5xYMBr9mh27zYUmo8wHQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c478eaf416411a7dedf773185b6d5bfc966a80ae", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index acbaf97..0000000 --- a/flake.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - description = "A flake for my personnal configurations"; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11"; - - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - neovim-nightly-overlay = { - url = "github:nix-community/neovim-nightly-overlay"; - }; - homepage = { - url = "github:JulienMalka/homepage"; - flake = false; - }; - - unstable = { - url = "github:NixOS/nixpkgs/nixos-unstable"; - }; - - sops-nix = { - url = "github:Mic92/sops-nix"; - }; - - }; - - outputs = { self, home-manager, nixpkgs, unstable, sops-nix, neovim-nightly-overlay, nur, ... }@inputs: - let - utils = import ./utils.nix { inherit nixpkgs sops-nix home-manager inputs; nixpkgs-unstable = unstable; }; - in - with utils; - { - nixosModules = builtins.listToAttrs (map - (x: { - name = x; - value = import (./modules + "/${x}"); - }) - (builtins.attrNames (builtins.readDir ./modules))); - - nixosConfigurations = builtins.mapAttrs (name: value: (mkMachine name value self.nixosModules)) (importConfig ./machines); - hydraJobs = (nixpkgs.lib.mapAttrs' (name: config: - nixpkgs.lib.nameValuePair "nixos-${name}" - config.config.system.build.toplevel) self.nixosConfigurations); - - }; -} diff --git a/hive.nix b/hive.nix new file mode 100644 index 0000000..aad91c8 --- /dev/null +++ b/hive.nix @@ -0,0 +1 @@ +let outputs = import ./.; in outputs.colmena diff --git a/home-manager-modules/alacritty/config b/home-manager-modules/alacritty/config new file mode 100644 index 0000000..b539f49 --- /dev/null +++ b/home-manager-modules/alacritty/config @@ -0,0 +1,990 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +# Import additional configuration files +# +# Imports are loaded in order, skipping all missing files, with the importing +# file being loaded last. If a field is already present in a previous import, it +# will be replaced. +# +# All imports must either be absolute paths starting with `/`, or paths relative +# to the user's home directory starting with `~/`. +#import: +# - /path/to/alacritty.yml + +# Any items in the `env` entry below will be added as +# environment variables. Some entries may override variables +# set by alacritty itself. + + +env: + TERM: xterm-256color + +#env: + # TERM variable + # + # This value is used to set the `$TERM` environment variable for + # each instance of Alacritty. If it is not present, alacritty will + # check the local terminfo database and use `alacritty` if it is + # available, otherwise `xterm-256color` is used. + #TERM: alacritty + +window: + # Window dimensions (changes require restart) + # + # Number of lines/columns (not pixels) in the terminal. Both lines and columns + # must be non-zero for this to take effect. The number of columns must be at + # least `2`, while using a value of `0` for columns and lines will fall back + # to the window manager's recommended size + #dimensions: + # columns: 0 + # lines: 0 + + # Window position (changes require restart) + # + # Specified in number of pixels. + # If the position is not set, the window manager will handle the placement. + #position: + # x: 0 + # y: 0 + + # Window padding (changes require restart) + # + # Blank space added around the window in pixels. This padding is scaled + # by DPI and the specified value is always added at both opposing sides. + padding: + x: 10 + y: 10 + + # Spread additional padding evenly around the terminal content. + #dynamic_padding: false + + # Window decorations + # + # Values for `decorations`: + # - full: Borders and title bar + # - none: Neither borders nor title bar + # + # Values for `decorations` (macOS only): + # - transparent: Title bar, transparent background and title bar buttons + # - buttonless: Title bar, transparent background and no title bar buttons + #decorations: full + + # Background opacity + # + # Window opacity as a floating point number from `0.0` to `1.0`. + # The value `0.0` is completely transparent and `1.0` is opaque. + #opacity: 1.0 + + # Startup Mode (changes require restart) + # + # Values for `startup_mode`: + # - Windowed + # - Maximized + # - Fullscreen + # + # Values for `startup_mode` (macOS only): + # - SimpleFullscreen + #startup_mode: Windowed + + # Window title + #title: Alacritty + + # Allow terminal applications to change Alacritty's window title. + #dynamic_title: true + + # Window class (Linux/BSD only): + #class: + # Application instance name + #instance: Alacritty + # General application class + #general: Alacritty + + # Decorations theme variant + # + # Override the variant of the System theme/GTK theme/Wayland client side + # decorations. Commonly supported values are `Dark`, `Light`, and `None` for + # auto pick-up. Set this to `None` to use the default theme variant. + #decorations_theme_variant: None + + # Make `Option` key behave as `Alt` (macOS only): + # - OnlyLeft + # - OnlyRight + # - Both + # - None (default) + #option_as_alt: None + +#scrolling: + # Maximum number of lines in the scrollback buffer. + # Specifying '0' will disable scrolling. + #history: 10000 + + # Scrolling distance multiplier. + #multiplier: 3 + +# Font configuration +font: + #Normal (roman) font face + normal: + # Font family + # + # Default: + # - (macOS) Menlo + # - (Linux/BSD) monospace + # - (Windows) Consolas + family: Fira Code + + # The `style` can be specified to pick a specific face. + style: Regular + + # Bold font face + bold: + # Font family + # + # If the bold family is not specified, it will fall back to the + # value specified for the normal font. + #family: monospace + + # The `style` can be specified to pick a specific face. + style: Bold + + # Italic font face + italic: + # Font family + # + # If the italic family is not specified, it will fall back to the + # value specified for the normal font. + #family: monospace + + # The `style` can be specified to pick a specific face. + style: Italic + + # Bold italic font face + #bold_italic: + # Font family + # + # If the bold italic family is not specified, it will fall back to the + # value specified for the normal font. + #family: monospace + + # The `style` can be specified to pick a specific face. + #style: Bold Italic + + # Point size + size: 10.0 + + # Offset is the extra space around each character. `offset.y` can be thought + # of as modifying the line spacing, and `offset.x` as modifying the letter + # spacing. + #offset: + # x: 0 + # y: 0 + + # Glyph offset determines the locations of the glyphs within their cells with + # the default being at the bottom. Increasing `x` moves the glyph to the + # right, increasing `y` moves the glyph upward. + #glyph_offset: + # x: 0 + # y: 0 + + # Use built-in font for box drawing characters. + # + # If `true`, Alacritty will use a custom built-in font for box drawing + # characters (Unicode points 2500 - 259f). + # + #builtin_box_drawing: true + +# If `true`, bold text is drawn using the bright color variants. +#draw_bold_text_with_bright_colors: false + +# Colors (Tomorrow Night) +#colors: + # Default colors + #primary: + # background: '#1d1f21' + # foreground: '#c5c8c6' + + # Bright and dim foreground colors + # + # The dimmed foreground color is calculated automatically if it is not + # present. If the bright foreground color is not set, or + # `draw_bold_text_with_bright_colors` is `false`, the normal foreground + # color will be used. + #dim_foreground: '#828482' + #bright_foreground: '#eaeaea' + + # Cursor colors + # + # Colors which should be used to draw the terminal cursor. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #cursor: + # text: CellBackground + # cursor: CellForeground + + # Vi mode cursor colors + # + # Colors for the cursor when the vi mode is active. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #vi_mode_cursor: + # text: CellBackground + # cursor: CellForeground + + # Search colors + # + # Colors used for the search bar and match highlighting. + #search: + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #matches: + # foreground: '#000000' + # background: '#ffffff' + #focused_match: + # foreground: '#ffffff' + # background: '#000000' + + # Keyboard hints + #hints: + # First character in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #start: + # foreground: '#1d1f21' + # background: '#e9ff5e' + + # All characters after the first one in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #end: + # foreground: '#e9ff5e' + # background: '#1d1f21' + + # Line indicator + # + # Color used for the indicator displaying the position in history during + # search and vi mode. + # + # By default, these will use the opposing primary color. + #line_indicator: + # foreground: None + # background: None + + # Footer bar + # + # Color used for the footer bar on the bottom, used by search regex input, + # hyperlink URI preview, etc. + # + #footer_bar: + # background: '#c5c8c6' + # foreground: '#1d1f21' + + # Selection colors + # + # Colors which should be used to draw the selection area. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #selection: + # text: CellBackground + # background: CellForeground + + # Normal colors + #normal: + # black: '#1d1f21' + # red: '#cc6666' + # green: '#b5bd68' + # yellow: '#f0c674' + # blue: '#81a2be' + # magenta: '#b294bb' + # cyan: '#8abeb7' + # white: '#c5c8c6' + + # Bright colors + #bright: + # black: '#666666' + # red: '#d54e53' + # green: '#b9ca4a' + # yellow: '#e7c547' + # blue: '#7aa6da' + # magenta: '#c397d8' + # cyan: '#70c0b1' + # white: '#eaeaea' + + # Dim colors + # + # If the dim colors are not set, they will be calculated automatically based + # on the `normal` colors. + #dim: + # black: '#131415' + # red: '#864343' + # green: '#777c44' + # yellow: '#9e824c' + # blue: '#556a7d' + # magenta: '#75617b' + # cyan: '#5b7d78' + # white: '#828482' + + # Indexed Colors + # + # The indexed colors include all colors from 16 to 256. + # When these are not set, they're filled with sensible defaults. + # + # Example: + # `- { index: 16, color: '#ff00ff' }` + # + #indexed_colors: [] + + # Transparent cell backgrounds + # + # Whether or not `window.opacity` applies to all cell backgrounds or only to + # the default background. When set to `true` all cells will be transparent + # regardless of their background color. + #transparent_background_colors: false + +# Bell +# +# The bell is rung every time the BEL control character is received. +#bell: + # Visual Bell Animation + # + # Animation effect for flashing the screen when the visual bell is rung. + # + # Values for `animation`: + # - Ease + # - EaseOut + # - EaseOutSine + # - EaseOutQuad + # - EaseOutCubic + # - EaseOutQuart + # - EaseOutQuint + # - EaseOutExpo + # - EaseOutCirc + # - Linear + #animation: EaseOutExpo + + # Duration of the visual bell flash in milliseconds. A `duration` of `0` will + # disable the visual bell animation. + #duration: 0 + + # Visual bell animation color. + #color: '#ffffff' + + # Bell Command + # + # This program is executed whenever the bell is rung. + # + # When set to `command: None`, no command will be executed. + # + # Example: + # command: + # program: notify-send + # args: ["Hello, World!"] + # + #command: None + +#selection: + # This string contains all characters that are used as separators for + # "semantic words" in Alacritty. + #semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" + + # When set to `true`, selected text will be copied to the primary clipboard. + #save_to_clipboard: false + +#cursor: + # Cursor style + #style: + # Cursor shape + # + # Values for `shape`: + # - ▇ Block + # - _ Underline + # - | Beam + #shape: Block + + # Cursor blinking state + # + # Values for `blinking`: + # - Never: Prevent the cursor from ever blinking + # - Off: Disable blinking by default + # - On: Enable blinking by default + # - Always: Force the cursor to always blink + #blinking: Off + + # Vi mode cursor style + # + # If the vi mode cursor style is `None` or not specified, it will fall back to + # the style of the active value of the normal cursor. + # + # See `cursor.style` for available options. + #vi_mode_style: None + + # Cursor blinking interval in milliseconds. + #blink_interval: 750 + + # Time after which cursor stops blinking, in seconds. + # + # Specifying '0' will disable timeout for blinking. + #blink_timeout: 5 + + # If this is `true`, the cursor will be rendered as a hollow box when the + # window is not focused. + #unfocused_hollow: true + + # Thickness of the cursor relative to the cell width as floating point number + # from `0.0` to `1.0`. + #thickness: 0.15 + +# Live config reload (changes require restart) +#live_config_reload: true + +# Shell +# +# You can set `shell.program` to the path of your favorite shell, e.g. +# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the +# shell. +# +# Default: +# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset +# - (Windows) powershell +#shell: +# program: /bin/bash +# args: +# - --login + +# Startup directory +# +# Directory the shell is started in. If this is unset, or `None`, the working +# directory of the parent process will be used. +#working_directory: None + +# Offer IPC using `alacritty msg` (unix only) +#ipc_socket: true + +#mouse: + # Click settings + # + # The `double_click` and `triple_click` settings control the time + # alacritty should wait for accepting multiple clicks as one double + # or triple click. + #double_click: { threshold: 300 } + #triple_click: { threshold: 300 } + + # If this is `true`, the cursor is temporarily hidden when typing. + #hide_when_typing: false + +# Hints +# +# Terminal hints can be used to find text or hyperlink in the visible part of +# the terminal and pipe it to other applications. +#hints: + # Keys used for the hint labels. + #alphabet: "jfkdls;ahgurieowpq" + + # List with all available hints + # + # Each hint must have any of `regex` or `hyperlinks` field and either an + # `action` or a `command` field. The fields `mouse`, `binding` and + # `post_processing` are optional. + # + # The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be + # highlighted. + # + # The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and + # `mouse.mods` accept the same values as they do in the `key_bindings` section. + # + # The `mouse.enabled` field controls if the hint should be underlined while + # the mouse with all `mouse.mods` keys held or the vi mode cursor is above it. + # + # If the `post_processing` field is set to `true`, heuristics will be used to + # shorten the match if there are characters likely not to be part of the hint + # (e.g. a trailing `.`). This is most useful for URIs and applies only to + # `regex` matches. + # + # Values for `action`: + # - Copy + # Copy the hint's text to the clipboard. + # - Paste + # Paste the hint's text to the terminal or search. + # - Select + # Select the hint's text. + # - MoveViModeCursor + # Move the vi mode cursor to the beginning of the hint. + #enabled: + # - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ + # [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" + # hyperlinks: true + # command: xdg-open + # post_processing: true + # mouse: + # enabled: true + # mods: None + # binding: + # key: U + # mods: Control|Shift + +# Mouse bindings +# +# Mouse bindings are specified as a list of objects, much like the key +# bindings further below. +# +# To trigger mouse bindings when an application running within Alacritty +# captures the mouse, the `Shift` modifier is automatically added as a +# requirement. +# +# Each mouse binding will specify a: +# +# - `mouse`: +# +# - Middle +# - Left +# - Right +# - Numeric identifier such as `5` +# +# - `action` (see key bindings for actions not exclusive to mouse mode) +# +# - Mouse exclusive actions: +# +# - ExpandSelection +# Expand the selection to the current mouse cursor location. +# +# And optionally: +# +# - `mods` (see key bindings) +#mouse_bindings: +# - { mouse: Right, action: ExpandSelection } +# - { mouse: Right, mods: Control, action: ExpandSelection } +# - { mouse: Middle, mode: ~Vi, action: PasteSelection } + +# Key bindings +# +# Key bindings are specified as a list of objects. For example, this is the +# default paste binding: +# +# `- { key: V, mods: Control|Shift, action: Paste }` +# +# Each key binding will specify a: +# +# - `key`: Identifier of the key pressed +# +# - A-Z +# - F1-F24 +# - Key0-Key9 +# +# A full list with available key codes can be found here: +# https://docs.rs/winit/*/winit/event/enum.VirtualKeyCode.html#variants +# +# Instead of using the name of the keys, the `key` field also supports using +# the scancode of the desired key. Scancodes have to be specified as a +# decimal number. This command will allow you to display the hex scancodes +# for certain keys: +# +# `showkey --scancodes`. +# +# Then exactly one of: +# +# - `chars`: Send a byte sequence to the running application +# +# The `chars` field writes the specified string to the terminal. This makes +# it possible to pass escape sequences. To find escape codes for bindings +# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside +# of tmux. Note that applications use terminfo to map escape sequences back +# to keys. It is therefore required to update the terminfo when changing an +# escape sequence. +# +# - `action`: Execute a predefined action +# +# - ToggleViMode +# - SearchForward +# Start searching toward the right of the search origin. +# - SearchBackward +# Start searching toward the left of the search origin. +# - Copy +# - Paste +# - IncreaseFontSize +# - DecreaseFontSize +# - ResetFontSize +# - ScrollPageUp +# - ScrollPageDown +# - ScrollHalfPageUp +# - ScrollHalfPageDown +# - ScrollLineUp +# - ScrollLineDown +# - ScrollToTop +# - ScrollToBottom +# - ClearHistory +# Remove the terminal's scrollback history. +# - Hide +# Hide the Alacritty window. +# - Minimize +# Minimize the Alacritty window. +# - Quit +# Quit Alacritty. +# - ToggleFullscreen +# - SpawnNewInstance +# Spawn a new instance of Alacritty. +# - CreateNewWindow +# Create a new Alacritty window from the current process. +# - ClearLogNotice +# Clear Alacritty's UI warning and error notice. +# - ClearSelection +# Remove the active selection. +# - ReceiveChar +# - None +# +# - Vi mode exclusive actions: +# +# - Open +# Perform the action of the first matching hint under the vi mode cursor +# with `mouse.enabled` set to `true`. +# - ToggleNormalSelection +# - ToggleLineSelection +# - ToggleBlockSelection +# - ToggleSemanticSelection +# Toggle semantic selection based on `selection.semantic_escape_chars`. +# - CenterAroundViCursor +# Center view around vi mode cursor +# +# - Vi mode exclusive cursor motion actions: +# +# - Up +# One line up. +# - Down +# One line down. +# - Left +# One character left. +# - Right +# One character right. +# - First +# First column, or beginning of the line when already at the first column. +# - Last +# Last column, or beginning of the line when already at the last column. +# - FirstOccupied +# First non-empty cell in this terminal row, or first non-empty cell of +# the line when already at the first cell of the row. +# - High +# Top of the screen. +# - Middle +# Center of the screen. +# - Low +# Bottom of the screen. +# - SemanticLeft +# Start of the previous semantically separated word. +# - SemanticRight +# Start of the next semantically separated word. +# - SemanticLeftEnd +# End of the previous semantically separated word. +# - SemanticRightEnd +# End of the next semantically separated word. +# - WordLeft +# Start of the previous whitespace separated word. +# - WordRight +# Start of the next whitespace separated word. +# - WordLeftEnd +# End of the previous whitespace separated word. +# - WordRightEnd +# End of the next whitespace separated word. +# - Bracket +# Character matching the bracket at the cursor's location. +# - SearchNext +# Beginning of the next match. +# - SearchPrevious +# Beginning of the previous match. +# - SearchStart +# Start of the match to the left of the vi mode cursor. +# - SearchEnd +# End of the match to the right of the vi mode cursor. +# +# - Search mode exclusive actions: +# - SearchFocusNext +# Move the focus to the next search match. +# - SearchFocusPrevious +# Move the focus to the previous search match. +# - SearchConfirm +# - SearchCancel +# - SearchClear +# Reset the search regex. +# - SearchDeleteWord +# Delete the last word in the search regex. +# - SearchHistoryPrevious +# Go to the previous regex in the search history. +# - SearchHistoryNext +# Go to the next regex in the search history. +# +# - macOS exclusive actions: +# - ToggleSimpleFullscreen +# Enter fullscreen without occupying another space. +# +# - Linux/BSD exclusive actions: +# +# - CopySelection +# Copy from the selection buffer. +# - PasteSelection +# Paste from the selection buffer. +# +# - `command`: Fork and execute a specified command plus arguments +# +# The `command` field must be a map containing a `program` string and an +# `args` array of command line parameter strings. For example: +# `{ program: "alacritty", args: ["-e", "vttest"] }` +# +# And optionally: +# +# - `mods`: Key modifiers to filter binding actions +# +# - Command +# - Control +# - Option +# - Super +# - Shift +# - Alt +# +# Multiple `mods` can be combined using `|` like this: +# `mods: Control|Shift`. +# Whitespace and capitalization are relevant and must match the example. +# +# - `mode`: Indicate a binding for only specific terminal reported modes +# +# This is mainly used to send applications the correct escape sequences +# when in different modes. +# +# - AppCursor +# - AppKeypad +# - Search +# - Alt +# - Vi +# +# A `~` operator can be used before a mode to apply the binding whenever +# the mode is *not* active, e.g. `~Alt`. +# +# Bindings are always filled by default, but will be replaced when a new +# binding with the same triggers is defined. To unset a default binding, it can +# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for +# a no-op if you do not wish to receive input characters for that binding. +# +# If the same trigger is assigned to multiple actions, all of them are executed +# in the order they were defined in. +#key_bindings: + #- { key: Paste, action: Paste } + #- { key: Copy, action: Copy } + #- { key: L, mods: Control, action: ClearLogNotice } + #- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp } + #- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown } + #- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop } + #- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom } + + # Vi Mode + #- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode } + #- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom } + #- { key: Escape, mode: Vi|~Search, action: ClearSelection } + #- { key: I, mode: Vi|~Search, action: ToggleViMode } + #- { key: I, mode: Vi|~Search, action: ScrollToBottom } + #- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode } + #- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp } + #- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown } + #- { key: G, mode: Vi|~Search, action: ScrollToTop } + #- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom } + #- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp } + #- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown } + #- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp } + #- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown } + #- { key: Y, mode: Vi|~Search, action: Copy } + #- { key: Y, mode: Vi|~Search, action: ClearSelection } + #- { key: Copy, mode: Vi|~Search, action: ClearSelection } + #- { key: V, mode: Vi|~Search, action: ToggleNormalSelection } + #- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection } + #- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection } + #- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection } + #- { key: Return, mode: Vi|~Search, action: Open } + #- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor } + #- { key: K, mode: Vi|~Search, action: Up } + #- { key: J, mode: Vi|~Search, action: Down } + #- { key: H, mode: Vi|~Search, action: Left } + #- { key: L, mode: Vi|~Search, action: Right } + #- { key: Up, mode: Vi|~Search, action: Up } + #- { key: Down, mode: Vi|~Search, action: Down } + #- { key: Left, mode: Vi|~Search, action: Left } + #- { key: Right, mode: Vi|~Search, action: Right } + #- { key: Key0, mode: Vi|~Search, action: First } + #- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last } + #- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied } + #- { key: H, mods: Shift, mode: Vi|~Search, action: High } + #- { key: M, mods: Shift, mode: Vi|~Search, action: Middle } + #- { key: L, mods: Shift, mode: Vi|~Search, action: Low } + #- { key: B, mode: Vi|~Search, action: SemanticLeft } + #- { key: W, mode: Vi|~Search, action: SemanticRight } + #- { key: E, mode: Vi|~Search, action: SemanticRightEnd } + #- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft } + #- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight } + #- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd } + #- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket } + #- { key: Slash, mode: Vi|~Search, action: SearchForward } + #- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward } + #- { key: N, mode: Vi|~Search, action: SearchNext } + #- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious } + + # Search Mode + #- { key: Return, mode: Search|Vi, action: SearchConfirm } + #- { key: Escape, mode: Search, action: SearchCancel } + #- { key: C, mods: Control, mode: Search, action: SearchCancel } + #- { key: U, mods: Control, mode: Search, action: SearchClear } + #- { key: W, mods: Control, mode: Search, action: SearchDeleteWord } + #- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious } + #- { key: N, mods: Control, mode: Search, action: SearchHistoryNext } + #- { key: Up, mode: Search, action: SearchHistoryPrevious } + #- { key: Down, mode: Search, action: SearchHistoryNext } + #- { key: Return, mode: Search|~Vi, action: SearchFocusNext } + #- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious } + + # (Windows, Linux, and BSD only) + #- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste } + #- { key: C, mods: Control|Shift, action: Copy } + #- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward } + #- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward } + #- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection } + #- { key: Insert, mods: Shift, action: PasteSelection } + #- { key: Key0, mods: Control, action: ResetFontSize } + #- { key: Equals, mods: Control, action: IncreaseFontSize } + #- { key: Plus, mods: Control, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Control, action: IncreaseFontSize } + #- { key: Minus, mods: Control, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } + + # (Windows only) + #- { key: Return, mods: Alt, action: ToggleFullscreen } + + # (macOS only) + #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory } + #- { key: Key0, mods: Command, action: ResetFontSize } + #- { key: Equals, mods: Command, action: IncreaseFontSize } + #- { key: Plus, mods: Command, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Command, action: IncreaseFontSize } + #- { key: Minus, mods: Command, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } + #- { key: V, mods: Command, action: Paste } + #- { key: C, mods: Command, action: Copy } + #- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection } + #- { key: H, mods: Command, action: Hide } + #- { key: H, mods: Command|Alt, action: HideOtherApplications } + #- { key: M, mods: Command, action: Minimize } + #- { key: Q, mods: Command, action: Quit } + #- { key: W, mods: Command, action: Quit } + #- { key: N, mods: Command, action: CreateNewWindow } + #- { key: F, mods: Command|Control, action: ToggleFullscreen } + #- { key: F, mods: Command, mode: ~Search, action: SearchForward } + #- { key: B, mods: Command, mode: ~Search, action: SearchBackward } + +#debug: + # Display the time it takes to redraw each frame. + #render_timer: false + + # Keep the log file after quitting Alacritty. + #persistent_logging: false + + # Log level + # + # Values for `log_level`: + # - Off + # - Error + # - Warn + # - Info + # - Debug + # - Trace + #log_level: Warn + + # Renderer override. + # - glsl3 + # - gles2 + # - gles2_pure + #renderer: None + + # Print all received window events. + #print_events: false + + # Highlight window damage information. + #highlight_damage: false + +colors: + primary: + background: "#1E1E2E" # base + foreground: "#CDD6F4" # text + # Bright and dim foreground colors + dim_foreground: "#CDD6F4" # text + bright_foreground: "#CDD6F4" # text + + # Cursor colors + cursor: + text: "#1E1E2E" # base + cursor: "#F5E0DC" # rosewater + vi_mode_cursor: + text: "#1E1E2E" # base + cursor: "#B4BEFE" # lavender + + # Search colors + search: + matches: + foreground: "#1E1E2E" # base + background: "#A6ADC8" # subtext0 + focused_match: + foreground: "#1E1E2E" # base + background: "#A6E3A1" # green + footer_bar: + foreground: "#1E1E2E" # base + background: "#A6ADC8" # subtext0 + + # Keyboard regex hints + hints: + start: + foreground: "#1E1E2E" # base + background: "#F9E2AF" # yellow + end: + foreground: "#1E1E2E" # base + background: "#A6ADC8" # subtext0 + + # Selection colors + selection: + text: "#1E1E2E" # base + background: "#F5E0DC" # rosewater + + # Normal colors + normal: + black: "#45475A" # surface1 + red: "#F38BA8" # red + green: "#A6E3A1" # green + yellow: "#F9E2AF" # yellow + blue: "#89B4FA" # blue + magenta: "#F5C2E7" # pink + cyan: "#94E2D5" # teal + white: "#BAC2DE" # subtext1 + + # Bright colors + bright: + black: "#585B70" # surface2 + red: "#F38BA8" # red + green: "#A6E3A1" # green + yellow: "#F9E2AF" # yellow + blue: "#89B4FA" # blue + magenta: "#F5C2E7" # pink + cyan: "#94E2D5" # teal + white: "#A6ADC8" # subtext0 + + # Dim colors + dim: + black: "#45475A" # surface1 + red: "#F38BA8" # red + green: "#A6E3A1" # green + yellow: "#F9E2AF" # yellow + blue: "#89B4FA" # blue + magenta: "#F5C2E7" # pink + cyan: "#94E2D5" # teal + white: "#BAC2DE" # subtext1 + + indexed_colors: + - { index: 16, color: "#FAB387" } + - { index: 17, color: "#F5E0DC" } + diff --git a/home-manager-modules/alacritty/default.nix b/home-manager-modules/alacritty/default.nix new file mode 100644 index 0000000..2e957d5 --- /dev/null +++ b/home-manager-modules/alacritty/default.nix @@ -0,0 +1,17 @@ +{ config, lib, ... }: +let + cfg = config.luj.programs.alacritty; +in +with lib; +{ + options.luj.programs.alacritty = { + enable = mkEnableOption "Enable alacritty program"; + }; + + config = mkIf cfg.enable + { + programs.alacritty.enable = true; + xdg.configFile."alacritty/alacritty.yml".source = lib.mkForce ./config; + }; +} + diff --git a/home-manager-modules/alacritty/machiatto.yml b/home-manager-modules/alacritty/machiatto.yml new file mode 100644 index 0000000..9a7c6a4 --- /dev/null +++ b/home-manager-modules/alacritty/machiatto.yml @@ -0,0 +1,80 @@ +colors: + # Default colors + primary: + background: "#24273A" # base + foreground: "#CAD3F5" # text + # Bright and dim foreground colors + dim_foreground: "#CAD3F5" # text + bright_foreground: "#CAD3F5" # text + + # Cursor colors + cursor: + text: "#24273A" # base + cursor: "#F4DBD6" # rosewater + vi_mode_cursor: + text: "#24273A" # base + cursor: "#B7BDF8" # lavender + + # Search colors + search: + matches: + foreground: "#24273A" # base + background: "#A5ADCB" # subtext0 + focused_match: + foreground: "#24273A" # base + background: "#A6DA95" # green + footer_bar: + foreground: "#24273A" # base + background: "#A5ADCB" # subtext0 + + # Keyboard regex hints + hints: + start: + foreground: "#24273A" # base + background: "#EED49F" # yellow + end: + foreground: "#24273A" # base + background: "#A5ADCB" # subtext0 + + # Selection colors + selection: + text: "#24273A" # base + background: "#F4DBD6" # rosewater + + # Normal colors + normal: + black: "#494D64" # surface1 + red: "#ED8796" # red + green: "#A6DA95" # green + yellow: "#EED49F" # yellow + blue: "#8AADF4" # blue + magenta: "#F5BDE6" # pink + cyan: "#8BD5CA" # teal + white: "#B8C0E0" # subtext1 + + # Bright colors + bright: + black: "#5B6078" # surface2 + red: "#ED8796" # red + green: "#A6DA95" # green + yellow: "#EED49F" # yellow + blue: "#8AADF4" # blue + magenta: "#F5BDE6" # pink + cyan: "#8BD5CA" # teal + white: "#A5ADCB" # subtext0 + + # Dim colors + dim: + black: "#494D64" # surface1 + red: "#ED8796" # red + green: "#A6DA95" # green + yellow: "#EED49F" # yellow + blue: "#8AADF4" # blue + magenta: "#F5BDE6" # pink + cyan: "#8BD5CA" # teal + white: "#B8C0E0" # subtext1 + + indexed_colors: + - { index: 16, color: "#F5A97F" } + - { index: 17, color: "#F4DBD6" } + diff --git a/home-manager-modules/dunst/default.nix b/home-manager-modules/dunst/default.nix new file mode 100644 index 0000000..d682c6e --- /dev/null +++ b/home-manager-modules/dunst/default.nix @@ -0,0 +1,44 @@ +{ config, lib, ... }: +let + cfg = config.luj.programs.dunst; +in +with lib; +{ + options.luj.programs.dunst = { + enable = mkEnableOption "Enable Dunst"; + }; + + config = mkIf cfg.enable { + + services.dunst = { + enable = true; + settings = { + global = { + monitor = 0; + corner_radius = 5; + frame_color = "#89B4FA"; + frame_width = 0; + separator_color = "frame"; + }; + + urgency_low = { + background = "#1E1E2E"; + foreground = "#CDD6F4"; + }; + urgency_normal = { + background = "#1E1E2E"; + foreground = "#CDD6F4"; + }; + + urgency_critical = { + background = "#1E1E2E"; + foreground = "#CDD6F4"; + frame_color = "#FAB387"; + }; + + }; + + }; + }; + +} diff --git a/home-manager-modules/emacs/default.nix b/home-manager-modules/emacs/default.nix new file mode 100644 index 0000000..dc81ec9 --- /dev/null +++ b/home-manager-modules/emacs/default.nix @@ -0,0 +1,16 @@ +{ config, lib, ... }: +let + cfg = config.luj.programs.emacs; +in +with lib; +{ + options.luj.programs.emacs = { + enable = mkEnableOption "Enable Emacs"; + }; + + config = mkIf cfg.enable { + + services.emacs.enable = true; + + }; +} diff --git a/home-manager-modules/emacs/doom.d/config.el b/home-manager-modules/emacs/doom.d/config.el new file mode 100644 index 0000000..326c68d --- /dev/null +++ b/home-manager-modules/emacs/doom.d/config.el @@ -0,0 +1 @@ +(setq doom-theme 'catppuccin) diff --git a/home-manager-modules/emacs/doom.d/init.el b/home-manager-modules/emacs/doom.d/init.el new file mode 100644 index 0000000..8fe5dd1 --- /dev/null +++ b/home-manager-modules/emacs/doom.d/init.el @@ -0,0 +1,192 @@ +;;; init.el -*- lexical-binding: t; -*- + +;; This file controls what Doom modules are enabled and what order they load +;; in. Remember to run 'doom sync' after modifying it! + +;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's +;; documentation. There you'll find a "Module Index" link where you'll find +;; a comprehensive list of Doom's modules and what flags they support. + +;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or +;; 'C-c c k' for non-vim users) to view its documentation. This works on +;; flags as well (those symbols that start with a plus). +;; +;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its +;; directory (for easy access to its source code). + +(doom! :input + ;;chinese + ;;japanese + ;;layout ; auie,ctsrnm is the superior home row + + :completion + company ; the ultimate code completion backend + ;;helm ; the *other* search engine for love and life + ;;ido ; the other *other* search engine... + ;;ivy ; a search engine for love and life + vertico ; the search engine of the future + + :ui + ;;deft ; notational velocity for Emacs + doom ; what makes DOOM look the way it does + doom-dashboard ; a nifty splash screen for Emacs + doom-quit ; DOOM quit-message prompts when you quit Emacs + (emoji +unicode) ; 🙂 + hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + ;;hydra + ;;indent-guides ; highlighted indent columns + ;;ligatures ; ligatures and symbols to make your code pretty again + ;;minimap ; show a map of the code on the side + modeline ; snazzy, Atom-inspired modeline, plus API + ;;nav-flash ; blink cursor line after big motions + ;;neotree ; a project drawer, like NERDTree for vim + ophints ; highlight the region an operation acts on + (popup +defaults) ; tame sudden yet inevitable temporary windows + ;;tabs ; a tab bar for Emacs + treemacs ; a project drawer, like neotree but cooler + ;;unicode ; extended unicode support for various languages + vc-gutter ; vcs diff in the fringe + vi-tilde-fringe ; fringe tildes to mark beyond EOB + ;;window-select ; visually switch windows + workspaces ; tab emulation, persistence & separate workspaces + ;;zen ; distraction-free coding or writing + + :editor + (evil +everywhere); come to the dark side, we have cookies + file-templates ; auto-snippets for empty files + fold ; (nigh) universal code folding + (format +onsave) ; automated prettiness + ;;god ; run Emacs commands without modifier keys + ;;lispy ; vim for lisp, for people who don't like vim + ;;multiple-cursors ; editing in many places at once + ;;objed ; text object editing for the innocent + ;;parinfer ; turn lisp into python, sort of + ;;rotate-text ; cycle region at point between text candidates + snippets ; my elves. They type so I don't have to + ;;word-wrap ; soft wrapping with language-aware indent + + :emacs + dired ; making dired pretty [functional] + electric ; smarter, keyword-based electric-indent + ;;ibuffer ; interactive buffer management + undo ; persistent, smarter undo for your inevitable mistakes + vc ; version-control and Emacs, sitting in a tree + + :term + eshell ; the elisp shell that works everywhere + ;;shell ; simple shell REPL for Emacs + ;;term ; basic terminal emulator for Emacs + vterm ; the best terminal emulation in Emacs + + :checkers + syntax ; tasing you for every semicolon you forget + ;;(spell +flyspell) ; tasing you for misspelling mispelling + ;;grammar ; tasing grammar mistake every you make + + :tools + ;;ansible + ;;biblio ; Writes a PhD for you (citation needed) + ;;debugger ; FIXME stepping through code, to help you add bugs + ;;direnv + ;;docker + ;;editorconfig ; let someone else argue about tabs vs spaces + ;;ein ; tame Jupyter notebooks with emacs + (eval +overlay) ; run code, run (also, repls) + ;;gist ; interacting with github gists + lookup ; navigate your code and its documentation + lsp ; M-x vscode + magit ; a git porcelain for Emacs + ;;make ; run make tasks from Emacs + ;;pass ; password manager for nerds + pdf ; pdf enhancements + ;;prodigy ; FIXME managing external services & code builders + ;;rgb ; creating color strings + ;;taskrunner ; taskrunner for all your projects + ;;terraform ; infrastructure as code + ;;tmux ; an API for interacting with tmux + ;;upload ; map local to remote projects via ssh/ftp + + :os + (:if IS-MAC macos) ; improve compatibility with macOS + ;;tty ; improve the terminal Emacs experience + + :lang + ;;agda ; types of types of types of types... + ;;beancount ; mind the GAAP + ;;cc ; C > C++ == 1 + ;;clojure ; java with a lisp + ;;common-lisp ; if you've seen one lisp, you've seen them all + ;;coq ; proofs-as-programs + ;;crystal ; ruby at the speed of c + ;;csharp ; unity, .NET, and mono shenanigans + ;;data ; config/data formats + ;;(dart +flutter) ; paint ui and not much else + ;;dhall + ;;elixir ; erlang done right + ;;elm ; care for a cup of TEA? + emacs-lisp ; drown in parentheses + ;;erlang ; an elegant language for a more civilized age + ;;ess ; emacs speaks statistics + ;;factor + ;;faust ; dsp, but you get to keep your soul + ;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER) + ;;fsharp ; ML stands for Microsoft's Language + ;;fstar ; (dependent) types and (monadic) effects and Z3 + ;;gdscript ; the language you waited for + ;;(go +lsp) ; the hipster dialect + ;;(haskell +lsp) ; a language that's lazier than I am + ;;hy ; readability of scheme w/ speed of python + ;;idris ; a language you can depend on + ;;json ; At least it ain't XML + ;;(java +meghanada) ; the poster child for carpal tunnel syndrome + ;;javascript ; all(hope(abandon(ye(who(enter(here)))))) + ;;julia ; a better, faster MATLAB + ;;kotlin ; a better, slicker Java(Script) + latex ; writing papers in Emacs has never been so fun + ;;lean ; for folks with too much to prove + ;;ledger ; be audit you can be + ;;lua ; one-based indices? one-based indices + markdown ; writing docs for people to ignore + ;;nim ; python + lisp at the speed of c + nix ; I hereby declare "nix geht mehr!" + ;;ocaml ; an objective camel + org ; organize your plain life in plain text + ;;php ; perl's insecure younger brother + ;;plantuml ; diagrams for confusing people more + ;;purescript ; javascript, but functional + ;;python ; beautiful is better than ugly + ;;qt ; the 'cutest' gui framework ever + ;;racket ; a DSL for DSLs + ;;raku ; the artist formerly known as perl6 + ;;rest ; Emacs as a REST client + ;;rst ; ReST in peace + ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + ;;scala ; java, but good + ;;(scheme +guile) ; a fully conniving family of lisps + sh ; she sells {ba,z,fi}sh shells on the C xor + ;;sml + ;;solidity ; do you need a blockchain? No. + ;;swift ; who asked for emoji variables? + ;;terra ; Earth and Moon in alignment for performance. + ;;web ; the tubes + ;;yaml ; JSON, but readable + ;;zig ; C, but simpler + + :email + ;;(mu4e +org +gmail) + ;;notmuch + ;;(wanderlust +gmail) + + :app + ;;calendar + ;;emms + ;;everywhere ; *leave* Emacs!? You must be joking + ;;irc ; how neckbeards socialize + ;;(rss +org) ; emacs as an RSS reader + ;;twitter ; twitter client https://twitter.com/vnought + + :config + ;;literate + (default +bindings +smartparens)) + diff --git a/home-manager-modules/emacs/doom.d/packages.el b/home-manager-modules/emacs/doom.d/packages.el new file mode 100644 index 0000000..ceb9170 --- /dev/null +++ b/home-manager-modules/emacs/doom.d/packages.el @@ -0,0 +1 @@ +(package! catppuccin-theme) diff --git a/home-manager-modules/firefox/default.nix b/home-manager-modules/firefox/default.nix new file mode 100644 index 0000000..9a7dd27 --- /dev/null +++ b/home-manager-modules/firefox/default.nix @@ -0,0 +1,23 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.luj.programs.firefox; +in +with lib; +{ + options.luj.programs.firefox = { + enable = mkEnableOption "Enable Firefox"; + }; + + config = mkIf cfg.enable { + programs.firefox = { + enable = true; + package = pkgs.firefox; + }; + + }; +} diff --git a/home-manager-modules/fish/default.nix b/home-manager-modules/fish/default.nix new file mode 100644 index 0000000..33b1968 --- /dev/null +++ b/home-manager-modules/fish/default.nix @@ -0,0 +1,111 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.luj.programs.fish; +in +with lib; +{ + options.luj.programs.fish = { + enable = mkEnableOption "Enable fish"; + }; + + config = mkIf cfg.enable { + + programs.fish = { + enable = true; + shellInit = '' + [ -n "$EAT_SHELL_INTEGRATION_DIR" ] && \ + source "$EAT_SHELL_INTEGRATION_DIR/fish" + ''; + + shellAliases = { + + ka = "killall"; + mkd = "mkdir -pv"; + + nix-build = "nom-build"; + + ca = "khal interactive"; + sync_ca = "vsync sync"; + + dnd = "dunstctl set-paused true"; + nodnd = "dunstctl set-paused false"; + + lg = "lazygit"; + g = "git"; + gua = "git remote | xargs -L1 git push --all"; + + v = "$EDITOR"; + sdn = "shutdown now"; + + SU = "systemctl --user"; + SS = "sudo systemctl"; + + weather = "curl wttr.in"; + v6 = "curl api6.ipify.org"; + v4 = "curl api.ipify.org"; + clbin = "curl -F'clbin=<-' https://clbin.com"; + _0x0 = "curl -F'file=@-' https://0x0.st"; + + phs = "python -m http.server"; + + ls = "eza"; + + rtmv = "rsync -avP"; + archive = "rsync --remove-source-files -avPzz"; + + luks_integrity_check = "gocryptfs -fsck -extpass 'pass Private/LUKS' /boot/luks"; + + fetch-emails = "mbsync --all && notmuch new && afew -t -n -v"; + + nsp = "nix-shell -p"; + ns = "nix-shell"; + + ncg = "sudo nix-collect-garbage --delete-older-than 30d"; + ncga = "sudo nix-collect-garbage -d"; + nso = "sudo nix-store --optimise"; + + lln = "NIX_PATH=\"nixpkgs=$LOCAL_NIXPKGS_CHECKOUT\""; + # Local build + lnb = "NIX_PATH=\"nixpkgs=$LOCAL_NIXPKGS_CHECKOUT\" nom-build '' --no-out-link -A $1"; + # Local shell + lns = "NIX_PATH=\"nixpkgs=$LOCAL_NIXPKGS_CHECKOUT\" nix-shell -p $1"; + # Local test + ltt = ''NIX_PATH=\"nixpkgs=$LOCAL_NIXPKGS_CHECKOUT\" nom-build --no-out-link "$LOCAL_NIXPKGS_CHECKOUT/nixos/tests/$1"''; + }; + + }; + + # Broot + programs.broot = { + enable = true; + enableFishIntegration = true; + }; + + # Direnv: must have. + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + + programs.oh-my-posh = { + enable = true; + enableFishIntegration = true; + useTheme = "catppuccin_mocha"; + }; + + # Misc + programs.lesspipe.enable = true; + + home.packages = with pkgs; [ + eza + python3 + libnotify + nix-output-monitor + ]; + }; +} diff --git a/home-manager-modules/git/default.nix b/home-manager-modules/git/default.nix index 9c167cb..f9db92c 100644 --- a/home-manager-modules/git/default.nix +++ b/home-manager-modules/git/default.nix @@ -1,4 +1,9 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let cfg = config.luj.programs.git; in @@ -12,7 +17,34 @@ with lib; programs.git = { enable = true; userName = "Julien Malka"; - userEmail = "julien.malka@me.com"; + userEmail = "julien@malka.sh"; + signing = { + signByDefault = true; + key = "6FC74C847011FD83"; + }; + maintenance = { + enable = true; + repositories = [ + "/home/julien/dev/nixpkgs" + ]; + }; + delta.enable = true; + ignores = [ ".direnv" ]; + extraConfig = { + init.defaultBranch = "main"; + diff.colorMoved = "zebra"; + pull.rebase = true; + fetch.prune = true; + rebase.autoStash = true; + push.autoSetupRemote = true; + }; + }; + + home.extraActivationPath = [ pkgs.gnupg ]; + home.activation = { + myActivationAction = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + gpg --import /run/agenix/git-gpg-private-key + ''; }; }; } diff --git a/home-manager-modules/gtk/default.nix b/home-manager-modules/gtk/default.nix new file mode 100644 index 0000000..bb941c7 --- /dev/null +++ b/home-manager-modules/gtk/default.nix @@ -0,0 +1,32 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.luj.programs.gtk; +in +with lib; +{ + options.luj.programs.gtk = { + enable = mkEnableOption "Enable gtk customizations"; + }; + + config = mkIf cfg.enable { + gtk = { + enable = true; + theme = { + name = "Catppuccin-Macchiato-Standard-Pink-Dark"; + package = pkgs.catppuccin-gtk.override { + accents = [ "pink" ]; + variant = "macchiato"; + }; + }; + }; + qt = { + enable = true; + platformTheme.name = "gtk"; + }; + }; +} diff --git a/home-manager-modules/hyprland/default.nix b/home-manager-modules/hyprland/default.nix new file mode 100644 index 0000000..56dbef5 --- /dev/null +++ b/home-manager-modules/hyprland/default.nix @@ -0,0 +1,170 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.luj.programs.hyprland; + terminal = "${pkgs.kitty}/bin/kitty"; + menu = "${pkgs.rofi-wayland}/bin/rofi -no-lazy-grab -show drun"; +in +with lib; +{ + options.luj.programs.hyprland = { + enable = mkEnableOption "Enable HyprLand"; + }; + + config = mkIf cfg.enable { + wayland.windowManager.hyprland = { + enable = true; + package = pkgs.unstable.hyprland; + systemd = { + enable = true; + variables = [ "WLR_NO_HARDWARE_CURSORS=1" ]; + }; + settings = { + # Variables + "$mod" = "ALT_L"; + "$term" = terminal; + "$launcher" = menu; + + general = { + gaps_in = "6"; + gaps_out = "10"; + }; + input = { + kb_layout = "fr"; + follow_mouse = 1; + sensitivity = 0; # -1.0 - 1.0, 0 means no modification. + }; + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + decoration = { + rounding = 6; + }; + animations.enabled = true; + + xwayland = { + force_zero_scaling = true; + }; + + workspace = [ + "1,monitor:DP-3" + "2,monitor:HDM1-A-1" + ]; + + exec = [ "hyprpaper" ]; + + env = [ + "LIBVA_DRIVER_NAME, nvidia" + "WLR_NO_HARDWARE_CURSORS, 1" + "WLR_DRM_DEVICES,/home/julien/.config/hypr/card" + ]; + + monitor = [ + "DP-3, 2560x1440@60, 0x0, 1" + "HDM1-A-1, 2560x1440@60, 2560x0, 1" + ]; + + bind = [ + "$mod, RETURN, exec, kitty" + "$mod, SPACE, exec, $launcher" + "$mod, w, exec, swaylock" + + # Window management + "$mod, Q, killactive" + "$mod, F, fullscreen" + # Focus + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + # Move + "$mod SHIFT, left, movewindow, l" + "$mod SHIFT, right, movewindow, r" + "$mod SHIFT, up, movewindow, u" + "$mod SHIFT, down, movewindow, d" + + # Switch workspaces + "$mod, code:10, workspace, 1" + "$mod, code:11, workspace, 2" + "$mod, code:12, workspace, 3" + "$mod, code:13, workspace, 4" + "$mod, code:14, workspace, 5" + "$mod, code:15, workspace, 6" + "$mod, code:16, workspace, 7" + "$mod, code:17, workspace, 8" + "$mod, code:18, workspace, 9" + "$mod, code:19, workspace, 10" + + "$mod SHIFT, code:10, movetoworkspace, 1" + "$mod SHIFT, code:11, movetoworkspace, 2" + "$mod SHIFT, code:12, movetoworkspace, 3" + "$mod SHIFT, code:13, movetoworkspace, 4" + "$mod SHIFT, code:14, movetoworkspace, 5" + "$mod SHIFT, code:15, movetoworkspace, 6" + "$mod SHIFT, code:16, movetoworkspace, 7" + "$mod SHIFT, code:17, movetoworkspace, 8" + "$mod SHIFT, code:18, movetoworkspace, 9" + "$mod SHIFT, code:19, movetoworkspace, 10" + + ]; + + }; + + }; + + xdg.configFile."hypr/hyprpaper.conf".text = '' + preload = ${../../machines/fischer/wallpaper.jpg} + wallpaper = ,${../../machines/fischer/wallpaper.jpg} + ''; + + services.swayidle = { + enable = true; + systemdTarget = "hyprland-session.target"; + events = [ + { + event = "before-sleep"; + command = "${pkgs.swaylock-effects}/bin/swaylock --config /home/julien/.config/swaylock/config"; + } + ]; + }; + + programs.swaylock = { + enable = true; + package = pkgs.swaylock-effects; + settings = { + screenshots = true; + clock = true; + indicator = true; + indicator-radius = 200; + indicator-thickness = 20; + grace = 0; + grace-no-mouse = true; + grace-no-touch = true; + line-uses-ring = false; + ignore-empty-password = true; + show-failed-attempts = false; + + font = "Fira Code"; + timestr = "%H:%M"; + datestr = ""; + effect-blur = "8x5"; + effect-vignette = "0.5:0.5"; + color = "00000000"; + + }; + + }; + + home.packages = with pkgs; [ + qt6.qtwayland + libsForQt5.qt5.qtwayland + hyprpaper + ]; + + }; +} diff --git a/home-manager-modules/i3/config b/home-manager-modules/i3/config deleted file mode 100644 index d5358da..0000000 --- a/home-manager-modules/i3/config +++ /dev/null @@ -1,265 +0,0 @@ -# This file has been auto-generated by i3-config-wizard(1). -# It will not be overwritten, so edit it as you like. -# -# Should you change your keyboard layout some time, delete -# this file and re-run i3-config-wizard(1). -# - -# i3 config file (v4) -# -# Please see http://i3wm.org/docs/userguide.html for a complete reference! - -#Execs - -exec_always xrandr --output $leftm --primary --mode 1920x1080 --pos 0x0 --rotate normal --output $rightm --mode 1920x1080 --pos 1920x0 --rotate normal - - -#exec_always xrandr --output $leftm --primary --mode 1920x1080 --pos 0x0 --rotate normal - -exec_always feh --bg-scale ~/df/bg.jpg - -# Variables {{{ - -set $sup Mod1 -set $terminal tabbed -c urxvt -embed -set $leftm HDMI-1 -set $rightm eDP-1 - -set $workspace1 "" -set $workspace2 "" -set $workspace3 "" -set $workspace4 "4" -set $workspace5 "5" -set $workspace6 "6" -set $workspace7 "7" -set $workspace8 "8" -set $workspace9 "9" -set $workspace10 "" -# }}} - - -workspace "" output $leftm -workspace "" output $rightm -workspace "" output $rightm - - - -#Set Mod -set $mod Mod4 - -set $bg-color #172A47 -set $text-color #5A9857 -set $urgent-bg-color #E53935 -set $inactive-bg-color #435E75 - - -########################################## - -#Scrolling - doesn't work -#exec --no-startup-id synclient HorizEdgeScroll=1 VertEdgeScroll=1 VertScrollDelta=-111 - -#WORKSPACE STARTUP - -#Gaps and Window - -for_window [class="^.*"] border pixel 2 -#new_window pixel 4 -#new_float pixel 4 -#gaps inner 20 -gaps inner 10 -#border_radius 5 -#new_window pixel 3 -#new_float pixel 3 -#gaps top 35 -hide_edge_borders vertical - -# Color variables -set $unfocused_border #72afff -set $focused_border #b21c0e - -# class border backgr. text indicator -client.focused #698AB2 #698AB2 #698AB2 #698AB2 #698AB2 -#client.focused_inactive $base03 $base03 $base05 $base03 -#client.unfocused $base03 $base03 $base05 $base00 -#client.urgent $base01 $base01 $base05 $base00 - - -#Check .Xresources for font - -# start a terminal -bindsym $mod+Return workspace  -bindsym $mod+Shift+Return exec urxvt - -# kill focused window -bindsym $mod+q kill - -# start rofi - -bindsym $mod+space exec rofi -show run - - -# change focus - -# alternatively, you can use the cursor keys: -bindsym $mod+h focus left -bindsym $mod+j focus down -bindsym $mod+k focus up -bindsym $mod+l focus right - - -# alternatively, you can use the cursor keys: -bindsym $mod+Shift+h move left -bindsym $mod+Shift+j move down -bindsym $mod+Shift+k move up -bindsym $mod+Shift+l move right - -# split in horizontal orientation -bindsym $mod+o split h - -# split in vertical orientation -bindsym $mod+v split v - -# enter fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle - -# change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+e layout toggle split - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle - -# change focus between tiling / floating windows -#bindsym $mod+space focus mode_toggle - -# focus the parent container -bindsym $mod+a focus parent - -# focus the child container -#bindsym $mod+d focus child - -bindsym $mod+Ctrl+Left move workspace to output $leftm -bindsym $mod+Ctrl+Right move workspace to output $rightm - - -# switch to workspace -bindsym $mod+1 workspace  -bindsym $mod+2 workspace  -bindsym $mod+3 workspace  -bindsym $mod+4 workspace 4 -bindsym $mod+5 workspace 5 -bindsym $mod+6 workspace 6 -bindsym $mod+7 workspace 7 -bindsym $mod+8 workspace 8 -bindsym $mod+9 workspace 9 -bindsym $mod+0 workspace  - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace  -bindsym $mod+Shift+2 move container to workspace  -bindsym $mod+Shift+3 move container to workspace  -bindsym $mod+Shift+4 move container to workspace 4 -bindsym $mod+Shift+5 move container to workspace 5 -bindsym $mod+Shift+6 move container to workspace 6 -bindsym $mod+Shift+7 move container to workspace 7 -bindsym $mod+Shift+8 move container to workspace 8 -bindsym $mod+Shift+9 move container to workspace 9 -bindsym $mod+Shift+0 move container to workspace  - - -#assign apps to workspaces -#assign [class = "URxvt"]  -assign [class = "Firefox"]  -assign [class = "discord"]  -assign[class="Atomic TweetDeck"]  -assign [class="Slack"]  -assign[class="Atom"] - - -# reload the configuration file -bindsym $mod+Shift+c reload -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -# also destroy anything in startup workspace -bindsym $mod+Shift+r restart [workspace=] kill -# exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" - -# resize window (you can also use the mouse for that) -mode "resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym h resize shrink width 10 px or 10 ppt - bindsym j resize shrink height 10 px or 10 ppt - bindsym k resize grow height 10 px or 10 ppt - bindsym l resize grow width 10 px or 10 ppt - - # same bindings, but for the arrow keys - bindsym Left resize shrink width 10 px or 10 ppt - bindsym Down resize grow height 10 px or 10 ppt - bindsym Up resize shrink height 10 px or 10 ppt - bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape - bindsym $mod+R mode "default" - bindsym Return mode "default" - bindsym Escape mode "default" -} - -bindsym $mod+r mode "resize" -bindsym $mod+p exec i3lock-fancy - -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) -#bar { -# font pango:DejaVu Sans Mono, Awesome 8 -# status_command i3blocks -# colors { -# background #23313D -# separator #757575 -# # border background text -# focused_workspace $inactive-bg-color $bg-color $text-color -# inactive_workspace $bg-color $bg-color $text-color -# urgent_workspace $urgent-bg-color $urgent-bg-color $text-color -# } -#} - - -#SCROT -bindsym --release Print exec "scrot ~/Pictures/Screenshots/%b%d:%H%M%S.png" - -# Alsa controls -bindsym XF86AudioMute exec amixer set Master toggle; exec pkill -RTMIN+10 i3blocks -bindsym XF86AudioRaiseVolume exec amixer set Master 5%+; exec pkill -RTMIN+10 i3blocks -bindsym XF86AudioLowerVolume exec amixer set Master 5%-; exec pkill -RTMIN+10 i3blocks - -#Pulse Audio controls -#bindsym XF86AudioRaiseVolume exec amixer -q -D pulse sset Master 2%+; -#exec pkill -RTMIN+10 i3blocks -#bindsym XF86AudioLowerVolume exec amixer -q -D pulse sset Master 2%-; -#exec pkill -RTMIN+10 i3blocks -#bindsym XF86AudioMute exec amixer -q -D pulse sset Master toggle; -#exec pkill -RTMIN+10 i3blocks - -# Sreen brightness controls -bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness -bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness - -# Touchpad controls -bindsym XF86TouchpadToggle exec /some/path/toggletouchpad.sh # toggle touchpad - -# Media player controls -bindsym XF86AudioPlay exec playerctl play -bindsym XF86AudioPause exec playerctl pause -#bindsym XF86AudioNext exec playerctl next -#bindsym XF86AudioPrev exec playerctl previous - - -exec systemctl --user restart polybar -exec xrdb /home/julien/.Xressources - -#exec --no-startup-id i3-msg 'workspace ; exec urxvt;exec urxvt;exec urxvt;exec urxvt; workspace ' diff --git a/home-manager-modules/i3/default.nix b/home-manager-modules/i3/default.nix deleted file mode 100644 index 80c7733..0000000 --- a/home-manager-modules/i3/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, pkgs, lib, ... }: -let - cfg = config.luj.i3; -in with lib; -{ - options.luj.i3 = { - enable = mkEnableOption "activate i3"; - }; - - config = mkIf cfg.enable { - xsession.windowManager.i3 = { - enable = true; - package = pkgs.i3-gaps; - }; - - xdg.configFile."i3/config".source = lib.mkForce ./config; - - }; -} diff --git a/home-manager-modules/kitty/default.nix b/home-manager-modules/kitty/default.nix new file mode 100644 index 0000000..66fcd3b --- /dev/null +++ b/home-manager-modules/kitty/default.nix @@ -0,0 +1,35 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.luj.programs.kitty; +in +with lib; +{ + options.luj.programs.kitty = { + enable = mkEnableOption "Enable Kitty"; + }; + + config = mkIf cfg.enable { + + programs.kitty = { + enable = true; + settings = { + wayland_titlebar_color = "background"; + shell_integration = "no-cursor"; + window_padding_width = 3; + font_size = 10; + confirm_os_window_close = 0; + }; + font = { + name = "FiraCode Nerd Font Mono Reg"; + package = pkgs.nerd-fonts.fira-code; + }; + themeFile = "Catppuccin-Mocha"; + + }; + }; +} diff --git a/home-manager-modules/mails/afewconfig b/home-manager-modules/mails/afewconfig deleted file mode 100644 index 80b737a..0000000 --- a/home-manager-modules/mails/afewconfig +++ /dev/null @@ -1,90 +0,0 @@ - - -[Filter.1] -query = subject:"Formulaire d'externement" -tags = +externement -message = Externement - - -[Filter.2] -query = subject:/\[DG\]/ -tags = +dg -message = Mail pour la DG - -[Filter.3] -query = subject:"Demande de malle" -tags = +malle -message = Malle - -[Filter.4] -query = subject:"Demande d'inscription de" -tags = +thurnage -message = Thurnage - -[Filter.5] -query = subject:"Formulaire situation de" -tags = +situation -message = Situation - -[Filter.6] -query = subject:"Inscription au thurnage général de" -tags = +thurnage -message = TG - -[Filter.7] -query = subject:"Prévision d'externement de" -tags = +externement -message = previsionext - -[Filter.8] -query = subject:"Demande d'accès" -tags = +malle -message = acces - -[Filter.9] -query = subject:"Rendu de malle" -tags = +malle -message = rendu - -[Filter.10] -query = subject:"Prolongation de la malle" -tags = +malle -message = prolong - -[Filter.11] -query = subject:"Fermeture de l'internat" -tags = +fermeture -message = fermeture - -[Filter.12] -query = subject:/\[COF\]/ -tags = +cof -message = COF - -[Filter.13] -query = subject:"Modification inscription TG" -tags= +thurnage - -[Filter.14] -query = subject:/\[Pouët-Pouêt\]/ -tags = +fanfare -message = fanfare - -[Filter.15] -query = subject:/\[K-Fêt\]/ -tags = +kfet -message = kfet - -[Filter.16] -query = subject:/\[Chef.fe.s\]/ -tags = +chefs -message = chefs - - -[InboxFilter] - -[MailMover] -folders = ens/INBOX ens/DG -rename = True -ens/INBOX = 'tag:dg':ens/DG 'tag:COF':ens/COF 'tag:fanfare':ens/Fanfare 'tag:kfet':ens/K-Fet 'tag:chefs':ens/K-Fet/Chefs -ens/DG = 'tag:externement':ens/DG/Externements 'tag:malle':ens/DG/Malles 'tag:thurnage':ens/DG/Thurnages 'tag:situation':ens/DG/Situations 'tag:fermeture':ens/DG/Fermeture diff --git a/home-manager-modules/mails/default.nix b/home-manager-modules/mails/default.nix index d60f5f9..0a1a8e0 100644 --- a/home-manager-modules/mails/default.nix +++ b/home-manager-modules/mails/default.nix @@ -1,4 +1,9 @@ -{ pkgs, config, lib, ... }: +{ + pkgs, + config, + lib, + ... +}: let cfg = config.luj.emails; in @@ -6,68 +11,156 @@ with lib; { options.luj.emails = { enable = mkEnableOption "enable mail management"; - backend.enable = mkEnableOption "enable filtering backend"; }; + config = mkIf cfg.enable { - config = mkMerge [ - (mkIf cfg.enable { - programs.mbsync.enable = true; - programs.neomutt.enable = true; - programs.msmtp.enable = true; - accounts.email = { - accounts.ens = { - address = "julien.malka@ens.fr"; - imap.host = "clipper.ens.fr"; - mbsync = { - enable = true; - create = "maildir"; - extraConfig.channel = { - "CopyArrivalDate" = "yes"; - }; + age.secrets.work-mail-pw = { + file = ../../secrets/work-mail-pw.age; + }; + + age.secrets.dgnum-mail-pw = { + file = ../../secrets/dgnum-mail-pw.age; + }; + + age.secrets.telecom-mail-pw = { + file = ../../secrets/telecom-mail-pw.age; + }; + + age.secrets.ens-mail-pw = { + file = ../../secrets/ens-mail-pw.age; + }; + + programs.mbsync = { + enable = lib.mkDefault true; + package = pkgs.unstable.isync; + }; + + programs.msmtp.enable = true; + accounts.email = { + accounts.ens = { + notmuch.enable = true; + folders.inbox = "INBOX"; + address = "julien.malka@ens.fr"; + imap.host = "clipper.ens.fr"; + mbsync = { + enable = true; + create = "maildir"; + expunge = "both"; + extraConfig.channel = { + "CopyArrivalDate" = "yes"; }; - msmtp.enable = true; - primary = true; - realName = "Julien Malka"; - passwordCommand = "${pkgs.gnupg}/bin/gpg -q --batch --passphrase-file /home/julien/email-passphrase -d ${./ens.pass.gpg}"; - smtp = { - host = "clipper.ens.fr"; - }; - userName = "jmalka"; }; + msmtp.enable = true; + primary = true; + realName = "Julien Malka"; + passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.ens-mail-pw.path}"; + smtp = { + host = "clipper.ens.fr"; + }; + userName = "jmalka"; }; - services.mbsync = { - enable = true; - frequency = "*-*-* *:*:00"; - verbose = false; - }; - xdg.configFile = { - "neomutt/neomuttrc".source = lib.mkForce ./neomuttrc; + accounts.work = { + notmuch.enable = true; + folders.inbox = "INBOX"; + address = "julien@malka.sh"; + imap.host = "mail.luj.fr"; + mbsync = { + enable = true; + create = "maildir"; + expunge = "both"; + extraConfig.channel = { + "CopyArrivalDate" = "yes"; + }; + }; + msmtp.enable = true; + primary = false; + realName = "Julien Malka"; + passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.work-mail-pw.path}"; + smtp = { + host = "mail.luj.fr"; + }; + userName = "malka"; }; - - }) - - (mkIf (cfg.enable && cfg.backend.enable) { - programs.afew.enable = true; - accounts.email.accounts.ens.notmuch.enable = true; - services.mbsync.postExec = "${pkgs.notmuch}/bin/notmuch new"; - programs.notmuch = { - enable = true; - new.tags = [ "new" ]; - hooks.postNew = '' - ${pkgs.afew}/bin/afew --tag --new - ${pkgs.afew}/bin/afew --move-mails - ''; - }; - xdg.configFile = { - "afew/config".source = lib.mkForce ./afewconfig; + accounts.telecom = { + notmuch.enable = true; + folders.inbox = "INBOX"; + address = "julien.malka@telecom-paris.fr"; + imap.host = "z.imt.fr"; + mbsync = { + enable = true; + create = "maildir"; + expunge = "both"; + extraConfig.channel = { + "CopyArrivalDate" = "yes"; + }; + }; + msmtp.enable = true; + primary = false; + realName = "Julien Malka"; + passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.telecom-mail-pw.path}"; + smtp = { + host = "z.imt.fr"; + }; + userName = "julien.malka@telecom-paris.fr"; }; + accounts.dgnum = { + notmuch.enable = true; + folders.inbox = "INBOX"; + address = "luj@dgnum.eu"; + imap.host = "kurisu.lahfa.xyz"; + mbsync = { + enable = true; + create = "maildir"; + expunge = "both"; + extraConfig.channel = { + "CopyArrivalDate" = "yes"; + }; + }; + msmtp.enable = true; + primary = false; + realName = "Julien Malka"; + passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.dgnum-mail-pw.path}"; + smtp = { + host = "kurisu.lahfa.xyz"; + }; + userName = "luj@dgnum.eu"; + }; - }) + }; + services.mbsync = { + enable = lib.mkDefault true; + frequency = "minutely"; + package = pkgs.unstable.isync; + }; - ]; + services.mbsync.postExec = lib.mkDefault "${pkgs.notmuch}/bin/notmuch new"; + programs.notmuch = { + enable = lib.mkDefault true; + new.tags = [ "new" ]; + hooks.preNew = lib.mkDefault '' + ${pkgs.notmuch-mailmover}/bin/notmuch-mailmover --config ${./mailmover.lua} + ''; + hooks.postNew = lib.mkDefault '' + ${pkgs.afew}/bin/afew --tag --new + ''; + }; + + programs.afew = { + enable = true; + extraConfig = '' + [FolderNameFilter] + maildir_separator = / + folder_lowercases = true + [Filter.1] + query = tag:new + tags = -new + ''; + }; + + }; } diff --git a/home-manager-modules/mails/mailmover.lua b/home-manager-modules/mails/mailmover.lua new file mode 100644 index 0000000..0f0c046 --- /dev/null +++ b/home-manager-modules/mails/mailmover.lua @@ -0,0 +1,173 @@ +local match_modes = { + ALL = "all", + FIRST = "first", + UNIQUE = "unique", +} + +--- Execute a shell command and return its output +local function execute_command(cmd) + local handle = io.popen(cmd) + local result = handle:read("*a") + handle:close() + return result +end + +--- Get all folders from the Maildir structure +local function get_maildir_folders(maildir_path) + local cmd = "find " .. maildir_path .. " -type d -name cur | sed 's|/cur$||' | sed 's|" .. maildir_path .. "/||'" + local output = execute_command(cmd) + + local folders = {} + for folder in string.gmatch(output, "([^\n]+)") do + if folder ~= "" then + folders[#folders+1] = folder + end + end + + return folders +end + +--- Check if one path is a parent of another +local function is_parent_path(parent, child) + return child:match("^" .. parent .. "/") ~= nil +end + +--- Check if a folder contains "Archive" in its name +local function contains_archive(folder) + return string.find(folder, "Archive") ~= nil +end + +--- Generate rules based on folder structure +local function generate_rules(maildir_path) + local folders = get_maildir_folders(maildir_path) + local rules = {} + + -- Create a sorted copy of folders, from longest path to shortest + -- This ensures we process children before parents + local sorted_folders = {} + for _, folder in ipairs(folders) do + table.insert(sorted_folders, folder) + end + table.sort(sorted_folders, function(a, b) + return #a > #b + end) + + -- Store each folder's subfolder tags for exclusion + local subfolder_tags = {} + for _, folder in ipairs(sorted_folders) do + subfolder_tags[folder] = {} + end + + -- Collect all subfolder-specific tags for each folder + for _, folder in ipairs(sorted_folders) do + local parts = {} + for part in string.gmatch(folder, "([^/]+)") do + table.insert(parts, part) + end + + -- For each folder, find its parent folders and add its deepest tag to their exclusion list + if #parts > 0 then + local deepest_tag = string.lower(parts[#parts]) + local parent_path = "" + + for i = 1, #parts - 1 do + if i > 1 then + parent_path = parent_path .. "/" + end + parent_path = parent_path .. parts[i] + + -- Add this tag to the parent's exclusion list + if subfolder_tags[parent_path] then + table.insert(subfolder_tags[parent_path], deepest_tag) + end + end + end + end + + -- Now generate rules with proper exclusions + for _, folder in ipairs(folders) do + -- Skip Trash and Sent as they're already handled + if folder ~= "Trash" and folder ~= "Sent" then + local query_parts = {} + local exclusion_parts = {} + + -- Convert each folder component to a lowercase tag requirement + for part in string.gmatch(folder, "([^/]+)") do + table.insert(query_parts, "tag:" .. string.lower(part)) + end + + -- Add exclusions for subfolder-specific tags + if subfolder_tags[folder] then + for _, tag in ipairs(subfolder_tags[folder]) do + table.insert(exclusion_parts, "not tag:" .. tag) + end + end + + -- Add "not tag:sent" for any folder containing "Archive" + if contains_archive(folder) then + table.insert(exclusion_parts, "not tag:sent") + end + + -- Build the complete query + local query = table.concat(query_parts, " and ") + if #exclusion_parts > 0 then + query = query .. " and " .. table.concat(exclusion_parts, " and ") + end + + -- Add rule for this folder + rules[#rules+1] = { + folder = folder, + query = query, + } + end + end + + -- Sort rules by complexity (number of tags) - more specific rules first + table.sort(rules, function(a, b) + if a.folder == "Trash" then return true end + if b.folder == "Trash" then return false end + if a.folder == "Sent" then return true end + if b.folder == "Sent" then return false end + + local a_count = select(2, string.gsub(a.query, "tag:", "")) + local b_count = select(2, string.gsub(b.query, "tag:", "")) + return a_count > b_count + end) + + local final_rules = {} + for _, rule in ipairs(rules) do + if string.lower(rule.folder) ~= "drafts" then + table.insert(final_rules, rule) + end + end + + return final_rules +end + +-- Path to maildir +local maildir_path = os.getenv("HOME") .. "/Maildir" + +--- Configuration for notmuch-mailmover. +-- +--- @class config +--- @field maildir string Path to the maildir +--- @field notmuch_config string Path to the notmuch configuration +--- @field rename boolean Rename the files when moving +--- @field max_age_days number Maximum age (days) of the messages to be procssed +--- @field rule_match_mode config.match_mode Match mode for rules +--- @field rules rule[] List of rules +--- +--- @class rule +--- @field folder string Folder to move the messages to +--- @field query string Notmuch query to match the messages +local config = { + maildir = maildir_path, + notmuch_config = "/home/julien/.config/notmuch/default/config", + rename = true, + max_age_days = 356, + rule_match_mode = match_modes.UNIQUE, + rules = generate_rules(maildir_path), +} + + +return config diff --git a/home-manager-modules/mails/neomuttrc b/home-manager-modules/mails/neomuttrc deleted file mode 100644 index 1957994..0000000 --- a/home-manager-modules/mails/neomuttrc +++ /dev/null @@ -1,83 +0,0 @@ -set from = "julien.malka@ens.fr" - -# Nom complet de l'expéditeur -set realname = "Julien Malka" - -# Génération du champs from -set use_from = yes - -set edit_headers=yes -set reverse_name -set mark_old=no -set editor = "nvim -c 'set tw=72' -c 'set wrap'" -#set editor="vim +':set textwidth=0' +':set wrapmargin=0' +':set wrap'" -#set wrap="72" -set folder = ~/Maildir/ens - -set mbox_type=Maildir -set virtual_spoolfile=yes -set header_cache=~/.cache/mutt -set sidebar_visible = yes -set record = "+Sent\ Messages" -#mailboxes =Inbox =DG =DG/Malles =DG/Externements =DG/Thurnages =DG/Situations =DG/Fermeture =Sent\ Messages -#named-mailboxes "Malles" =DG/Malles -#named-mailboxes "Externements" =DG/Externements -#named-mailboxes "Thurnages" =DG/Thurnages -#named-mailboxes "Situations" =DG/Situations -#named-mailboxes "Fermeture" =DG/Fermeture -#named-mailboxes "Sent" =Sent\ Messages -set nm_unread_tag = unread -set mail_check_stats=yes -set sidebar_short_path = yes - - -set timeout=10 -set mail_check=10 -virtual-mailboxes "Inbox" "notmuch://?query=tag:inbox and NOT tag:dg and NOT tag:cof and NOT tag:fanfare and NOT tag:kfet and NOT tag:chefs" -virtual-mailboxes "K-Fêt" "notmuch://?query=tag:kfet" -virtual-mailboxes "Chefs" "notmuch://?query=tag:chefs" -virtual-mailboxes "DG" "notmuch://?query=tag:dg and NOT tag:externement and NOT tag:fermeture and NOT tag:malle and NOT tag:situation and NOT tag:thurnage" -virtual-mailboxes "Externements" "notmuch://?query=tag:externement" -virtual-mailboxes "Fermeture" "notmuch://?query=tag:fermeture" -virtual-mailboxes "Malles" "notmuch://?query=tag:malle" -virtual-mailboxes "Situations" "notmuch://?query=tag:situation" -virtual-mailboxes "Thurnages" "notmuch://?query=tag:thurnage" -virtual-mailboxes "Fanfare" "notmuch://?query=tag:fanfare" - -set sidebar_width=15 -set sidebar_divider_char='|' -# color of folders with new mail -# ctrl-n, ctrl-p to select next, prev folder# ctrl-o to open selected folder -bind index \CP sidebar-prev -bind index \CN sidebar-next -bind index \CO sidebar-open -bind pager \CP sidebar-prev -bind pager \CN sidebar-next -bind pager \CO sidebar-open -bind pager previous-line -set nm_default_url = "notmuch:///home/julien/Maildir" - -macro index \\ "" -set metoo=yes - -set text_flowed - -set collapse_unread = no -set collapse_all = yes - -bind index - collapse-thread - - - -set sort = threads -set sort_aux = reverse-last-date-received - -folder-hook . 'source /home/julien/dotfiles/profile.default' -folder-hook "DG" 'source /home/julien/dotfiles/profile.dg' -folder-hook "K-Fêt" 'source /home/julien/dotfiles/profile.kfet' -folder-hook "Chefs" 'source /home/julien/dotfiles/profile.chefs' -set sidebar_format = '%D%* %?N?(%N)?%*' -color sidebar_unread yellow default - -source ~/dotfiles/dracula.muttrc -set sendmail = "msmtp" diff --git a/home-manager-modules/neovim/default.nix b/home-manager-modules/neovim/default.nix index e7d5ad9..778b582 100644 --- a/home-manager-modules/neovim/default.nix +++ b/home-manager-modules/neovim/default.nix @@ -1,16 +1,12 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + home, + lib, + config, + ... +}: let cfg = config.luj.programs.neovim; - dusk-vim = pkgs.vimUtils.buildVimPlugin { - name = "dusk-vim"; - src = pkgs.fetchFromGitHub { - owner = "notusknot"; - repo = "dusk-vim"; - rev = "8eb71f092ebfa173a6568befbe522a56e8382756"; - sha256 = "09l4hda5jnyigc2hhlirv1rc8hsnsc4zgcv4sa4br8fryi73nf4g"; - }; - }; - in with lib; { @@ -19,54 +15,166 @@ with lib; }; config = mkIf cfg.enable { + + home.packages = with pkgs; [ + git + nodejs + ripgrep + gcc + ]; + programs.neovim = { enable = true; package = pkgs.neovim-unwrapped; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + + coc = { + enable = true; + settings = { + coc.preferences.formatOnSaveFiletypes = [ + "nix" + "rust" + "sql" + "python" + "haskell" + ]; + rust-analyzer.enable = true; + rust-analyzer.cargo.allFeatures = true; + rust-analyzer.checkOnSave.allTargets = true; + languageserver = { + python = { + command = "pyright"; + filetypes = [ + "py" + "python" + ]; + }; + + haskell = { + command = "haskell-language-server-wrapper"; + args = [ "--lsp" ]; + rootPatterns = [ + "*.cabal" + "cabal.project" + "hie.yaml" + ".stack.yaml" + ]; + filetypes = [ + "haskell" + "lhaskell" + "hs" + "lhs" + ]; + settings = { + haskell = { + checkParents = "CheckOnSave"; + checkProject = true; + maxCompletions = 40; + formattingProvider = "ormolu"; + }; + }; + }; + + go = { + command = "gopls"; + rootPatterns = [ + "go.work" + "go.mod" + ".vim/" + ".git/" + ".hg/" + ]; + filetypes = [ "go" ]; + initializationOptions = { + usePlaceholders = true; + }; + }; + + nix = { + command = "nixd"; + filetypes = [ "nix" ]; + settings.nixd.formatting.command = [ "nixfmt" ]; + }; + + ccls = { + command = "ccls"; + filetypes = [ + "c" + "cpp" + "objc" + "objcpp" + ]; + rootPatterns = [ + ".ccls" + "compile_commands.json" + ".vim/" + ".git/" + ".hg/" + ]; + initializationOptions = { + cache = { + directory = "/tmp/ccls"; + }; + }; + }; + }; + }; + }; + + withPython3 = true; plugins = with pkgs.vimPlugins; [ - # File tree - nvim-web-devicons - nvim-tree-lua - # LSP - nvim-lspconfig - # Languages - vim-nix + plenary-nvim - # Eyecandy - nvim-treesitter - bufferline-nvim - galaxyline-nvim - nvim-colorizer-lua - pears-nvim - dusk-vim - - # Lsp and completion - nvim-lspconfig - nvim-compe - - # Telescope + #Telescope telescope-nvim - # Indent lines - #indent-blankline-nvim + nvim-web-devicons + + catppuccin-nvim + + pkgs.unstable.vimPlugins.bufferline-nvim + nvim-colorizer-lua + pears-nvim + nvim-tree-lua + + (nvim-treesitter.withPlugins ( + ps: with ps; [ + tree-sitter-nix + tree-sitter-python + ] + )) + + vim-lastplace + vim-nix + vim-nixhash + vim-yaml + vim-toml + vim-airline + vim-devicons + zig-vim + vim-scriptease + semshi + coc-prettier + coc-pyright + coc-rust-analyzer + rust-vim ]; + extraPackages = with pkgs; [ - gcc - rnix-lsp - tree-sitter - sumneko-lua-language-server + rust-analyzer + pkgs.nixd + pyright + ormolu + ccls + gopls + unstable.nixfmt-rfc-style ]; + extraConfig = '' - luafile ${./lua}/lsp.lua - luafile ${./lua}/nvim-tree.lua - luafile ${./lua}/galaxyline.lua - luafile ${./lua}/settings.lua + luafile ${./settings.lua} ''; }; }; - } - - - - - diff --git a/home-manager-modules/neovim/lua/galaxyline.lua b/home-manager-modules/neovim/lua/galaxyline.lua deleted file mode 100755 index 06f6eb0..0000000 --- a/home-manager-modules/neovim/lua/galaxyline.lua +++ /dev/null @@ -1,204 +0,0 @@ - -- This file configures galaxyline, a fast and small statusline for nvim. - -- The configuration was taken from github.com/siduck76/neovim-dotfiles/ - -- All I did was change the colors. Full credit goes to siduck76 - -local gl = require("galaxyline") -local gls = gl.section - -gl.short_line_list = {" "} -- keeping this table { } as empty will show inactive statuslines - -local colors = { - bg = "#2e303e", - line_bg = "#2e303e", - fg = "#e3e6ee", - green = "#29d398", - orange = "#efb993", - red = "#e95678", - lightbg = "#2e303e", - lightbasdfg = "#393b4d", - nord = "#9699b7", - greenYel = "#efb993" -} - -gls.left[1] = { - leftRounded = { - provider = function() - return " " - end, - highlight = {colors.nord, colors.bg} - } -} - -gls.left[2] = { - statusIcon = { - provider = function() - return "  " - end, - highlight = {colors.fg, colors.bg}, - separator = " ", - separator_highlight = {colors.lightbg, colors.lightbg} - } -} - -gls.left[3] = { - FileIcon = { - provider = "FileIcon", - condition = buffer_not_empty, - highlight = {require("galaxyline.provider_fileinfo").get_file_icon_color, colors.lightbg} - } -} - -gls.left[4] = { - FileName = { - provider = {"FileName", "FileSize"}, - condition = buffer_not_empty, - highlight = {colors.fg, colors.lightbg} - } -} - -gls.left[5] = { - teech = { - provider = function() - return " " - end, - separator = " ", - highlight = {colors.lightbg, colors.bg} - } -} - -local checkwidth = function() - local squeeze_width = vim.fn.winwidth(0) / 2 - if squeeze_width > 40 then - return true - end - return false -end - -gls.left[6] = { - DiffAdd = { - provider = "DiffAdd", - condition = checkwidth, - icon = "  ", - highlight = {colors.greenYel, colors.line_bg} - } -} - -gls.left[7] = { - DiffModified = { - provider = "DiffModified", - condition = checkwidth, - icon = " ", - highlight = {colors.orange, colors.line_bg} - } -} - -gls.left[8] = { - DiffRemove = { - provider = "DiffRemove", - condition = checkwidth, - icon = " ", - highlight = {colors.lightbg, colors.line_bg} - } -} - -gls.left[9] = { - LeftEnd = { - provider = function() - return " " - end, - separator = " ", - separator_highlight = {colors.line_bg, colors.line_bg}, - highlight = {colors.line_bg, colors.line_bg} - } -} - -gls.left[10] = { - DiagnosticError = { - provider = "DiagnosticError", - icon = "  ", - highlight = {colors.red, colors.bg} - } -} - -gls.left[11] = { - Space = { - provider = function() - return " " - end, - highlight = {colors.line_bg, colors.line_bg} - } -} - -gls.left[12] = { - DiagnosticWarn = { - provider = "DiagnosticWarn", - icon = "  ", - highlight = {colors.red, colors.bg} - } -} - -gls.right[1] = { - GitIcon = { - provider = function() - return "  " - end, - condition = require("galaxyline.provider_vcs").check_git_workspace, - highlight = {colors.green, colors.line_bg} - } -} - -gls.right[2] = { - GitBranch = { - provider = "GitBranch", - condition = require("galaxyline.provider_vcs").check_git_workspace, - highlight = {colors.green, colors.line_bg} - } -} - -gls.right[3] = { - right_LeftRounded = { - provider = function() - return " " - end, - separator = " ", - separator_highlight = {colors.bg, colors.bg}, - highlight = {colors.lightbg, colors.bg} - } -} - -gls.right[4] = { - ViMode = { - provider = function() - local alias = { - n = "NORMAL", - i = "INSERT", - c = "COMMAND", - V = "VISUAL", - [""] = "VISUAL", - v = "VISUAL", - R = "REPLACE" - } - return alias[vim.fn.mode()] - end, - highlight = {colors.fg, colors.lightbg} - } -} - -gls.right[5] = { - PerCent = { - provider = "LinePercent", - separator = " ", - separator_highlight = {colors.lightbg, colors.lightbg}, - highlight = {colors.fg, colors.lightbg} - } -} - -gls.right[6] = { - rightRounded = { - provider = function() - return " " - end, - highlight = {colors.lightbg, colors.bg} - } -} - diff --git a/home-manager-modules/neovim/lua/lsp.lua b/home-manager-modules/neovim/lua/lsp.lua deleted file mode 100755 index 5978580..0000000 --- a/home-manager-modules/neovim/lua/lsp.lua +++ /dev/null @@ -1,76 +0,0 @@ --- This file sets up autocompletion for neovim's native lsp - --- This enables all the language servers I want on my system --- Change these to whatever languages you use - -require'lspconfig'.rnix.setup{} -require'lspconfig'.sumneko_lua.setup{} -vim.o.completeopt = "menuone,noselect" - --- Autocompletion setup -require'compe'.setup { - enabled = true; - autocomplete = true; - debug = false; - min_length = 1; - preselect = 'enable'; - throttle_time = 80; - source_timeout = 200; - incomplete_delay = 400; - max_abbr_width = 100; - max_kind_width = 100; - max_menu_width = 100; - documentation = false; - source = { - path = true; - buffer = true; - nvim_lsp = true; - treesitter = true; - }; -} - --- Set tab to accept the autocompletion -local t = function(str) - return vim.api.nvim_replace_termcodes(str, true, true, true) -end -_G.tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" - else - return t "" - end -end - -vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) - - --- set the path to the sumneko installation; if you previously installed via the now deprecated :LspInstall, use -local sumneko_root_path = vim.fn.stdpath('cache')..'/lspconfig/sumneko_lua/lua-language-server' -local sumneko_binary = "lua-language-server" - -local runtime_path = vim.split(package.path, ';') -table.insert(runtime_path, "lua/?.lua") -table.insert(runtime_path, "lua/?/init.lua") - -require'lspconfig'.sumneko_lua.setup { - cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}; - settings = { - Lua = { - runtime = { - version = 'LuaJIT', - path = runtime_path, - }, - diagnostics = { - globals = {'vim'}, - }, - workspace = { - library = vim.api.nvim_get_runtime_file("", true), - preloadFileSize = 120 - }, - telemetry = { - enable = false, - }, - }, - }, -} diff --git a/home-manager-modules/neovim/lua/nvim-tree.lua b/home-manager-modules/neovim/lua/nvim-tree.lua deleted file mode 100755 index 6cb44f0..0000000 --- a/home-manager-modules/neovim/lua/nvim-tree.lua +++ /dev/null @@ -1,60 +0,0 @@ --- following options are the default --- each of these are documented in `:help nvim-tree.OPTION_NAME` -require'nvim-tree'.setup { - disable_netrw = true, - hijack_netrw = true, - open_on_setup = false, - ignore_ft_on_setup = {}, - auto_close = false, - open_on_tab = false, - hijack_cursor = false, - update_cwd = false, - update_to_buf_dir = { - enable = true, - auto_open = true, - }, - diagnostics = { - enable = false, - icons = { - hint = "", - info = "", - warning = "", - error = "", - } - }, - update_focused_file = { - enable = false, - update_cwd = false, - ignore_list = {} - }, - system_open = { - cmd = nil, - args = {} - }, - filters = { - dotfiles = false, - custom = {} - }, - git = { - enable = true, - ignore = true, - timeout = 500, - }, - view = { - width = 30, - height = 30, - hide_root_folder = false, - side = 'left', - auto_resize = false, - mappings = { - custom_only = false, - list = {} - }, - number = false, - relativenumber = false - }, - trash = { - cmd = "trash", - require_confirm = true - } -} diff --git a/home-manager-modules/neovim/lua/settings.lua b/home-manager-modules/neovim/lua/settings.lua deleted file mode 100644 index 45b2a56..0000000 --- a/home-manager-modules/neovim/lua/settings.lua +++ /dev/null @@ -1,96 +0,0 @@ --- Lazy load everything! --- --- ---dofile("lsp.lua") ---dofile("galaxyline.lua") ---dofile("nvim-tree.lua") -local opt = vim.opt -local g = vim.g - - -vim.cmd [[ - set nowrap - set nobackup - set nowritebackup - set noerrorbells - set noswapfile - - colorscheme dusk - function! Preserve(command) - let w = winsaveview() - execute a:command - call winrestview(w) - endfunction - autocmd FileType nix map u :call Preserve("%!update-nix-fetchgit --location=" . line(".") . ":" . col(".")) - autocmd BufWinEnter NvimTree setlocal nonumber - map ; : - highlight IndentBlanklineChar guifg = #393b4d - -]] - --- Enable plugins -require('bufferline').setup{} -require('pears').setup() -require('colorizer').setup() - --- Treesitter settings -require'nvim-treesitter.configs'.setup { - ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages - highlight = { - enable = true - }, -} - -local map = vim.api.nvim_set_keymap -options = { noremap = true } -map('n', '', ':NvimTreeToggle ', options) -map('n', '', ':Telescope find_files ', options) -map('n', '', ':Telescope live_grep ', options) -map('n', '', ':noh ', options) -map('n', '', ':!xclip -sel c -o | pygmentize -f html | xclip -sel c ', options) -vim.api.nvim_set_keymap('n', '0', "getline('.')[0 : col('.') - 2] =~# '^\\s\\+$' ? '0' : '^'", {silent = true, noremap = true, expr = true}) -g.mapleader = ' ' - --- Indent line -g.indent_blankline_char = '▏' - --- Performance -opt.lazyredraw = true; -opt.shell = "zsh" -opt.shadafile = "NONE" - --- Colors -opt.termguicolors = true - --- Undo files -opt.undofile = true - --- Indentation -opt.smartindent = true -opt.tabstop = 4 -opt.shiftwidth = 4 -opt.shiftround = true -opt.expandtab = true -opt.scrolloff = 3 - --- Set clipboard to use system clipboard -opt.clipboard = "unnamedplus" - --- Use mouse -opt.mouse = "a" - --- Nicer UI settings -opt.cursorline = true -opt.relativenumber = true -opt.number = true - --- Get rid of annoying viminfo file -opt.viminfo = "" -opt.viminfofile = "NONE" - --- Miscellaneous quality of life -opt.ignorecase = true -opt.ttimeoutlen = 5 -opt.compatible = false -opt.hidden = true -opt.shortmess = "atI" diff --git a/home-manager-modules/neovim/settings.lua b/home-manager-modules/neovim/settings.lua new file mode 100644 index 0000000..f878c44 --- /dev/null +++ b/home-manager-modules/neovim/settings.lua @@ -0,0 +1,273 @@ +local opt = vim.opt +local g = vim.g +local keyset = vim.keymap.set + +opt.backup = false +opt.writebackup = false +opt.updatetime = 300 +opt.signcolumn = "yes" + + +vim.cmd [[ + syntax on + set scrolloff=4 + set nocompatible + set encoding=utf-8 + set fileencoding=utf-8 + + set smartindent + set autoindent + set number + set relativenumber + + colorscheme catppuccin +]] + +require("catppuccin").setup({ + flavour = "mocha", -- latte, frappe, macchiato, mocha + background = { -- :h background + light = "latte", + dark = "mocha", + }, + transparent_background = false, + show_end_of_buffer = false, -- show the '~' characters after the end of buffers + term_colors = false, + dim_inactive = { + enabled = false, + shade = "dark", + percentage = 0.15, + }, + no_italic = false, -- Force no italic + no_bold = false, -- Force no bold + styles = { + comments = { "italic" }, + conditionals = { "italic" }, + loops = {}, + functions = {}, + keywords = {}, + strings = {}, + variables = {}, + numbers = {}, + booleans = {}, + properties = {}, + types = {}, + operators = {}, + }, + color_overrides = {}, + custom_highlights = {}, + integrations = { + cmp = true, + gitsigns = true, + nvimtree = true, + telescope = true, + notify = false, + mini = false, + -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) + }, +}) + +require("nvim-tree").setup() +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'ff', builtin.find_files, {}) +vim.keymap.set('n', 'fg', builtin.live_grep, {}) +vim.keymap.set('n', 'fb', builtin.buffers, {}) +vim.keymap.set('n', 'fh', builtin.help_tags, {}) + +require'nvim-web-devicons'.setup() + +vim.opt.termguicolors = true +require("bufferline").setup{} + +require('colorizer').setup() + +-- Treesitter settings +require'nvim-treesitter.configs'.setup { + ensure_installed = "", -- one of "all", "maintained" (parsers with maintainers), or a list of languages + highlight = { + enable = true + }, +} + + + +-- Some servers have issues with backup files, see #649. +vim.opt.backup = false +vim.opt.writebackup = false + +-- Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable +-- delays and poor user experience. +vim.opt.updatetime = 300 + +-- Always show the signcolumn, otherwise it would shift the text each time +-- diagnostics appear/become resolved. +vim.opt.signcolumn = "yes" + +local keyset = vim.keymap.set +-- Auto complete +function _G.check_back_space() + local col = vim.fn.col('.') - 1 + return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil +end + +-- Use tab for trigger completion with characters ahead and navigate. +-- NOTE: There's always complete item selected by default, you may want to enable +-- no select by `"suggest.noselect": true` in your configuration file. +-- NOTE: Use command ':verbose imap ' to make sure tab is not mapped by +-- other plugin before putting this into your config. +local opts = {silent = true, noremap = true, expr = true, replace_keycodes = false} +keyset("i", "", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "" : coc#refresh()', opts) +keyset("i", "", [[coc#pum#visible() ? coc#pum#prev(1) : "\"]], opts) + +-- Make to accept selected completion item or notify coc.nvim to format +-- u breaks current undo, please make your own choice. +keyset("i", "", [[coc#pum#visible() ? coc#pum#confirm() : "\u\\=coc#on_enter()\"]], opts) + +-- Use to trigger snippets +keyset("i", "", "(coc-snippets-expand-jump)") +-- Use to trigger completion. +keyset("i", "", "coc#refresh()", {silent = true, expr = true}) + +-- Use `[g` and `]g` to navigate diagnostics +-- Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. +keyset("n", "[g", "(coc-diagnostic-prev)", {silent = true}) +keyset("n", "]g", "(coc-diagnostic-next)", {silent = true}) + +-- GoTo code navigation. +keyset("n", "gd", "(coc-definition)", {silent = true}) +keyset("n", "gy", "(coc-type-definition)", {silent = true}) +keyset("n", "gi", "(coc-implementation)", {silent = true}) +keyset("n", "gr", "(coc-references)", {silent = true}) + + +-- Use K to show documentation in preview window. +function _G.show_docs() + local cw = vim.fn.expand('') + if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then + vim.api.nvim_command('h ' .. cw) + elseif vim.api.nvim_eval('coc#rpc#ready()') then + vim.fn.CocActionAsync('doHover') + else + vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw) + end +end +keyset("n", "K", 'lua _G.show_docs()', {silent = true}) + + +-- Highlight the symbol and its references when holding the cursor. +vim.api.nvim_create_augroup("CocGroup", {}) +vim.api.nvim_create_autocmd("CursorHold", { + group = "CocGroup", + command = "silent call CocActionAsync('highlight')", + desc = "Highlight symbol under cursor on CursorHold" +}) + + +-- Symbol renaming. +keyset("n", "rn", "(coc-rename)", {silent = true}) + + +-- Formatting selected code. +keyset("x", "f", "(coc-format-selected)", {silent = true}) +keyset("n", "f", "(coc-format-selected)", {silent = true}) + + +-- Setup formatexpr specified filetype(s). +vim.api.nvim_create_autocmd("FileType", { + group = "CocGroup", + pattern = "typescript,json", + command = "setl formatexpr=CocAction('formatSelected')", + desc = "Setup formatexpr specified filetype(s)." +}) + +-- Update signature help on jump placeholder. +vim.api.nvim_create_autocmd("User", { + group = "CocGroup", + pattern = "CocJumpPlaceholder", + command = "call CocActionAsync('showSignatureHelp')", + desc = "Update signature help on jump placeholder" +}) + + +-- Applying codeAction to the selected region. +-- Example: `aap` for current paragraph +local opts = {silent = true, nowait = true} +keyset("x", "a", "(coc-codeaction-selected)", opts) +keyset("n", "a", "(coc-codeaction-selected)", opts) + +-- Remap keys for applying codeAction to the current buffer. +keyset("n", "ac", "(coc-codeaction)", opts) + + +-- Apply AutoFix to problem on the current line. +keyset("n", "qf", "(coc-fix-current)", opts) + + +-- Run the Code Lens action on the current line. +keyset("n", "cl", "(coc-codelens-action)", opts) + + +-- Map function and class text objects +-- NOTE: Requires 'textDocument.documentSymbol' support from the language server. +keyset("x", "if", "(coc-funcobj-i)", opts) +keyset("o", "if", "(coc-funcobj-i)", opts) +keyset("x", "af", "(coc-funcobj-a)", opts) +keyset("o", "af", "(coc-funcobj-a)", opts) +keyset("x", "ic", "(coc-classobj-i)", opts) +keyset("o", "ic", "(coc-classobj-i)", opts) +keyset("x", "ac", "(coc-classobj-a)", opts) +keyset("o", "ac", "(coc-classobj-a)", opts) + + +-- Remap and for scroll float windows/popups. +---@diagnostic disable-next-line: redefined-local +local opts = {silent = true, nowait = true, expr = true} +keyset("n", "", 'coc#float#has_scroll() ? coc#float#scroll(1) : ""', opts) +keyset("n", "", 'coc#float#has_scroll() ? coc#float#scroll(0) : ""', opts) +keyset("i", "", + 'coc#float#has_scroll() ? "=coc#float#scroll(1)" : ""', opts) +keyset("i", "", + 'coc#float#has_scroll() ? "=coc#float#scroll(0)" : ""', opts) +keyset("v", "", 'coc#float#has_scroll() ? coc#float#scroll(1) : ""', opts) +keyset("v", "", 'coc#float#has_scroll() ? coc#float#scroll(0) : ""', opts) + + +-- Use CTRL-S for selections ranges. +-- Requires 'textDocument/selectionRange' support of language server. +keyset("n", "", "(coc-range-select)", {silent = true}) +keyset("x", "", "(coc-range-select)", {silent = true}) + + +-- Add `:Format` command to format current buffer. +vim.api.nvim_create_user_command("Format", "call CocAction('format')", {}) + +-- " Add `:Fold` command to fold current buffer. +vim.api.nvim_create_user_command("Fold", "call CocAction('fold', )", {nargs = '?'}) + +-- Add `:OR` command for organize imports of the current buffer. +vim.api.nvim_create_user_command("OR", "call CocActionAsync('runCommand', 'editor.action.organizeImport')", {}) + +-- Add (Neo)Vim's native statusline support. +-- NOTE: Please see `:h coc-status` for integrations with external plugins that +-- provide custom statusline: lightline.vim, vim-airline. +vim.opt.statusline:prepend("%{coc#status()}%{get(b:,'coc_current_function','')}") + +-- Mappings for CoCList +-- code actions and coc stuff +---@diagnostic disable-next-line: redefined-local +local opts = {silent = true, nowait = true} +-- Show all diagnostics. +keyset("n", "a", ":CocList diagnostics", opts) +-- Manage extensions. +keyset("n", "e", ":CocList extensions", opts) +-- Show commands. +keyset("n", "c", ":CocList commands", opts) +-- Find symbol of current document. +keyset("n", "o", ":CocList outline", opts) +-- Search workspace symbols. +keyset("n", "s", ":CocList -I symbols", opts) +-- Do default action for next item. +keyset("n", "j", ":CocNext", opts) +-- Do default action for previous item. +keyset("n", "k", ":CocPrev", opts) +-- Resume latest coc list. +keyset("n", "p", ":CocListResume", opts) diff --git a/home-manager-modules/pass/default.nix b/home-manager-modules/pass/default.nix new file mode 100644 index 0000000..19d70d5 --- /dev/null +++ b/home-manager-modules/pass/default.nix @@ -0,0 +1,23 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.luj.programs.pass; +in +with lib; +{ + options.luj.programs.pass = { + enable = mkEnableOption "Enable pass"; + }; + + config = mkIf cfg.enable { + programs.rbw = { + enable = true; + settings = { + base_url = "https://vaults.malka.family"; + email = "julien@malka.sh"; + pinentry = pkgs.unstable.pinentry-tty; + lock_timeout = 600; + }; + }; + }; + +} diff --git a/home-manager-modules/polybar/config b/home-manager-modules/polybar/config deleted file mode 100644 index aed6c44..0000000 --- a/home-manager-modules/polybar/config +++ /dev/null @@ -1,434 +0,0 @@ -;------------------------------------------------- -; ; -; Polybar config for Cranium ; -; ; -;------------------------------------------------- - - -[colors] -;background = ${xrdb:color0:#222} -;background = #212E36 -background = #cf172a47 -;it's ARGB so "cfl" is for transparency -;background-alt = #cf3C5A46 -background-unf = #2D4058 - -;background-unf = #cf2E463E -background-alt = #405C7D -background-mod0 = #cf3C5A46 -background-mod1 = #cf546E53 -background-mod2 = #cf708963 -background-alrt = #cfA1BB76 - -;foreground = ${xrdb:color7:#222} -foreground = #F3F3BA -foreground-alt = #F3F3BA -primary = #F3F3BA -secondary = #F3F3BA - - -[bar/PolybarTony] -;monitor = ${env:MONITOR:HDMI-1} -;monitor = ${env:MONITOR:} -width = 100% -height = 30 -offset-x = 0% -;offset-y = 10% -radius = 0.0 -fixed-center = true - -background = ${colors.background} -foreground = ${colors.foreground} - -line-size = 0 -line-color = #f00 - -border-size = 0 -border-color = #00000000 - -padding-left = 0 -padding-right = 0 - -module-margin-left = 0 -module-margin-right = 0 - -font-0 = Misc Termsyn:size=8;1 -;font-0 = Ubuntu:size=10;1 -font-1 = FontAwesome:fontformat=truetype:size=12;1 -font-3 = Font Awesome 5 Free:style=Regular:pixelsize=8;1 -font-4 = Font Awesome 5 Free:style=Solid:pixelsize=8;1 -font-5 = Font Awesome 5 Brands:pixelsize=8;1 -font-2 = sm4tik:pixelsize=10;1 - -modules-left = i3 -modules-center = date -modules-right = wireless-network memory cpu battery powermenu - -tray-position = right -tray-padding = 11 -tray-transparent = false -tray-offset-y = 0 -tray-offset-x = 0 -tray-maxsize = 18 -tray-detached = false -tray-background = colors.background - -;wm-restack = bspwm -wm-restack = i3 - -override-redirect = false - -;scroll-up = bspwm-desknext -;scroll-down = bspwm-deskprev - -;scroll-up = i3wm-wsnext -;scroll-down = i3wm-wsprev - - -[module/weather] -type = custom/script -interval = 60 - -;format-background = ${colors.background-alt} -format =