├── .editorconfig ├── .github ├── dependabot.yaml ├── mergify.yml └── workflows │ ├── build-nixosConfiguration.yaml │ └── flake-update.yaml ├── .gitignore ├── .sops.yaml ├── LICENSE ├── README-ja.md ├── README.md ├── assets ├── homepage.html ├── nix-snowflake.svg └── ss.png ├── flake.lock ├── flake.nix ├── hosts ├── default.nix └── sforza │ ├── configuration.nix │ ├── hardware-configuration.nix │ └── mine.nix ├── modules ├── README.md ├── default.nix ├── etc │ ├── fonts │ │ └── default.nix │ ├── secrets │ │ └── default.nix │ ├── shared │ │ ├── default.nix │ │ ├── home-manager.nix │ │ ├── security.nix │ │ └── users.nix │ ├── theme │ │ └── default.nix │ └── vars │ │ └── default.nix ├── programs │ ├── emacs │ │ └── default.nix │ ├── firefox │ │ ├── bookmarks.nix │ │ ├── default.nix │ │ ├── extensions.nix │ │ ├── search.nix │ │ └── settings.nix │ ├── fish │ │ ├── default.nix │ │ ├── direnv.nix │ │ ├── functions.nix │ │ └── shellAliases.nix │ ├── foot │ │ └── default.nix │ ├── fuzzel │ │ └── default.nix │ ├── gaming │ │ └── default.nix │ ├── git │ │ └── default.nix │ ├── gpg │ │ └── default.nix │ ├── hyprland │ │ ├── cliphist.nix │ │ ├── default.nix │ │ ├── hypridle.nix │ │ ├── hyprlock.nix │ │ └── settings.nix │ ├── ncmpcpp │ │ └── default.nix │ ├── nvim │ │ └── default.nix │ ├── sway │ │ ├── bars.nix │ │ ├── config.nix │ │ ├── default.nix │ │ ├── keybindings.nix │ │ └── window.nix │ ├── tmux │ │ └── default.nix │ ├── vesktop │ │ └── default.nix │ ├── waybar │ │ ├── default.nix │ │ └── style.nix │ ├── wezterm │ │ └── default.nix │ ├── wleave │ │ └── default.nix │ └── zen-browser │ │ ├── bookmarks.nix │ │ ├── default.nix │ │ ├── extensions.nix │ │ ├── modules │ │ ├── default.nix │ │ ├── mkFirefoxModule.nix │ │ └── profiles │ │ │ ├── bookmark-types.nix │ │ │ ├── bookmarks.nix │ │ │ └── search.nix │ │ ├── search.nix │ │ └── settings.nix └── services │ ├── dnscrypt2 │ └── default.nix │ ├── fcitx5 │ ├── config │ │ ├── conf │ │ │ ├── classicui.conf │ │ │ └── notifications.conf │ │ ├── config │ │ └── profile │ └── default.nix │ ├── gammastep │ └── default.nix │ ├── keyring │ └── default.nix │ ├── mako │ └── default.nix │ ├── mpd │ └── default.nix │ ├── pipewire │ └── default.nix │ ├── sddm │ └── default.nix │ ├── tlp │ └── default.nix │ ├── wireguard │ └── default.nix │ └── xdg-portal │ └── default.nix ├── parts └── default.nix └── secrets └── secrets.yaml /.editorconfig: -------------------------------------------------------------------------------- 1 | root=true 2 | 3 | [*] 4 | charset=utf-8 5 | end_of_line=lf 6 | indent_size=2 7 | indent_style=space 8 | insert_final_newline=true 9 | trim_trailing_whitespace=true 10 | 11 | [*.md] 12 | max_line_length=off 13 | trim_trailing_whitespace=false 14 | 15 | [*.{diff,patch}] 16 | end_of_line=unset 17 | indent_size=unset 18 | insert_final_newline=unset 19 | trim_trailing_whitespace=unset 20 | 21 | [{LICENSES/**,LICENSE}] 22 | charset=unset 23 | end_of_line=unset 24 | indent_size=unset 25 | indent_style=unset 26 | insert_final_newline=unset 27 | trim_trailing_whitespace=unset 28 | -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 2 | 3 | version: 2 4 | updates: 5 | - package-ecosystem: "github-actions" # See documentation for possible values 6 | directory: "/" # Location of package manifests 7 | schedule: 8 | interval: "daily" 9 | -------------------------------------------------------------------------------- /.github/mergify.yml: -------------------------------------------------------------------------------- 1 | queue_rules: 2 | - name: default 3 | queue_conditions: 4 | - check-success=All Garnix checks 5 | - -title ~= (?i)wip 6 | - -merged 7 | - -closed 8 | - -draft 9 | - -author~=\[bot\]$ 10 | merge_conditions: [] 11 | merge_method: rebase 12 | update_method: rebase 13 | 14 | pull_request_rules: 15 | - name: Automatic rebase for PRs marked as "keep-up-to-date" 16 | conditions: 17 | - label=keep-up-to-date 18 | - -draft 19 | actions: 20 | update: 21 | 22 | - name: Automatic merge when CI passes 23 | conditions: [] 24 | actions: 25 | queue: 26 | delete_head_branch: 27 | 28 | - name: Toggle conflict label based on mergeability 29 | conditions: 30 | - conflict 31 | actions: 32 | label: 33 | toggle: 34 | - conflict 35 | comment: 36 | message: "@{{author}} this pull request is now in conflict 😩" 37 | 38 | - name: Label WIP PRs 39 | conditions: 40 | - title ~= (?i)wip 41 | actions: 42 | label: 43 | add: 44 | - WIP 45 | -------------------------------------------------------------------------------- /.github/workflows/build-nixosConfiguration.yaml: -------------------------------------------------------------------------------- 1 | # https://github.com/thiagokokada/nix-configs 2 | name: build-nixos-configuration-and-populate 3 | on: 4 | workflow_dispatch: # Do not run unless i run it manually 5 | 6 | jobs: 7 | build-nixosConfiguration: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: easimon/maximize-build-space@v10 11 | with: 12 | overprovision-lvm: true 13 | remove-android: true 14 | remove-codeql: true 15 | remove-docker-images: true 16 | remove-dotnet: true 17 | remove-haskell: true 18 | root-reserve-mb: 512 19 | swap-size-mb: 1024 20 | 21 | - uses: actions/checkout@v4 22 | 23 | - name: Install Lix 24 | uses: DeterminateSystems/nix-installer-action@v17 25 | with: 26 | diagnostic-endpoint: '' 27 | source-url: 'https://install.lix.systems/lix/lix-installer-x86_64-linux' 28 | extra_nix_config: | 29 | substituters = https://cache.garnix.io https://nyx.chaotic.cx https://cache.nixos.org/ 30 | trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= nyx.chaotic.cx-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8= chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8= 31 | 32 | - uses: cachix/cachix-action@v16 33 | with: 34 | authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} 35 | name: sforza-config 36 | 37 | - name: Set default git branch (to reduce log spam) 38 | run: git config --global init.defaultBranch flake-parts 39 | 40 | - name: "Build nixosConfiguration for: sforza" 41 | run: |- 42 | nix build --print-build-logs '.#nixosConfigurations.sforza.config.system.build.toplevel' 43 | -------------------------------------------------------------------------------- /.github/workflows/flake-update.yaml: -------------------------------------------------------------------------------- 1 | name: Update Flakes 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: "0 17 * * 0" # Runs every Sunday at 17:00 UTC / Monday at 2:00 AM JST 7 | 8 | jobs: 9 | update-flake-lock: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout repository 13 | uses: actions/checkout@v4.1.3 14 | 15 | - name: Install Lix 16 | uses: DeterminateSystems/nix-installer-action@v17 17 | with: 18 | diagnostic-endpoint: '' 19 | source-url: 'https://install.lix.systems/lix/lix-installer-x86_64-linux' 20 | 21 | - name: Update flake.lock 22 | uses: DeterminateSystems/update-flake-lock@main 23 | with: 24 | git-author-name: "Maximilian Sforza" 25 | git-author-email: "maximiliansforza@proton.me" 26 | git-committer-name: "Maximilian Sforza" 27 | git-committer-email: "maximiliansforza@proton.me" 28 | token: ${{ secrets.PR_TOKEN }} 29 | commit-msg: "chore: Update flake.lock" # The message provided with the commit 30 | pr-title: "Update flake.lock" # Title of PR to be created 31 | pr-labels: | # Labels to be set on the PR 32 | automated 33 | keep-up-to-date 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.toptal.com/developers/gitignore/api/direnv,emacs,visualstudiocode,vim,git,patch 2 | # Edit at https://www.toptal.com/developers/gitignore?templates=direnv,emacs,visualstudiocode,vim,git,patch 3 | 4 | rebuild.sh 5 | 6 | ### direnv ### 7 | .direnv 8 | .envrc 9 | 10 | ### Emacs ### 11 | # -*- mode: gitignore; -*- 12 | *~ 13 | \#*\# 14 | /.emacs.desktop 15 | /.emacs.desktop.lock 16 | *.elc 17 | auto-save-list 18 | tramp 19 | .\#* 20 | 21 | # Org-mode 22 | .org-id-locations 23 | *_archive 24 | 25 | # flymake-mode 26 | *_flymake.* 27 | 28 | # eshell files 29 | /eshell/history 30 | /eshell/lastdir 31 | 32 | # elpa packages 33 | /elpa/ 34 | 35 | # reftex files 36 | *.rel 37 | 38 | # AUCTeX auto folder 39 | /auto/ 40 | 41 | # cask packages 42 | .cask/ 43 | dist/ 44 | 45 | # Flycheck 46 | flycheck_*.el 47 | 48 | # server auth directory 49 | /server/ 50 | 51 | # projectiles files 52 | .projectile 53 | 54 | # directory configuration 55 | .dir-locals.el 56 | 57 | # network security 58 | /network-security.data 59 | 60 | 61 | ### Git ### 62 | # Created by git for backups. To disable backups in Git: 63 | # $ git config --global mergetool.keepBackup false 64 | *.orig 65 | 66 | # Created by git when using merge tools for conflicts 67 | *.BACKUP.* 68 | *.BASE.* 69 | *.LOCAL.* 70 | *.REMOTE.* 71 | *_BACKUP_*.txt 72 | *_BASE_*.txt 73 | *_LOCAL_*.txt 74 | *_REMOTE_*.txt 75 | 76 | ### Patch ### 77 | *.rej 78 | 79 | ### Vim ### 80 | # Swap 81 | [._]*.s[a-v][a-z] 82 | !*.svg # comment out if you don't need vector files 83 | [._]*.sw[a-p] 84 | [._]s[a-rt-v][a-z] 85 | [._]ss[a-gi-z] 86 | [._]sw[a-p] 87 | 88 | # Session 89 | Session.vim 90 | Sessionx.vim 91 | 92 | # Temporary 93 | .netrwhist 94 | # Auto-generated tag files 95 | tags 96 | # Persistent undo 97 | [._]*.un~ 98 | 99 | ### VisualStudioCode ### 100 | .vscode/* 101 | !.vscode/settings.json 102 | !.vscode/tasks.json 103 | !.vscode/launch.json 104 | !.vscode/extensions.json 105 | !.vscode/*.code-snippets 106 | 107 | # Local History for Visual Studio Code 108 | .history/ 109 | 110 | # Built Visual Studio Code Extensions 111 | *.vsix 112 | 113 | ### VisualStudioCode Patch ### 114 | # Ignore all local history of files 115 | .history 116 | .ionide 117 | 118 | # End of https://www.toptal.com/developers/gitignore/api/direnv,emacs,visualstudiocode,vim,git,patch 119 | -------------------------------------------------------------------------------- /.sops.yaml: -------------------------------------------------------------------------------- 1 | keys: 2 | - &airi age1kzq0576smpu33wud97vr5ue87alqwq4w0fscykevkr3suv6qwf4q3jqlkg 3 | creation_rules: 4 | - path_regex: secrets/secrets.yaml$ 5 | key_groups: 6 | - age: 7 | - *airi 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README-ja.md: -------------------------------------------------------------------------------- 1 |
2 | NixOS 3 |

❖ LudovicoのDotfiles ❖

4 |

5 | GitHubリポジトリのスター数 6 | GitHub最終コミット 7 | GitHubリポジトリのサイズ 8 | 9 | NixOS不安定版 10 | 11 |

12 |
13 | 14 | --- 15 | 16 | > [!WARNING] 17 | > これは私の個人的なNixOS設定であり、進行中の作業です。 18 | > このセットアップは、Nixの学習と自身のコンピュータ管理を目的としています。 19 | > **この構成を使用したことによる損害について、私は一切責任を負いません。自己責任でご利用ください。** 20 | 21 | --- 22 | 23 | ## **✨ スクリーンショット** 24 | 25 |
26 | スクリーンショット 27 |
28 | 29 | --- 30 | 31 | ## **📦 私が個人用のコンピュータで使用しているソフトウェア** 32 | 33 | | コンポーネント | 名前/リンク | 34 | |---------------------------|----------------------------------------------| 35 | | **Waylandコンポジター** | [Hyprland](https://hyprland.org) | 36 | | **Waylandバー** | [Waybar](https://github.com/Alexays/Waybar) | 37 | | **通知マネージャー** | [Mako](https://github.com/emersion/mako) | 38 | | **エディター** | [Neovim](https://neovim.io/) | 39 | | **ターミナル** | [Kitty](https://github.com/kovidgoyal/kitty) | 40 | | **シェル** | [Fish](https://fishshell.com/) | 41 | | **ブラウザー** | [Firefox](https://www.mozilla.org/en-US/firefox) | 42 | 43 | --- 44 | 45 | ## **📚 リソース** 46 | 47 | NixおよびNixOSについて詳しく学ぶには、以下をご覧ください: 48 | 49 | - [NixOSマニュアル](https://nixos.org/manual/nixos/stable/) 50 | - [Nixpkgsマニュアル](https://nixos.org/manual/nixpkgs/stable/) 51 | 52 | --- 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | NixOS 3 |

❖ Ludovico's Dotfiles ❖

4 |

5 | GitHub Repo stars 6 | GitHub last commit 7 | GitHub repo size 8 | 9 | NixOS Unstable 10 | 11 |

12 |
13 | 14 | --- 15 | 16 | > [!WARNING] 17 | > This is my personal NixOS configuration and a work in progress. 18 | > I'm using it to learn Nix and manage my own systems. 19 | > **Use at your own risk — I am not responsible for any damage caused.** 20 | 21 | --- 22 | 23 | ## **✨ Screenshots** 24 | 25 |
26 | Screenshot 27 |
28 | 29 | --- 30 | 31 | ## **📦 Software I Use** 32 | 33 | | Component | Name/Link | 34 | |-----------------------|--------------------------------------------| 35 | | **Wayland compositor** | [Hyprland](https://hyprland.org) | 36 | | **Wayland bar** | [Waybar](https://github.com/Alexays/Waybar) | 37 | | **Notification manager** | [Mako](https://github.com/emersion/mako) | 38 | | **Editor** | [Neovim](https://neovim.io/) | 39 | | **Terminal** | [Kitty](https://github.com/kovidgoyal/kitty) | 40 | | **Shell** | [Fish](https://fishshell.com/) | 41 | | **Browser** | [Firefox](https://www.mozilla.org/en-US/firefox) | 42 | 43 | --- 44 | 45 | ## **📚 Resources** 46 | 47 | Explore the following resources to learn more about Nix and NixOS: 48 | 49 | - [NixOS Manual](https://nixos.org/manual/nixos/stable/) 50 | - [Nixpkgs Manual](https://nixos.org/manual/nixpkgs/stable/) 51 | 52 | --- 53 | 54 | [README-ja](README-ja.md) 55 | -------------------------------------------------------------------------------- /assets/homepage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Start 6 | 7 | 95 | 96 | 97 | 98 |

Welcome

99 | 108 | 109 | 119 | 120 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /assets/ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LudovicoPiero/dotfiles/9032e698199b82a1e273e8d4e316a526697cd685/assets/ss.png -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "xd uwu"; 3 | 4 | outputs = 5 | inputs@{ flake-parts, ... }: 6 | flake-parts.lib.mkFlake { inherit inputs; } { 7 | imports = [ 8 | ./hosts 9 | ./parts 10 | ]; 11 | }; 12 | 13 | # Inputs are written in attribute-set form instead of using `url = "...";` strings. 14 | # This provides more structure, makes parsing easier, and is helpful for tools or flake editors. 15 | # 16 | # Conventions used: 17 | # - GitHub shorthand `github:owner/repo/ref` becomes: 18 | # { 19 | # type = "github"; 20 | # owner = "owner"; 21 | # repo = "repo"; 22 | # ref = "ref"; # optional, if a branch/tag/commit is specified 23 | # } 24 | # - If no `ref` is given, the flake defaults to the repository's default branch. 25 | # 26 | # - GitLab uses the same structure with `type = "gitlab"`. 27 | # - For tarball archives (e.g., Lix), we use: 28 | # { 29 | # type = "tarball"; 30 | # url = "https://..."; 31 | # } 32 | # - For flakes with directory overlays (e.g., `?dir=...`), we add a `dir = "..."` field. 33 | # - `.inputs.nixpkgs.follows = "..."` lines are kept unchanged to simplify dependency alignment. 34 | # - Flakes that don’t expose a flake (like `catppuccin-base16`) explicitly set `flake = false`. 35 | 36 | inputs = { 37 | nixpkgs-unstable = { 38 | type = "github"; 39 | owner = "NixOS"; 40 | repo = "nixpkgs"; 41 | ref = "nixos-unstable"; 42 | }; 43 | nixpkgs.follows = "nixpkgs-unstable"; 44 | 45 | home-manager = { 46 | type = "github"; 47 | owner = "nix-community"; 48 | repo = "home-manager"; 49 | }; 50 | home-manager.inputs.nixpkgs.follows = "nixpkgs"; 51 | 52 | flake-parts = { 53 | type = "github"; 54 | owner = "hercules-ci"; 55 | repo = "flake-parts"; 56 | }; 57 | flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; 58 | 59 | firefox-addons = { 60 | type = "gitlab"; 61 | owner = "rycee"; 62 | repo = "nur-expressions"; 63 | dir = "pkgs/firefox-addons"; 64 | }; 65 | firefox-addons.inputs.nixpkgs.follows = "nixpkgs"; 66 | 67 | sops-nix = { 68 | type = "github"; 69 | owner = "Mic92"; 70 | repo = "sops-nix"; 71 | }; 72 | sops-nix.inputs.nixpkgs.follows = "nixpkgs"; 73 | 74 | programsdb = { 75 | type = "github"; 76 | owner = "wamserma"; 77 | repo = "flake-programs-sqlite"; 78 | }; 79 | programsdb.inputs.nixpkgs.follows = "nixpkgs"; 80 | 81 | lix-module = { 82 | type = "tarball"; 83 | url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"; 84 | }; 85 | lix-module.inputs.nixpkgs.follows = "nixpkgs"; 86 | 87 | ludovico-nixvim = { 88 | type = "github"; 89 | owner = "LudovicoPiero"; 90 | repo = "nvim-flake"; 91 | }; 92 | ludovico-nixvim.inputs.nixpkgs.follows = "nixpkgs"; 93 | 94 | ludovico-pkgs = { 95 | type = "github"; 96 | owner = "LudovicoPiero"; 97 | repo = "pkgs"; 98 | }; 99 | ludovico-pkgs.inputs.nixpkgs.follows = "nixpkgs"; 100 | 101 | zen-browser = { 102 | type = "github"; 103 | owner = "0xc000022070"; 104 | repo = "zen-browser-flake"; 105 | }; 106 | zen-browser.inputs.nixpkgs.follows = "nixpkgs"; 107 | 108 | wrapper-manager = { 109 | type = "github"; 110 | owner = "viperML"; 111 | repo = "wrapper-manager"; 112 | }; 113 | wrapper-manager.inputs.nixpkgs.follows = "nixpkgs"; 114 | 115 | emacs-overlay = { 116 | type = "github"; 117 | owner = "nix-community"; 118 | repo = "emacs-overlay"; 119 | }; 120 | emacs-overlay.inputs.nixpkgs.follows = "nixpkgs"; 121 | 122 | nix-colors = { 123 | type = "github"; 124 | owner = "misterio77"; 125 | repo = "nix-colors"; 126 | }; 127 | 128 | catppuccin-base16 = { 129 | type = "github"; 130 | owner = "catppuccin"; 131 | repo = "base16"; 132 | flake = false; 133 | }; 134 | }; 135 | } 136 | -------------------------------------------------------------------------------- /hosts/default.nix: -------------------------------------------------------------------------------- 1 | { inputs, ... }: 2 | { 3 | flake.nixosConfigurations = 4 | let 5 | inherit (inputs.nixpkgs.lib) nixosSystem; 6 | 7 | sharedModules = import ../modules; 8 | 9 | specialArgs = { inherit inputs; }; 10 | in 11 | { 12 | sforza = nixosSystem { 13 | inherit specialArgs; 14 | modules = [ 15 | sharedModules 16 | 17 | ./sforza/configuration.nix 18 | ]; 19 | }; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /hosts/sforza/configuration.nix: -------------------------------------------------------------------------------- 1 | # Edit this configuration file to define what should be installed on 2 | # your system. Help is available in the configuration.nix(5) man page, on 3 | # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). 4 | { 5 | lib, 6 | config, 7 | pkgs, 8 | ... 9 | }: 10 | { 11 | imports = [ 12 | ./hardware-configuration.nix 13 | ./mine.nix 14 | ]; 15 | 16 | networking.hostName = "sforza"; # Define your hostname. 17 | networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. 18 | 19 | # Use the systemd-boot EFI boot loader. 20 | boot = { 21 | loader = { 22 | systemd-boot.enable = true; 23 | systemd-boot.configurationLimit = 3; 24 | efi.canTouchEfiVariables = true; 25 | efi.efiSysMountPoint = "/boot"; 26 | }; 27 | 28 | initrd = { 29 | availableKernelModules = [ 30 | "nvme" 31 | "xhci_pci" 32 | "ahci" 33 | "usbhid" 34 | "usb_storage" 35 | "sd_mod" 36 | ]; 37 | kernelModules = [ 38 | "amdgpu" 39 | "bcachefs" 40 | "btrfs" 41 | "dm-snapshot" 42 | ]; 43 | }; 44 | 45 | kernelModules = [ "kvm-amd" ]; 46 | extraModulePackages = [ ]; 47 | supportedFilesystems = [ 48 | "btrfs" 49 | "ntfs" 50 | "xfs" 51 | ]; 52 | 53 | kernelPackages = pkgs.linuxPackages_latest; 54 | }; 55 | 56 | # OpenGL 57 | hardware = { 58 | bluetooth = { 59 | enable = true; 60 | settings = { 61 | General = { 62 | Experimental = true; 63 | }; 64 | }; 65 | }; 66 | graphics = { 67 | enable = true; 68 | enable32Bit = true; 69 | extraPackages = with pkgs; [ 70 | rocmPackages.clr.icd 71 | rocmPackages.clr 72 | ]; 73 | }; 74 | }; 75 | 76 | # Select internationalisation properties. 77 | i18n.defaultLocale = "en_US.UTF-8"; 78 | console = { 79 | font = "Lat2-Terminus16"; 80 | keyMap = lib.mkForce "us"; 81 | useXkbConfig = true; # use xkb.options in tty. 82 | }; 83 | } 84 | -------------------------------------------------------------------------------- /hosts/sforza/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { 5 | config, 6 | lib, 7 | modulesPath, 8 | ... 9 | }: 10 | { 11 | imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; 12 | 13 | fileSystems = { 14 | "/" = { 15 | device = "/dev/disk/by-label/ROOT"; 16 | fsType = "btrfs"; 17 | options = [ 18 | "noatime" 19 | "compress=zstd" 20 | ]; 21 | }; 22 | 23 | "/home" = { 24 | device = "/dev/disk/by-label/HOME"; 25 | fsType = "btrfs"; 26 | options = [ 27 | "noatime" 28 | "compress=zstd" 29 | ]; 30 | }; 31 | 32 | "/Persist" = { 33 | device = "/dev/disk/by-label/PERSIST"; 34 | fsType = "btrfs"; 35 | neededForBoot = true; # for sops-nix 36 | options = [ 37 | "noatime" 38 | "compress=zstd" 39 | ]; 40 | }; 41 | 42 | "/boot" = { 43 | device = "/dev/disk/by-label/BOOT"; 44 | fsType = "vfat"; 45 | options = [ 46 | "fmask=0022" 47 | "dmask=0022" 48 | ]; 49 | }; 50 | 51 | "${config.vars.homeDirectory}/WinE" = { 52 | device = "/dev/disk/by-label/WinE"; 53 | fsType = "ntfs"; 54 | options = [ 55 | "uid=1001" 56 | "gid=100" 57 | "rw" 58 | "user" 59 | "exec" 60 | "dmask=0002" 61 | "fmask=0113" 62 | "nofail" 63 | ]; 64 | }; 65 | 66 | "${config.vars.homeDirectory}/Media" = { 67 | device = "/dev/disk/by-label/Media"; 68 | fsType = "btrfs"; 69 | options = [ 70 | "noatime" 71 | "compress=zstd" 72 | ]; 73 | }; 74 | }; 75 | 76 | swapDevices = lib.mkForce [ ]; 77 | 78 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 79 | # (the default) this is the recommended approach. When using systemd-networkd it's 80 | # still possible to use this option, but it's recommended to use it in conjunction 81 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`. 82 | networking.useDHCP = lib.mkDefault true; 83 | # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; 84 | # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; 85 | 86 | # slows down boot time 87 | systemd.services.NetworkManager-wait-online.enable = false; 88 | 89 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 90 | hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 91 | } 92 | -------------------------------------------------------------------------------- /hosts/sforza/mine.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | inputs, 4 | config, 5 | ... 6 | }: 7 | { 8 | vars = { 9 | colorScheme = "catppuccin-macchiato"; 10 | email = "lewdovico@gnuweeb.org"; 11 | isALaptop = true; 12 | opacity = 1.0; 13 | sshPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINtzB1oiuDptWi04PAEJVpSAcvD96AL0S21zHuMgmcE9 ludovico@sforza"; 14 | stateVersion = "24.11"; 15 | terminal = "foot"; 16 | timezone = "Asia/Tokyo"; 17 | username = "airi"; 18 | withGui = true; 19 | }; 20 | 21 | mine = { 22 | cliphist = { 23 | enable = true; 24 | }; 25 | 26 | direnv = { 27 | enable = true; 28 | }; 29 | 30 | dnscrypt2 = { 31 | enable = !config.mine.wireguard.enable; 32 | StateDirectory = "dnscrypt-proxy"; 33 | hasIPv6Internet = false; 34 | }; 35 | 36 | emacs = { 37 | enable = true; 38 | }; 39 | 40 | fcitx5 = { 41 | enable = true; 42 | }; 43 | 44 | firefox = { 45 | enable = true; 46 | }; 47 | 48 | fish = { 49 | enable = true; 50 | }; 51 | 52 | foot = { 53 | enable = true; 54 | }; 55 | 56 | fonts = { 57 | enable = true; 58 | size = 14; 59 | cjk = { 60 | name = "Noto Sans CJK"; 61 | package = pkgs.noto-fonts-cjk-sans; 62 | }; 63 | emoji = { 64 | name = "Noto Color Emoji"; 65 | package = pkgs.noto-fonts-color-emoji; 66 | }; 67 | icon = { 68 | name = "Symbols Nerd Font Mono"; 69 | package = pkgs.nerd-fonts.symbols-only; 70 | }; 71 | main = { 72 | name = "SF Pro Display"; 73 | package = inputs.ludovico-pkgs.packages.${pkgs.stdenv.hostPlatform.system}.san-francisco-pro; 74 | }; 75 | terminal = { 76 | name = "Iosevka Q"; 77 | package = inputs.ludovico-pkgs.packages.${pkgs.stdenv.hostPlatform.system}.iosevka-q; 78 | }; 79 | }; 80 | 81 | fuzzel = { 82 | enable = true; 83 | }; 84 | 85 | gammastep = { 86 | enable = true; 87 | }; 88 | 89 | gaming = { 90 | enable = false; 91 | withGamemode = true; 92 | withSteam = true; 93 | }; 94 | 95 | git = { 96 | enable = true; 97 | }; 98 | 99 | gpg = { 100 | enable = true; 101 | }; 102 | 103 | hypridle = { 104 | enable = true; 105 | }; 106 | 107 | hyprland = { 108 | enable = true; 109 | }; 110 | 111 | hyprlock = { 112 | enable = true; 113 | }; 114 | 115 | keyring = { 116 | enable = true; 117 | }; 118 | 119 | mako = { 120 | enable = true; 121 | }; 122 | 123 | mpd = { 124 | enable = true; 125 | }; 126 | 127 | ncmpcpp = { 128 | enable = true; 129 | }; 130 | 131 | nvim = { 132 | enable = true; 133 | }; 134 | 135 | pipewire = { 136 | enable = true; 137 | quantum = 64; 138 | rate = 48000; 139 | }; 140 | 141 | sddm = { 142 | enable = true; 143 | }; 144 | 145 | secrets = { 146 | enable = true; 147 | }; 148 | 149 | sway = { 150 | enable = true; 151 | }; 152 | 153 | theme = { 154 | enable = true; 155 | gtk = { 156 | cursorTheme = { 157 | name = "phinger-cursors-light"; 158 | size = 24; 159 | package = pkgs.phinger-cursors; 160 | }; 161 | iconTheme = { 162 | name = "WhiteSur-dark"; 163 | package = pkgs.whitesur-icon-theme; 164 | }; 165 | theme = { 166 | name = "WhiteSur-Dark"; 167 | package = inputs.ludovico-pkgs.packages.${pkgs.stdenv.hostPlatform.system}.whitesur-gtk-theme; 168 | }; 169 | }; 170 | }; 171 | 172 | tlp = { 173 | enable = true; 174 | }; 175 | 176 | tmux = { 177 | enable = true; 178 | }; 179 | 180 | vesktop = { 181 | enable = true; 182 | themeLinks = [ 183 | "https://raw.githubusercontent.com/LudovicoPiero/discord-css/refs/heads/main/hide-avatar-decoration.css" 184 | "https://raw.githubusercontent.com/LudovicoPiero/discord-css/refs/heads/main/hide-invite-button.css" 185 | "https://raw.githubusercontent.com/LudovicoPiero/discord-css/refs/heads/main/hide-clantag.css" 186 | "https://raw.githubusercontent.com/LudovicoPiero/discord-css/refs/heads/main/fix-ui.css" 187 | "https://catppuccin.github.io/discord/dist/catppuccin-mocha.theme.css" 188 | # "https://raw.githubusercontent.com/refact0r/system24/refs/heads/main/theme/flavors/system24-catppuccin-mocha.theme.css" 189 | ]; 190 | }; 191 | 192 | waybar = { 193 | enable = true; 194 | }; 195 | 196 | wezterm = { 197 | enable = true; 198 | }; 199 | 200 | wireguard = { 201 | enable = true; 202 | }; 203 | 204 | wleave = { 205 | enable = true; 206 | }; 207 | 208 | xdg-portal = { 209 | enable = true; 210 | }; 211 | 212 | zen-browser = { 213 | enable = true; 214 | }; 215 | }; 216 | } 217 | -------------------------------------------------------------------------------- /modules/README.md: -------------------------------------------------------------------------------- 1 | Modules Template 2 | 3 | ```nix 4 | { 5 | lib, 6 | pkgs, 7 | config, 8 | ... 9 | }: 10 | let 11 | inherit (lib) 12 | mkEnableOption 13 | mkIf 14 | mkOption 15 | types 16 | ; 17 | 18 | cfg = config.mine.CHANGEME; 19 | in 20 | { 21 | options.mine.CHANGEME = { 22 | enable = mkEnableOption "CHANGEME service"; 23 | greeter = mkOption { 24 | type = types.str; 25 | default = "world"; 26 | }; 27 | }; 28 | 29 | config = mkIf cfg.enable { 30 | environment.systemPackages = [ 31 | pkgs.hello 32 | ]; 33 | }; 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /modules/default.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | imports = [ 3 | # Services 4 | ./services/dnscrypt2 5 | ./services/gammastep 6 | ./services/fcitx5 7 | ./services/pipewire 8 | ./services/sddm 9 | ./services/tlp 10 | ./services/wireguard 11 | ./services/xdg-portal 12 | ./services/keyring 13 | ./services/mako 14 | ./services/mpd 15 | 16 | # Programs 17 | ./programs/emacs 18 | ./programs/firefox 19 | ./programs/fish 20 | ./programs/foot 21 | ./programs/fuzzel 22 | ./programs/gaming 23 | ./programs/git 24 | ./programs/gpg 25 | ./programs/hyprland 26 | ./programs/ncmpcpp 27 | ./programs/nvim 28 | ./programs/sway 29 | ./programs/tmux 30 | ./programs/vesktop 31 | ./programs/waybar 32 | ./programs/wezterm 33 | ./programs/wleave 34 | ./programs/zen-browser 35 | 36 | # Etc 37 | ./etc/fonts 38 | ./etc/secrets 39 | ./etc/shared 40 | ./etc/theme 41 | ./etc/vars 42 | ]; 43 | } 44 | -------------------------------------------------------------------------------- /modules/etc/fonts/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | inputs, 6 | ... 7 | }: 8 | let 9 | inherit (lib) 10 | mkEnableOption 11 | mkOption 12 | mkIf 13 | types 14 | ; 15 | 16 | cfg = config.mine.fonts; 17 | in 18 | { 19 | options.mine.fonts = { 20 | enable = mkEnableOption "Fonts"; 21 | 22 | main = { 23 | name = mkOption { 24 | type = types.str; 25 | default = "SF Pro"; 26 | }; 27 | package = mkOption { 28 | type = types.package; 29 | default = inputs.ludovico-pkgs.packages.${pkgs.stdenv.hostPlatform.system}.san-francisco-pro; 30 | }; 31 | }; 32 | 33 | terminal = { 34 | name = mkOption { 35 | type = types.str; 36 | default = "Iosevka Q"; 37 | }; 38 | package = mkOption { 39 | type = types.package; 40 | default = inputs.ludovico-pkgs.packages.${pkgs.stdenv.hostPlatform.system}.iosevka-q; 41 | }; 42 | }; 43 | 44 | cjk = { 45 | name = mkOption { 46 | type = types.str; 47 | default = "Noto Sans CJK"; 48 | }; 49 | package = mkOption { 50 | type = types.package; 51 | default = pkgs.noto-fonts-cjk-sans; 52 | }; 53 | }; 54 | 55 | emoji = { 56 | name = mkOption { 57 | type = types.str; 58 | default = "Noto Color Emoji"; 59 | }; 60 | package = mkOption { 61 | type = types.package; 62 | default = pkgs.noto-fonts-color-emoji; 63 | }; 64 | }; 65 | 66 | icon = { 67 | name = mkOption { 68 | type = types.str; 69 | default = "Symbols Nerd Font Mono"; 70 | }; 71 | package = mkOption { 72 | type = types.package; 73 | default = pkgs.nerd-fonts.symbols-only; 74 | }; 75 | }; 76 | 77 | size = mkOption { 78 | type = types.int; 79 | default = 14; 80 | }; 81 | }; 82 | 83 | config = mkIf cfg.enable { 84 | environment.sessionVariables = { 85 | FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0"; 86 | }; 87 | 88 | fonts = { 89 | fontDir.enable = true; 90 | packages = [ 91 | cfg.main.package 92 | cfg.terminal.package 93 | cfg.cjk.package 94 | cfg.emoji.package 95 | cfg.icon.package 96 | 97 | pkgs.symbola 98 | pkgs.wqy_zenhei # For Steam 99 | ]; 100 | 101 | # use fonts specified by user rather than default ones 102 | enableDefaultPackages = false; 103 | fontconfig = { 104 | enable = true; 105 | defaultFonts = { 106 | serif = [ 107 | "${cfg.main.name}" 108 | "${cfg.cjk.name}" 109 | "${cfg.emoji.name}" 110 | "${cfg.icon.name}" 111 | "Symbola" 112 | ]; 113 | 114 | sansSerif = [ 115 | "${cfg.main.name}" 116 | "${cfg.cjk.name}" 117 | "${cfg.emoji.name}" 118 | "${cfg.icon.name}" 119 | "Symbola" 120 | ]; 121 | 122 | monospace = [ 123 | "${cfg.main.name}" 124 | "${cfg.cjk.name}" 125 | "${cfg.emoji.name}" 126 | "${cfg.icon.name}" 127 | "Symbola" 128 | ]; 129 | 130 | emoji = [ 131 | "${cfg.emoji.name}" 132 | "${cfg.icon.name}" 133 | "Symbola" 134 | ]; 135 | }; 136 | }; 137 | }; 138 | }; 139 | } 140 | -------------------------------------------------------------------------------- /modules/etc/secrets/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | inputs, 4 | config, 5 | pkgs, 6 | ... 7 | }: 8 | let 9 | inherit (lib) mkEnableOption mkIf; 10 | 11 | cfg = config.mine.secrets; 12 | in 13 | { 14 | imports = [ inputs.sops-nix.nixosModules.sops ]; 15 | 16 | options.mine.secrets = { 17 | enable = mkEnableOption "secrets"; 18 | }; 19 | 20 | config = mkIf cfg.enable { 21 | environment.systemPackages = with pkgs; [ 22 | sops 23 | age 24 | ]; 25 | 26 | sops = { 27 | defaultSopsFile = ../../../secrets/secrets.yaml; 28 | defaultSopsFormat = "yaml"; 29 | age.sshKeyPaths = [ "/Persist/ssh/id_ed25519_sops" ]; 30 | age.keyFile = "/Persist/sops/age/keys.txt"; 31 | }; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /modules/etc/shared/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | inputs, 4 | pkgs, 5 | config, 6 | ... 7 | }: 8 | { 9 | # Nixos Stuff 10 | imports = [ 11 | inputs.lix-module.nixosModules.default 12 | 13 | ./users.nix 14 | ./security.nix 15 | ./home-manager.nix 16 | ]; 17 | 18 | nixpkgs.config.allowUnfree = true; 19 | nixpkgs.config.allowUnfreePredicate = _: true; 20 | hardware.enableRedistributableFirmware = lib.mkDefault true; 21 | hardware.enableAllFirmware = true; 22 | time.timeZone = config.vars.timezone; 23 | 24 | system.rebuild.enableNg = true; 25 | system.switch.enableNg = true; 26 | 27 | programs = { 28 | command-not-found.dbPath = 29 | inputs.programsdb.packages.${pkgs.stdenv.hostPlatform.system}.programs-sqlite; 30 | dconf.enable = true; 31 | nh = { 32 | enable = true; 33 | flake = "${config.vars.homeDirectory}/Code/nixos"; 34 | clean = { 35 | enable = true; 36 | dates = "weekly"; 37 | extraArgs = "--keep 3"; 38 | }; 39 | }; 40 | }; 41 | 42 | environment = { 43 | systemPackages = lib.attrValues { 44 | inherit (pkgs) 45 | # Networking and connectivity tools 46 | teavpn2 47 | iputils # Tools like ping, tracepath, etc., for IP network diagnostics 48 | curl # Command-line tool for transferring data with URLs 49 | dnsutils # DNS-related tools like dig and nslookup 50 | nmap # Powerful network scanner for security auditing and discovery 51 | whois # Query domain registration info 52 | 53 | # Clipboard and file operations 54 | rsync # Fast, versatile file copying/syncing tool 55 | wl-clipboard # Wayland clipboard tool (wl-copy/wl-paste) 56 | unzip # Extract .zip archives 57 | 58 | # Command-line utilities 59 | fd # User-friendly alternative to `find` 60 | fzf # Fuzzy finder for the terminal, useful in shells and editors 61 | jq # Command-line JSON processor 62 | ripgrep # Fast recursive search, better `grep` 63 | tealdeer # Fast, community-driven man pages (`tldr`) 64 | bottom # Graphical process/system monitor, like htop 65 | nix-index # Index all Nix packages for local search 66 | nh # Helper for managing NixOS systems and generations 67 | git # gud 68 | 69 | # Nix-related tools 70 | nixpkgs-review # Review pull requests or changes in nixpkgs locally 71 | 72 | # Secure Boot & system tools 73 | sbctl # Secure Boot key manager, useful for enrolling custom keys, debugging SB issues 74 | 75 | # Favorite desktop apps 76 | element-desktop # Matrix client for decentralized chat (Electron-based) 77 | qbittorrent # Qt-based BitTorrent client with a clean UI 78 | imv # Minimalist image viewer for X11/Wayland 79 | viewnior # Lightweight image viewer, good for simple needs 80 | ente-auth # Ente authentication app (for encrypted cloud photo storage) 81 | thunderbird # Popular email client by Mozilla 82 | telegram-desktop # Desktop client for Telegram messaging app 83 | mpv # Highly configurable and efficient media player 84 | yazi # Blazing fast terminal file manager with preview support (like `lf`) 85 | ; 86 | 87 | coreutils = pkgs.hiPrio pkgs.uutils-coreutils-noprefix; 88 | findutils = pkgs.hiPrio pkgs.uutils-findutils; 89 | 90 | tidal-hifi = pkgs.tidal-hifi.overrideAttrs { 91 | /* 92 | #HACK: 93 | Remove space in the name to fix issue below 94 | 95 | ❯ fuzzel 96 | Invalid Entry ID 'TIDAL Hi-Fi.desktop'! 97 | */ 98 | desktopItems = [ 99 | (pkgs.makeDesktopItem { 100 | exec = "tidal-hifi"; 101 | name = "tidal-hifi"; 102 | desktopName = "Tidal Hi-Fi"; 103 | genericName = "Tidal Hi-Fi"; 104 | comment = "The web version of listen.tidal.com running in electron with hifi support thanks to widevine."; 105 | icon = "tidal-hifi"; 106 | startupNotify = true; 107 | terminal = false; 108 | type = "Application"; 109 | categories = [ 110 | "Network" 111 | "Application" 112 | "AudioVideo" 113 | "Audio" 114 | "Video" 115 | ]; 116 | startupWMClass = "tidal-hifi"; 117 | mimeTypes = [ "x-scheme-handler/tidal" ]; 118 | extraConfig.X-PulseAudio-Properties = "media.role=music"; 119 | }) 120 | ]; 121 | 122 | }; 123 | 124 | # use OCR and copy to clipboard 125 | wl-ocr = 126 | let 127 | _ = lib.getExe; 128 | in 129 | pkgs.writeShellScriptBin "wl-ocr" '' 130 | ${_ pkgs.grim} -g "$(${_ pkgs.slurp})" -t ppm - | ${_ pkgs.tesseract5} - - | ${pkgs.wl-clipboard}/bin/wl-copy 131 | ${_ pkgs.libnotify} "$(${pkgs.wl-clipboard}/bin/wl-paste)" 132 | ''; 133 | }; 134 | }; 135 | 136 | programs = { 137 | evince.enable = config.vars.withGui; # Document Viewer 138 | file-roller.enable = config.vars.withGui; # Archive Manager 139 | 140 | thunar = { 141 | enable = config.vars.withGui; 142 | plugins = with pkgs.xfce; [ 143 | thunar-archive-plugin 144 | thunar-volman 145 | ]; 146 | }; 147 | }; 148 | services = { 149 | gvfs.enable = config.vars.withGui; # Mount, trash, and other functionalities 150 | tumbler.enable = config.vars.withGui; # Thumbnail support for images 151 | }; 152 | 153 | security = { 154 | sudo = { 155 | enable = true; 156 | extraConfig = '' 157 | # rollback results in sudo lectures after each reboot 158 | Defaults lecture = never 159 | 160 | # Show asterisk when typing password 161 | Defaults pwfeedback 162 | ''; 163 | }; 164 | }; 165 | 166 | services = { 167 | # Service that makes Out of Memory Killer more effective 168 | earlyoom.enable = true; 169 | 170 | # Enable periodic SSD TRIM of mounted partitions in background 171 | fstrim.enable = true; 172 | }; 173 | 174 | systemd.services.nix-daemon = lib.mkIf config.boot.tmp.useTmpfs { 175 | environment.TMPDIR = "/var/tmp"; 176 | }; 177 | nix = { 178 | nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; 179 | 180 | # Improve nix store disk usage 181 | optimise.automatic = true; 182 | 183 | settings = { 184 | experimental-features = [ 185 | # Enable flakes. 186 | "flakes" 187 | 188 | # Enable nix3-command. 189 | "nix-command" 190 | 191 | # Allows Lix to invoke a custom command via its main binary `lix`, 192 | # i.e. `lix-foo` gets invoked when `lix foo` is executed. 193 | "lix-custom-sub-commands" 194 | 195 | # Allows Nix to automatically pick UIDs for builds, rather than creating `nixbld*` user accounts. 196 | "auto-allocate-uids" 197 | ]; 198 | 199 | # Allow Lix to import from a derivation, allowing building at evaluation time. 200 | allow-import-from-derivation = true; 201 | 202 | # Prevent impurities in builds 203 | sandbox = pkgs.stdenv.hostPlatform.isLinux; 204 | 205 | # Keep building derivations when another build fails. 206 | keep-going = true; 207 | 208 | # The number of lines of the tail of the log to show if a build fails. 209 | log-lines = 30; 210 | 211 | # The commit summary to use when committing changed flake lock files. 212 | commit-lockfile-summary = "chore: Update flake.lock"; 213 | 214 | # Accept nix configurations from flake without prompting 215 | # Dangerous! 216 | accept-flake-config = false; 217 | 218 | # If set to true, Nix automatically detects files in the store that have identical contents, 219 | # and replaces them with hard links to a single copy. 220 | auto-optimise-store = true; 221 | 222 | # If set to true, Nix will conform to the XDG Base Directory Specification for files in $HOME. 223 | use-xdg-base-directories = true; 224 | 225 | # For GC roots. 226 | # If true (default), the garbage collector will keep the derivations from which non-garbage store paths were built 227 | keep-derivations = true; 228 | 229 | # If true, the garbage collector will keep the outputs of non-garbage derivations. 230 | keep-outputs = true; 231 | 232 | # Whether to warn about dirty Git/Mercurial trees. 233 | warn-dirty = false; 234 | 235 | # Give group special Nix privileges. 236 | trusted-users = [ "@wheel" ]; 237 | allowed-users = [ "@wheel" ]; 238 | 239 | substituters = [ 240 | # The default is https://cache.nixos.org, which has a priority of 40. 241 | # Lower value means higher priority. 242 | "https://cache.nixos.org?priority=10" 243 | "https://nix-community.cachix.org?priority=20" 244 | "https://cache.garnix.io?priority=40" 245 | ]; 246 | 247 | trusted-public-keys = [ 248 | "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" 249 | "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 250 | ]; 251 | }; 252 | 253 | registry = { 254 | system.flake = inputs.nixpkgs; 255 | default.flake = inputs.nixpkgs; 256 | nixpkgs.flake = inputs.nixpkgs; 257 | }; 258 | }; 259 | system.stateVersion = config.vars.stateVersion; 260 | } 261 | -------------------------------------------------------------------------------- /modules/etc/shared/home-manager.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | inputs, 4 | lib, 5 | ... 6 | }: 7 | { 8 | imports = [ 9 | inputs.home-manager.nixosModules.home-manager 10 | (lib.modules.mkAliasOptionModule [ "hm" ] [ "home-manager" "users" config.vars.username ]) 11 | ]; 12 | 13 | home-manager.useGlobalPkgs = true; 14 | home-manager.useUserPackages = true; 15 | 16 | hm = 17 | { config, osConfig, ... }: 18 | { 19 | home.stateVersion = osConfig.vars.stateVersion; 20 | home.sessionVariables = 21 | { 22 | EDITOR = "nvim"; 23 | VISUAL = "nvim"; 24 | NIXPKGS_ALLOW_UNFREE = "1"; 25 | MANPAGER = "sh -c 'col -bx | bat -l man -p'"; 26 | 27 | # XDG Related Stuff 28 | XDG_CACHE_HOME = config.xdg.cacheHome; 29 | XDG_CONFIG_HOME = config.xdg.configHome; 30 | XDG_CONFIG_DIR = config.xdg.configHome; 31 | XDG_DATA_HOME = config.xdg.dataHome; 32 | XDG_STATE_HOME = config.xdg.stateHome; 33 | XDG_DESKTOP_DIR = config.xdg.userDirs.desktop; 34 | XDG_DOCUMENTS_DIR = config.xdg.userDirs.documents; 35 | XDG_DOWNLOAD_DIR = config.xdg.userDirs.download; 36 | XDG_MUSIC_DIR = config.xdg.userDirs.music; 37 | XDG_PICTURES_DIR = config.xdg.userDirs.pictures; 38 | XDG_PUBLICSHARE_DIR = config.xdg.userDirs.publicShare; 39 | XDG_TEMPLATES_DIR = config.xdg.userDirs.templates; 40 | XDG_VIDEOS_DIR = config.xdg.userDirs.videos; 41 | } 42 | // lib.optionalAttrs osConfig.vars.withGui { 43 | NIXOS_OZONE_WL = "1"; 44 | TERM = "xterm-256color"; 45 | BROWSER = "firefox"; 46 | # Fix for some Java AWT applications (e.g. Android Studio), 47 | # use this if they aren't displayed properly: 48 | "_JAVA_AWT_WM_NONREPARENTING" = "1"; 49 | QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; 50 | QT_QPA_PLATFORM = "wayland"; 51 | SDL_VIDEODRIVER = "wayland"; 52 | XDG_SESSION_TYPE = "wayland"; 53 | }; 54 | }; 55 | } 56 | -------------------------------------------------------------------------------- /modules/etc/shared/security.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | { 3 | # Enable zram-based swap 4 | zramSwap = { 5 | enable = true; 6 | algorithm = "zstd"; 7 | memoryPercent = 50; 8 | priority = 100; 9 | }; 10 | 11 | environment.defaultPackages = lib.mkDefault [ ]; 12 | 13 | boot = { 14 | # tmpfs = /tmp is mounted in RAM for speed and volatility. 15 | tmp.useTmpfs = lib.mkDefault true; 16 | # Clean /tmp on boot if tmpfs is not in use. 17 | tmp.cleanOnBoot = lib.mkDefault (!config.boot.tmp.useTmpfs); 18 | 19 | # Disable systemd-boot editor to fix a backwards compatibility security issue. 20 | loader.systemd-boot.editor = false; 21 | 22 | kernel.sysctl = { 23 | # Disable Magic SysRq key for security. 24 | "kernel.sysrq" = 0; 25 | # Disable NMI watchdog. 26 | "kernel.nmi_watchdog" = 0; 27 | # Hide kernel messages from the console. 28 | "kernel.printk" = "3 3 3 3"; 29 | # Minimize swap usage. 30 | "vm.swappiness" = "1"; 31 | 32 | # Restrict kernel pointer exposure to mitigate potential kernel info leaks. 33 | "kernel.kptr_restrict" = 2; 34 | 35 | # Limit ptrace scope to prevent unprivileged processes from debugging others. 36 | "kernel.yama.ptrace_scope" = 1; 37 | 38 | # Protect against hardlink and symlink attacks. 39 | "fs.protected_hardlinks" = 1; 40 | "fs.protected_symlinks" = 1; 41 | 42 | # Disable kexec loading to prevent replacing the running kernel without a reboot. 43 | "kernel.kexec_load_disabled" = 1; 44 | 45 | # Disable core dumps for setuid programs to protect sensitive information. 46 | "fs.suid_dumpable" = 0; 47 | 48 | # Restrict performance event usage to mitigate potential side-channel attacks. 49 | "kernel.perf_event_paranoid" = 2; 50 | 51 | ## TCP hardening 52 | # Ignore bogus ICMP error responses. 53 | "net.ipv4.icmp_ignore_bogus_error_responses" = 1; 54 | # Enable reverse path filtering. 55 | "net.ipv4.conf.default.rp_filter" = 1; 56 | "net.ipv4.conf.all.rp_filter" = 1; 57 | # Do not accept source route packets. 58 | "net.ipv4.conf.all.accept_source_route" = 0; 59 | "net.ipv6.conf.all.accept_source_route" = 0; 60 | # Disable sending redirects. 61 | "net.ipv4.conf.all.send_redirects" = 0; 62 | "net.ipv4.conf.default.send_redirects" = 0; 63 | # Refuse and disable ICMP redirects. 64 | "net.ipv4.conf.all.accept_redirects" = 0; 65 | "net.ipv4.conf.default.accept_redirects" = 0; 66 | "net.ipv4.conf.all.secure_redirects" = 0; 67 | "net.ipv4.conf.default.secure_redirects" = 0; 68 | "net.ipv6.conf.all.accept_redirects" = 0; 69 | "net.ipv6.conf.default.accept_redirects" = 0; 70 | # Protect against SYN flood attacks. 71 | "net.ipv4.tcp_syncookies" = 1; 72 | # Incomplete protection for TIME-WAIT assassination. 73 | "net.ipv4.tcp_rfc1337" = 1; 74 | # Enable TCP Fast Open. 75 | "net.ipv4.tcp_fastopen" = 3; 76 | # Use BBR for congestion control and CAKE for queueing. 77 | "net.ipv4.tcp_congestion_control" = "bbr"; 78 | "net.core.default_qdisc" = "cake"; 79 | }; 80 | 81 | # Enable BBR kernel module. 82 | kernelModules = [ "tcp_bbr" ]; 83 | 84 | # Blacklist unnecessary or potentially insecure kernel modules. 85 | blacklistedKernelModules = [ 86 | "nvidia" 87 | "nvidia-drm" 88 | "nvidia-modeset" 89 | "nouveau" 90 | "ax25" 91 | "netrom" 92 | "rose" 93 | "adfs" 94 | "affs" 95 | "bfs" 96 | "befs" 97 | "cramfs" 98 | "efs" 99 | "erofs" 100 | "exofs" 101 | "freevxfs" 102 | "f2fs" 103 | "vivid" 104 | "gfs2" 105 | "ksmbd" 106 | "nfsv4" 107 | "nfsv3" 108 | "cifs" 109 | "nfs" 110 | "cramfs" 111 | "freevxfs" 112 | "jffs2" 113 | "hfs" 114 | "hfsplus" 115 | "squashfs" 116 | "udf" 117 | "hpfs" 118 | "jfs" 119 | "minix" 120 | "nilfs2" 121 | "omfs" 122 | "qnx4" 123 | "qnx6" 124 | "sysv" 125 | ]; 126 | }; 127 | 128 | # Automatically accept ACME terms. 129 | security.acme.acceptTerms = true; 130 | } 131 | -------------------------------------------------------------------------------- /modules/etc/shared/users.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | { 3 | sops = { 4 | secrets."users/userPassword".neededForUsers = true; 5 | secrets."users/rootPassword".neededForUsers = true; 6 | }; 7 | 8 | users = { 9 | mutableUsers = false; 10 | users.root.hashedPasswordFile = config.sops.secrets."users/rootPassword".path; 11 | users.${config.vars.username} = { 12 | hashedPasswordFile = config.sops.secrets."users/userPassword".path; 13 | isNormalUser = true; 14 | extraGroups = 15 | [ 16 | "seat" 17 | "video" 18 | "wheel" 19 | ] 20 | ++ lib.optional config.virtualisation.libvirtd.enable "libvirtd" 21 | ++ lib.optional config.virtualisation.docker.enable "docker" 22 | ++ lib.optional config.networking.networkmanager.enable "networkmanager"; 23 | }; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /modules/etc/theme/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | inputs, 6 | ... 7 | }: 8 | let 9 | inherit (lib) 10 | mkEnableOption 11 | mkIf 12 | mkOption 13 | types 14 | ; 15 | 16 | inherit (inputs) self; 17 | 18 | wallpaperLink = pkgs.fetchurl { 19 | url = "https://w.wallhaven.cc/full/0p/wallhaven-0pom5m.jpg"; 20 | hash = "sha256-WHt/fDfCHlS4VZp+lydSHm8f7Pa0trf3WoiCCmG8Ih0="; 21 | }; 22 | 23 | cfg = config.mine.theme; 24 | in 25 | { 26 | options.mine.theme = { 27 | enable = mkEnableOption "Theme"; 28 | 29 | colorScheme = mkOption { 30 | type = types.anything; 31 | default = inputs.nix-colors.colorSchemes.${config.vars.colorScheme}; 32 | }; 33 | 34 | gtk = { 35 | cursorTheme = { 36 | name = mkOption { 37 | type = types.str; 38 | default = "phinger-cursors-light"; 39 | }; 40 | size = mkOption { 41 | type = types.int; 42 | default = 24; 43 | }; 44 | package = mkOption { 45 | type = types.package; 46 | default = pkgs.phinger-cursors; 47 | }; 48 | }; 49 | 50 | theme = { 51 | name = mkOption { 52 | type = types.str; 53 | default = "WhiteSur-Dark"; 54 | }; 55 | package = mkOption { 56 | type = types.package; 57 | default = inputs.ludovico-pkgs.packages.${pkgs.stdenv.hostPlatform.system}.whitesur-gtk-theme; 58 | }; 59 | }; 60 | 61 | iconTheme = { 62 | name = mkOption { 63 | type = types.str; 64 | default = "WhiteSur-dark"; 65 | }; 66 | package = mkOption { 67 | type = types.package; 68 | default = pkgs.whitesur-icon-theme; 69 | }; 70 | }; 71 | }; 72 | }; 73 | 74 | config = mkIf cfg.enable { 75 | hm = 76 | { config, osConfig, ... }: 77 | { 78 | imports = [ inputs.nix-colors.homeManagerModules.default ]; 79 | inherit (cfg) colorScheme; 80 | 81 | systemd.user.services.swaybg = { 82 | Unit = { 83 | Description = "Wayland wallpaper daemon"; 84 | After = [ "graphical-session.target" ]; 85 | BindsTo = [ "graphical-session.target" ]; 86 | }; 87 | Install.WantedBy = [ "graphical-session.target" ]; 88 | Service = { 89 | Type = "simple"; 90 | Restart = "on-failure"; 91 | ExecStart = "${lib.getExe pkgs.swaybg} -i ${wallpaperLink}"; 92 | }; 93 | }; 94 | 95 | home = { 96 | packages = [ 97 | cfg.gtk.cursorTheme.package 98 | pkgs.gnomeExtensions.user-themes 99 | ]; 100 | pointerCursor = { 101 | inherit (cfg.gtk.cursorTheme) name package size; 102 | hyprcursor.enable = true; 103 | x11.enable = true; 104 | gtk.enable = true; 105 | }; 106 | }; 107 | 108 | gtk = { 109 | enable = true; 110 | 111 | font = { 112 | inherit (osConfig.mine.fonts.main) name package; 113 | inherit (osConfig.mine.fonts) size; 114 | }; 115 | 116 | inherit (cfg.gtk) cursorTheme theme iconTheme; 117 | 118 | gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; 119 | gtk3.bookmarks = [ 120 | "file://${config.home.homeDirectory}/Code" 121 | "file://${config.home.homeDirectory}/Media" 122 | "file://${config.home.homeDirectory}/Documents" 123 | "file://${config.home.homeDirectory}/Downloads" 124 | "file://${config.home.homeDirectory}/Music" 125 | "file://${config.home.homeDirectory}/Pictures" 126 | "file://${config.home.homeDirectory}/Videos" 127 | "file://${config.home.homeDirectory}/WinE" 128 | ]; 129 | }; 130 | 131 | qt = { 132 | enable = true; 133 | platformTheme.name = "gtk3"; 134 | }; 135 | 136 | xdg = { 137 | # Stolen from https://github.com/khaneliman/khanelinix/blob/e0039561cfaa7810325ecd811e672ffa6d96736f/modules/home/theme/gtk/default.nix#L150 138 | configFile = 139 | let 140 | gtk4Dir = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0"; 141 | in 142 | { 143 | "gtk-4.0/assets".source = "${gtk4Dir}/assets"; 144 | "gtk-4.0/gtk.css".source = "${gtk4Dir}/gtk.css"; 145 | "gtk-4.0/gtk-dark.css".source = "${gtk4Dir}/gtk-dark.css"; 146 | }; 147 | 148 | systemDirs.data = 149 | let 150 | schema = pkgs.gsettings-desktop-schemas; 151 | in 152 | [ "${schema}/share/gsettings-schemas/${schema.name}" ]; 153 | }; 154 | 155 | dconf.settings = { 156 | "org/gnome/desktop/interface" = { 157 | # Use dconf-editor to get this settings. 158 | color-scheme = "prefer-dark"; 159 | cursor-theme = config.gtk.cursorTheme.name; 160 | cursor-size = config.gtk.cursorTheme.size; 161 | gtk-theme = config.gtk.theme.name; 162 | icon-theme = config.gtk.iconTheme.name; 163 | font-name = "${osConfig.mine.fonts.main.name} ${toString osConfig.mine.fonts.size}"; 164 | document-font-name = "${osConfig.mine.fonts.main.name} ${toString osConfig.mine.fonts.size}"; 165 | monospace-font-name = "${osConfig.mine.fonts.main.name} ${toString osConfig.mine.fonts.size}"; 166 | clock-format = "12h"; 167 | clock-show-date = true; 168 | clock-show-seconds = false; 169 | clock-show-weekday = false; 170 | enable-animations = true; 171 | enable-hot-corners = false; 172 | font-antialiasing = "rgba"; 173 | font-hinting = "full"; 174 | scaling-factor = 1; 175 | text-scaling-factor = 1.0; 176 | toolbar-style = "text"; 177 | }; 178 | "org/gnome/shell" = { 179 | disable-user-extensions = false; 180 | enabled-extensions = [ "user-theme@gnome-shell-extensions.gcampax.github.com" ]; 181 | }; 182 | "org/gnome/shell/extensions/user-theme" = { inherit (config.gtk.theme) name; }; 183 | "org/gnome/desktop/background" = { 184 | color-shading-type = "solid"; 185 | picture-options = "zoom"; 186 | picture-uri = "${self}/assets/Lain_Red.png"; 187 | picture-uri-dark = "${self}/assets/anime-nix-wallpaper.png"; 188 | primary-color = "#000000000000"; 189 | secondary-color = "#000000000000"; 190 | }; 191 | "org/gnome/desktop/wm/preferences" = { 192 | button-layout = "close,minimize,maximize:icon"; 193 | }; 194 | }; 195 | }; 196 | }; 197 | } 198 | -------------------------------------------------------------------------------- /modules/etc/vars/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | let 3 | inherit (lib) mkOption types; 4 | in 5 | { 6 | options.vars = { 7 | colorScheme = mkOption { 8 | type = types.str; 9 | # List of available color schemes: 10 | # https://github.com/tinted-theming/schemes/blob/spec-0.11/base16/ 11 | default = "catppuccin-mocha"; 12 | }; 13 | 14 | email = mkOption { 15 | type = types.str; 16 | default = "email@69420blaze.it"; 17 | }; 18 | 19 | username = mkOption { 20 | type = types.str; 21 | default = "airi"; 22 | }; 23 | 24 | homeDirectory = mkOption { 25 | type = types.str; 26 | default = "/home/${config.vars.username}"; 27 | }; 28 | 29 | terminal = mkOption { 30 | type = types.str; 31 | default = "wezterm"; 32 | }; 33 | 34 | sshPublicKey = mkOption { 35 | type = types.str; 36 | default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINtzB1oiuDptWi04PAEJVpSAcvD96AL0S21zHuMgmcE9 ludovico@sforza"; 37 | }; 38 | 39 | stateVersion = mkOption { 40 | type = types.str; 41 | default = "24.11"; 42 | }; 43 | 44 | timezone = mkOption { 45 | type = types.str; 46 | default = "Asia/Tokyo"; 47 | }; 48 | 49 | opacity = mkOption { 50 | type = types.float; 51 | default = 1.0; 52 | }; 53 | 54 | withGui = mkOption { 55 | type = types.bool; 56 | default = false; 57 | }; 58 | 59 | isALaptop = mkOption { 60 | type = types.bool; 61 | default = false; 62 | }; 63 | }; 64 | } 65 | -------------------------------------------------------------------------------- /modules/programs/emacs/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | pkgs, 4 | config, 5 | lib, 6 | ... 7 | }: 8 | let 9 | inherit (lib) mkIf mkEnableOption; 10 | inherit (inputs) emacs-overlay wrapper-manager; 11 | 12 | emacsPackage = 13 | with pkgs; 14 | (emacsPackagesFor emacs-git-pgtk).emacsWithPackages ( 15 | epkgs: with epkgs; [ 16 | treesit-grammars.with-all-grammars 17 | vterm 18 | ] 19 | ); 20 | 21 | cfg = config.mine.emacs; 22 | in 23 | { 24 | options.mine.emacs.enable = mkEnableOption "Emacs"; 25 | 26 | config = mkIf cfg.enable { 27 | nixpkgs.overlays = [ emacs-overlay.overlays.default ]; 28 | 29 | hm = { 30 | home.packages = [ 31 | (wrapper-manager.lib.build { 32 | inherit pkgs; 33 | modules = [ 34 | { 35 | wrappers.emacs = { 36 | basePackage = emacsPackage; 37 | pathAdd = with pkgs; [ 38 | ## Optional dependencies 39 | (mkIf (config.programs.gnupg.agent.enable) pinentry-emacs) # in-emacs gnupg prompts 40 | (aspellWithDicts ( 41 | ds: with ds; [ 42 | en 43 | en-computers 44 | en-science 45 | ] 46 | )) 47 | # https://github.com/manateelazycat/lsp-bridge/wiki/NixOS 48 | (python3.withPackages ( 49 | p: with p; [ 50 | epc 51 | orjson 52 | sexpdata 53 | six 54 | setuptools 55 | paramiko 56 | rapidfuzz 57 | watchdog 58 | packaging 59 | ] 60 | )) 61 | 62 | fzf 63 | ripgrep 64 | fd # faster projectile indexing 65 | imagemagick # for image-dired 66 | zstd # for undo-fu-session/undo-tree compression 67 | 68 | # Nix 69 | nixd 70 | nixfmt-rfc-style 71 | 72 | # C 73 | clang-tools 74 | cmake 75 | 76 | # Python 77 | basedpyright 78 | python3 79 | black 80 | ruff 81 | 82 | # Go 83 | go 84 | gopls 85 | 86 | # Rust 87 | rust-analyzer 88 | clippy 89 | rustfmt 90 | 91 | # Web Development 92 | prettierd 93 | vscode-langservers-extracted 94 | typescript-language-server 95 | intelephense # php 96 | astro-language-server 97 | vue-language-server 98 | tailwindcss-language-server 99 | ]; 100 | }; 101 | } 102 | ]; 103 | }) 104 | ]; 105 | }; 106 | }; 107 | } 108 | -------------------------------------------------------------------------------- /modules/programs/firefox/bookmarks.nix: -------------------------------------------------------------------------------- 1 | { 2 | hm.programs.firefox.profiles.ludovico.bookmarks = { 3 | force = true; 4 | settings = [ 5 | { 6 | name = "ANIME"; # Bookmark Folder 7 | toolbar = true; 8 | bookmarks = [ 9 | { 10 | name = "ANIMEPAHE"; 11 | keyword = "ah"; 12 | url = "https://animepahe.ru"; 13 | } 14 | { 15 | name = "KICKASSANIME"; 16 | keyword = "kaa"; 17 | url = "https://kaa.mx"; 18 | } 19 | ]; 20 | } 21 | { 22 | name = "NixOS"; 23 | toolbar = true; 24 | bookmarks = [ 25 | { 26 | name = "Nix Package"; 27 | keyword = "np"; 28 | url = "https://search.nixos.org/packages?channel=unstable"; 29 | } 30 | { 31 | name = "Nix Options"; 32 | keyword = "no"; 33 | url = "https://search.nixos.org/options?channel=unstable"; 34 | } 35 | { 36 | name = "NixOS Wiki"; 37 | keyword = "nw"; 38 | url = "https://wiki.nixos.org/wiki/Linux_kernel"; 39 | } 40 | { 41 | name = "Home-Manager"; 42 | keyword = "hm"; 43 | url = "https://nix-community.github.io/home-manager/options.xhtml"; 44 | } 45 | ]; 46 | } 47 | { 48 | name = "1337"; 49 | toolbar = true; 50 | bookmarks = [ 51 | { 52 | name = "GitHub"; 53 | keyword = "gh"; 54 | url = "https://github.com"; 55 | } 56 | { 57 | name = "GitLab"; 58 | keyword = "gl"; 59 | url = "https://gitlab.com"; 60 | } 61 | { 62 | name = "SourceHut"; 63 | keyword = "sh"; 64 | url = "https://git.sr.ht"; 65 | } 66 | ]; 67 | } 68 | { 69 | name = "lol"; 70 | toolbar = false; 71 | bookmarks = [ 72 | { 73 | name = "Google"; 74 | keyword = "g"; 75 | url = "https://google.com"; 76 | } 77 | { 78 | name = "DuckDuckGo"; 79 | keyword = "dg"; 80 | url = "https://DuckDuckGo.com"; 81 | } 82 | { 83 | name = "Twitter"; 84 | keyword = "x"; 85 | url = "https://x.com"; 86 | } 87 | { 88 | name = "YouTube"; 89 | keyword = "yt"; 90 | url = "https://YouTube.com"; 91 | } 92 | ]; 93 | } 94 | ]; 95 | }; 96 | } 97 | -------------------------------------------------------------------------------- /modules/programs/firefox/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | inputs, 6 | ... 7 | }: 8 | let 9 | inherit (lib) mkEnableOption mkIf; 10 | 11 | cfg = config.mine.firefox; 12 | in 13 | { 14 | imports = [ 15 | ./settings.nix 16 | ./search.nix 17 | ./bookmarks.nix 18 | ./extensions.nix 19 | ]; 20 | 21 | options.mine.firefox = { 22 | enable = mkEnableOption "firefox browser"; 23 | }; 24 | 25 | config = mkIf cfg.enable { 26 | hm = { 27 | programs.firefox = { 28 | enable = true; 29 | package = pkgs.firefox; 30 | 31 | profiles = { 32 | ludovico = 33 | { 34 | id = 0; 35 | isDefault = true; 36 | name = "Ludovico"; 37 | } 38 | // ( 39 | let 40 | inherit (inputs.ludovico-pkgs.packages.${pkgs.stdenv.hostPlatform.system}) firefox-gnome-theme; 41 | in 42 | { 43 | userChrome = ''@import "${firefox-gnome-theme}/userChrome.css";''; 44 | userContent = ''@import "${firefox-gnome-theme}/userContent.css";''; 45 | extraConfig = '' 46 | // user_pref("extensions.formautofill.addresses.enabled", false); 47 | // user_pref("extensions.formautofill.creditCards.enabled", false); 48 | 49 | // // PREF: enable HTTPS-Only Mode 50 | // // Warn me before loading sites that don't support HTTPS 51 | // // when using Private Browsing windows. 52 | // user_pref("dom.security.https_only_mode_pbm", true); 53 | // user_pref("dom.security.https_only_mode_error_page_user_suggestions", true); 54 | 55 | // // PREF: disable the Firefox View tour from popping up 56 | // user_pref("browser.firefox-view.feature-tour", "{\"screen\":\"\",\"complete\":true}"); 57 | 58 | // // Fix Strict ETP issue 59 | // user_pref("browser.contentblocking.category", "standard"); 60 | 61 | /* Custom User.js */ 62 | user_pref("privacy.sanitize.sanitizeOnShutdown", false); 63 | user_pref("privacy.clearOnShutdown.cache", false); 64 | user_pref("privacy.clearOnShutdown.cookies", false); 65 | user_pref("privacy.clearOnShutdown.offlineApps", false); 66 | user_pref("browser.sessionstore.privacy_level", 0); 67 | ''; 68 | } 69 | ); 70 | }; 71 | }; 72 | }; 73 | }; 74 | } 75 | -------------------------------------------------------------------------------- /modules/programs/firefox/extensions.nix: -------------------------------------------------------------------------------- 1 | { inputs, pkgs, ... }: 2 | { 3 | hm.programs.firefox.profiles.ludovico.extensions = { 4 | force = true; 5 | packages = with inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}; [ 6 | bitwarden 7 | refined-github 8 | sponsorblock 9 | to-deepl 10 | ublock-origin 11 | search-by-image 12 | ]; 13 | settings = { 14 | "uBlock0@raymondhill.net" = { 15 | settings = { 16 | # Get your settings here 17 | # ~/.mozilla/YOUR_PROFILE_NAME/browser-extension-data/uBlock0@raymondhill.net/storage.js 18 | advancedUserEnabled = true; 19 | selectedFilterLists = [ 20 | "user-filters" 21 | "ublock-filters" 22 | "ublock-badware" 23 | "ublock-privacy" 24 | "ublock-unbreak" 25 | "ublock-quick-fixes" 26 | "easylist" 27 | "easyprivacy" 28 | "urlhaus-1" 29 | "plowe-0" 30 | "adguard-spyware-url" 31 | "fanboy-cookiemonster" 32 | "ublock-cookies-easylist" 33 | "easylist-annoyances" 34 | "easylist-chat" 35 | "easylist-newsletters" 36 | "easylist-notifications" 37 | "ublock-annoyances" 38 | "IDN-0" 39 | ]; 40 | "user-filters" = '' 41 | shopee.co.id##li.col-xs-2-4.shopee-search-item-result__item:has(div:contains(Ad)) 42 | shopee.co.id##.oMSmr0:has(div:contains(Ad)) 43 | tokopedia.com#?#.product-card:has(span:-abp-contains(/^Ad$/)) 44 | tokopedia.com##a[data-testid="lnkProductContainer"]:has(img[alt^="topads"]) 45 | tokopedia.com##div[data-ssr="findProductSSR"]:has(span[data-testid="lblTopads"]) 46 | tokopedia.com##div[data-ssr="findProductSSR"]:has(span[data-testid="linkProductTopads"]) 47 | tokopedia.com##div[data-testid="CPMWrapper"] 48 | tokopedia.com#?#div[data-testid="divCarouselProduct"]:has(span:-abp-contains(/^Ad$/)) 49 | tokopedia.com##div[data-testid="divProduct"]:has(span[data-testid="icnHomeTopadsRecom"]) 50 | tokopedia.com##div[data-testid="divProductWrapper"]:has(span[data-testid="divSRPTopadsIcon"]) 51 | tokopedia.com##div[data-testid="featuredShopCntr"] 52 | tokopedia.com#?#div[data-testid="lazy-frame"]:has(span:-abp-contains(/^Ad$/)) 53 | tokopedia.com##div[data-testid="lazy-frame"]:has(span[data-testid="lblProdTopads"]) 54 | tokopedia.com##div[data-testid="master-product-card"]:has(span[data-testid^="linkProductTopads"]) 55 | tokopedia.com##div[data-testid="topadsCPMWrapper"] 56 | tokopedia.com#?#div[data-testid^="divProductRecommendation"]:has(span:-abp-contains(/^Ad$/)) 57 | tokopedia.com##div[data-testid^="divProductRecommendation"]:has(span[data-testid="icnHomeTopadsRecom"]) 58 | ''; 59 | }; 60 | }; 61 | }; 62 | }; 63 | } 64 | -------------------------------------------------------------------------------- /modules/programs/firefox/search.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | hm.programs.firefox.profiles.ludovico.search = { 4 | force = true; 5 | default = "ddg"; 6 | order = [ 7 | "ddg" 8 | "brave" 9 | "searx" 10 | "google" 11 | ]; 12 | 13 | engines = { 14 | "searx" = { 15 | urls = [ 16 | { 17 | template = "https://opnxng.com/search"; 18 | params = [ 19 | { 20 | name = "q"; 21 | value = "{searchTerms}"; 22 | } 23 | { 24 | name = "categories"; 25 | value = "general"; 26 | } 27 | { 28 | name = "language"; 29 | value = "all"; 30 | } 31 | { 32 | name = "safesearch"; 33 | value = "0"; 34 | } 35 | ]; 36 | } 37 | ]; 38 | definedAliases = [ "s" ]; 39 | }; 40 | 41 | "brave" = { 42 | urls = [ { template = "https://search.brave.com/search?q={searchTerms}"; } ]; 43 | definedAliases = [ "b" ]; 44 | }; 45 | 46 | "ddg" = { 47 | urls = [ { template = "https://duckduckgo.com/?q={searchTerms}"; } ]; 48 | definedAliases = [ "d" ]; 49 | }; 50 | 51 | "github (code)" = { 52 | urls = [ { template = "https://github.com/search?q={searchTerms}&type=code"; } ]; 53 | definedAliases = [ "ghc" ]; 54 | }; 55 | 56 | "github (repository)" = { 57 | urls = [ { template = "https://github.com/search?q={searchTerms}&type=repository"; } ]; 58 | definedAliases = [ "ghr" ]; 59 | }; 60 | 61 | "nix-packages" = { 62 | urls = [ 63 | { 64 | template = "https://search.nixos.org/packages"; 65 | params = [ 66 | { 67 | name = "channel"; 68 | value = "unstable"; 69 | } 70 | { 71 | name = "type"; 72 | value = "packages"; 73 | } 74 | { 75 | name = "query"; 76 | value = "{searchTerms}"; 77 | } 78 | ]; 79 | } 80 | ]; 81 | 82 | icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; 83 | definedAliases = [ "np" ]; 84 | }; 85 | 86 | "home-manager" = { 87 | urls = [ { template = "https://rycee.gitlab.io/home-manager/options.html"; } ]; 88 | definedAliases = [ "hm" ]; 89 | }; 90 | 91 | "nixos-options" = { 92 | urls = [ 93 | { 94 | template = "https://search.nixos.org/options"; 95 | params = [ 96 | { 97 | name = "channel"; 98 | value = "unstable"; 99 | } 100 | { 101 | name = "type"; 102 | value = "packages"; 103 | } 104 | { 105 | name = "query"; 106 | value = "{searchTerms}"; 107 | } 108 | ]; 109 | } 110 | ]; 111 | 112 | icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; 113 | definedAliases = [ "no" ]; 114 | }; 115 | 116 | "nixos-wiki" = { 117 | urls = [ { template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ]; 118 | icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; 119 | definedAliases = [ "nw" ]; 120 | }; 121 | 122 | "youtube" = { 123 | urls = [ { template = "https://www.youtube.com/results?search_query={searchTerms}"; } ]; 124 | definedAliases = [ "yt" ]; 125 | }; 126 | 127 | "amazondotcom-us".metaData.hidden = true; 128 | "bing".metaData.hidden = true; 129 | "ebay".metaData.hidden = true; 130 | "google".metaData.hidden = true; 131 | "google".metaData.alias = "g"; 132 | "wikipedia".metaData.hidden = true; 133 | }; 134 | }; 135 | } 136 | -------------------------------------------------------------------------------- /modules/programs/firefox/settings.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | lib, 4 | config, 5 | ... 6 | }: 7 | { 8 | hm.programs.firefox.profiles.ludovico.settings = 9 | { 10 | # Homepage 11 | "browser.startup.page" = 1; 12 | "browser.startup.homepage" = "${inputs.self}/assets/homepage.html"; 13 | 14 | "media.videocontrols.picture-in-picture.video-toggle.enabled" = false; # Hide picture-in-picture 15 | "extensions.autoDisableScopes" = 0; 16 | "browser.search.region" = "AU"; 17 | "browser.search.isUS" = false; 18 | "distribution.searchplugins.defaultLocale" = "en-AU"; 19 | "general.useragent.locale" = "en-AU"; 20 | "browser.bookmarks.showMobileBookmarks" = true; 21 | "toolkit.legacyUserProfileCustomizations.stylesheets" = true; 22 | "browser.privatebrowsing.vpnpromourl" = ""; 23 | "browser.tabs.firefox-view" = false; # Disable Firefox View 24 | "browser.tabs.firefox-view-next" = false; 25 | "browser.shell.checkDefaultBrowser" = false; 26 | "browser.ctrlTab.sortByRecentlyUsed" = true; 27 | 28 | "sidebar.verticalTabs" = false; 29 | "sidebar.main.tools" = ""; 30 | "sidebar.visibility" = "hide-sidebar"; 31 | "sidebar.revamp" = false; 32 | "browser.ml.chat.enabled" = false; 33 | "gfx.webrender.all" = true; 34 | 35 | "network.trr.mode" = 2; 36 | "network.trr.max-fails" = 5; 37 | "network.trr.default_provider_uri" = "https://dns.nextdns.io/518d18/nixos"; 38 | "network.trr.uri" = "https://dns.nextdns.io/518d18/nixos"; 39 | "network.trr.custom_uri" = "https://dns.nextdns.io/518d18/nixos"; 40 | "network.trr.bootstrapAddress" = "1.1.1.1"; 41 | 42 | # Disable telemetry 43 | "datareporting.usage.uploadEnabled" = false; 44 | "browser.newtabpage.activity-stream.feeds.telemetry" = false; 45 | "browser.ping-centre.telemetry" = false; 46 | "browser.tabs.crashReporting.sendReport" = false; 47 | "devtools.onboarding.telemetry.logged" = false; 48 | "toolkit.telemetry.enabled" = false; 49 | "toolkit.telemetry.server" = "data:,"; 50 | "toolkit.telemetry.unified" = false; 51 | "toolkit.telemetry.archive.enabled" = false; 52 | "toolkit.telemetry.newProfilePing.enabled" = false; 53 | "toolkit.telemetry.shutdownPingSender.enabled" = false; 54 | "toolkit.telemetry.updatePing.enabled" = false; 55 | "toolkit.telemetry.bhrPing.enabled" = false; 56 | "toolkit.telemetry.firstShutdownPing.enabled" = false; 57 | 58 | # # Disable Pocket 59 | "browser.newtabpage.activity-stream.feeds.discoverystreamfeed" = false; 60 | "browser.newtabpage.activity-stream.feeds.section.topstories" = false; 61 | "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; 62 | "browser.newtabpage.activity-stream.showSponsored" = false; 63 | "extensions.pocket.enabled" = false; 64 | 65 | # Disable prefetching 66 | "network.dns.disablePrefetch" = true; 67 | "network.prefetch-next" = false; 68 | 69 | # Disable JS in PDFs 70 | "pdfjs.enableScripting" = false; 71 | 72 | # Harden SSL 73 | "security.ssl.require_safe_negotiation" = true; 74 | 75 | # Tweaks from archwiki 76 | "browser.cache.disk.enable" = false; 77 | "browser.cache.memory.enable" = true; 78 | "browser.cache.memory.capacity" = 131072; # 128 MB 79 | "browser.cache.memory.max_entry_size" = 20480; # 20 MB 80 | "browser.aboutConfig.showWarning" = false; 81 | "browser.preferences.defaultPerformanceSettings.enabled" = false; 82 | "browser.places.speculativeConnect.enabled" = false; 83 | "middlemouse.paste" = false; 84 | 85 | # Smooth Scroll 86 | "general.smoothScroll" = true; 87 | "general.smoothScroll.lines.durationMaxMS" = 125; 88 | "general.smoothScroll.lines.durationMinMS" = 125; 89 | "general.smoothScroll.mouseWheel.durationMaxMS" = 200; 90 | "general.smoothScroll.mouseWheel.durationMinMS" = 100; 91 | "general.smoothScroll.msdPhysics.enabled" = true; 92 | "general.smoothScroll.other.durationMaxMS" = 125; 93 | "general.smoothScroll.other.durationMinMS" = 125; 94 | "general.smoothScroll.pages.durationMaxMS" = 125; 95 | "general.smoothScroll.pages.durationMinMS" = 125; 96 | "mousewheel.min_line_scroll_amount" = 30; 97 | "mousewheel.system_scroll_override_on_root_content.enabled" = true; 98 | "mousewheel.system_scroll_override_on_root_content.horizontal.factor" = 175; 99 | "mousewheel.system_scroll_override_on_root_content.vertical.factor" = 175; 100 | "toolkit.scrollbox.horizontalScrollDistance" = 6; 101 | "toolkit.scrollbox.verticalScrollDistance" = 2; 102 | 103 | # # Extra 104 | "identity.fxaccounts.enabled" = false; 105 | "browser.download.useDownloadDir" = false; 106 | "browser.search.suggest.enabled" = false; 107 | "browser.urlbar.shortcuts.bookmarks" = false; 108 | "browser.urlbar.shortcuts.history" = false; 109 | "browser.urlbar.shortcuts.tabs" = false; 110 | "browser.urlbar.suggest.bookmark" = false; 111 | "browser.urlbar.suggest.searches" = false; 112 | "browser.urlbar.suggest.engines" = false; 113 | "browser.urlbar.suggest.history" = true; 114 | "browser.urlbar.suggest.openpage" = false; 115 | "browser.urlbar.suggest.topsites" = false; 116 | "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false; 117 | "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false; 118 | "signon.rememberSignons" = false; 119 | "signon.autofillForms" = false; 120 | "network.dns.disableIPv6" = true; 121 | "network.proxy.socks_remote_dns" = true; 122 | "dom.security.https_first" = true; 123 | 124 | # Disable permission 125 | # 0=always ask (default), 1=allow, 2=block 126 | "permissions.default.geo" = 2; 127 | "permissions.default.camera" = 2; 128 | "permissions.default.microphone" = 0; 129 | "permissions.default.desktop-notification" = 2; 130 | "permissions.default.xr" = 2; # Virtual Reality 131 | "browser.discovery.enabled" = false; 132 | "datareporting.healthreport.uploadEnabled" = false; 133 | "datareporting.policy.dataSubmissionEnabled" = false; 134 | "app.shield.optoutstudies.enabled" = false; 135 | "app.normandy.enabled" = false; 136 | "app.normandy.api_url" = ""; 137 | 138 | # Firefox GNOME Theme 139 | # Hide the tab bar when only one tab is open. 140 | "gnomeTheme.hideSingleTab" = false; 141 | # By default the tab close buttons follows the position of the window controls, this preference reverts that behavior. 142 | "gnomeTheme.swapTabClose" = true; 143 | # Move Bookmarks toolbar under tabs. 144 | "gnomeTheme.bookmarksToolbarUnderTabs" = true; 145 | # Hide WebRTC indicator since GNOME provides their own privacy icons in the top right. 146 | "gnomeTheme.hideWebrtcIndicator" = true; 147 | # Use system theme icons instead of Adwaita icons included by theme. 148 | "gnomeTheme.systemIcons" = true; 149 | } 150 | // lib.optionalAttrs config.mine.dnscrypt2.enable { 151 | # DOH 152 | /* 153 | 2 is enable DOH. 154 | 3 is no failback to system dns 155 | 5 is no DOH. 156 | */ 157 | "network.trr.mode" = 5; 158 | "network.trr.max-fails" = 5; 159 | "network.trr.default_provider_uri" = ""; 160 | "network.trr.uri" = ""; 161 | "network.trr.custom_uri" = ""; 162 | # "network.trr.bootstrapAddress" = "1.1.1.1"; 163 | }; 164 | } 165 | -------------------------------------------------------------------------------- /modules/programs/fish/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | let 8 | _ = lib.getExe; 9 | 10 | inherit (lib) 11 | mkForce 12 | mkEnableOption 13 | mkIf 14 | optionalString 15 | ; 16 | 17 | cfg = config.mine.fish; 18 | in 19 | { 20 | 21 | imports = [ 22 | ./direnv.nix 23 | ./functions.nix 24 | ./shellAliases.nix 25 | ]; 26 | 27 | options.mine.fish = { 28 | enable = mkEnableOption "Fish Shell"; 29 | }; 30 | 31 | config = mkIf cfg.enable { 32 | users.users.root.shell = pkgs.fish; 33 | users.users.${config.vars.username}.shell = pkgs.fish; 34 | sops.secrets."shells/githubToken" = { 35 | mode = "0444"; 36 | }; 37 | environment.pathsToLink = [ "/share/fish" ]; 38 | programs = { 39 | fish = { 40 | enable = true; 41 | useBabelfish = true; 42 | shellAliases = mkForce { }; 43 | interactiveShellInit = 44 | '' 45 | . ${config.sops.secrets."shells/githubToken".path} 46 | '' 47 | + optionalString (!config.vars.withGui && config.vars.isALaptop) '' 48 | ${pkgs.util-linux}/bin/setterm -blank 1 --powersave on 49 | ''; 50 | }; 51 | 52 | bat = { 53 | enable = true; 54 | extraPackages = with pkgs.bat-extras; [ 55 | batdiff 56 | batman 57 | prettybat 58 | ]; 59 | settings = { 60 | pager = "less"; 61 | theme = "OneHalfDark"; 62 | }; 63 | }; 64 | }; 65 | 66 | hm = { 67 | home.packages = with pkgs; [ 68 | zoxide 69 | fzf 70 | fd 71 | lazygit 72 | ]; 73 | 74 | programs = { 75 | fish = { 76 | enable = true; 77 | 78 | #NOTE: get default tide config using `set -U | grep tide_` 79 | interactiveShellInit = with pkgs; '' 80 | function fish_greeting 81 | end 82 | 83 | set -x tide_character_color brgreen 84 | set -x tide_character_color_failure brred 85 | set -x tide_character_icon ❯ 86 | set -x tide_character_vi_icon_default ❮ 87 | set -x tide_character_vi_icon_replace ▶ 88 | set -x tide_character_vi_icon_visual V 89 | 90 | set -x tide_status_bg_color normal 91 | set -x tide_status_bg_color_failure normal 92 | set -x tide_status_color green 93 | set -x tide_status_color_failure red 94 | set -x tide_status_icon ✔ 95 | set -x tide_status_icon_failure ✘ 96 | 97 | set -x tide_prompt_add_newline_before true 98 | set -x tide_prompt_color_frame_and_connection 6C6C6C 99 | set -x tide_prompt_color_separator_same_color 949494 100 | set -x tide_prompt_min_cols 34 101 | set -x tide_prompt_pad_items false 102 | set -x tide_prompt_transient_enabled true 103 | 104 | set -x tide_left_prompt_items pwd git newline character 105 | set -x tide_left_prompt_frame_enabled false 106 | set -x tide_left_prompt_prefix 107 | set -x tide_left_prompt_separator_diff_color " " 108 | set -x tide_left_prompt_separator_same_color " " 109 | set -x tide_left_prompt_suffix " " 110 | 111 | set -x tide_right_prompt_frame_enabled false 112 | set -x tide_right_prompt_items status cmd_duration context jobs direnv node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir zig 113 | set -x tide_right_prompt_prefix " " 114 | set -x tide_right_prompt_separator_diff_color " " 115 | set -x tide_right_prompt_separator_same_color " " 116 | set -x tide_right_prompt_suffix "" 117 | 118 | set -x tide_pwd_bg_color normal 119 | set -x tide_pwd_color_anchors brcyan 120 | set -x tide_pwd_color_dirs cyan 121 | set -x tide_pwd_color_truncated_dirs magenta 122 | set -x tide_pwd_icon 123 | set -x tide_pwd_icon_home 124 | set -x tide_pwd_icon_unwritable  125 | set -x tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json build.zig 126 | 127 | ${_ zoxide} init fish | source 128 | ${_ nix-your-shell} fish | source 129 | ''; 130 | 131 | plugins = [ 132 | { 133 | name = "fzf.fish"; 134 | src = pkgs.fetchFromGitHub { 135 | owner = "PatrickF1"; 136 | repo = "fzf.fish"; 137 | rev = "e5d54b93cd3e096ad6c2a419df33c4f50451c900"; 138 | hash = "sha256-5cO5Ey7z7KMF3vqQhIbYip5JR6YiS2I9VPRd6BOmeC8="; 139 | }; 140 | } 141 | { 142 | name = "tide"; 143 | src = pkgs.fetchFromGitHub { 144 | owner = "IlanCosman"; 145 | repo = "tide"; 146 | rev = "44c521ab292f0eb659a9e2e1b6f83f5f0595fcbd"; 147 | hash = "sha256-85iU1QzcZmZYGhK30/ZaKwJNLTsx+j3w6St8bFiQWxc="; 148 | }; 149 | } 150 | ]; 151 | }; 152 | }; 153 | }; 154 | }; 155 | } 156 | -------------------------------------------------------------------------------- /modules/programs/fish/direnv.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | let 3 | inherit (lib) mkEnableOption mkIf; 4 | 5 | cfg = config.mine.direnv; 6 | in 7 | { 8 | options.mine.direnv = { 9 | enable = mkEnableOption "Direnv" // { 10 | default = config.mine.fish.enable; 11 | }; 12 | }; 13 | 14 | config = mkIf cfg.enable { 15 | hm = { 16 | programs.direnv = { 17 | enable = true; 18 | nix-direnv.enable = true; 19 | }; 20 | }; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /modules/programs/fish/functions.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | config, 5 | ... 6 | }: 7 | let 8 | _ = lib.getExe; 9 | __ = lib.getExe'; 10 | 11 | cfg = config.mine.fish; 12 | in 13 | with pkgs; 14 | { 15 | config = lib.mkIf cfg.enable { 16 | hm.programs.fish.shellInit = '' 17 | function gitignore 18 | curl -sL https://www.toptal.com/developers/gitignore/api/$argv 19 | end 20 | 21 | function , 22 | nix run nixpkgs#$argv[1] 23 | end 24 | 25 | function ns 26 | set pkgs 27 | for pkg in $argv 28 | set pkgs $pkgs nixpkgs#$pkg 29 | end 30 | nix shell $pkgs 31 | end 32 | 33 | 34 | function notify 35 | if set -q DISPLAY || set -q WAYLAND_DISPLAY 36 | ${__ libnotify "notify-send"} $argv 37 | end 38 | end 39 | 40 | function y 41 | set tmp (mktemp -t "yazi-cwd.XXXXXX") 42 | ${_ yazi} $argv --cwd-file="$tmp" 43 | if set cwd (command cat -- "$tmp"); and test -n "$cwd"; and test "$cwd" != "$PWD" 44 | builtin cd -- "$cwd" 45 | end 46 | rm -f -- "$tmp" 47 | end 48 | 49 | function bs 50 | pushd ${config.vars.homeDirectory}/Code/nixos 51 | ${_ nh} os switch . 52 | 53 | if test $status -eq 0 54 | notify "Rebuild Switch" "Build successful!" 55 | else 56 | notify "Rebuild Switch" "Build failed!" 57 | end 58 | 59 | popd 60 | end 61 | 62 | function bb 63 | pushd ${config.vars.homeDirectory}/Code/nixos 64 | ${_ nh} os boot . 65 | 66 | if test $status -eq 0 67 | notify "Rebuild Boot" "Build successful!" 68 | else 69 | notify "Rebuild Boot" "Build failed!" 70 | end 71 | 72 | popd 73 | end 74 | 75 | function clean-all 76 | ${_ nh} clean all 77 | 78 | if test $status -eq 0 79 | notify "NH Clean all" "Success!" 80 | else 81 | notify "NH Clean all" "Failed!" 82 | end 83 | end 84 | 85 | function fe 86 | set selected_file (${__ ripgrep "rg"} --files $argv[1] | fzf --preview "${_ bat} -f {}") 87 | if test -n "$selected_file" 88 | echo "$selected_file" | xargs nvim 89 | end 90 | end 91 | 92 | function paste 93 | set URL "https://paste.cachyos.org" 94 | 95 | set FILEPATH $argv[1] 96 | set FILENAME (basename -- $FILEPATH) 97 | set EXTENSION (string match -r '\.(.*)$' $FILENAME; and echo $argv[1]; or echo "") 98 | 99 | set RESPONSE (curl --data-binary @$FILEPATH --url $URL) 100 | set PASTELINK "$URL$RESPONSE" 101 | 102 | if test -z "$EXTENSION" 103 | echo "$PASTELINK" 104 | else 105 | echo "$PASTELINK$EXTENSION" 106 | end 107 | end 108 | 109 | function watchLive 110 | if test (count $argv) -ge 2 111 | set quality $argv[2] 112 | else 113 | set quality "best" 114 | end 115 | 116 | ${_ streamlink} --player ${_ mpv} $argv[1] $quality 117 | end 118 | 119 | function mkcd 120 | ${__ uutils-coreutils-noprefix "mkdir"} -p $argv[1] 121 | if test -d "$argv[1]" 122 | cd $argv[1] 123 | end 124 | end 125 | 126 | function extract 127 | switch "$argv[1]" 128 | case '*.tar.bz2' 129 | ${__ gnutar "tar"} xvjf "$argv[1]" 130 | case '*.tar.gz' 131 | ${__ gnutar "tar"} xvzf "$argv[1]" 132 | case '*.bz2' 133 | ${__ bzip2 "bunzip2"} "$argv[1]" 134 | case '*.rar' 135 | ${_ unrar} x "$argv[1]" 136 | case '*.gz' 137 | ${__ gzip "gunzip"} "$argv[1]" 138 | case '*.tar' 139 | ${__ gnutar "tar"} xvf "$argv[1]" 140 | case '*.tbz2' 141 | ${__ gnutar "tar"} xvjf "$argv[1]" 142 | case '*.tgz' 143 | ${__ gnutar "tar"} xvzf "$argv[1]" 144 | case '*.zip' 145 | ${_ unzip} "$argv[1]" 146 | case '*.Z' 147 | ${__ gzip "uncompress"} "$argv[1]" 148 | case '*.7z' 149 | ${__ p7zip "7z"} x "$argv[1]" 150 | case '*' 151 | echo "Cannot extract '$argv[1]' via extract" 152 | end 153 | end 154 | 155 | # Media Stuff 156 | # Fullscreen screen recording 157 | function record 158 | set -l file ${config.vars.homeDirectory}/Videos/Record/(date +'%F_%H:%M:%S').mp4 159 | ${_ wl-screenrec} -f $file 160 | end 161 | 162 | # Region-based screen recording 163 | function record-region 164 | set -l region (${_ slurp}) 165 | set -l file ${config.vars.homeDirectory}/Videos/Record/(date +'%F_%H:%M:%S').mp4 166 | ${_ wl-screenrec} -g $region -f $file 167 | end 168 | 169 | function yt 170 | set -l sub $argv[1] 171 | set -e argv[1] 172 | 173 | switch $sub 174 | case aac 175 | set -l outdir ${config.vars.homeDirectory}/Media/Audios 176 | ${_ yt-dlp} --extract-audio --audio-format aac --audio-quality 0 -P $outdir --output "%(title)s.%(ext)s" $argv 177 | 178 | case best 179 | set -l outdir ${config.vars.homeDirectory}/Media/Audios 180 | ${_ yt-dlp} --extract-audio --audio-format best --audio-quality 0 -P $outdir --output "%(title)s.%(ext)s" $argv 181 | 182 | case flac 183 | set -l outdir ${config.vars.homeDirectory}/Media/Audios 184 | ${_ yt-dlp} --extract-audio --audio-format flac --audio-quality 0 -P $outdir --output "%(title)s.%(ext)s" $argv 185 | 186 | case mp3 187 | set -l outdir ${config.vars.homeDirectory}/Media/Audios 188 | ${_ yt-dlp} --extract-audio --audio-format mp3 --audio-quality 0 -P $outdir --output "%(title)s.%(ext)s" $argv 189 | 190 | case video 191 | set -l outdir ${config.vars.homeDirectory}/Media/Videos 192 | ${_ yt-dlp} -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' \ 193 | --merge-output-format mp4 -P $outdir --output "%(title)s.%(ext)s" $argv 194 | 195 | case '*' 196 | echo "Usage: yt [aac|best|flac|mp3|video] " 197 | end 198 | end 199 | ''; 200 | }; 201 | } 202 | -------------------------------------------------------------------------------- /modules/programs/fish/shellAliases.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | let 8 | _ = lib.getExe; 9 | 10 | cfg = config.mine.fish; 11 | in 12 | with pkgs; 13 | { 14 | config = lib.mkIf cfg.enable { 15 | hm.programs.fish.shellInit = '' 16 | alias c="${_ curlie}" 17 | alias cat="${_ bat}" 18 | alias config="cd ~/Code/nixos" 19 | alias v=nvim 20 | alias nv=nvim 21 | 22 | alias ls="${_ eza} --color=always --group-directories-first --icons" 23 | alias ll="${_ eza} -la --icons --octal-permissions --group-directories-first" 24 | alias l="${_ eza} -bGF --header --git --color=always --group-directories-first --icons" 25 | alias llm="${_ eza} -lbGd --header --git --sort=modified --color=always --group-directories-first --icons" 26 | alias la="${_ eza} --long --all --group --group-directories-first" 27 | alias lx="${_ eza} -lbhHigUmuSa@ --time-style=long-iso --git --color-scale --color=always --group-directories-first --icons" 28 | alias lS="${_ eza} -1 --color=always --group-directories-first --icons" 29 | alias lt="${_ eza} --tree --level=2 --color=always --group-directories-first --icons" 30 | alias l.="${_ eza} -a | grep -E '^\.'" 31 | alias t="${_ eza} --icons --tree" 32 | alias tree="${_ eza} --icons --tree" 33 | 34 | alias nr="${_ nixpkgs-review}" 35 | alias nv="nvim" 36 | alias mkdir="mkdir -p" 37 | 38 | alias g="${_ git}" 39 | 40 | alias ..="cd .." 41 | alias ...="cd ../.." 42 | 43 | alias grep="grep --color=auto" 44 | alias f="${_ fzf}" 45 | alias ff="find . -type f | ${_ fzf}" 46 | alias rg="${_ ripgrep}" 47 | alias rgr="${_ repgrep}" 48 | alias jq="${_ jq}" # jq if not globally accessible 49 | ''; 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /modules/programs/foot/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | let 3 | inherit (config.mine.theme.colorScheme) palette; 4 | inherit (lib) mkIf mkEnableOption; 5 | 6 | cfg = config.mine.foot; 7 | in 8 | { 9 | options.mine.foot.enable = mkEnableOption "foot terminal"; 10 | 11 | config = mkIf cfg.enable { 12 | hm = 13 | { osConfig, ... }: 14 | let 15 | fontConfig = osConfig.mine.fonts; 16 | in 17 | { 18 | programs.foot = { 19 | enable = true; 20 | settings = { 21 | main = { 22 | font = "${fontConfig.terminal.name}:size=15,${fontConfig.emoji.name}:size=15,${fontConfig.icon.name}:size=15"; 23 | term = "xterm-256color"; 24 | dpi-aware = "yes"; 25 | initial-window-size-chars = "82x23"; 26 | initial-window-mode = "windowed"; 27 | pad = "10x10"; 28 | resize-delay-ms = 100; 29 | }; 30 | 31 | colors = { 32 | alpha = osConfig.vars.opacity; 33 | foreground = "${palette.base05}"; # Text 34 | background = "${palette.base00}"; # colors.base 35 | 36 | regular0 = "${palette.base03}"; # Surface 1 37 | regular1 = "${palette.base08}"; # red 38 | regular2 = "${palette.base0B}"; # green 39 | regular3 = "${palette.base0A}"; # yellow 40 | regular4 = "${palette.base0D}"; # blue 41 | regular5 = "${palette.base0F}"; # pink 42 | regular6 = "${palette.base0C}"; # teal 43 | regular7 = "${palette.base06}"; # Subtext 0 44 | # Subtext 1 ??? 45 | bright0 = "${palette.base04}"; # Surface 2 46 | bright1 = "${palette.base08}"; # red 47 | bright2 = "${palette.base0B}"; # green 48 | bright3 = "${palette.base0A}"; # yellow 49 | bright4 = "${palette.base0D}"; # blue 50 | bright5 = "${palette.base0F}"; # pink 51 | bright6 = "${palette.base0C}"; # teal 52 | bright7 = "${palette.base07}"; # Subtext 0 53 | }; 54 | 55 | mouse = { 56 | hide-when-typing = "yes"; 57 | alternate-scroll-mode = "yes"; 58 | }; 59 | }; 60 | }; 61 | }; 62 | }; 63 | } 64 | -------------------------------------------------------------------------------- /modules/programs/fuzzel/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | config, 4 | inputs, 5 | pkgs, 6 | ... 7 | }: 8 | let 9 | inherit (lib) mkEnableOption mkIf getExe; 10 | inherit (config.mine.theme.colorScheme) palette; 11 | 12 | app2unit = "${getExe inputs.ludovico-pkgs.packages.${pkgs.stdenv.hostPlatform.system}.app2unit}"; 13 | 14 | cfg = config.mine.fuzzel; 15 | in 16 | { 17 | options.mine.fuzzel = { 18 | enable = mkEnableOption "fuzzel"; 19 | }; 20 | 21 | config = mkIf cfg.enable { 22 | hm.programs.fuzzel = { 23 | enable = true; 24 | 25 | settings = { 26 | main = { 27 | font = "${config.mine.fonts.terminal.name} Semibold:size=${toString config.mine.fonts.size}"; 28 | terminal = config.vars.terminal; 29 | icon-theme = config.mine.theme.gtk.theme.name; 30 | icons-enabled = "yes"; 31 | inner-pad = 15; 32 | layer = "overlay"; 33 | dpi-aware = "auto"; 34 | exit-on-keyboard-focus-loss = "no"; 35 | fields = "filename,name,generic"; 36 | use-bold = "yes"; 37 | prompt = "->"; 38 | width = 50; 39 | launch-prefix = if config.mine.hyprland.withUWSM then "${app2unit} --fuzzel-compat --" else null; 40 | }; 41 | 42 | border = { 43 | width = 2; 44 | radius = 0; 45 | }; 46 | 47 | dmenu = { 48 | mode = "text"; 49 | }; 50 | 51 | colors = { 52 | background = "${palette.base00}f2"; 53 | text = "${palette.base05}ff"; 54 | match = "${palette.base0A}ff"; 55 | selection = "${palette.base03}ff"; 56 | selection-text = "${palette.base05}ff"; 57 | selection-match = "${palette.base0A}ff"; 58 | border = "${palette.base0D}ff"; 59 | }; 60 | }; 61 | }; 62 | }; 63 | } 64 | -------------------------------------------------------------------------------- /modules/programs/gaming/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | let 8 | inherit (lib) 9 | mkEnableOption 10 | mkIf 11 | mkMerge 12 | mkOption 13 | types 14 | ; 15 | 16 | cfg = config.mine.gaming; 17 | in 18 | { 19 | options.mine.gaming = { 20 | enable = mkEnableOption "gaming"; 21 | 22 | withGamemode = mkOption { 23 | type = types.bool; 24 | default = true; 25 | }; 26 | 27 | withSteam = mkOption { 28 | type = types.bool; 29 | default = true; 30 | }; 31 | }; 32 | 33 | config = mkIf cfg.enable (mkMerge [ 34 | (mkIf cfg.withGamemode { 35 | programs.gamemode = 36 | let 37 | programs = lib.makeBinPath ( 38 | with pkgs; 39 | [ 40 | gojq 41 | systemd 42 | ] 43 | ); 44 | 45 | startscript = pkgs.writeShellScript "gamemode-start" '' 46 | export PATH=$PATH:${programs} 47 | export HYPRLAND_INSTANCE_SIGNATURE=$(ls -w1 /tmp/hypr | tail -1) 48 | hyprctl --batch 'keyword decoration:blur:enabled 0 ; keyword animations:enabled 0' 49 | ${pkgs.libnotify}/bin/notify-send -a 'Gamemode' 'Optimizations activated' 50 | ${lib.getExe' pkgs.mako "makoctl"} mode -a dnd 51 | ''; 52 | 53 | endscript = pkgs.writeShellScript "gamemode-end" '' 54 | export PATH=$PATH:${programs} 55 | export HYPRLAND_INSTANCE_SIGNATURE=$(ls -w1 /tmp/hypr | tail -1) 56 | hyprctl --batch 'keyword decoration:blur:enabled 1 ; keyword animations:enabled 1' 57 | ${lib.getExe' pkgs.mako "makoctl"} mode -r dnd 58 | ${pkgs.libnotify}/bin/notify-send -a 'Gamemode' 'Optimizations deactivated' 59 | ''; 60 | in 61 | { 62 | enable = true; 63 | enableRenice = true; 64 | settings = { 65 | general = { 66 | softrealtime = "auto"; 67 | renice = 15; 68 | }; 69 | custom = { 70 | start = startscript.outPath; 71 | end = endscript.outPath; 72 | }; 73 | }; 74 | }; 75 | }) 76 | 77 | (mkIf cfg.withSteam { 78 | hardware.steam-hardware.enable = true; 79 | programs.steam = { 80 | enable = true; 81 | 82 | # Open ports for Steam Remote Play 83 | remotePlay.openFirewall = false; 84 | 85 | # Open ports for Source Dedicated Server 86 | dedicatedServer.openFirewall = false; 87 | }; 88 | }) 89 | ]); 90 | } 91 | -------------------------------------------------------------------------------- /modules/programs/git/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | let 3 | inherit (lib) mkEnableOption mkIf; 4 | 5 | cfg = config.mine.git; 6 | in 7 | { 8 | options.mine.git = { 9 | enable = mkEnableOption "Git"; 10 | }; 11 | 12 | config = mkIf cfg.enable { 13 | hm = { 14 | programs = { 15 | git = { 16 | enable = true; 17 | # package = pkgs.gitFull; 18 | 19 | signing = { 20 | key = "3911DD276CFE779C"; 21 | signByDefault = true; 22 | }; 23 | userName = "Ludovico Piero"; 24 | userEmail = "${config.vars.email}"; 25 | 26 | aliases = { 27 | # Basic Commands 28 | a = "add -p"; 29 | co = "checkout"; 30 | cob = "checkout -b"; 31 | cl = "clone"; 32 | ba = "branch -a"; 33 | bd = "branch -d"; 34 | bD = "branch -D"; 35 | 36 | # Fetch & Syncing 37 | f = "fetch"; 38 | fp = "fetch --prune"; 39 | pl = "pull"; 40 | up = "pull --rebase --autostash"; 41 | p = "push"; 42 | pushf = "push --force-with-lease"; 43 | 44 | # Commit & Amend 45 | c = "commit -s -v"; 46 | ca = "commit --amend"; 47 | can = "commit --amend --no-edit"; 48 | 49 | # Restore & Reset 50 | r = "restore"; 51 | rs = "restore --staged"; 52 | soft = "reset --soft"; 53 | hard = "reset --hard"; 54 | s1ft = "reset --soft HEAD~1"; 55 | h1rd = "reset --hard HEAD~1"; 56 | 57 | # Stash 58 | stsh = "stash"; 59 | stls = "stash list"; 60 | stp = "stash pop"; 61 | 62 | # Status 63 | s = "status"; 64 | st = "status -sb"; 65 | sti = "status --ignored"; 66 | 67 | # Diff & Comparison 68 | d = "diff"; 69 | dc = "diff --cached"; 70 | ds = "diff --staged"; 71 | d1 = "diff HEAD~1 HEAD"; 72 | d2 = "diff HEAD~2 HEAD"; 73 | wdiff = "diff --word-diff"; 74 | 75 | # Logging 76 | l = "log --oneline --decorate --graph --all"; 77 | last = "log -1 HEAD"; 78 | lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; 79 | plog = "log --graph --pretty=format:'%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'"; 80 | tlog = "log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative"; 81 | rank = "shortlog -sn --no-merges"; 82 | 83 | # Bisect 84 | bis = "bisect"; 85 | bisg = "bisect good"; 86 | bisb = "bisect bad"; 87 | bisr = "bisect reset"; 88 | 89 | # Rebase & Cleanup 90 | rba = "rebase --abort"; 91 | rbc = "rebase --continue"; 92 | rbi = "rebase -i HEAD~5"; 93 | clean = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"; 94 | bdm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"; 95 | }; 96 | 97 | extraConfig = { 98 | color.ui = true; 99 | init.defaultBranch = "master"; 100 | format.signoff = "yes"; 101 | pull.rebase = true; 102 | commit.gpgSign = true; 103 | gpg.format = "openpgp"; 104 | }; 105 | 106 | ignores = [ 107 | # Compiled source # 108 | "*.o" 109 | "*.so" 110 | "*.a" 111 | "*.la" 112 | "*.lo" 113 | "*.class" 114 | "*.dll" 115 | "*.exe" 116 | "*.out" 117 | "*.pyc" 118 | "__pycache__/" 119 | ".DS_Store" 120 | 121 | # Compiled source # 122 | "*~" 123 | "*.bak" 124 | "*.swp" 125 | 126 | # etc # 127 | "node_modules" 128 | "tmp" 129 | "TODO" 130 | 131 | # nix 132 | "*result*" 133 | ".direnv" 134 | ".nix-defexpr/" 135 | ]; 136 | }; 137 | }; 138 | }; 139 | }; 140 | } 141 | -------------------------------------------------------------------------------- /modules/programs/gpg/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkEnableOption mkIf; 9 | 10 | guiCfg = config.vars.withGui; 11 | 12 | cfg = config.mine.gpg; 13 | in 14 | { 15 | options.mine.gpg = { 16 | enable = mkEnableOption "gpg"; 17 | }; 18 | 19 | config = mkIf cfg.enable { 20 | services.dbus.packages = [ pkgs.gcr ]; 21 | 22 | hm = 23 | { config, ... }: 24 | { 25 | programs.gpg = { 26 | enable = true; 27 | homedir = "${config.xdg.configHome}/gnupg"; 28 | }; 29 | 30 | # Fix pass 31 | services.gpg-agent = { 32 | enable = true; 33 | pinentry.package = if guiCfg then pkgs.pinentry-gnome3 else pkgs.pinentry-curses; 34 | extraConfig = '' 35 | allow-emacs-pinentry 36 | allow-loopback-pinentry 37 | allow-preset-passphrase 38 | ''; 39 | }; 40 | }; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /modules/programs/hyprland/cliphist.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | let 3 | inherit (lib) mkEnableOption mkIf; 4 | 5 | cfg = config.mine.cliphist; 6 | in 7 | { 8 | options.mine.cliphist = { 9 | enable = mkEnableOption "cliphist service"; 10 | }; 11 | 12 | config = mkIf cfg.enable { 13 | hm = { 14 | services.cliphist = { 15 | enable = true; 16 | allowImages = true; 17 | extraOptions = [ 18 | "-max-dedupe-search" 19 | "10" 20 | "-max-items" 21 | "500" 22 | ]; 23 | }; 24 | }; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /modules/programs/hyprland/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | let 8 | inherit (lib) 9 | mkEnableOption 10 | mkIf 11 | mkOption 12 | types 13 | mkMerge 14 | ; 15 | 16 | cfg = config.mine.hyprland; 17 | in 18 | { 19 | imports = [ 20 | ./cliphist.nix 21 | ./hypridle.nix 22 | ./hyprlock.nix 23 | ./settings.nix 24 | ]; 25 | 26 | options.mine.hyprland = { 27 | enable = mkEnableOption "hyprland"; 28 | 29 | package = mkOption { 30 | type = types.package; 31 | default = pkgs.hyprland; 32 | description = "The Hyprland package to use."; 33 | }; 34 | 35 | withUWSM = mkOption { 36 | type = types.bool; 37 | default = true; 38 | }; 39 | }; 40 | 41 | config = mkIf cfg.enable (mkMerge [ 42 | (mkIf cfg.withUWSM { 43 | programs.uwsm = { 44 | enable = true; 45 | waylandCompositors.hyprland = { 46 | binPath = "/run/current-system/sw/bin/Hyprland"; 47 | prettyName = "Hyprland"; 48 | comment = "Hyprland managed by UWSM"; 49 | }; 50 | }; 51 | 52 | environment.sessionVariables = { 53 | APP2UNIT_SLICES = "a=app-graphical.slice b=background-graphical.slice s=session-graphical.slice"; 54 | APP2UNIT_TYPE = "scope"; 55 | }; 56 | }) 57 | 58 | { 59 | programs.hyprland = { 60 | enable = true; 61 | package = cfg.package; 62 | portalPackage = pkgs.xdg-desktop-portal-hyprland; 63 | }; 64 | 65 | hm.wayland.windowManager.hyprland = { 66 | enable = true; 67 | 68 | extraConfig = '' 69 | # window resize 70 | bind = $mod, S, submap, resize 71 | 72 | submap = resize 73 | binde = , right, resizeactive, 10 0 74 | binde = , left, resizeactive, -10 0 75 | binde = , up, resizeactive, 0 -10 76 | binde = , down, resizeactive, 0 10 77 | bind = , escape, submap, reset 78 | submap = reset 79 | ''; 80 | }; 81 | } 82 | ]); 83 | } 84 | -------------------------------------------------------------------------------- /modules/programs/hyprland/hypridle.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkEnableOption mkIf getExe'; 9 | 10 | hyprlockPackage = config.hm.programs.hyprlock.package; 11 | 12 | cfg = config.mine.hypridle; 13 | in 14 | { 15 | options.mine.hypridle = { 16 | enable = mkEnableOption "hypridle service"; 17 | }; 18 | 19 | config = mkIf cfg.enable { 20 | hm = 21 | { config, ... }: 22 | let 23 | cfgwm = config.wayland.windowManager; 24 | in 25 | { 26 | services.hypridle = { 27 | enable = true; 28 | settings = { 29 | general = { 30 | before_sleep_cmd = "${pkgs.systemd}/bin/loginctl lock-session"; 31 | lock_cmd = "${lib.getExe hyprlockPackage}"; 32 | }; 33 | 34 | listener = [ 35 | { 36 | timeout = 300; 37 | on-timeout = "${lib.getExe hyprlockPackage}"; 38 | } 39 | { 40 | timeout = 350; 41 | on-timeout = "${getExe' cfgwm.hyprland.package "hyprctl"} dispatch dpms off; ${getExe' cfgwm.sway.package "swaymsg"} output HDMI-A-1 dpms off"; 42 | on-resume = "${getExe' cfgwm.hyprland.package "hyprctl"} dispatch dpms on; ${getExe' cfgwm.sway.package "swaymsg"} output HDMI-A-1 dpms on"; 43 | } 44 | ]; 45 | }; 46 | }; 47 | }; 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /modules/programs/hyprland/hyprlock.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | config, 4 | pkgs, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkEnableOption mkIf; 9 | inherit (config.mine.theme.colorScheme) palette; 10 | 11 | backgroundLink = pkgs.fetchurl { 12 | url = "https://w.wallhaven.cc/full/49/wallhaven-497wow.jpg"; 13 | hash = "sha256-OzpRjVb9gXnCGJW6mSai+E+TJUa5ycijxkOI2ch7PSQ="; 14 | }; 15 | 16 | cfg = config.mine.hyprlock; 17 | in 18 | { 19 | options.mine.hyprlock = { 20 | enable = mkEnableOption "hyprlock service"; 21 | }; 22 | 23 | config = mkIf cfg.enable { 24 | security.pam.services.hyprlock.text = "auth include login"; 25 | 26 | hm = 27 | { osConfig, ... }: 28 | { 29 | programs.hyprlock = { 30 | enable = true; 31 | settings = { 32 | general = { 33 | grace = 30; 34 | no_fade_in = true; 35 | hide_cursor = false; 36 | }; 37 | 38 | background = { 39 | path = "${backgroundLink}"; 40 | color = "rgb(${palette.base03})"; # fallback color if path is not set 41 | blur_size = 0; 42 | blur_passes = 0; 43 | }; 44 | 45 | input-field = { 46 | size = "400, 90"; 47 | position = "0, -449"; 48 | dots_center = true; 49 | fade_on_empty = false; 50 | font_family = osConfig.mine.fonts.main.name; 51 | outer_color = "rgb(${palette.base03})"; 52 | inner_color = "rgb(${palette.base00})"; 53 | font_color = "rgb(${palette.base05})"; 54 | fail_color = "rgb(${palette.base08})"; 55 | check_color = "rgb(${palette.base0A})"; 56 | capslock_color = "rgb(${palette.base0D})"; 57 | outline_thickness = 5; 58 | placeholder_text = "Input Password..."; 59 | shadow_passes = 2; 60 | }; 61 | }; 62 | }; 63 | }; 64 | }; 65 | } 66 | -------------------------------------------------------------------------------- /modules/programs/ncmpcpp/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkEnableOption mkIf; 9 | 10 | cfg = config.mine.ncmpcpp; 11 | in 12 | { 13 | options.mine.ncmpcpp.enable = mkEnableOption "ncmpcpp"; 14 | 15 | config = mkIf cfg.enable { 16 | hm = 17 | { config, ... }: 18 | { 19 | programs.ncmpcpp = { 20 | enable = true; 21 | 22 | package = pkgs.ncmpcpp.override { 23 | outputsSupport = true; # outputs screen 24 | visualizerSupport = false; # visualizer screen 25 | clockSupport = true; # clock screen 26 | taglibSupport = true; # tag editor 27 | }; 28 | 29 | mpdMusicDir = config.services.mpd.musicDirectory; 30 | 31 | settings = { 32 | # Miscelaneous 33 | ncmpcpp_directory = "${config.xdg.configHome}/ncmpcpp"; 34 | 35 | mpd_host = "localhost"; 36 | mpd_port = "6600"; 37 | 38 | # VISUALIZER 39 | # --- 40 | visualizer_data_source = "/tmp/mpd.fifo"; 41 | visualizer_output_name = "Visualizer"; 42 | visualizer_in_stereo = "no"; 43 | visualizer_fps = "60"; 44 | visualizer_type = "wave"; 45 | visualizer_look = "∗▐"; 46 | visualizer_color = "199,200,201,202,166,130,94,58,22"; 47 | visualizer_spectrum_smooth_look = "yes"; 48 | 49 | # GENERAL 50 | # --- 51 | lyrics_directory = "${config.xdg.configHome}/ncmpcpp/lyrics"; 52 | connected_message_on_startup = "yes"; 53 | cyclic_scrolling = "yes"; 54 | mouse_support = "yes"; 55 | mouse_list_scroll_whole_page = "yes"; 56 | lines_scrolled = "1"; 57 | message_delay_time = "1"; 58 | playlist_shorten_total_times = "yes"; 59 | playlist_display_mode = "columns"; 60 | browser_display_mode = "columns"; 61 | search_engine_display_mode = "columns"; 62 | playlist_editor_display_mode = "columns"; 63 | autocenter_mode = "yes"; 64 | centered_cursor = "yes"; 65 | user_interface = "alternative"; 66 | follow_now_playing_lyrics = "yes"; 67 | locked_screen_width_part = "50"; 68 | ask_for_locked_screen_width_part = "yes"; 69 | display_bitrate = "no"; 70 | external_editor = "nvim"; 71 | main_window_color = "default"; 72 | startup_screen = "playlist"; 73 | 74 | # PROGRESS BAR 75 | # --- 76 | progressbar_look = "━━━"; 77 | #progressbar_look = "▃▃▃"; 78 | progressbar_elapsed_color = "5"; 79 | progressbar_color = "black"; 80 | 81 | # UI VISIBILITY 82 | # --- 83 | header_visibility = "no"; 84 | statusbar_visibility = "yes"; 85 | titles_visibility = "yes"; 86 | enable_window_title = "yes"; 87 | 88 | # COLORS 89 | # --- 90 | statusbar_color = "white"; 91 | color1 = "white"; 92 | color2 = "blue"; 93 | 94 | # UI APPEARANCE 95 | # --- 96 | now_playing_prefix = "$b$2 $7 "; 97 | now_playing_suffix = " $/b$8"; 98 | current_item_prefix = "$b$7 $/b$3 "; 99 | current_item_suffix = " $8"; 100 | 101 | # song_columns_list_format = "(50)[]{t|fr:Title} (0)[magenta]{a}"; 102 | song_columns_list_format = "(30)[]{t|fr:Title} (5)[white]{n} (20)[green]{b} (20)[magenta]{a} (7)[blue]{l}"; 103 | 104 | # song_list_format = " {%t $R  $8%a$8}|{%f $R  $8%l$8} $8"; 105 | song_list_format = "{%a - }{%t}|{$8%f$9}$R{$3%l$9}"; 106 | 107 | song_status_format = "$b$7[$8󰒫 󰐎 󰓛 󰒬 $7] $7󰝗 {$8 %b }|{$8 %t }|{$8 %f }$7󰉾 $8"; 108 | 109 | song_window_title_format = "Now Playing .."; 110 | }; 111 | }; 112 | }; 113 | }; 114 | } 115 | -------------------------------------------------------------------------------- /modules/programs/nvim/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | inputs, 6 | ... 7 | }: 8 | let 9 | inherit (lib) mkEnableOption mkIf; 10 | 11 | cfg = config.mine.nvim; 12 | in 13 | { 14 | options.mine.nvim = { 15 | enable = mkEnableOption "nvim"; 16 | }; 17 | 18 | config = mkIf cfg.enable { 19 | environment.systemPackages = [ 20 | inputs.ludovico-nixvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /modules/programs/sway/bars.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | let 3 | inherit (lib) getExe; 4 | inherit (config.mine.theme.colorScheme) palette; 5 | in 6 | { 7 | hm = 8 | { config, osConfig, ... }: 9 | { 10 | wayland.windowManager.sway.config.bars = [ 11 | { 12 | command = "${getExe config.programs.waybar.package}"; 13 | position = "bottom"; 14 | 15 | fonts = { 16 | names = [ "${osConfig.mine.fonts.terminal.name}" ]; 17 | size = 10.0; 18 | }; 19 | colors = { 20 | background = "#${palette.base00}"; 21 | separator = "#${palette.base04}"; 22 | statusline = "#${palette.base05}"; 23 | focusedWorkspace = { 24 | border = "#${palette.base05}"; 25 | background = "#${palette.base0D}"; 26 | text = "#${palette.base00}"; 27 | }; 28 | activeWorkspace = { 29 | border = "#${palette.base05}"; 30 | background = "#${palette.base03}"; 31 | text = "#${palette.base05}"; 32 | }; 33 | inactiveWorkspace = { 34 | border = "#${palette.base03}"; 35 | background = "#${palette.base01}"; 36 | text = "#${palette.base05}"; 37 | }; 38 | urgentWorkspace = { 39 | border = "#${palette.base08}"; 40 | background = "#${palette.base08}"; 41 | text = "#${palette.base00}"; 42 | }; 43 | bindingMode = { 44 | border = "#${palette.base00}"; 45 | background = "#${palette.base0A}"; 46 | text = "#${palette.base00}"; 47 | }; 48 | }; 49 | } 50 | ]; 51 | }; 52 | } 53 | -------------------------------------------------------------------------------- /modules/programs/sway/config.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkIf getExe optionals; 9 | 10 | cfg = config.mine.sway; 11 | 12 | uwsm = config.programs.uwsm.package; 13 | in 14 | { 15 | hm = 16 | { osConfig, ... }: 17 | { 18 | wayland.windowManager.sway.config = { 19 | modifier = "Mod4"; 20 | terminal = "${osConfig.vars.terminal}"; 21 | menu = "${getExe pkgs.fuzzel}"; 22 | startup = 23 | [ 24 | (mkIf cfg.withUWSM { command = "${getExe uwsm} finalize"; }) 25 | { command = "${getExe pkgs.thunderbird}"; } 26 | { command = "${getExe pkgs.brightnessctl} set 10%"; } 27 | ] 28 | ++ optionals config.services.desktopManager.gnome.enable [ 29 | "systemctl --user stop xdg-desktop-portal-gnome.service" 30 | ] 31 | ++ optionals config.services.desktopManager.plasma6.enable [ 32 | "systemctl --user stop xdg-desktop-portal-kde.service" 33 | "systemctl --user stop plasma-xdg-desktop-portal-kde.service" 34 | ]; 35 | 36 | output = { 37 | "eDP-1" = { 38 | disable = ""; 39 | }; 40 | "HDMI-A-1" = { 41 | mode = "1920x1080@144Hz"; 42 | scale = "1"; 43 | adaptive_sync = "on"; 44 | }; 45 | }; 46 | 47 | input = { 48 | "type:touchpad" = { 49 | dwt = "enabled"; 50 | tap = "enabled"; 51 | natural_scroll = "enabled"; 52 | }; 53 | "type:keyboard" = { 54 | xkb_options = "ctrl:nocaps"; 55 | repeat_delay = "300"; 56 | repeat_rate = "30"; 57 | }; 58 | }; 59 | floating = { 60 | border = 2; 61 | titlebar = true; 62 | criteria = [ 63 | { window_role = "pop-up"; } 64 | { window_role = "bubble"; } 65 | { window_role = "dialog"; } 66 | { window_type = "dialog"; } 67 | { app_id = "lutris"; } 68 | { app_id = "thunar"; } 69 | { app_id = "pavucontrol"; } 70 | { class = ".*.exe"; } # Wine apps 71 | { class = "steam_app.*"; } # Steam games 72 | { class = "^Steam$"; } # Steam itself 73 | ]; 74 | }; 75 | gaps = { 76 | inner = 0; 77 | outer = 0; 78 | }; 79 | fonts = { 80 | names = [ "${osConfig.mine.fonts.terminal.name}" ]; 81 | size = 10.0; 82 | }; 83 | }; 84 | }; 85 | } 86 | -------------------------------------------------------------------------------- /modules/programs/sway/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | let 3 | inherit (lib) 4 | mkEnableOption 5 | mkIf 6 | mkOption 7 | mkMerge 8 | types 9 | ; 10 | 11 | cfg = config.mine.sway; 12 | in 13 | { 14 | imports = [ 15 | ./config.nix 16 | ./bars.nix 17 | ./keybindings.nix 18 | ./window.nix 19 | ]; 20 | 21 | options.mine.sway = { 22 | enable = mkEnableOption "sway"; 23 | 24 | withUWSM = mkOption { 25 | type = types.bool; 26 | default = true; 27 | }; 28 | }; 29 | 30 | config = mkIf cfg.enable (mkMerge [ 31 | (mkIf cfg.withUWSM { 32 | programs.uwsm = { 33 | enable = true; 34 | waylandCompositors.sway = { 35 | binPath = "/etc/profiles/per-user/airi/bin/sway"; 36 | prettyName = "Sway"; 37 | comment = "Sway managed by UWSM"; 38 | }; 39 | }; 40 | 41 | environment.sessionVariables = { 42 | APP2UNIT_SLICES = "a=app-graphical.slice b=background-graphical.slice s=session-graphical.slice"; 43 | APP2UNIT_TYPE = "scope"; 44 | }; 45 | }) 46 | 47 | { 48 | hm = 49 | let 50 | inherit (config.mine.theme.colorScheme) palette; 51 | background = palette.base00; 52 | indicator = palette.base0B; 53 | text = palette.base05; 54 | urgent = palette.base08; 55 | focused = palette.base0D; 56 | unfocused = palette.base03; 57 | in 58 | { 59 | wayland.windowManager.sway = { 60 | enable = true; 61 | systemd.enable = true; 62 | config.colors = { 63 | urgent = { 64 | inherit background indicator text; 65 | border = urgent; 66 | childBorder = urgent; 67 | }; 68 | focused = { 69 | inherit background indicator text; 70 | border = focused; 71 | childBorder = focused; 72 | }; 73 | focusedInactive = { 74 | inherit background indicator text; 75 | border = unfocused; 76 | childBorder = unfocused; 77 | }; 78 | unfocused = { 79 | inherit background indicator text; 80 | border = unfocused; 81 | childBorder = unfocused; 82 | }; 83 | placeholder = { 84 | inherit background indicator text; 85 | border = unfocused; 86 | childBorder = unfocused; 87 | }; 88 | }; 89 | }; 90 | }; 91 | } 92 | ]); 93 | } 94 | -------------------------------------------------------------------------------- /modules/programs/sway/keybindings.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | inputs, 6 | ... 7 | }: 8 | let 9 | inherit (lib) getExe getExe'; 10 | 11 | cfg = config.mine.sway; 12 | cfgsway = config.hm.wayland.windowManager.sway.config; 13 | 14 | mod = cfgsway.modifier; 15 | amixer = "${getExe' pkgs.alsa-utils "amixer"}"; 16 | brightnessctl = "${getExe pkgs.brightnessctl}"; 17 | playerctl = "${getExe pkgs.playerctl}"; 18 | clipboard = "${getExe pkgs.cliphist} list | ${getExe pkgs.fuzzel} --dmenu | ${getExe pkgs.cliphist} decode | ${getExe' pkgs.wl-clipboard "wl-copy"}"; 19 | emojiPicker = getExe inputs.ludovico-pkgs.packages.${pkgs.stdenv.hostPlatform.system}.fuzzmoji; 20 | 21 | app2unit = 22 | if cfg.withUWSM then 23 | "${getExe inputs.ludovico-pkgs.packages.${pkgs.stdenv.hostPlatform.system}.app2unit} --" 24 | else 25 | ""; 26 | in 27 | { 28 | hm = { 29 | wayland.windowManager.sway.config.keybindings = { 30 | # Kill focused window 31 | "${mod}+w" = "kill"; 32 | 33 | # Reload the configuration file 34 | "${mod}+Shift+r" = "reload"; 35 | 36 | # Wleave 37 | "${mod}+x" = "exec ${getExe pkgs.wleave}"; 38 | 39 | # Exit sway 40 | "${mod}+Shift+c" = "exit"; 41 | 42 | ### Moving around 43 | # Move your focus around 44 | "${mod}+h" = "focus left"; 45 | "${mod}+l" = "focus right"; 46 | 47 | # Move the focused window with the same, but add Shift 48 | "${mod}+Shift+h" = "move left"; 49 | "${mod}+Shift+j" = "move down"; 50 | "${mod}+Shift+k" = "move up"; 51 | "${mod}+Shift+l" = "move right"; 52 | 53 | ### Workspaces 54 | # Switch to workspace 55 | "${mod}+1" = "workspace 1"; 56 | "${mod}+2" = "workspace 2"; 57 | "${mod}+3" = "workspace 3"; 58 | "${mod}+4" = "workspace 4"; 59 | "${mod}+5" = "workspace 5"; 60 | "${mod}+6" = "workspace 6"; 61 | "${mod}+7" = "workspace 7"; 62 | "${mod}+8" = "workspace 8"; 63 | "${mod}+9" = "workspace 9"; 64 | 65 | # Move focused container to workspace 66 | "${mod}+Shift+1" = "move container to workspace 1"; 67 | "${mod}+Shift+2" = "move container to workspace 2"; 68 | "${mod}+Shift+3" = "move container to workspace 3"; 69 | "${mod}+Shift+4" = "move container to workspace 4"; 70 | "${mod}+Shift+5" = "move container to workspace 5"; 71 | "${mod}+Shift+6" = "move container to workspace 6"; 72 | "${mod}+Shift+7" = "move container to workspace 7"; 73 | "${mod}+Shift+8" = "move container to workspace 8"; 74 | "${mod}+Shift+9" = "move container to workspace 9"; 75 | 76 | ### Resizing containers 77 | "${mod}+s" = "mode resize"; 78 | "${mod}+Left" = "resize shrink width 10px"; 79 | "${mod}+Right" = "resize grow width 10px"; 80 | "${mod}+Down" = "resize shrink height 10px"; 81 | "${mod}+Up" = "resize grow height 10px"; 82 | 83 | ### Scratchpad 84 | # Move the currently focused window to the scratchpad 85 | "${mod}+Shift+q" = "move scratchpad"; 86 | 87 | # Show the next scratchpad window or hide the focused scratchpad window. 88 | # If there are multiple scratchpad windows, this command cycles through them. 89 | "${mod}+q" = "scratchpad show"; 90 | 91 | # Fullscreen 92 | "${mod}+f" = "fullscreen"; 93 | 94 | ### Layout stuff 95 | "${mod}+c" = "splith"; 96 | "${mod}+v" = "splitv"; 97 | 98 | # Switch the current container between different layout styles 99 | "${mod}+r" = "layout stacking"; 100 | "${mod}+e" = "layout toggle split"; 101 | "${mod}+t" = "layout tabbed"; 102 | 103 | # Toggle the current focus between tiling and floating mode 104 | "${mod}+Space" = "floating toggle"; 105 | 106 | ### Apps 107 | "${mod}+Return" = "exec ${app2unit} '${cfgsway.terminal}'"; 108 | 109 | "${mod}+o" = "exec ${app2unit} ${clipboard}"; 110 | "${mod}+Shift+o" = "exec ${app2unit} '${emojiPicker}'"; 111 | "${mod}+p" = "exec ${app2unit} '${cfgsway.menu}'"; 112 | "${mod}+g" = "exec ${app2unit} 'firefox'"; 113 | "${mod}+Shift+g" = "exec ${app2unit} 'zen-beta'"; 114 | "${mod}+d" = "exec ${app2unit} 'vesktop'"; 115 | "${mod}+Shift+e" = "exec ${app2unit} '${getExe pkgs.xfce.thunar}'"; 116 | 117 | ### Screenshot 118 | "Print" = "exec ${app2unit} wl-ocr"; 119 | "CTRL+Print" = 120 | "exec ${app2unit} ${getExe pkgs.grim} -g \"$(${getExe pkgs.slurp})\" - | ${getExe pkgs.swappy} -f -"; 121 | 122 | # Volume 123 | # (un)mute output 124 | XF86AudioMute = "exec ${amixer} set Master toggle"; 125 | # increase output volume 126 | XF86AudioRaiseVolume = "exec ${amixer} -q set Master 5%+"; 127 | # decrease output volume 128 | XF86AudioLowerVolume = "exec ${amixer} -q set Master 5%-"; 129 | 130 | # Media control 131 | XF86AudioPlay = "exec ${playerctl} play-pause"; 132 | XF86AudioNext = "exec ${playerctl} next"; 133 | XF86AudioPrev = "exec ${playerctl} previous"; 134 | XF86AudioStop = "exec ${playerctl} stop"; 135 | 136 | # Brightness 137 | XF86MonBrightnessUp = "exec ${brightnessctl} set 5%+"; 138 | XF86MonBrightnessDown = "exec ${brightnessctl} set 5%-"; 139 | }; 140 | }; 141 | } 142 | -------------------------------------------------------------------------------- /modules/programs/sway/window.nix: -------------------------------------------------------------------------------- 1 | { 2 | hm.wayland.windowManager.sway.config.window = { 3 | border = 2; 4 | titlebar = false; 5 | commands = [ 6 | { 7 | criteria = { 8 | title = "(?i)(open|save)( as)? (file|folder|directory)?"; 9 | }; 10 | command = "floating enable, resize set width 800 height 600"; 11 | } 12 | 13 | # Handle popup/dialog globally 14 | { 15 | criteria = { 16 | window_role = "popup"; 17 | }; 18 | command = "floating enable"; 19 | } 20 | { 21 | criteria = { 22 | app_id = "xdg-desktop-portal"; 23 | }; 24 | command = "floating enable, resize set width 800 height 600"; 25 | } 26 | { 27 | criteria = { 28 | app_id = "thunderbird"; 29 | }; 30 | command = "move to workspace 9"; 31 | } 32 | { 33 | criteria = { 34 | app_id = "^(tidal-hifi|org.fooyin.fooyin)$"; 35 | }; 36 | command = "move to workspace 5"; 37 | } 38 | { 39 | criteria = { 40 | app_id = "org.telegram.desktop"; 41 | }; 42 | command = "move to workspace 4"; 43 | } 44 | { 45 | criteria = { 46 | app_id = "^(discord|vesktop|WebCord)$"; 47 | }; 48 | command = "move to workspace 3"; 49 | } 50 | { 51 | criteria = { 52 | app_id = "^(chromium-browser|firefox|floorp|zen-beta)$"; 53 | }; 54 | command = "move to workspace 2"; 55 | } 56 | ]; 57 | }; 58 | } 59 | -------------------------------------------------------------------------------- /modules/programs/tmux/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkEnableOption mkIf; 9 | 10 | cfg = config.mine.tmux; 11 | in 12 | { 13 | options.mine.tmux = { 14 | enable = mkEnableOption "tmux"; 15 | }; 16 | 17 | config = mkIf cfg.enable { 18 | hm.programs.tmux = { 19 | enable = true; 20 | prefix = "C-a"; # Sets the prefix key to Ctrl+a 21 | keyMode = "vi"; # Enables vi-style keybindings 22 | mouse = true; # Enables mouse support 23 | historyLimit = 10000; # Sets the scrollback buffer size 24 | escapeTime = 10; # Sets the escape time in milliseconds 25 | baseIndex = 1; # Sets window and pane numbering to start at 1 26 | terminal = "screen-256color"; # Sets the terminal type 27 | resizeAmount = 5; # Sets the pane resize amount 28 | customPaneNavigationAndResize = true; # Enables custom pane navigation and resizing 29 | reverseSplit = false; # Keeps default split directions 30 | disableConfirmationPrompt = true; # Disables confirmation prompts 31 | extraConfig = '' 32 | # Pane navigation 33 | bind h select-pane -L 34 | bind j select-pane -D 35 | bind k select-pane -U 36 | bind l select-pane -R 37 | 38 | # Pane resizing 39 | bind -r H resize-pane -L 5 40 | bind -r J resize-pane -D 5 41 | bind -r K resize-pane -U 5 42 | bind -r L resize-pane -R 5 43 | 44 | # Splits 45 | bind v split-window -v 46 | bind \; split-window -h 47 | 48 | # Tabs (windows) 49 | bind c new-window 50 | bind 1 select-window -t 1 51 | bind 2 select-window -t 2 52 | bind 3 select-window -t 3 53 | bind 4 select-window -t 4 54 | bind 5 select-window -t 5 55 | bind 6 select-window -t 6 56 | bind 7 select-window -t 7 57 | bind 8 select-window -t 8 58 | 59 | # Copy mode 60 | bind [ copy-mode 61 | 62 | # Send Ctrl+A 63 | bind C-a send-prefix 64 | ''; 65 | }; 66 | }; 67 | } 68 | -------------------------------------------------------------------------------- /modules/programs/waybar/style.nix: -------------------------------------------------------------------------------- 1 | { config, ... }: 2 | let 3 | inherit (config.mine.theme.colorScheme) palette; 4 | in 5 | { 6 | hm.programs.waybar.style = '' 7 | * { 8 | font-family: 9 | "${config.mine.fonts.terminal.name} Semibold", 10 | "${config.mine.fonts.icon.name}", 11 | monospace; 12 | font-size: ${toString config.mine.fonts.size}px; 13 | } 14 | 15 | window#waybar { 16 | background-color: #${palette.base00}; 17 | color: #${palette.base05}; 18 | border-bottom: 2px solid #${palette.base01}; 19 | transition-property: background-color; 20 | transition-duration: 0.5s; 21 | } 22 | 23 | window#waybar.hidden { 24 | opacity: 0.5; 25 | } 26 | 27 | #custom-menu { 28 | background-color: #${palette.base01}; 29 | 30 | font-size: 18px; 31 | border-radius: 0px 14px 0px 0px; 32 | margin: 0px 0px 0px 0px; 33 | padding: 2px 8px 2px 8px; 34 | } 35 | 36 | #custom-disk_home { 37 | color: #${palette.base0D}; 38 | } 39 | 40 | #custom-wireguard { 41 | color: #${palette.base0B}; 42 | } 43 | 44 | #custom-disk_root { 45 | color: #${palette.base0D}; 46 | } 47 | 48 | #custom-power { 49 | background-color: #${palette.base08}; 50 | font-size: 16px; 51 | } 52 | 53 | #custom-power, 54 | #custom-themes { 55 | color: #${palette.base00}; 56 | border-radius: 10px; 57 | margin: 6px 6px 6px 0px; 58 | padding: 2px 8px 2px 8px; 59 | } 60 | 61 | #idle_inhibitor { 62 | background-color: #${palette.base0B}; 63 | color: #${palette.base00}; 64 | border-radius: 10px; 65 | margin: 6px 0px 6px 6px; 66 | padding: 4px 6px; 67 | } 68 | 69 | #idle_inhibitor.deactivated { 70 | background-color: #${palette.base08}; 71 | } 72 | 73 | #tray { 74 | background-color: #${palette.base01}; 75 | border-radius: 10px; 76 | margin: 6px 0px 6px 6px; 77 | padding: 4px 6px; 78 | } 79 | 80 | #tray > .passive { 81 | -gtk-icon-effect: dim; 82 | } 83 | 84 | #tray > .needs-attention { 85 | -gtk-icon-effect: highlight; 86 | } 87 | 88 | #tray > .active { 89 | } 90 | 91 | @keyframes gradient { 92 | 0% { 93 | background-position: 0% 50%; 94 | } 95 | 96 | 50% { 97 | background-position: 100% 50%; 98 | } 99 | 100 | 100% { 101 | background-position: 0% 50%; 102 | } 103 | } 104 | 105 | #mpd { 106 | color: #${palette.base05}; 107 | font-size: 12px; 108 | font-weight: bold; 109 | } 110 | 111 | #mpd.disconnected { 112 | color: #${palette.base08}; 113 | } 114 | 115 | #mpd.stopped { 116 | color: #${palette.base08}; 117 | } 118 | 119 | #mpd.playing { 120 | color: #${palette.base0C}; 121 | } 122 | 123 | #mpd.paused { 124 | } 125 | 126 | #mpd.2 { 127 | border-radius: 10px 0px 0px 10px; 128 | margin: 6px 0px 6px 6px; 129 | padding: 4px 6px 4px 10px; 130 | } 131 | 132 | #mpd.3 { 133 | margin: 6px 0px 6px 0px; 134 | padding: 4px; 135 | } 136 | 137 | #mpd.4 { 138 | border-radius: 0px 10px 10px 0px; 139 | margin: 6px 6px 6px 0px; 140 | padding: 4px 10px 4px 6px; 141 | } 142 | 143 | #mpd.2, 144 | #mpd.3, 145 | #mpd.4 { 146 | background-color: #${palette.base01}; 147 | font-size: 14px; 148 | } 149 | 150 | #custom-spotify { 151 | background-color: #${palette.base01}; 152 | color: #${palette.base05}; 153 | border-radius: 10px; 154 | margin: 6px 0px 6px 6px; 155 | padding: 4px 8px; 156 | font-size: 12px; 157 | font-weight: bold; 158 | } 159 | 160 | #custom-spotify.paused { 161 | color: #${palette.base05}; 162 | } 163 | 164 | #custom-spotify.playing { 165 | background: linear-gradient( 166 | 90deg, 167 | #${palette.base09} 25%, 168 | #${palette.base08} 50%, 169 | #${palette.base0A} 75%, 170 | #${palette.base0C} 100% 171 | ); 172 | background-size: 300% 300%; 173 | animation: gradient 10s ease infinite; 174 | color: #${palette.base00}; 175 | } 176 | 177 | #custom-spotify.offline { 178 | color: #${palette.base08}; 179 | } 180 | 181 | #cpu { 182 | color: #${palette.base08}; 183 | } 184 | 185 | #disk { 186 | color: #${palette.base0A}; 187 | } 188 | 189 | #pulseaudio { 190 | color: #${palette.base0D}; 191 | } 192 | 193 | #pulseaudio.bluetooth { 194 | color: #${palette.base0C}; 195 | } 196 | 197 | #pulseaudio.muted { 198 | color: #${palette.base08}; 199 | } 200 | 201 | #pulseaudio.2 { 202 | } 203 | 204 | #pulseaudio.2.bluetooth { 205 | } 206 | 207 | #pulseaudio.2.muted { 208 | } 209 | 210 | #backlight { 211 | color: #${palette.base09}; 212 | } 213 | 214 | #battery { 215 | color: #${palette.base0C}; 216 | } 217 | 218 | #battery.charging { 219 | } 220 | 221 | #battery.plugged { 222 | } 223 | 224 | @keyframes blink { 225 | to { 226 | color: #${palette.base05}; 227 | } 228 | } 229 | 230 | #battery.critical:not(.charging) { 231 | background-color: #${palette.base02}; 232 | } 233 | 234 | #battery.2.critical:not(.charging) { 235 | background-color: #${palette.base01}; 236 | color: #${palette.base08}; 237 | animation-name: blink; 238 | animation-duration: 0.5s; 239 | animation-timing-function: linear; 240 | animation-iteration-count: infinite; 241 | animation-direction: alternate; 242 | } 243 | 244 | #bluetooth { 245 | color: #${palette.base0B}; 246 | } 247 | 248 | #bluetooth.disabled { 249 | color: #${palette.base08}; 250 | } 251 | 252 | #bluetooth.off { 253 | color: #${palette.base08}; 254 | } 255 | 256 | #bluetooth.on { 257 | } 258 | 259 | #bluetooth.connected { 260 | } 261 | 262 | #bluetooth.discoverable { 263 | } 264 | 265 | #bluetooth.discovering { 266 | } 267 | 268 | #bluetooth.pairable { 269 | } 270 | 271 | #clock { 272 | color: #${palette.base0D}; 273 | } 274 | 275 | #custom-date { 276 | color: #${palette.base0D}; 277 | } 278 | 279 | #network { 280 | color: #${palette.base0E}; 281 | } 282 | 283 | #submap { 284 | background-color: #${palette.base00}; 285 | color: #${palette.base05}; 286 | } 287 | 288 | #workspaces { 289 | background-color: #${palette.base00}; 290 | margin: 6px; 291 | padding: 0px; 292 | } 293 | 294 | #workspaces button { 295 | color: #${palette.base05}; 296 | padding: 5px; 297 | background-color: #${palette.base00}; 298 | border-radius: 10px; 299 | } 300 | 301 | #workspaces button.empty { 302 | color: #${palette.base04}; 303 | background-color: #${palette.base00}; 304 | } 305 | 306 | #workspaces button.visible { 307 | color: #${palette.base04}; 308 | } 309 | 310 | #workspaces button.focused { 311 | color: #${palette.base00}; 312 | background-color: #${palette.base07}; 313 | } 314 | 315 | #workspaces button.active { 316 | color: #${palette.base00}; 317 | background-color: #${palette.base07}; 318 | } 319 | 320 | #workspaces button:hover { 321 | color: #${palette.base00}; 322 | background-color: #${palette.base0E}; 323 | } 324 | 325 | #backlight, 326 | #battery, 327 | #clock, 328 | #cpu, 329 | #custom-date, 330 | #custom-disk_root, 331 | #custom-disk_home, 332 | #custom-wireguard, 333 | #disk, 334 | #pulseaudio, 335 | #network, 336 | #bluetooth { 337 | background-color: #${palette.base02}; 338 | border-radius: 10px 0px 0px 10px; 339 | margin: 6px 0px 6px 0px; 340 | padding: 4px 6px; 341 | } 342 | 343 | #backlight.2, 344 | #battery.2, 345 | #clock.2, 346 | #cpu.2, 347 | #disk.2, 348 | #pulseaudio.2, 349 | #network.2, 350 | #bluetooth.2 { 351 | background-color: #${palette.base01}; 352 | color: #${palette.base05}; 353 | font-size: 12px; 354 | font-weight: bold; 355 | border-radius: 0px 10px 10px 0px; 356 | margin: 6px 6px 6px 0px; 357 | padding: 5px 6px 4px 6px; 358 | } 359 | ''; 360 | } 361 | -------------------------------------------------------------------------------- /modules/programs/wezterm/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | let 3 | inherit (lib) mkEnableOption mkIf; 4 | inherit (config.mine.theme.colorScheme) palette; 5 | 6 | cfg = config.mine.wezterm; 7 | in 8 | { 9 | options.mine.wezterm = { 10 | enable = mkEnableOption "wezterm"; 11 | }; 12 | 13 | config = mkIf cfg.enable { 14 | hm = { 15 | programs.wezterm = { 16 | enable = true; 17 | extraConfig = '' 18 | local wezterm = require("wezterm") 19 | 20 | -- Watch the config directory for changes and reload automatically 21 | wezterm.add_to_config_reload_watch_list(wezterm.config_dir) 22 | 23 | -- Initialize the main config table, supporting both release and nightly 24 | local config = {} 25 | if wezterm.config_builder then 26 | config = wezterm.config_builder() 27 | end 28 | 29 | local function make_user_config() 30 | return { 31 | -- Fonts (intentionally unchanged) 32 | font = wezterm.font_with_fallback({ 33 | "${config.mine.fonts.terminal.name} Semibold", 34 | "${config.mine.fonts.icon.name}", 35 | "${config.mine.fonts.emoji.name}", 36 | }), 37 | 38 | -- Wayland and UI settings 39 | enable_wayland = true, 40 | enable_scroll_bar = false, 41 | enable_kitty_keyboard = true, 42 | check_for_updates = false, 43 | default_cursor_style = "SteadyBlock", 44 | use_fancy_tab_bar = false, 45 | hide_tab_bar_if_only_one_tab = true, 46 | enable_tab_bar = true, 47 | scrollback_lines = 10000, 48 | adjust_window_size_when_changing_font_size = false, 49 | audible_bell = "Disabled", 50 | clean_exit_codes = { 130 }, 51 | window_background_opacity = ${toString config.vars.opacity}, 52 | 53 | -- Window frame styling 54 | window_frame = { 55 | active_titlebar_bg = "#${palette.base03}", 56 | active_titlebar_fg = "#${palette.base05}", 57 | active_titlebar_border_bottom = "#${palette.base03}", 58 | border_left_color = "#${palette.base01}", 59 | border_right_color = "#${palette.base01}", 60 | border_bottom_color = "#${palette.base01}", 61 | border_top_color = "#${palette.base01}", 62 | button_bg = "#${palette.base01}", 63 | button_fg = "#${palette.base05}", 64 | button_hover_bg = "#${palette.base05}", 65 | button_hover_fg = "#${palette.base03}", 66 | inactive_titlebar_bg = "#${palette.base01}", 67 | inactive_titlebar_fg = "#${palette.base05}", 68 | inactive_titlebar_border_bottom = "#${palette.base03}", 69 | }, 70 | 71 | -- Tab bar colors 72 | colors = { 73 | ansi = { 74 | "#${palette.base00}", 75 | "#${palette.base08}", 76 | "#${palette.base0B}", 77 | "#${palette.base0A}", 78 | "#${palette.base0D}", 79 | "#${palette.base0E}", 80 | "#${palette.base0C}", 81 | "#${palette.base05}", 82 | }, 83 | brights = { 84 | "#${palette.base03}", 85 | "#${palette.base08}", 86 | "#${palette.base0B}", 87 | "#${palette.base0A}", 88 | "#${palette.base0D}", 89 | "#${palette.base0E}", 90 | "#${palette.base0C}", 91 | "#${palette.base07}", 92 | }, 93 | background = "#${palette.base00}", 94 | cursor_bg = "#${palette.base05}", 95 | cursor_fg = "#${palette.base00}", 96 | compose_cursor = "#${palette.base06}", 97 | foreground = "#${palette.base05}", 98 | scrollbar_thumb = "#${palette.base01}", 99 | selection_bg = "#${palette.base05}", 100 | selection_fg = "#${palette.base00}", 101 | split = "#${palette.base03}", 102 | visual_bell = "#${palette.base09}", 103 | tab_bar = { 104 | background = "#${palette.base01}", 105 | inactive_tab_edge = "#${palette.base01}", 106 | active_tab = { 107 | bg_color = "#${palette.base00}", 108 | fg_color = "#${palette.base05}", 109 | }, 110 | inactive_tab = { 111 | bg_color = "#${palette.base03}", 112 | fg_color = "#${palette.base05}", 113 | }, 114 | inactive_tab_hover = { 115 | bg_color = "#${palette.base05}", 116 | fg_color = "#${palette.base00}", 117 | }, 118 | new_tab = { 119 | bg_color = "#${palette.base03}", 120 | fg_color = "#${palette.base05}", 121 | }, 122 | new_tab_hover = { 123 | bg_color = "#${palette.base05}", 124 | fg_color = "#${palette.base00}", 125 | }, 126 | }, 127 | }, 128 | 129 | -- Command palette 130 | command_palette_bg_color = "#${palette.base01}", 131 | command_palette_fg_color = "#${palette.base05}", 132 | command_palette_font_size = ${toString config.mine.fonts.size}, 133 | 134 | -- Leader key and shortcuts 135 | leader = { key = "a", mods = "CTRL", timeout_milliseconds = 1000 }, 136 | keys = { 137 | -- Scrolling 138 | { key = "UpArrow", mods = "SHIFT", action = wezterm.action.ScrollByLine(-1) }, 139 | { key = "DownArrow", mods = "SHIFT", action = wezterm.action.ScrollByLine(1) }, 140 | -- Pane navigation 141 | { key = "h", mods = "LEADER", action = wezterm.action.ActivatePaneDirection("Left") }, 142 | { key = "j", mods = "LEADER", action = wezterm.action.ActivatePaneDirection("Down") }, 143 | { key = "k", mods = "LEADER", action = wezterm.action.ActivatePaneDirection("Up") }, 144 | { key = "l", mods = "LEADER", action = wezterm.action.ActivatePaneDirection("Right") }, 145 | -- Copy mode 146 | { key = "[", mods = "LEADER", action = wezterm.action.ActivateCopyMode }, 147 | -- Command palette 148 | { key = "p", mods = "CMD|SHIFT", action = wezterm.action.ActivateCommandPalette }, 149 | -- Splits 150 | { key = "v", mods = "LEADER", action = wezterm.action.SplitPane({ direction = "Down", size = { Percent = 45 } }) }, 151 | { key = ";", mods = "LEADER", action = wezterm.action.SplitPane({ direction = "Right", size = { Percent = 45 } }) }, 152 | -- Tabs 153 | { key = "c", mods = "LEADER", action = wezterm.action.SpawnTab("CurrentPaneDomain") }, 154 | -- Tab switching 155 | { key = "1", mods = "LEADER", action = wezterm.action({ ActivateTab = 0 }) }, 156 | { key = "2", mods = "LEADER", action = wezterm.action({ ActivateTab = 1 }) }, 157 | { key = "3", mods = "LEADER", action = wezterm.action({ ActivateTab = 2 }) }, 158 | { key = "4", mods = "LEADER", action = wezterm.action({ ActivateTab = 3 }) }, 159 | { key = "5", mods = "LEADER", action = wezterm.action({ ActivateTab = 4 }) }, 160 | { key = "6", mods = "LEADER", action = wezterm.action({ ActivateTab = 5 }) }, 161 | { key = "7", mods = "LEADER", action = wezterm.action({ ActivateTab = 6 }) }, 162 | { key = "8", mods = "LEADER", action = wezterm.action({ ActivateTab = 7 }) }, 163 | -- Send Ctrl+A 164 | { key = "a", mods = "LEADER|CTRL", action = wezterm.action.SendString("\x01") }, 165 | }, 166 | } 167 | end 168 | 169 | for k, v in pairs(make_user_config()) do 170 | config[k] = v 171 | end 172 | 173 | -- Add URL hyperlink rules for Markdown handling 174 | -- Source: https://github.com/wez/wezterm/issues/3803#issuecomment-1608954312 175 | config.hyperlink_rules = { 176 | { regex = '\\((\\w+://\\S+)\\)', format = '$1', highlight = 1 }, 177 | { regex = '\\[(\\w+://\\S+)\\]', format = '$1', highlight = 1 }, 178 | { regex = '\\{(\\w+://\\S+)\\}', format = '$1', highlight = 1 }, 179 | { regex = '<(\\w+://\\S+)>', format = '$1', highlight = 1 }, 180 | { regex = '[^(]\\b(\\w+://\\S+[)/a-zA-Z0-9-]+)',format='$1', highlight = 1 }, 181 | { regex = '\\b\\w+@[\\w-]+(\\.[\\w-]+)+\\b', format = 'mailto:$0' }, 182 | } 183 | 184 | -- Load and apply user-specific overrides if available 185 | if wezterm.config_builder then 186 | if type(user_conf) == "table" then 187 | for k, v in pairs(user_conf) do 188 | config[k] = v 189 | end 190 | end 191 | end 192 | 193 | return config 194 | ''; 195 | }; 196 | }; 197 | }; 198 | } 199 | -------------------------------------------------------------------------------- /modules/programs/wleave/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | config, 4 | lib, 5 | ... 6 | }: 7 | let 8 | inherit (lib) 9 | mkEnableOption 10 | mkOption 11 | mkIf 12 | types 13 | getExe 14 | ; 15 | inherit (config.mine.theme.colorScheme) palette; 16 | 17 | wleaveIconPath = "${pkgs.wleave}/share/wleave/icons"; 18 | 19 | cfg = config.mine.wleave; 20 | in 21 | { 22 | options.mine.wleave = { 23 | enable = mkEnableOption "wleave"; 24 | 25 | package = mkOption { 26 | type = types.package; 27 | default = pkgs.wleave; 28 | description = "The wleave package to use."; 29 | }; 30 | }; 31 | 32 | config = mkIf cfg.enable { 33 | hm = { 34 | home.packages = [ cfg.package ]; 35 | 36 | xdg.configFile = { 37 | "wleave/layout".text = '' 38 | { 39 | "label" : "lock", 40 | "action" : "${getExe pkgs.hyprlock} --immediate --immediate-render", 41 | "text" : "Lock", 42 | "keybind" : "l" 43 | } 44 | { 45 | "label" : "hibernate", 46 | "action" : "systemctl hibernate", 47 | "text" : "Hibernate", 48 | "keybind" : "h" 49 | } 50 | { 51 | "label" : "logout", 52 | "action" : "${getExe config.programs.uwsm.package} stop", 53 | "text" : "Logout", 54 | "keybind" : "e" 55 | } 56 | { 57 | "label" : "shutdown", 58 | "action" : "systemctl poweroff", 59 | "text" : "Shutdown", 60 | "keybind" : "s" 61 | } 62 | { 63 | "label" : "suspend", 64 | "action" : "systemctl suspend", 65 | "text" : "Suspend", 66 | "keybind" : "u" 67 | } 68 | { 69 | "label" : "reboot", 70 | "action" : "systemctl reboot", 71 | "text" : "Reboot", 72 | "keybind" : "r" 73 | } 74 | ''; 75 | 76 | "wleave/style.css".text = '' 77 | * { 78 | background-image: none; 79 | font-family: "${config.mine.fonts.main.name}"; 80 | } 81 | 82 | window { 83 | background-color: #${palette.base01}; 84 | } 85 | 86 | button { 87 | color: #${palette.base05}; 88 | background-color: #${palette.base00}; 89 | border-style: solid; 90 | border-width: 2px; 91 | background-repeat: no-repeat; 92 | background-position: center; 93 | } 94 | 95 | button:focus, 96 | button:active, 97 | button:hover { 98 | background-color: #${palette.base02}; 99 | outline-style: none; 100 | } 101 | 102 | #lock { 103 | background-image: url("${wleaveIconPath}/lock.svg"), 104 | url("${wleaveIconPath}/lock.svg"); 105 | } 106 | 107 | #logout { 108 | background-image: url("${wleaveIconPath}/logout.svg"), 109 | url("${wleaveIconPath}/logout.svg"); 110 | } 111 | 112 | #suspend { 113 | background-image: url("${wleaveIconPath}/suspend.svg"), 114 | url("${wleaveIconPath}/suspend.svg"); 115 | } 116 | 117 | #hibernate { 118 | background-image: url("${wleaveIconPath}/hibernate.svg"), 119 | url("${wleaveIconPath}/hibernate.svg"); 120 | } 121 | 122 | #shutdown { 123 | background-image: url("${wleaveIconPath}/shutdown.svg"), 124 | url("${wleaveIconPath}/shutdown.svg"); 125 | } 126 | 127 | #reboot { 128 | background-image: url("${wleaveIconPath}/reboot.svg"), 129 | url("${wleaveIconPath}/reboot.svg"); 130 | } 131 | ''; 132 | }; 133 | }; 134 | }; 135 | } 136 | -------------------------------------------------------------------------------- /modules/programs/zen-browser/bookmarks.nix: -------------------------------------------------------------------------------- 1 | { 2 | hm.programs.zen-browser.profiles.ludovico.bookmarks = { 3 | force = true; 4 | settings = [ 5 | { 6 | name = "ANIME"; # Bookmark Folder 7 | toolbar = true; 8 | bookmarks = [ 9 | { 10 | name = "ANIMEPAHE"; 11 | keyword = "ah"; 12 | url = "https://animepahe.ru"; 13 | } 14 | { 15 | name = "KICKASSANIME"; 16 | keyword = "kaa"; 17 | url = "https://kaa.mx"; 18 | } 19 | ]; 20 | } 21 | { 22 | name = "NixOS"; 23 | toolbar = true; 24 | bookmarks = [ 25 | { 26 | name = "Nix Package"; 27 | keyword = "np"; 28 | url = "https://search.nixos.org/packages?channel=unstable"; 29 | } 30 | { 31 | name = "Nix Options"; 32 | keyword = "no"; 33 | url = "https://search.nixos.org/options?channel=unstable"; 34 | } 35 | { 36 | name = "NixOS Wiki"; 37 | keyword = "nw"; 38 | url = "https://wiki.nixos.org/wiki/Linux_kernel"; 39 | } 40 | { 41 | name = "Home-Manager"; 42 | keyword = "hm"; 43 | url = "https://nix-community.github.io/home-manager/options.xhtml"; 44 | } 45 | ]; 46 | } 47 | { 48 | name = "1337"; 49 | toolbar = true; 50 | bookmarks = [ 51 | { 52 | name = "GitHub"; 53 | keyword = "gh"; 54 | url = "https://github.com"; 55 | } 56 | { 57 | name = "GitLab"; 58 | keyword = "gl"; 59 | url = "https://gitlab.com"; 60 | } 61 | { 62 | name = "SourceHut"; 63 | keyword = "sh"; 64 | url = "https://git.sr.ht"; 65 | } 66 | ]; 67 | } 68 | { 69 | name = "lol"; 70 | toolbar = false; 71 | bookmarks = [ 72 | { 73 | name = "Google"; 74 | keyword = "g"; 75 | url = "https://google.com"; 76 | } 77 | { 78 | name = "DuckDuckGo"; 79 | keyword = "dg"; 80 | url = "https://DuckDuckGo.com"; 81 | } 82 | { 83 | name = "Twitter"; 84 | keyword = "x"; 85 | url = "https://x.com"; 86 | } 87 | { 88 | name = "YouTube"; 89 | keyword = "yt"; 90 | url = "https://YouTube.com"; 91 | } 92 | ]; 93 | } 94 | ]; 95 | }; 96 | } 97 | -------------------------------------------------------------------------------- /modules/programs/zen-browser/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | inputs, 6 | ... 7 | }: 8 | let 9 | inherit (lib) mkEnableOption mkIf; 10 | 11 | cfg = config.mine.zen-browser; 12 | in 13 | { 14 | imports = [ 15 | ./settings.nix 16 | ./search.nix 17 | ./bookmarks.nix 18 | ./extensions.nix 19 | ]; 20 | 21 | options.mine.zen-browser = { 22 | enable = mkEnableOption "Zen Browser"; 23 | }; 24 | 25 | config = mkIf cfg.enable { 26 | hm = { 27 | imports = [ ./modules ]; 28 | programs.zen-browser = { 29 | enable = true; 30 | package = inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default; 31 | 32 | profiles = { 33 | ludovico = { 34 | id = 0; 35 | isDefault = true; 36 | name = "Ludovico"; 37 | }; 38 | }; 39 | }; 40 | }; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /modules/programs/zen-browser/extensions.nix: -------------------------------------------------------------------------------- 1 | { inputs, pkgs, ... }: 2 | { 3 | hm.programs.zen-browser.profiles.ludovico.extensions = { 4 | force = true; 5 | packages = with inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}; [ 6 | bitwarden 7 | refined-github 8 | sponsorblock 9 | to-deepl 10 | ublock-origin 11 | search-by-image 12 | ]; 13 | settings = { 14 | "uBlock0@raymondhill.net" = { 15 | settings = { 16 | # Get your settings here 17 | # ~/.zen/YOUR_PROFILE_NAME/browser-extension-data/uBlock0@raymondhill.net/storage.js 18 | advancedUserEnabled = true; 19 | selectedFilterLists = [ 20 | "user-filters" 21 | "ublock-filters" 22 | "ublock-badware" 23 | "ublock-privacy" 24 | "ublock-unbreak" 25 | "ublock-quick-fixes" 26 | "easylist" 27 | "easyprivacy" 28 | "urlhaus-1" 29 | "plowe-0" 30 | "adguard-spyware-url" 31 | "fanboy-cookiemonster" 32 | "ublock-cookies-easylist" 33 | "easylist-annoyances" 34 | "easylist-chat" 35 | "easylist-newsletters" 36 | "easylist-notifications" 37 | "ublock-annoyances" 38 | "IDN-0" 39 | ]; 40 | "user-filters" = '' 41 | shopee.co.id##li.col-xs-2-4.shopee-search-item-result__item:has(div:contains(Ad)) 42 | shopee.co.id##.oMSmr0:has(div:contains(Ad)) 43 | tokopedia.com#?#.product-card:has(span:-abp-contains(/^Ad$/)) 44 | tokopedia.com##a[data-testid="lnkProductContainer"]:has(img[alt^="topads"]) 45 | tokopedia.com##div[data-ssr="findProductSSR"]:has(span[data-testid="lblTopads"]) 46 | tokopedia.com##div[data-ssr="findProductSSR"]:has(span[data-testid="linkProductTopads"]) 47 | tokopedia.com##div[data-testid="CPMWrapper"] 48 | tokopedia.com#?#div[data-testid="divCarouselProduct"]:has(span:-abp-contains(/^Ad$/)) 49 | tokopedia.com##div[data-testid="divProduct"]:has(span[data-testid="icnHomeTopadsRecom"]) 50 | tokopedia.com##div[data-testid="divProductWrapper"]:has(span[data-testid="divSRPTopadsIcon"]) 51 | tokopedia.com##div[data-testid="featuredShopCntr"] 52 | tokopedia.com#?#div[data-testid="lazy-frame"]:has(span:-abp-contains(/^Ad$/)) 53 | tokopedia.com##div[data-testid="lazy-frame"]:has(span[data-testid="lblProdTopads"]) 54 | tokopedia.com##div[data-testid="master-product-card"]:has(span[data-testid^="linkProductTopads"]) 55 | tokopedia.com##div[data-testid="topadsCPMWrapper"] 56 | tokopedia.com#?#div[data-testid^="divProductRecommendation"]:has(span:-abp-contains(/^Ad$/)) 57 | tokopedia.com##div[data-testid^="divProductRecommendation"]:has(span[data-testid="icnHomeTopadsRecom"]) 58 | ''; 59 | }; 60 | }; 61 | }; 62 | }; 63 | } 64 | -------------------------------------------------------------------------------- /modules/programs/zen-browser/modules/default.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | let 3 | modulePath = [ 4 | "programs" 5 | "zen-browser" 6 | ]; 7 | mkFirefoxModule = import ./mkFirefoxModule.nix; 8 | in 9 | { 10 | imports = [ 11 | (mkFirefoxModule { 12 | inherit modulePath; 13 | name = "Zen Browser"; 14 | wrappedPackageName = "zen-browser"; 15 | unwrappedPackageName = "zen-browser-unwrapped"; 16 | visible = true; 17 | 18 | platforms = { 19 | linux = { 20 | vendorPath = ".zen"; 21 | configPath = ".zen"; 22 | }; 23 | darwin = { 24 | configPath = "Library/Application Support/Zen"; 25 | }; 26 | }; 27 | }) 28 | ]; 29 | } 30 | -------------------------------------------------------------------------------- /modules/programs/zen-browser/modules/profiles/bookmark-types.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | 3 | let 4 | 5 | inherit (builtins) attrValues; 6 | inherit (lib) types mkOption; 7 | 8 | in 9 | rec { 10 | settingsType = 11 | with types; 12 | coercedTo (addCheck (attrsOf nodeType) 13 | # Check whether attribute set is of correct type 14 | (attrs: !(attrs ? settings) || nodeType.check attrs.settings) 15 | ) attrValues (listOf nodeType); 16 | 17 | bookmarkSubmodule = 18 | types.submodule ( 19 | { name, ... }: 20 | { 21 | options = { 22 | name = mkOption { 23 | type = types.str; 24 | default = name; 25 | description = "Bookmark name."; 26 | }; 27 | 28 | tags = mkOption { 29 | type = types.listOf types.str; 30 | default = [ ]; 31 | description = "Bookmark tags."; 32 | }; 33 | 34 | keyword = mkOption { 35 | type = types.nullOr types.str; 36 | default = null; 37 | description = "Bookmark search keyword."; 38 | }; 39 | 40 | url = mkOption { 41 | type = types.str; 42 | description = "Bookmark url, use %s for search terms."; 43 | }; 44 | }; 45 | } 46 | ) 47 | // { 48 | description = "bookmark submodule"; 49 | }; 50 | 51 | bookmarkType = types.addCheck bookmarkSubmodule (x: x ? "url"); 52 | 53 | directoryType = 54 | types.submodule ( 55 | { name, ... }: 56 | { 57 | options = { 58 | name = mkOption { 59 | type = types.str; 60 | default = name; 61 | description = "Directory name."; 62 | }; 63 | 64 | bookmarks = mkOption { 65 | type = types.listOf nodeType; 66 | default = [ ]; 67 | description = "Bookmarks within directory."; 68 | }; 69 | 70 | toolbar = mkOption { 71 | type = types.bool; 72 | default = false; 73 | description = '' 74 | Make this the toolbar directory. Note, this does _not_ 75 | mean that this directory will be added to the toolbar, 76 | this directory _is_ the toolbar. 77 | ''; 78 | }; 79 | }; 80 | } 81 | ) 82 | // { 83 | description = "directory submodule"; 84 | }; 85 | 86 | nodeType = types.either bookmarkType directoryType; 87 | } 88 | -------------------------------------------------------------------------------- /modules/programs/zen-browser/modules/profiles/bookmarks.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | modulePath, 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | escapeXML 11 | concatStringsSep 12 | mkOption 13 | maintainers 14 | types 15 | literalExpression 16 | ; 17 | 18 | inherit (bookmarkTypes) settingsType; 19 | 20 | bookmarkTypes = import ./bookmark-types.nix { inherit lib; }; 21 | 22 | bookmarksFile = 23 | bookmarks: 24 | let 25 | indent = level: lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level)); 26 | 27 | bookmarkToHTML = 28 | indentLevel: bookmark: 29 | ''${indent indentLevel}
${escapeXML bookmark.name}''; 36 | 37 | directoryToHTML = indentLevel: directory: '' 38 | ${indent indentLevel}
${ 39 | if directory.toolbar then 40 | ''

Bookmarks Toolbar'' 41 | else 42 | ''

${escapeXML directory.name}'' 43 | }

44 | ${indent indentLevel}

45 | ${allItemsToHTML (indentLevel + 1) directory.bookmarks} 46 | ${indent indentLevel}

''; 47 | 48 | itemToHTMLOrRecurse = 49 | indentLevel: item: 50 | if item ? "url" then bookmarkToHTML indentLevel item else directoryToHTML indentLevel item; 51 | 52 | allItemsToHTML = 53 | indentLevel: bookmarks: lib.concatStringsSep "\n" (map (itemToHTMLOrRecurse indentLevel) bookmarks); 54 | 55 | bookmarkEntries = allItemsToHTML 1 bookmarks; 56 | in 57 | pkgs.writeText "bookmarks.html" '' 58 | 59 | 62 | 63 | Bookmarks 64 |

Bookmarks Menu

65 |

66 | ${bookmarkEntries} 67 |

68 | ''; 69 | in 70 | { 71 | imports = [ 72 | (pkgs.path + "/nixos/modules/misc/assertions.nix") 73 | (pkgs.path + "/nixos/modules/misc/meta.nix") 74 | ]; 75 | 76 | # We're currently looking for a maintainer who actively uses bookmarks! 77 | meta.maintainers = with maintainers; [ kira-bruneau ]; 78 | 79 | options = { 80 | enable = mkOption { 81 | type = with types; bool; 82 | default = config.settings != [ ]; 83 | internal = true; 84 | }; 85 | 86 | force = mkOption { 87 | type = with types; bool; 88 | default = false; 89 | description = '' 90 | Whether to force override existing custom bookmarks. 91 | ''; 92 | }; 93 | 94 | settings = mkOption { 95 | type = settingsType; 96 | default = [ ]; 97 | example = literalExpression '' 98 | [ 99 | { 100 | name = "wikipedia"; 101 | tags = [ "wiki" ]; 102 | keyword = "wiki"; 103 | url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; 104 | } 105 | { 106 | name = "kernel.org"; 107 | url = "https://www.kernel.org"; 108 | } 109 | { 110 | name = "Nix sites"; 111 | toolbar = true; 112 | bookmarks = [ 113 | { 114 | name = "homepage"; 115 | url = "https://nixos.org/"; 116 | } 117 | { 118 | name = "wiki"; 119 | tags = [ "wiki" "nix" ]; 120 | url = "https://wiki.nixos.org/"; 121 | } 122 | ]; 123 | } 124 | ] 125 | ''; 126 | description = '' 127 | Custom bookmarks. 128 | ''; 129 | }; 130 | 131 | configFile = mkOption { 132 | type = with types; nullOr path; 133 | default = if config.enable then bookmarksFile config.settings else null; 134 | description = '' 135 | Configuration file to define custom bookmarks. 136 | ''; 137 | }; 138 | }; 139 | 140 | config = { 141 | assertions = [ 142 | { 143 | assertion = config.enable -> config.force; 144 | message = '' 145 | Using '${lib.showAttrPath (modulePath ++ [ "settings" ])}' will override all previous bookmarks. 146 | Enable ${lib.showAttrPath (modulePath ++ [ "force" ])}' to acknowledge this. 147 | ''; 148 | } 149 | ]; 150 | }; 151 | } 152 | -------------------------------------------------------------------------------- /modules/programs/zen-browser/search.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | hm.programs.zen-browser.profiles.ludovico.search = { 4 | force = true; 5 | default = "ddg"; 6 | order = [ 7 | "ddg" 8 | "brave" 9 | "searx" 10 | "google" 11 | ]; 12 | 13 | engines = { 14 | "searx" = { 15 | urls = [ 16 | { 17 | template = "https://opnxng.com/search"; 18 | params = [ 19 | { 20 | name = "q"; 21 | value = "{searchTerms}"; 22 | } 23 | { 24 | name = "categories"; 25 | value = "general"; 26 | } 27 | { 28 | name = "language"; 29 | value = "all"; 30 | } 31 | { 32 | name = "safesearch"; 33 | value = "0"; 34 | } 35 | ]; 36 | } 37 | ]; 38 | definedAliases = [ "s" ]; 39 | }; 40 | 41 | "brave" = { 42 | urls = [ { template = "https://search.brave.com/search?q={searchTerms}"; } ]; 43 | definedAliases = [ "b" ]; 44 | }; 45 | 46 | "ddg" = { 47 | urls = [ { template = "https://duckduckgo.com/?q={searchTerms}"; } ]; 48 | definedAliases = [ "d" ]; 49 | }; 50 | 51 | "github (code)" = { 52 | urls = [ { template = "https://github.com/search?q={searchTerms}&type=code"; } ]; 53 | definedAliases = [ "ghc" ]; 54 | }; 55 | 56 | "github (repository)" = { 57 | urls = [ { template = "https://github.com/search?q={searchTerms}&type=repository"; } ]; 58 | definedAliases = [ "ghr" ]; 59 | }; 60 | 61 | "nix-packages" = { 62 | urls = [ 63 | { 64 | template = "https://search.nixos.org/packages"; 65 | params = [ 66 | { 67 | name = "channel"; 68 | value = "unstable"; 69 | } 70 | { 71 | name = "type"; 72 | value = "packages"; 73 | } 74 | { 75 | name = "query"; 76 | value = "{searchTerms}"; 77 | } 78 | ]; 79 | } 80 | ]; 81 | 82 | icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; 83 | definedAliases = [ "np" ]; 84 | }; 85 | 86 | "home-manager" = { 87 | urls = [ { template = "https://rycee.gitlab.io/home-manager/options.html"; } ]; 88 | definedAliases = [ "hm" ]; 89 | }; 90 | 91 | "nixos-options" = { 92 | urls = [ 93 | { 94 | template = "https://search.nixos.org/options"; 95 | params = [ 96 | { 97 | name = "channel"; 98 | value = "unstable"; 99 | } 100 | { 101 | name = "type"; 102 | value = "packages"; 103 | } 104 | { 105 | name = "query"; 106 | value = "{searchTerms}"; 107 | } 108 | ]; 109 | } 110 | ]; 111 | 112 | icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; 113 | definedAliases = [ "no" ]; 114 | }; 115 | 116 | "nixos-wiki" = { 117 | urls = [ { template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ]; 118 | icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; 119 | definedAliases = [ "nw" ]; 120 | }; 121 | 122 | "youtube" = { 123 | urls = [ { template = "https://www.youtube.com/results?search_query={searchTerms}"; } ]; 124 | definedAliases = [ "yt" ]; 125 | }; 126 | 127 | "amazondotcom-us".metaData.hidden = true; 128 | "bing".metaData.hidden = true; 129 | "ebay".metaData.hidden = true; 130 | "google".metaData.hidden = true; 131 | "google".metaData.alias = "g"; 132 | "wikipedia".metaData.hidden = true; 133 | }; 134 | }; 135 | } 136 | -------------------------------------------------------------------------------- /modules/programs/zen-browser/settings.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | lib, 4 | config, 5 | ... 6 | }: 7 | { 8 | hm.programs.zen-browser.profiles.ludovico.settings = 9 | { 10 | # Homepage 11 | "browser.startup.page" = 1; 12 | "browser.startup.homepage" = "${inputs.self}/assets/homepage.html"; 13 | 14 | # Zen Settings 15 | "zen.tab-unloader.enabled" = true; 16 | "zen.tab-unloader.timeout-minutes" = 20; 17 | "zen.view.sidebar-expanded" = false; 18 | "zen.view.show-newtab-button-top" = false; 19 | "zen.welcome-screen.seen" = true; 20 | "zen.glance.open-essential-external-links" = false; 21 | 22 | "media.videocontrols.picture-in-picture.video-toggle.enabled" = false; # Hide picture-in-picture 23 | "extensions.autoDisableScopes" = 0; 24 | "browser.search.region" = "AU"; 25 | "browser.search.isUS" = false; 26 | "distribution.searchplugins.defaultLocale" = "en-AU"; 27 | "general.useragent.locale" = "en-AU"; 28 | "browser.bookmarks.showMobileBookmarks" = true; 29 | "toolkit.legacyUserProfileCustomizations.stylesheets" = true; 30 | "browser.privatebrowsing.vpnpromourl" = ""; 31 | "browser.tabs.firefox-view" = false; # Disable Firefox View 32 | "browser.tabs.firefox-view-next" = false; 33 | "browser.shell.checkDefaultBrowser" = false; 34 | "browser.ctrlTab.sortByRecentlyUsed" = true; 35 | 36 | "network.trr.mode" = 2; 37 | "network.trr.max-fails" = 5; 38 | "network.trr.default_provider_uri" = "https://dns.nextdns.io/518d18/nixos"; 39 | "network.trr.uri" = "https://dns.nextdns.io/518d18/nixos"; 40 | "network.trr.custom_uri" = "https://dns.nextdns.io/518d18/nixos"; 41 | "network.trr.bootstrapAddress" = "1.1.1.1"; 42 | 43 | # Disable telemetry 44 | "datareporting.usage.uploadEnabled" = false; 45 | "browser.newtabpage.activity-stream.feeds.telemetry" = false; 46 | "browser.ping-centre.telemetry" = false; 47 | "browser.tabs.crashReporting.sendReport" = false; 48 | "devtools.onboarding.telemetry.logged" = false; 49 | "toolkit.telemetry.enabled" = false; 50 | "toolkit.telemetry.server" = "data:,"; 51 | "toolkit.telemetry.unified" = false; 52 | "toolkit.telemetry.archive.enabled" = false; 53 | "toolkit.telemetry.newProfilePing.enabled" = false; 54 | "toolkit.telemetry.shutdownPingSender.enabled" = false; 55 | "toolkit.telemetry.updatePing.enabled" = false; 56 | "toolkit.telemetry.bhrPing.enabled" = false; 57 | "toolkit.telemetry.firstShutdownPing.enabled" = false; 58 | 59 | # # Disable Pocket 60 | "browser.newtabpage.activity-stream.feeds.discoverystreamfeed" = false; 61 | "browser.newtabpage.activity-stream.feeds.section.topstories" = false; 62 | "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; 63 | "browser.newtabpage.activity-stream.showSponsored" = false; 64 | "extensions.pocket.enabled" = false; 65 | 66 | # Disable prefetching 67 | "network.dns.disablePrefetch" = true; 68 | "network.prefetch-next" = false; 69 | 70 | # Disable JS in PDFs 71 | "pdfjs.enableScripting" = false; 72 | 73 | # Harden SSL 74 | "security.ssl.require_safe_negotiation" = true; 75 | 76 | # Tweaks from archwiki 77 | "browser.cache.disk.enable" = false; 78 | "browser.cache.memory.enable" = true; 79 | "browser.cache.memory.capacity" = 131072; # 128 MB 80 | "browser.cache.memory.max_entry_size" = 20480; # 20 MB 81 | "browser.aboutConfig.showWarning" = false; 82 | "browser.preferences.defaultPerformanceSettings.enabled" = false; 83 | "browser.places.speculativeConnect.enabled" = false; 84 | "middlemouse.paste" = false; 85 | 86 | # Smooth Scroll 87 | # "general.smoothScroll" = true; 88 | # "general.smoothScroll.lines.durationMaxMS" = 125; 89 | # "general.smoothScroll.lines.durationMinMS" = 125; 90 | # "general.smoothScroll.mouseWheel.durationMaxMS" = 200; 91 | # "general.smoothScroll.mouseWheel.durationMinMS" = 100; 92 | # "general.smoothScroll.msdPhysics.enabled" = true; 93 | # "general.smoothScroll.other.durationMaxMS" = 125; 94 | # "general.smoothScroll.other.durationMinMS" = 125; 95 | # "general.smoothScroll.pages.durationMaxMS" = 125; 96 | # "general.smoothScroll.pages.durationMinMS" = 125; 97 | # "mousewheel.min_line_scroll_amount" = 30; 98 | # "mousewheel.system_scroll_override_on_root_content.enabled" = true; 99 | # "mousewheel.system_scroll_override_on_root_content.horizontal.factor" = 175; 100 | # "mousewheel.system_scroll_override_on_root_content.vertical.factor" = 175; 101 | # "toolkit.scrollbox.horizontalScrollDistance" = 6; 102 | # "toolkit.scrollbox.verticalScrollDistance" = 2; 103 | 104 | # Extra 105 | "identity.fxaccounts.enabled" = false; 106 | "browser.download.useDownloadDir" = false; 107 | "browser.search.suggest.enabled" = false; 108 | "browser.urlbar.shortcuts.bookmarks" = false; 109 | "browser.urlbar.shortcuts.history" = false; 110 | "browser.urlbar.shortcuts.tabs" = false; 111 | "browser.urlbar.suggest.bookmark" = false; 112 | "browser.urlbar.suggest.searches" = false; 113 | "browser.urlbar.suggest.engines" = false; 114 | "browser.urlbar.suggest.history" = true; 115 | "browser.urlbar.suggest.openpage" = false; 116 | "browser.urlbar.suggest.topsites" = false; 117 | "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false; 118 | "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false; 119 | "signon.rememberSignons" = false; 120 | "signon.autofillForms" = false; 121 | "network.dns.disableIPv6" = true; 122 | "network.proxy.socks_remote_dns" = true; 123 | "dom.security.https_first" = true; 124 | 125 | # Disable permission 126 | # 0=always ask (default), 1=allow, 2=block 127 | "permissions.default.geo" = 2; 128 | "permissions.default.camera" = 2; 129 | "permissions.default.microphone" = 0; 130 | "permissions.default.desktop-notification" = 2; 131 | "permissions.default.xr" = 2; # Virtual Reality 132 | "browser.discovery.enabled" = false; 133 | "datareporting.healthreport.uploadEnabled" = false; 134 | "datareporting.policy.dataSubmissionEnabled" = false; 135 | "app.shield.optoutstudies.enabled" = false; 136 | "app.normandy.enabled" = false; 137 | "app.normandy.api_url" = ""; 138 | } 139 | // lib.optionalAttrs config.mine.dnscrypt2.enable { 140 | # DOH 141 | /* 142 | 2 is enable DOH. 143 | 3 is no failback to system dns 144 | 5 is no DOH. 145 | */ 146 | "network.trr.mode" = 5; 147 | "network.trr.max-fails" = 5; 148 | "network.trr.default_provider_uri" = ""; 149 | "network.trr.uri" = ""; 150 | "network.trr.custom_uri" = ""; 151 | # "network.trr.bootstrapAddress" = "1.1.1.1"; 152 | }; 153 | } 154 | -------------------------------------------------------------------------------- /modules/services/dnscrypt2/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | let 3 | inherit (lib) 4 | mkEnableOption 5 | mkOption 6 | mkIf 7 | types 8 | ; 9 | 10 | cfg = config.mine.dnscrypt2; 11 | in 12 | { 13 | options.mine.dnscrypt2 = { 14 | enable = mkEnableOption "dnscrypt2 service"; 15 | 16 | hasIPv6Internet = mkOption { 17 | type = types.bool; 18 | default = false; 19 | }; 20 | 21 | StateDirectory = mkOption { 22 | type = types.str; 23 | default = "dnscrypt-proxy"; 24 | }; 25 | }; 26 | 27 | config = mkIf cfg.enable { 28 | networking = { 29 | nameservers = [ 30 | "127.0.0.1" 31 | "::1" 32 | ]; 33 | dhcpcd.extraConfig = "nohook resolv.conf"; # If using dhcpcd 34 | networkmanager.dns = "none"; # If using NetworkManager 35 | }; 36 | 37 | services.dnscrypt-proxy2 = { 38 | enable = true; 39 | settings = { 40 | server_names = [ "NextDNS-518d18" ]; 41 | 42 | max_clients = 250; 43 | 44 | # Use servers reachable over IPv4 45 | ipv4_servers = true; 46 | # Use servers reachable over IPv6 -- Do not enable if you don't have IPv6 connectivity 47 | ipv6_servers = cfg.hasIPv6Internet; 48 | # Use servers implementing the DNSCrypt protocol 49 | dnscrypt_servers = true; 50 | # Use servers implementing the DNS-over-HTTPS protocol 51 | doh_servers = true; 52 | # Server must support DNS security extensions (DNSSEC) 53 | require_dnssec = true; 54 | # Server must not log user queries (declarative) 55 | require_nolog = true; 56 | # Server must not enforce its own blacklist (for parental control, ads blocking...) 57 | require_nofilter = true; 58 | force_tcp = false; 59 | 60 | ## How long a DNS query will wait for a response, in milliseconds 61 | timeout = 2500; 62 | ## Keepalive for HTTP (HTTPS, HTTP/2) queries, in seconds 63 | keepalive = 30; 64 | 65 | ## Automatic log files rotation 66 | # Maximum log files size in MB 67 | log_files_max_size = 10; 68 | # How long to keep backup files, in days 69 | log_files_max_age = 7; 70 | # Maximum log files backups to keep (or 0 to keep all backups) 71 | log_files_max_backups = 1; 72 | 73 | ## Do not enable if you added a validating resolver such as dnsmasq in front 74 | ## of the proxy. 75 | block_ipv6 = !cfg.hasIPv6Internet; 76 | 77 | ########################### 78 | # DNS cache # 79 | ########################### 80 | ## Enable a DNS cache to reduce latency and outgoing traffic 81 | cache = true; 82 | ## Cache size 83 | cache_size = 512; 84 | ## Minimum TTL for cached entries 85 | cache_min_ttl = 600; 86 | ## Maximum TTL for cached entries 87 | cache_max_ttl = 86400; 88 | ## Minimum TTL for negatively cached entries 89 | cache_neg_min_ttl = 60; 90 | ## Maximum TTL for negatively cached entries 91 | cache_neg_max_ttl = 600; 92 | 93 | ########################### 94 | # NextDNS # 95 | ########################### 96 | static."NextDNS-518d18".stamp = "sdns://AgEAAAAAAAAAAAAOZG5zLm5leHRkbnMuaW8HLzUxOGQxOA"; 97 | 98 | ########################### 99 | # Sources # 100 | ########################### 101 | sources = { 102 | public-resolvers = { 103 | urls = [ 104 | "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md" 105 | "https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md" 106 | ]; 107 | cache_file = "/var/lib/${cfg.StateDirectory}/public-resolvers.md"; 108 | minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"; 109 | }; 110 | # relays = { 111 | # urls = [ 112 | # "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/relays.md" 113 | # "https://download.dnscrypt.info/resolvers-list/v3/relays.md" 114 | # ]; 115 | # cache_file = "/var/lib/dnscrypt-proxy2/relays.md"; 116 | # minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"; 117 | # }; 118 | }; 119 | 120 | # anonymized_dns = { 121 | # routes = [ 122 | # { 123 | # server_name = "*"; 124 | # via = [ 125 | # "anon-cs-singapore" 126 | # "anon-saldnssg01-conoha-ipv4" 127 | # "anon-tiarap" 128 | # "dnscry.pt-anon-singapore-ipv4" 129 | # ]; 130 | # } 131 | # ]; 132 | # skip_incompatible = true; 133 | # }; 134 | }; 135 | }; 136 | 137 | systemd.services.dnscrypt-proxy2.serviceConfig.StateDirectory = cfg.StateDirectory; 138 | }; 139 | } 140 | -------------------------------------------------------------------------------- /modules/services/fcitx5/config/conf/classicui.conf: -------------------------------------------------------------------------------- 1 | # Vertical Candidate List 2 | Vertical Candidate List=False 3 | # Use mouse wheel to go to prev or next page 4 | WheelForPaging=True 5 | # Font 6 | Font="Iosevka q 10" 7 | # Menu Font 8 | MenuFont="Iosevka q 10" 9 | # Tray Font 10 | TrayFont="Iosevka q 10" 11 | # Tray Label Outline Color 12 | TrayOutlineColor=#000000 13 | # Tray Label Text Color 14 | TrayTextColor=#ffffff 15 | # Prefer Text Icon 16 | PreferTextIcon=True 17 | # Show Layout Name In Icon 18 | ShowLayoutNameInIcon=True 19 | # Use input method language to display text 20 | UseInputMethodLanguageToDisplayText=True 21 | # Theme 22 | Theme=catppuccin-mocha 23 | # Dark Theme 24 | DarkTheme=default-dark 25 | # Follow system light/dark color scheme 26 | UseDarkTheme=False 27 | # Use Per Screen DPI on X11 28 | PerScreenDPI=False 29 | # Force font DPI on Wayland 30 | ForceWaylandDPI=0 31 | # Enable fractional scale under Wayland 32 | EnableFractionalScale=True 33 | 34 | -------------------------------------------------------------------------------- /modules/services/fcitx5/config/conf/notifications.conf: -------------------------------------------------------------------------------- 1 | # 隠す通知 2 | HiddenNotifications= 3 | 4 | -------------------------------------------------------------------------------- /modules/services/fcitx5/config/config: -------------------------------------------------------------------------------- 1 | [Hotkey] 2 | # Switch every time the trigger key is pressed 3 | EnumerateWithTriggerKeys=True 4 | # Skip the first input method when switching 5 | EnumerateSkipFirst=False 6 | # Enable input method 7 | ActivateKeys= 8 | # Disable input method 9 | DeactivateKeys= 10 | 11 | [Hotkey/TriggerKeys] 12 | 0=Control+Shift+space 13 | 14 | [Hotkey/AltTriggerKeys] 15 | 0=Page_Up 16 | 17 | [Hotkey/EnumerateForwardKeys] 18 | 0=Control+Shift_L 19 | 20 | [Hotkey/EnumerateBackwardKeys] 21 | 0=Control+Shift_R 22 | 23 | [Hotkey/EnumerateGroupForwardKeys] 24 | 0=Super+space 25 | 26 | [Hotkey/EnumerateGroupBackwardKeys] 27 | 0=Shift+Super+space 28 | 29 | [Hotkey/PrevPage] 30 | 0=Up 31 | 32 | [Hotkey/NextPage] 33 | 0=Down 34 | 35 | [Hotkey/PrevCandidate] 36 | 0=Shift+Tab 37 | 38 | [Hotkey/NextCandidate] 39 | 0=Tab 40 | 41 | [Hotkey/TogglePreedit] 42 | 0=Control+Alt+P 43 | 44 | [Behavior] 45 | # Enable by default 46 | ActiveByDefault=True 47 | # Share input state 48 | ShareInputState=No 49 | # Display preedit in applications 50 | PreeditEnabledByDefault=True 51 | # Display input method information when switching input methods 52 | ShowInputMethodInformation=True 53 | # Display input method information when changing focus 54 | showInputMethodInformationWhenFocusIn=False 55 | # Display input method information compactly 56 | CompactInputMethodInformation=True 57 | # Display information of the first input method 58 | ShowFirstInputMethodInformation=True 59 | # Default page size 60 | DefaultPageSize=5 61 | # Override XKB option 62 | OverrideXkbOption=False 63 | # Custom XKB option 64 | CustomXkbOption= 65 | # Force Enabled Addons 66 | EnabledAddons= 67 | # Force Disabled Addons 68 | DisabledAddons= 69 | # Preload input method to be used by default 70 | PreloadInputMethod=True 71 | 72 | -------------------------------------------------------------------------------- /modules/services/fcitx5/config/profile: -------------------------------------------------------------------------------- 1 | [Groups/0] 2 | # Group Name 3 | Name=Keys 4 | # Layout 5 | Default Layout=us 6 | # Default Input Method 7 | DefaultIM=keyboard-us 8 | 9 | [Groups/0/Items/0] 10 | # Name 11 | Name=mozc 12 | # Layout 13 | Layout= 14 | 15 | [Groups/0/Items/1] 16 | # Name 17 | Name=keyboard-us 18 | # Layout 19 | Layout= 20 | 21 | [Groups/0/Items/2] 22 | Name=hangul 23 | Layout=us 24 | 25 | [GroupOrder] 26 | 0=Keys 27 | 28 | -------------------------------------------------------------------------------- /modules/services/fcitx5/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | config, 4 | pkgs, 5 | inputs, 6 | ... 7 | }: 8 | let 9 | inherit (lib) mkEnableOption mkIf; 10 | 11 | en = "en_US.UTF-8"; 12 | # ja = "ja_JP.UTF-8"; 13 | extraLocaleSettings = { 14 | LC_ADDRESS = en; 15 | LC_IDENTIFICATION = en; 16 | LC_MEASUREMENT = en; 17 | LC_MONETARY = en; 18 | LC_MESSAGES = en; 19 | LC_NAME = en; 20 | LC_NUMERIC = en; 21 | LC_PAPER = en; 22 | LC_TELEPHONE = en; 23 | LC_TIME = en; 24 | }; 25 | 26 | cfg = config.mine.fcitx5; 27 | in 28 | { 29 | options.mine.fcitx5 = { 30 | enable = mkEnableOption "fcitx5 service"; 31 | }; 32 | 33 | config = mkIf cfg.enable { 34 | i18n = { 35 | inherit extraLocaleSettings; 36 | inputMethod = { 37 | enable = true; 38 | type = "fcitx5"; 39 | fcitx5 = { 40 | waylandFrontend = true; 41 | addons = with pkgs; [ 42 | # Languages 43 | fcitx5-mozc # Japanese 44 | fcitx5-hangul # Korean 45 | 46 | # Input methods Module 47 | fcitx5-gtk 48 | libsForQt5.fcitx5-qt 49 | 50 | # Theme 51 | inputs.ludovico-pkgs.packages.${pkgs.stdenv.hostPlatform.system}.catppuccin-fcitx5 52 | ]; 53 | }; 54 | }; 55 | }; 56 | 57 | hm = { 58 | systemd.user.services.fcitx5 = { 59 | Unit = { 60 | Description = "Input method framework"; 61 | BindsTo = [ "graphical-session.target" ]; 62 | After = [ "graphical-session.target" ]; 63 | }; 64 | Install = { 65 | WantedBy = [ "graphical-session.target" ]; 66 | }; 67 | Service = { 68 | Type = "simple"; 69 | Restart = "on-failure"; 70 | ExecStart = "${lib.getExe pkgs.fcitx5}"; 71 | }; 72 | }; 73 | }; 74 | 75 | systemd.user.tmpfiles.users.${config.vars.username}.rules = [ 76 | "L+ %h/.config/fcitx5 0755 ${config.vars.username} users - ${./config}" 77 | ]; 78 | }; 79 | } 80 | -------------------------------------------------------------------------------- /modules/services/gammastep/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | let 3 | inherit (lib) mkEnableOption mkIf; 4 | 5 | cfg = config.mine.gammastep; 6 | in 7 | { 8 | options.mine.gammastep = { 9 | enable = mkEnableOption "Gammastep service"; 10 | }; 11 | 12 | config = mkIf cfg.enable { 13 | # Location services for gammastep 14 | services.geoclue2 = { 15 | enable = true; 16 | appConfig.gammastep = { 17 | isAllowed = true; 18 | isSystem = true; 19 | }; 20 | }; 21 | 22 | hm = { 23 | services.gammastep = { 24 | enable = true; 25 | provider = "geoclue2"; 26 | settings = { 27 | general = { 28 | brightness-day = 0.8; 29 | brightness-night = 0.6; 30 | }; 31 | }; 32 | }; 33 | }; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /modules/services/keyring/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkEnableOption mkIf; 9 | 10 | cfg = config.mine.keyring; 11 | in 12 | { 13 | options.mine.keyring = { 14 | enable = mkEnableOption "keyring"; 15 | }; 16 | 17 | config = mkIf cfg.enable { 18 | environment = { 19 | systemPackages = [ pkgs.libsecret ]; 20 | }; 21 | programs.dconf.enable = true; 22 | # Fixes the org.a11y.Bus not provided by .service file error 23 | services = { 24 | gnome.at-spi2-core.enable = true; 25 | gnome.gnome-keyring.enable = true; 26 | dbus.packages = with pkgs; [ 27 | gcr 28 | seahorse 29 | ]; 30 | }; 31 | security.polkit.enable = true; 32 | 33 | systemd.user.services.hyprpolkitagent = { 34 | description = "Polkit authentication agent"; 35 | after = [ "graphical-session.target" ]; 36 | wantedBy = [ "graphical-session.target" ]; 37 | bindsTo = [ "graphical-session.target" ]; 38 | serviceConfig = { 39 | Type = "simple"; 40 | Restart = "on-failure"; 41 | ExecStart = "${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent"; 42 | }; 43 | }; 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /modules/services/mako/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkEnableOption mkIf; 9 | inherit (config.mine.theme.colorScheme) palette; 10 | 11 | cfg = config.mine.mako; 12 | in 13 | { 14 | options.mine.mako = { 15 | enable = mkEnableOption "mako service"; 16 | }; 17 | 18 | config = mkIf cfg.enable { 19 | hm = { 20 | home.packages = with pkgs; [ 21 | libnotify 22 | mako 23 | ]; 24 | 25 | services.mako = { 26 | enable = true; 27 | }; 28 | 29 | #TODO 30 | xdg.configFile."mako/config".text = '' 31 | font=${config.mine.fonts.terminal.name} ${toString config.mine.fonts.size} 32 | background-color=#${palette.base00} 33 | border-color=#${palette.base0E} 34 | text-color=#${palette.base05} 35 | progress-color=over #${palette.base02} 36 | 37 | anchor=top-right 38 | border-radius=5 39 | border-size=2 40 | padding=20 41 | default-timeout=5000 42 | layer=top 43 | height=125 44 | width=400 45 | ''; 46 | }; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /modules/services/mpd/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkEnableOption mkIf; 9 | 10 | cfg = config.mine.mpd; 11 | in 12 | { 13 | options.mine.mpd.enable = mkEnableOption "MPD (Music Player Daemon)"; 14 | 15 | config = mkIf cfg.enable { 16 | hm = 17 | { config, ... }: 18 | { 19 | home.packages = with pkgs; [ fooyin ]; 20 | 21 | services.mpd = { 22 | enable = true; 23 | musicDirectory = "${config.home.homeDirectory}/Media/Music"; 24 | playlistDirectory = "${config.xdg.configHome}/mpd/playlists"; 25 | dbFile = "${config.xdg.stateHome}/mpd/database"; 26 | 27 | extraConfig = '' 28 | state_file "${config.xdg.stateHome}/mpd/state" 29 | sticker_file "${config.xdg.stateHome}/mpd/sticker.sql" 30 | 31 | auto_update "yes" 32 | volume_normalization "yes" 33 | restore_paused "yes" 34 | filesystem_charset "UTF-8" 35 | replaygain "track" 36 | 37 | audio_output { 38 | type "pipewire" 39 | name "PipeWire" 40 | } 41 | 42 | audio_output { 43 | type "fifo" 44 | name "Visualiser" 45 | path "/tmp/mpd.fifo" 46 | format "44100:16:2" 47 | } 48 | 49 | audio_output { 50 | type "httpd" 51 | name "lossless" 52 | encoder "flac" 53 | port "8000" 54 | max_clients "8" 55 | mixer_type "software" 56 | format "44100:16:2" 57 | } 58 | ''; 59 | }; 60 | }; 61 | }; 62 | } 63 | -------------------------------------------------------------------------------- /modules/services/pipewire/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkOption mkEnableOption mkIf; 9 | inherit (lib.types) int; 10 | inherit (lib.generators) toLua; 11 | 12 | qr = "${toString cfg.quantum}/${toString cfg.rate}"; 13 | 14 | cfg = config.mine.pipewire; 15 | in 16 | { 17 | options.mine.pipewire = { 18 | enable = mkEnableOption "pipewire"; 19 | 20 | quantum = mkOption { 21 | description = "Minimum quantum to set"; 22 | type = int; 23 | default = 64; 24 | example = 32; 25 | }; 26 | 27 | rate = mkOption { 28 | description = "Rate to set"; 29 | type = int; 30 | default = 48000; 31 | example = 96000; 32 | }; 33 | }; 34 | 35 | config = mkIf cfg.enable { 36 | security.rtkit.enable = true; 37 | services = { 38 | # Enable sound. 39 | pipewire = { 40 | enable = true; 41 | pulse.enable = true; 42 | wireplumber = { 43 | enable = true; 44 | configPackages = 45 | let 46 | # generate "matches" section of the rules 47 | matches = 48 | toLua 49 | { 50 | multiline = false; # looks better while inline 51 | indent = false; 52 | } 53 | [ 54 | [ 55 | [ 56 | "node.name" 57 | "matches" 58 | "alsa_output.*" 59 | ] 60 | ] 61 | ]; # nested lists are to produce `{{{ }}}` in the output 62 | 63 | # generate "apply_properties" section of the rules 64 | apply_properties = toLua { } { 65 | "audio.format" = "S32LE"; 66 | "audio.rate" = cfg.rate * 2; 67 | "api.alsa.period-size" = 2; 68 | }; 69 | in 70 | [ 71 | (pkgs.writeTextDir "share/lowlatency.lua.d/99-alsa-lowlatency.lua" '' 72 | -- Generated by nix-gaming 73 | alsa_monitor.rules = { 74 | { 75 | matches = ${matches}; 76 | apply_properties = ${apply_properties}; 77 | } 78 | } 79 | '') 80 | ]; 81 | }; 82 | 83 | extraConfig = { 84 | pipewire = { 85 | # stolen from fufexan/nix-gaming 86 | "99-lowlatency" = { 87 | context = { 88 | properties = { 89 | "default.clock.rate" = cfg.rate; 90 | "default.clock.min-quantum" = cfg.quantum; 91 | "default.clock.allowed-rates" = [ 92 | 44100 93 | 48000 94 | 88200 95 | 96000 96 | ]; 97 | }; 98 | modules = [ 99 | { 100 | name = "libpipewire-module-rtkit"; 101 | flags = [ 102 | "ifexists" 103 | "nofail" 104 | ]; 105 | args = { 106 | nice.level = -15; 107 | rt = { 108 | prio = 88; 109 | time.soft = 200000; 110 | time.hard = 200000; 111 | }; 112 | }; 113 | } 114 | { 115 | name = "libpipewire-module-protocol-pulse"; 116 | args = { 117 | server.address = [ "unix:native" ]; 118 | pulse.min = { 119 | req = qr; 120 | quantum = qr; 121 | frag = qr; 122 | }; 123 | }; 124 | } 125 | ]; 126 | 127 | stream.properties = { 128 | node.latency = qr; 129 | resample.quality = 1; 130 | }; 131 | }; 132 | }; 133 | }; 134 | 135 | pipewire-pulse = { 136 | "10-switch-on-connect" = { 137 | "pulse.cmd" = [ 138 | { 139 | cmd = "load-module"; 140 | args = "module-switch-on-connect"; 141 | } 142 | ]; 143 | }; 144 | }; 145 | }; 146 | }; 147 | }; 148 | }; 149 | } 150 | -------------------------------------------------------------------------------- /modules/services/sddm/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | config, 4 | pkgs, 5 | ... 6 | }: 7 | let 8 | inherit (lib) 9 | mkForce 10 | mkEnableOption 11 | mkIf 12 | mkMerge 13 | ; 14 | in 15 | { 16 | options.mine.sddm = { 17 | enable = mkEnableOption "sddm service"; 18 | }; 19 | 20 | config = mkMerge [ 21 | (mkIf config.vars.withGui { 22 | security = { 23 | pam.services.sddm.enableGnomeKeyring = true; 24 | }; 25 | 26 | services.displayManager.gdm.enable = mkForce false; 27 | services.displayManager.sddm = { 28 | enable = true; 29 | package = lib.mkForce ( 30 | pkgs.kdePackages.sddm.overrideAttrs (old: { 31 | patches = (old.patches or [ ]) ++ [ 32 | (pkgs.fetchpatch { 33 | url = "https://patch-diff.githubusercontent.com/raw/sddm/sddm/pull/1779.patch"; 34 | hash = "sha256-8QP9Y8V9s8xrc+MIUlB7iHVNHbntGkw0O/N510gQ+bE="; 35 | }) 36 | ]; 37 | }) 38 | ); 39 | 40 | wayland.enable = true; 41 | theme = lib.mkForce ""; 42 | }; 43 | }) 44 | 45 | (mkIf (!config.vars.withGui) { services.getty.autologinUser = "${config.vars.username}"; }) 46 | ]; 47 | } 48 | -------------------------------------------------------------------------------- /modules/services/tlp/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | let 3 | inherit (lib) mkEnableOption mkIf mkForce; 4 | 5 | cfg = config.mine.tlp; 6 | in 7 | { 8 | options.mine.tlp = { 9 | enable = mkEnableOption "tlp" // { 10 | default = config.vars.isALaptop; 11 | }; 12 | }; 13 | 14 | config = mkIf cfg.enable { 15 | services = { 16 | power-profiles-daemon.enable = mkForce false; 17 | tlp = { 18 | enable = true; 19 | settings = { 20 | # conservative ondemand userspace powersave performance schedutil 21 | CPU_SCALING_GOVERNOR_ON_AC = "schedutil"; 22 | CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; 23 | 24 | # performance / balance_performance / default / balance_power / power 25 | CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance"; 26 | CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; 27 | 28 | # 0 disable, 1 allow 29 | CPU_BOOST_ON_AC = 1; 30 | CPU_BOOST_ON_BAT = 0; 31 | 32 | # 0 disable, 1 enable 33 | CPU_HWP_DYN_BOOST_ON_AC = 1; 34 | CPU_HWP_DYN_BOOST_ON_BAT = 0; 35 | 36 | # 0 – off 37 | # 1..4 – maximum brightness reduction allowed by the ABM algorithm, 1 represents the least and 4 the most power saving 38 | AMDGPU_ABM_LEVEL_ON_AC = 0; 39 | AMDGPU_ABM_LEVEL_ON_BAT = 3; 40 | 41 | # performance / balanced / low-power 42 | PLATFORM_PROFILE_ON_AC = "balanced"; 43 | PLATFORM_PROFILE_ON_BAT = "low-power"; 44 | 45 | # auto – recommended / low / high 46 | RADEON_DPM_PERF_LEVEL_ON_AC = "auto"; 47 | RADEON_DPM_PERF_LEVEL_ON_BAT = "low"; 48 | 49 | /* 50 | auto – enabled (power down idle devices) 51 | on – disabled (devices powered on permanently) 52 | */ 53 | RUNTIME_PM_ON_AC = "auto"; 54 | RUNTIME_PM_ON_BAT = "auto"; 55 | 56 | START_CHARGE_THRESH_BAT1 = "85"; 57 | STOP_CHARGE_THRESH_BAT1 = "90"; 58 | }; 59 | }; 60 | 61 | logind = { 62 | powerKey = "suspend"; 63 | lidSwitch = "suspend-then-hibernate"; 64 | }; 65 | }; 66 | }; 67 | } 68 | -------------------------------------------------------------------------------- /modules/services/wireguard/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | let 3 | inherit (lib) mkEnableOption mkIf; 4 | 5 | cfg = config.mine.wireguard; 6 | in 7 | { 8 | options.mine.wireguard = { 9 | enable = mkEnableOption "wireguard service"; 10 | }; 11 | 12 | config = mkIf cfg.enable { 13 | sops.secrets = { 14 | presharedKey = { }; 15 | privateKey = { }; 16 | }; 17 | 18 | networking.wg-quick.interfaces = { 19 | wg0 = { 20 | autostart = true; 21 | address = [ "10.66.66.3/32" ]; 22 | dns = [ 23 | "45.90.28.49" 24 | "1.0.0.1" 25 | ]; 26 | privateKeyFile = config.sops.secrets.privateKey.path; 27 | 28 | peers = [ 29 | { 30 | publicKey = "jZ4mHEdMx0XHlEGRntWXtt0tpYz3feoVUbbJQejYQwA="; 31 | presharedKeyFile = config.sops.secrets.presharedKey.path; 32 | allowedIPs = [ "0.0.0.0/0" ]; 33 | endpoint = "167.179.64.176:51820"; 34 | persistentKeepalive = 25; 35 | } 36 | ]; 37 | }; 38 | }; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /modules/services/xdg-portal/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkEnableOption mkIf; 9 | 10 | cfg = config.mine.xdg-portal; 11 | in 12 | { 13 | options.mine.xdg-portal = { 14 | enable = mkEnableOption "xdg-portal service"; 15 | }; 16 | 17 | config = mkIf cfg.enable { 18 | xdg = { 19 | portal = { 20 | enable = true; 21 | 22 | config = { 23 | common = { 24 | # uses the first portal implementation found in lexicographical order 25 | default = [ "*" ]; 26 | "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; 27 | }; 28 | }; 29 | 30 | extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; 31 | }; 32 | }; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /parts/default.nix: -------------------------------------------------------------------------------- 1 | { inputs, ... }: 2 | { 3 | systems = [ "x86_64-linux" ]; 4 | 5 | perSystem = 6 | { 7 | pkgs, 8 | lib, 9 | system, 10 | ... 11 | }: 12 | { 13 | # This sets `pkgs` to a nixpkgs with allowUnfree option set. 14 | _module.args.pkgs = import inputs.nixpkgs { 15 | inherit system; 16 | overlays = [ ]; 17 | config.allowUnfree = true; 18 | }; 19 | 20 | formatter = pkgs.writeShellScriptBin "formatter" '' 21 | echo "Formatting *.nix files..." 22 | fd . -t f -e nix -x ${lib.getExe' pkgs.nixfmt-rfc-style "nixfmt"} -s '{}' 23 | 24 | echo "Formatting *.html files..." 25 | fd . -t f -e html -x ${lib.getExe pkgs.nodePackages.prettier} --write '{}' 26 | 27 | echo "Formatting *.sh files..." 28 | fd . -t f -e sh -x ${lib.getExe pkgs.shfmt} -w -i 2 '{}' 29 | ''; 30 | 31 | devShells.default = pkgs.mkShell { 32 | name = "UwU Shell"; 33 | buildInputs = with pkgs; [ 34 | nixfmt-rfc-style 35 | nixd 36 | sops 37 | ]; 38 | }; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /secrets/secrets.yaml: -------------------------------------------------------------------------------- 1 | presharedKey: ENC[AES256_GCM,data:r4+Oe0+fIVrHY7uTV/kvxwK4vn/ACWNZRTxkMfHyPICw+jS1wSAXcpxpXeU=,iv:eeoCntHBTn5QRl89DBW6zZgVEbZF1Qdj4Ek1x97RL8E=,tag:3nraXVviT4JD+//Xr/Bs6w==,type:str] 2 | privateKey: ENC[AES256_GCM,data:t9t8OdwLhkJcbo/JmPzw7F6Ud1HFBZal0zrShE+5BZlrxKFYBLqSgBNMkgw=,iv:J7uv340I6MgokIGeALnQuCb99VSF4dWrz7s2fXg+2cE=,tag:pLRVJU9cVlOKHjr5HrRwXQ==,type:str] 3 | shells: 4 | githubToken: ENC[AES256_GCM,data:L/zt1YZRmOf+GVGnkJ2/3jeH5AQbpPSRYtOsEE8mn7nA6sctKdnrQpPb2Ta8r27uU0jVUOSo3lxzbaQq,iv:Zh4U1KiNWSmUykMq6p9LDXoYIFXp/xJSCCyJfBkoNRc=,tag:ecqxM9UuqAIzQd2oM59U2Q==,type:str] 5 | users: 6 | userPassword: ENC[AES256_GCM,data:J68fCK2/PUwhuezuIuNj5dTbM9jPHFOToSM8LAbs9wc89V3nMOTcHRvtC54lmebmXmR0cK1xLkbSq32wBdoLzO4u7bacItggFq1+i8gIVyht/pviweyM+a/DSNaSTsf6sfhQ8SBE624mQw==,iv:u3spMSZZODCNz5mP8hhbcmaKA4ZR/oBFeNUaOfGI7W0=,tag:gX10bEl/z5TrkkcufRSEFA==,type:str] 7 | rootPassword: ENC[AES256_GCM,data:fs/y8a9Lz0sXQfb05ELBBfLUzVFc1kfjNN8N0/YlNvj5Xvap9u2hRRgXp1l0Nh8gw1a8OL8SDZmSynft/OaR4TTRVjL7cwc0HQI8tMEi0fP0fatPQkWoZ1Av1CdMELw8Z8N+063pAKyhBw==,iv:sPhJ9zpEYF6twsl1+pSXQXkbLl6wYWeUIqCO3HKPg3o=,tag:pzHn78gJ/uktOxwDFMIEcw==,type:str] 8 | teavpnConfig: ENC[AES256_GCM,data:jRkJPVOzHAic3d6F+FJbFMJXncRLL4E1bnGikGYoTwdfbBZOw3qlVgWqg3LhlBXgOzOYSygkYryl1Dor0Sj3RuUPPYqHZDZc4wTe7UCy14W20vDqviVCez+AyR6b/UaQM89O0bmKMxlr5E0j+Tlrl/lMInQIvfh173WOV2nvITqUMHDqdlBq+JAxElb425Q7jiSocfM9oiDK1sO/jvHphggFeaohGovSB/br2rCbDzaHeHXm5FnamqOQUQfj1LaXKLYq+0jAXIctKolCwuq5C2GJJkofmTZLD5eZCsqcZqwzxC183TTwsyUDlJ3NWOkzGd2TC+aDeMiHmA1slvEClv6oGzl9yw5hEct50EPKKvArKnv0NtdmYAtZJtZ14qnwzq7WmlNyXy3Xcn1VwLTVFEFgLOFOLDButsFfesMSKT52RWeN+IzJjRIubMZo0Y62WvytTWHebVuMB0iYUrjAT8neyqxfJEbt+Z7n5VVYiLicuNS2ZbzFzaNSKzUfOZhQSlwsLWRIuJcoToXVmm0RgDDfdVyMdlQiASv9P8mUpEpEnBckQg==,iv:m3OBFSOl+AnadZeaJ9EZYlOh8yfzbiZV++hLSlnh/qo=,tag:5kbBvhYySCu2zsxA4tjiZA==,type:str] 9 | sops: 10 | age: 11 | - recipient: age1kzq0576smpu33wud97vr5ue87alqwq4w0fscykevkr3suv6qwf4q3jqlkg 12 | enc: | 13 | -----BEGIN AGE ENCRYPTED FILE----- 14 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBTNFhIdjJrdDVLQXorQ0ty 15 | MTUxR1ZHSGtja05pT2x3c1o5YnUxVm5TOVJJCitWZnBNT2U4dUdVNDVYNkl3Uzd6 16 | T1BxLytMaFNnYUVaM0VyK2FFYUpFbTAKLS0tIDZzc0t0d0ZONzZSdmhIaHk5WkFB 17 | RXlRdnA1ejBNeDNaZlpOVDh6QVNBYVUKjozeUjQP6OaM7vqPcpU88jCD4ZT9iJIg 18 | GnyFeJn+yTWUtXRuTpRsgk7hZ2Vqoz30pFQIYc5KD+1JMXXl4T8eqw== 19 | -----END AGE ENCRYPTED FILE----- 20 | lastmodified: "2025-06-02T19:23:45Z" 21 | mac: ENC[AES256_GCM,data:5TOFZaoG1Irp6v6zT2DJylVTZcf0HTx5xqTmPojqvH/BCY3UlA5wLwGQVXYe9aGUZEd6SyJUY7uIYccn9OOSM13aNrbxo0qF89nbqFBfX0v+mmnH8DqNfUMCTl3fp/ScH79L3aY9gCaIXVlV69/PKZRjpj4D9uKrCYRR0V6rpoo=,iv:hUBqejiRvsAJfT3FRA5CNS0SXCFtI5UOdHhzEghtewM=,tag:CawPlb+lt1QK7Ij8Mw+Xcg==,type:str] 22 | unencrypted_suffix: _unencrypted 23 | version: 3.10.2 24 | --------------------------------------------------------------------------------