├── .gitattributes ├── .github ├── LICENSE ├── README.md ├── auto_assign.yml ├── scripts │ └── update-flake-inputs │ │ ├── bun.lockb │ │ ├── index.ts │ │ ├── package.json │ │ └── tsconfig.json └── workflows │ ├── deadnix.yml │ ├── flake.yml │ ├── pr-setup.yml │ └── style.yml ├── .gitignore ├── DISASTER_RECOVERY.md ├── flake.lock ├── flake.nix ├── flake.toml ├── home ├── dots │ ├── background.gif │ ├── btop │ │ ├── btop.conf │ │ └── themes │ │ │ └── custom.theme │ ├── go │ │ └── env │ ├── icons │ │ ├── crop.512.png │ │ └── screenshot.jpg │ ├── k9s │ │ ├── config.yml │ │ ├── skin.yml │ │ └── views.yml │ ├── macchina │ │ ├── assets │ │ │ └── v.ascii │ │ ├── macchina.toml │ │ └── themes │ │ │ └── yttrium.toml │ ├── ntfy-sh.png │ ├── rofi │ │ ├── config.rasi │ │ ├── rofi-network-manager.conf │ │ └── rofi-network-manager.rasi │ └── wallpapers │ │ ├── 1.jpg │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ ├── 6.jpg │ │ ├── 7.jpg │ │ ├── 8.png │ │ └── 9.jpg ├── modules │ ├── browser.nix │ ├── default.nix │ ├── desktop │ │ ├── cursor.nix │ │ ├── default.nix │ │ ├── dunst.nix │ │ ├── gtk.nix │ │ ├── rofi.nix │ │ ├── wayland │ │ │ ├── components │ │ │ │ ├── mako.nix │ │ │ │ ├── swww.nix │ │ │ │ └── waybar │ │ │ │ │ ├── default.nix │ │ │ │ │ └── styles │ │ │ │ │ └── waybar-v1.css │ │ │ └── hyprland │ │ │ │ ├── binds.nix │ │ │ │ └── default.nix │ │ └── x11 │ │ │ ├── i3 │ │ │ ├── default.nix │ │ │ ├── greenclip.nix │ │ │ ├── i3.nix │ │ │ ├── i3status-rust.nix │ │ │ └── picom.nix │ │ │ └── plasma │ │ │ └── default.nix │ ├── dev │ │ ├── clients.nix │ │ ├── database │ │ │ ├── default.nix │ │ │ ├── editor.nix │ │ │ └── tools.nix │ │ ├── default.nix │ │ ├── devenv.nix │ │ ├── encore.nix │ │ ├── etc.nix │ │ ├── git │ │ │ ├── aliases.nix │ │ │ ├── cli.nix │ │ │ ├── default.nix │ │ │ ├── dots │ │ │ │ ├── lazygit │ │ │ │ │ └── config.yml │ │ │ │ └── shell.zsh │ │ │ ├── etc.nix │ │ │ ├── github.nix │ │ │ ├── jujutsu.nix │ │ │ ├── lazygit.nix │ │ │ └── terminal.nix │ │ ├── go │ │ │ ├── cli.nix │ │ │ ├── default.nix │ │ │ ├── dots │ │ │ │ └── shell.sh │ │ │ ├── etc.nix │ │ │ └── terminal.nix │ │ ├── llm.nix │ │ ├── mobile.nix │ │ ├── node.nix │ │ ├── ocaml.nix │ │ ├── ops │ │ │ ├── aws.nix │ │ │ ├── default.nix │ │ │ ├── gdk.nix │ │ │ ├── k8s.nix │ │ │ ├── terraform.nix │ │ │ └── tools.nix │ │ ├── processors.nix │ │ ├── pwn │ │ │ ├── default.nix │ │ │ ├── lammer.nix │ │ │ ├── osint.nix │ │ │ └── tools.nix │ │ ├── python.nix │ │ ├── rust.nix │ │ ├── writer.nix │ │ └── zig.nix │ ├── discord.nix │ ├── docker.nix │ ├── editors │ │ ├── cursor.nix │ │ ├── default.nix │ │ ├── dots │ │ │ └── nanorc │ │ │ │ └── hcl.nanorc │ │ ├── nano.nix │ │ └── vscode.nix │ ├── etc │ │ ├── bat.nix │ │ ├── btop.nix │ │ ├── color-picker.nix │ │ ├── default.nix │ │ ├── gsimplecal.nix │ │ ├── macchina.nix │ │ ├── man.nix │ │ ├── ntfy-sh.nix │ │ ├── translator.nix │ │ └── zathura.nix │ ├── file-manager.nix │ ├── media.nix │ ├── nao.nix │ ├── password-store.nix │ ├── spotify.nix │ ├── studio │ │ ├── 3d.nix │ │ ├── default.nix │ │ ├── images.nix │ │ └── video.nix │ ├── systemless.nix │ ├── terminal │ │ ├── alacritty.nix │ │ ├── default.nix │ │ ├── direnv.nix │ │ ├── dots │ │ │ ├── .gitmux.conf │ │ │ ├── .tmux.conf │ │ │ ├── alacritty.toml │ │ │ └── completionInit.zsh │ │ ├── fzf.nix │ │ ├── ghostty.nix │ │ ├── tmux.nix │ │ ├── tty-tools.nix │ │ └── zsh.nix │ ├── work.nix │ └── xdg.nix ├── options │ ├── default.nix │ ├── emoji-fzf.nix │ ├── github.nix │ ├── ntfy-sh.nix │ └── zig.nix ├── profiles │ └── luisnquin │ │ ├── .face │ │ ├── default.nix │ │ └── home.nix └── services │ ├── bluetooth-mpris.nix │ └── default.nix ├── lib ├── base64.nix ├── default.nix ├── formats.nix ├── fs.nix ├── machine.nix └── metadata.nix ├── overlays ├── nixpkgs-beta.nix └── nixpkgs.nix ├── secrets ├── default.nix └── secrets.nix ├── system ├── hosts │ └── nyx │ │ ├── configuration.nix │ │ ├── default.nix │ │ ├── disk-config.nix │ │ └── hardware-configuration.nix ├── modules │ ├── android.nix │ ├── audio.nix │ ├── battery.nix │ ├── bloatware.nix │ ├── bluetooth.nix │ ├── boot │ │ ├── default.nix │ │ ├── dots │ │ │ └── splash-image.png │ │ ├── grub.nix │ │ └── loader.nix │ ├── clipboard.nix │ ├── dbus.nix │ ├── default.nix │ ├── desktop │ │ ├── common.nix │ │ ├── default.nix │ │ ├── hyprland.nix │ │ ├── i3.nix │ │ └── plasma.nix │ ├── docker.nix │ ├── essentials.nix │ ├── fonts.nix │ ├── fs │ │ ├── default.nix │ │ └── incron.nix │ ├── gaming.nix │ ├── graphics.nix │ ├── graphics.patch │ ├── kernel.nix │ ├── network │ │ ├── acme.nix │ │ ├── cloudflare.nix │ │ ├── default.nix │ │ ├── firewall.nix │ │ ├── hosts.nix │ │ ├── nginx.nix │ │ ├── shell.sh │ │ └── vpn.nix │ ├── nix.nix │ ├── security │ │ ├── default.nix │ │ ├── groups.nix │ │ ├── keyring.nix │ │ ├── protocols.nix │ │ ├── sudo.nix │ │ ├── tools │ │ │ ├── default.nix │ │ │ └── logkeys.nix │ │ └── user.nix │ ├── systemd.nix │ ├── terminal │ │ ├── aliases.nix │ │ ├── default.nix │ │ ├── dots │ │ │ ├── .shrc │ │ │ └── .zshrc │ │ ├── starship.nix │ │ └── zsh.nix │ ├── thunar.nix │ └── vm │ │ ├── base.nix │ │ ├── default.nix │ │ └── vnc.nix └── services │ ├── clean-trash-bin.nix │ ├── default.nix │ ├── ensure-home-fs.nix │ └── successful-ping-to-google.nix └── tools ├── nix ├── hm-options │ └── default.nix └── nixos-options │ ├── default.nix │ └── nyx.nix └── nyx ├── assets └── nix-logo.png ├── completions.zsh ├── default.nix └── main.bash /.gitattributes: -------------------------------------------------------------------------------- 1 | *.go linguist-vendored 2 | *.py linguist-vendored 3 | *.css linguist-vendored -------------------------------------------------------------------------------- /.github/LICENSE: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2022 Luis Quiñones Requelme 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/README.md: -------------------------------------------------------------------------------- 1 | # NixOS environment configuration 2 | 3 | [![nixos-unstable](https://img.shields.io/badge/NixOS-unstable-informational.svg?style=flat&logo=nixos&logoColor=dee1e6&colorA=101419&colorB=70a5eb)](https://github.com/nixos/nixpkgs) 4 | [![nix-fmt](https://github.com/luisnquin/nixos-config/actions/workflows/style.yml/badge.svg)](https://github.com/luisnquin/nixos-config/actions/workflows/style.yml) 5 | 6 | > **Warning** 7 | > 8 | > _Maybe_ this is a single user setup and is not intended to be anything else 9 | 10 | ## Resources 11 | 12 | - [Used scripts](https://github.com/luisnquin/nix-scripts) 13 | - [Additional pkgs](https://github.com/luisquin/nixpkgs-extra) 14 | 15 | ## How does it look like? 16 | 17 | ![first-son](https://github.com/user-attachments/assets/134496fb-cf33-46b0-a3ce-e024cdd1f032) 18 | 19 | ![second-son](https://github.com/user-attachments/assets/9e183389-ea38-4480-86b5-47595a6a7ddc) 20 | 21 | ## Some configurations comes here thanks to 22 | 23 | - [the-argus](https://github.com/the-argus/nixsys) 24 | - [angristan](https://github.com/angristan/nixos-config) 25 | - [kmein](https://github.com/kmein/niveum) 26 | - [mogria](https://github.com/mogria/nixpkgs-config) 27 | - [qbit](https://github.com/qbit/nix-conf) 28 | - [rxyhn](https://github.com/rxyhn/dotfiles) 29 | - [srid](https://github.com/srid/nixos-config) 30 | - [wegank](https://github.com/wegank/nixos-config) 31 | - [Th0rgal](https://github.com/Th0rgal/horus-nix-home) 32 | - [abxh](https://github.com/abxh/dotfiles) 33 | - [HeinzDev](https://github.com/HeinzDev/Hyprland-dotfiles) 34 | - [NotAShelf](https://github.com/NotAShelf/nyx) 35 | - [nmasur](https://github.com/nmasur/dotfiles) 36 | - [lovesegfault](https://github.com/lovesegfault/nix-config) 37 | -------------------------------------------------------------------------------- /.github/auto_assign.yml: -------------------------------------------------------------------------------- 1 | runOnDraft: false 2 | addReviewers: true 3 | addAssignees: author 4 | reviewers: 5 | - luisnquin 6 | 7 | # A number of reviewers added to the pull request 8 | # Set 0 to add all the reviewers (default: 0) 9 | numberOfReviewers: 0 10 | -------------------------------------------------------------------------------- /.github/scripts/update-flake-inputs/bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/.github/scripts/update-flake-inputs/bun.lockb -------------------------------------------------------------------------------- /.github/scripts/update-flake-inputs/index.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bun 2 | 3 | import { formatDate } from "date-fns/format"; 4 | import { titleCase } from "title-case"; 5 | import { $ } from "bun"; 6 | 7 | import "colors"; 8 | 9 | interface FlakeMetadata { 10 | description: string; 11 | lastModified: number; 12 | locked: { 13 | lastModified: number; 14 | narHash: string; 15 | ref: string; 16 | rev: string; 17 | revCount: number; 18 | type: "git"; 19 | url: string; 20 | }; 21 | locks: { 22 | nodes: { 23 | [key: string]: { 24 | inputs: { 25 | [key: string]: string[] | string; 26 | }; 27 | locked: { 28 | lastModified: number; 29 | narHash: string; 30 | owner: string; 31 | repo: string; 32 | rev: string; 33 | type: "github"; 34 | }; 35 | original: { 36 | owner: string; 37 | repo: string; 38 | type: "github"; 39 | }; 40 | }; 41 | }; 42 | root: "root"; 43 | version: number; 44 | }; 45 | original: { 46 | type: "git"; 47 | url: string; 48 | }; 49 | originalUrl: string; 50 | path: string; 51 | resolved: { 52 | type: "git"; 53 | url: string; 54 | }; 55 | resolvedUrl: string; 56 | revCount: number; 57 | revision: string; 58 | url: string; 59 | } 60 | 61 | class Flake { 62 | public meta: FlakeMetadata; 63 | 64 | constructor(meta: FlakeMetadata) { 65 | this.meta = meta; 66 | } 67 | 68 | static async getCurrentState(): Promise { 69 | return await $`nix flake metadata --json`.json(); 70 | } 71 | 72 | static async init(): Promise { 73 | const metadata = await Flake.getCurrentState(); 74 | 75 | return new Flake(metadata); 76 | } 77 | 78 | async refresh(): Promise { 79 | const meta = await Flake.getCurrentState(); 80 | this.meta = meta; 81 | } 82 | } 83 | 84 | const prettyJoin = (arr: string[]) => 85 | arr.length > 1 86 | ? `${arr.slice(0, arr.length - 1).join(", ")} and ${arr.at(-1)}` 87 | : arr[0]; 88 | 89 | const main = async () => { 90 | const flake = await Flake.init(); 91 | 92 | const inputNames = Object.keys(flake.meta.locks.nodes); 93 | 94 | const inputsToUpdate = [...new Set(process.argv.slice(2))]; 95 | if (inputsToUpdate.length === 0) { 96 | console.log("no inputs to update".yellow); 97 | return; 98 | } 99 | 100 | const missingInputs = inputsToUpdate.filter( 101 | (inputName) => !inputNames.includes(inputName), 102 | ); 103 | if (missingInputs.length > 0) { 104 | console.log( 105 | `input(s) not available in flake:\n - ${missingInputs.join("\n - ")}`.red, 106 | ); 107 | process.exit(1); 108 | } 109 | 110 | const epochToHumanReadableDate = (epoch: number) => 111 | formatDate(new Date(epoch * 1000), "yyyy-MM-dd"); 112 | 113 | const updatedInputs: Array = []; 114 | const { stderr } = process; 115 | 116 | for (const input of inputsToUpdate) { 117 | const since = epochToHumanReadableDate( 118 | flake.meta.locks.nodes[input].locked.lastModified, 119 | ); 120 | 121 | stderr.write(`$ nix flake lock --refresh --update-input ${input}\n`.yellow); 122 | await $`nix flake lock --refresh --update-input ${input}`.quiet(); 123 | 124 | await flake.refresh(); 125 | const until = epochToHumanReadableDate( 126 | flake.meta.locks.nodes[input].locked.lastModified, 127 | ); 128 | 129 | if (since === until) { 130 | stderr.write( 131 | `no new changes detected for input '${input}' since ${since}\n`.magenta, 132 | ); 133 | 134 | continue; 135 | } 136 | 137 | stderr.write(`new changes were detected since '${since}'\n`.blue); 138 | 139 | await $`git add flake.lock`.quiet(); 140 | await $`git commit -m "flake-update(${input}): automated change"`.quiet(); 141 | 142 | updatedInputs.push(titleCase(input)); 143 | } 144 | 145 | if (updatedInputs.length > 0) { 146 | console.log( 147 | `Updated ${updatedInputs.length} input(s): ${prettyJoin(updatedInputs)}`, 148 | ); 149 | } 150 | }; 151 | 152 | await main(); 153 | -------------------------------------------------------------------------------- /.github/scripts/update-flake-inputs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "update-flake-inputs", 3 | "module": "index.ts", 4 | "type": "module", 5 | "devDependencies": { 6 | "@types/bun": "latest" 7 | }, 8 | "peerDependencies": { 9 | "typescript": "^5.0.0" 10 | }, 11 | "dependencies": { 12 | "colors": "^1.4.0", 13 | "date-fns": "^4.1.0", 14 | "title-case": "^4.3.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.github/scripts/update-flake-inputs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | // Enable latest features 4 | "lib": ["ESNext", "DOM"], 5 | "target": "ESNext", 6 | "module": "ESNext", 7 | "moduleDetection": "force", 8 | "jsx": "react-jsx", 9 | "allowJs": true, 10 | 11 | // Bundler mode 12 | "moduleResolution": "bundler", 13 | "allowImportingTsExtensions": true, 14 | "verbatimModuleSyntax": true, 15 | "noEmit": true, 16 | 17 | // Best practices 18 | "strict": true, 19 | "skipLibCheck": true, 20 | "noFallthroughCasesInSwitch": true, 21 | 22 | // Some stricter flags (disabled by default) 23 | "noUnusedLocals": false, 24 | "noUnusedParameters": false, 25 | "noPropertyAccessFromIndexSignature": false 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.github/workflows/deadnix.yml: -------------------------------------------------------------------------------- 1 | name: Deadnix 2 | 3 | on: [push, pull_request] 4 | 5 | env: 6 | committer_name: Antigen 7 | committer_email: antigen.bot0@gmail.com 8 | 9 | jobs: 10 | deadnix-job: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Code checkout 14 | uses: actions/checkout@v4 15 | with: 16 | ref: ${{ github.head_ref }} 17 | 18 | - name: Debug logs 19 | run: | 20 | echo "github.head_ref: ${{ github.head_ref }}" 21 | echo "github.ref: ${{ github.ref }}" 22 | echo "github.repository: ${{ github.repository }}" 23 | echo "github.sha: ${{ github.sha }}" 24 | 25 | printf "$ git branch --show-current > " 26 | git branch --show-current 27 | 28 | - name: Install Nix 29 | uses: cachix/install-nix-action@v22 30 | 31 | - name: Setup Cachix 32 | uses: cachix/cachix-action@v12 33 | with: 34 | name: deadnix 35 | 36 | - name: Run deadnix and publish changes if any 37 | uses: luisnquin/deadnix-action@main 38 | with: 39 | author: ${{env.committer_name}} <${{env.committer_email}}> 40 | committer: ${{env.committer_name}} <${{env.committer_email}}> 41 | commit_message: "deadnix: removed dead code" 42 | -------------------------------------------------------------------------------- /.github/workflows/flake.yml: -------------------------------------------------------------------------------- 1 | name: Nix flake 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | check-flake: 6 | name: Evaluate flake 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Code checkout 10 | uses: actions/checkout@v4 11 | 12 | - name: Install Nix 13 | uses: DeterminateSystems/nix-installer-action@main 14 | 15 | - name: Check Nixpkgs Inputs 16 | uses: DeterminateSystems/flake-checker-action@v9 17 | 18 | - name: Add Nix Cache 19 | uses: DeterminateSystems/magic-nix-cache-action@main 20 | 21 | - name: Check the flake 22 | run: nix flake check 23 | -------------------------------------------------------------------------------- /.github/workflows/pr-setup.yml: -------------------------------------------------------------------------------- 1 | name: Pull request setup 2 | on: 3 | pull_request: 4 | types: 5 | - opened 6 | - ready_for_review 7 | 8 | permissions: 9 | contents: read 10 | pull-requests: write 11 | 12 | jobs: 13 | add-reviewers-assignees: 14 | name: Add reviewers and assignees 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Add reviewers and assignees 18 | uses: kentaro-m/auto-assign-action@v2.0.0 19 | with: 20 | configuration-path: .github/auto_assign.yml 21 | -------------------------------------------------------------------------------- /.github/workflows/style.yml: -------------------------------------------------------------------------------- 1 | name: Check Nix formatting 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | check-formatting: 6 | name: Check formatting 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Code checkout 10 | uses: actions/checkout@v4 11 | 12 | - name: Setup Alejandra CLI 13 | uses: luisnquin/setup-alejandra@v1.0.0 14 | 15 | - name: Check formatting 16 | run: alejandra --check **/*.nix 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/result 2 | **/target 3 | **/__pycache__ 4 | 5 | *.annot 6 | *.cmo 7 | *.cma 8 | *.cmi 9 | *.a 10 | *.o 11 | *.cmx 12 | *.cmxs 13 | *.cmxa 14 | 15 | node_modules/ 16 | 17 | # ocamlbuild working directory 18 | _build/ 19 | 20 | # ocamlbuild targets 21 | *.byte 22 | *.native 23 | 24 | # oasis generated files 25 | setup.data 26 | setup.log 27 | 28 | # Merlin configuring file for Vim and Emacs 29 | .merlin 30 | 31 | # Dune generated files 32 | *.install 33 | 34 | # Local OPAM switch 35 | _opam/ 36 | 37 | **/.vscode/ -------------------------------------------------------------------------------- /DISASTER_RECOVERY.md: -------------------------------------------------------------------------------- 1 | 2 | # Disaster recovery 3 | 4 | > [!CAUTION] 5 | > This could require you more disks! 6 | 7 | 1. [NixOS and/or Home manager **rebuild** fails with error _"failed to open '/nix/store/\*-source'"_](https://discourse.nixos.org/t/nix-flakes-nix-store-source-no-such-file-or-directory/17836/9) 8 | 9 | ![nix-rebuild-source-not-found](https://github.com/user-attachments/assets/546372ba-56e4-4fc8-8347-cd1d06e55483) 10 | 11 | 2. [Wireless connection instantly fails on startup when just switched from Windows](https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi#about_dual-boot_with_windows_and_fast-boot_enabled). 12 | 3. **macOS VM fails to build.** Ensure to enable the virtualisation capacibilities for your CPU in your **BIOS**. You might find this option as "Intel (VMX) Virtualization Technology". 13 | 4. In middle of a `nixos-rebuild` the screen may freeze and then the /boot partition will not mount correctly so when you restart the computer you will have the GRUB Rescue menu and nothing else. 14 | Trying to fix that problem from there wont be easy so you might need a Live USB with NixOS as part of your contigency plan. Once you're in, execute the following commands: 15 | 16 | ```shell 17 | $ sudo mkdir -p /mnt && sudo mount /dev/nvme0n1p6 /mnt && sudo mount /dev/nvme0n1p1 /mnt/boot 18 | $ sudo nixos-enter 19 | $ cd /home/luisnquin/.dotfiles; unset SUDO_USER && nixos-rebuild boot --flake .#nyx 20 | ``` 21 | 22 | 5. If the _/nix/store_ appears to be **corrupted** you might want to just execute this `sudo nix-store --repair --verify --check-contents`. 23 | -------------------------------------------------------------------------------- /flake.toml: -------------------------------------------------------------------------------- 1 | 2 | [users.luisnquin] 3 | fullName = "Luis Quiñones" 4 | email = "lpaandres2020@gmail.com" 5 | gitEmail = "lpaandres2020@gmail.com" 6 | 7 | [hosts.nyx] 8 | desktop = "hyprland" 9 | timeZone = "America/Lima" 10 | i18nLocale = "en_US.UTF-8" 11 | keyboardLayout = "latam" 12 | resolution = "1920x1080" 13 | batteryThreshold = 70 14 | isLaptop = true 15 | gui = true 16 | 17 | [nix] 18 | stateVersion = "25.11" 19 | channel = "nixos-unstable" 20 | -------------------------------------------------------------------------------- /home/dots/background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/background.gif -------------------------------------------------------------------------------- /home/dots/btop/themes/custom.theme: -------------------------------------------------------------------------------- 1 | 2 | # Main bg 3 | theme[main_bg]="#1f1d26" 4 | 5 | # Main text color 6 | theme[main_fg]="#64b3a4" 7 | 8 | # Title color for boxes 9 | theme[title]="#cfc9c2" 10 | 11 | # Highlight color for keyboard shortcuts 12 | theme[hi_fg]="#7dcfff" 13 | 14 | # Background color of selected item in processes box 15 | theme[selected_bg]="#7226de" 16 | 17 | # Foreground color of selected item in processes box 18 | theme[selected_fg]="#cfc9c2" 19 | 20 | # Color of inactive/disabled text 21 | theme[inactive_fg]="#565f89" 22 | 23 | # Misc colors for processes box including mini cpu graphs, details memory graph and details status text 24 | theme[proc_misc]="#7dcfff" 25 | 26 | # Cpu box outline color 27 | theme[cpu_box]="#565f89" 28 | 29 | # Memory/disks box outline color 30 | theme[mem_box]="#565f89" 31 | 32 | # Net up/down box outline color 33 | theme[net_box]="#565f89" 34 | 35 | # Processes box outline color 36 | theme[proc_box]="#565f89" 37 | 38 | # Box divider line and small boxes line color 39 | theme[div_line]="#565f89" 40 | 41 | # Temperature graph colors 42 | theme[temp_start]="#9ece6a" 43 | theme[temp_mid]="#e0af68" 44 | theme[temp_end]="#f7768e" 45 | 46 | # CPU graph colors 47 | theme[cpu_start]="#9ece6a" 48 | theme[cpu_mid]="#e0af68" 49 | theme[cpu_end]="#f7768e" 50 | 51 | # Mem/Disk free meter 52 | theme[free_start]="#9ece6a" 53 | theme[free_mid]="#e0af68" 54 | theme[free_end]="#f7768e" 55 | 56 | # Mem/Disk cached meter 57 | theme[cached_start]="#9ece6a" 58 | theme[cached_mid]="#e0af68" 59 | theme[cached_end]="#f7768e" 60 | 61 | # Mem/Disk available meter 62 | theme[available_start]="#9ece6a" 63 | theme[available_mid]="#e0af68" 64 | theme[available_end]="#f7768e" 65 | 66 | # Mem/Disk used meter 67 | theme[used_start]="#9ece6a" 68 | theme[used_mid]="#e0af68" 69 | theme[used_end]="#f7768e" 70 | 71 | # Download graph colors 72 | theme[download_start]="#9ece6a" 73 | theme[download_mid]="#e0af68" 74 | theme[download_end]="#f7768e" 75 | 76 | # Upload graph colors 77 | theme[upload_start]="#9ece6a" 78 | theme[upload_mid]="#e0af68" 79 | theme[upload_end]="#f7768e" 80 | -------------------------------------------------------------------------------- /home/dots/go/env: -------------------------------------------------------------------------------- 1 | GO111MODULE=on 2 | CGO_ENABLED=0 -------------------------------------------------------------------------------- /home/dots/icons/crop.512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/icons/crop.512.png -------------------------------------------------------------------------------- /home/dots/icons/screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/icons/screenshot.jpg -------------------------------------------------------------------------------- /home/dots/k9s/config.yml: -------------------------------------------------------------------------------- 1 | # Without symlink 2 | k9s: 3 | # Represents ui poll intervals. Default 2secs 4 | refreshRate: 2 5 | # Number of retries once the connection to the api-server is lost. Default 15. 6 | maxConnRetry: 15 7 | # Enable mouse support. Default false 8 | enableMouse: false 9 | # Set to true to hide K9s header. Default false 10 | headless: false 11 | # Set to true to hide K9s logo. Default false 12 | logoless: true 13 | # Set to true to hide K9s crumbs. Default false 14 | crumbsless: true 15 | # Indicates whether modification commands like delete/kill/edit are disabled. Default is false 16 | readOnly: false 17 | # Toggles icons display as not all terminal support these chars. 18 | noIcons: false 19 | # Logs configuration 20 | logger: 21 | tail: 200 22 | buffer: 5000 23 | sinceSeconds: 60 24 | fullScreenLogs: false 25 | textWrap: false 26 | showTime: false 27 | -------------------------------------------------------------------------------- /home/dots/k9s/skin.yml: -------------------------------------------------------------------------------- 1 | # catppuccin mocha style 2 | 3 | base: &base '#1e1e2e' 4 | blue: &blue '#89b4fa' 5 | crust: &crust '#11111b' 6 | flamingo: &flamingo '#f2cdcd' 7 | green: &green '#a6e3a1' 8 | lavender: &lavender '#b4befe' 9 | mantle: &mantle '#181825' 10 | maroon: &maroon '#eba0ac' 11 | mauve: &mauve '#cba6f7' 12 | overlay0: &overlay0 '#6c7086' 13 | overlay1: &overlay1 '#7f849c' 14 | overlay2: &overlay2 '#9399b2' 15 | peach: &peach '#fab387' 16 | pink: &pink '#f5c2e7' 17 | red: &red '#f38ba8' 18 | rosewater: &rosewater '#f5e0dc' 19 | sapphire: &sapphire '#74c7ec' 20 | sky: &sky '#89dceb' 21 | subtext0: &subtext0 '#a6adc8' 22 | subtext1: &subtext1 '#bac2de' 23 | surface0: &surface0 '#313244' 24 | surface1: &surface1 '#45475a' 25 | surface2: &surface2 '#585b70' 26 | teal: &teal '#94e2d5' 27 | text: &text '#cdd6f4' 28 | yellow: &yellow '#f9e2af' 29 | 30 | # Skin... 31 | k9s: 32 | # General K9s styles 33 | body: 34 | fgColor: *text 35 | bgColor: *base 36 | logoColor: *mauve 37 | 38 | # Command prompt styles 39 | prompt: 40 | fgColor: *text 41 | bgColor: *mantle 42 | suggestColor: *blue 43 | 44 | # ClusterInfoView styles. 45 | info: 46 | fgColor: *peach 47 | sectionColor: *text 48 | 49 | # Dialog styles. 50 | dialog: 51 | fgColor: *yellow 52 | bgColor: *overlay2 53 | buttonFgColor: *base 54 | buttonBgColor: *overlay1 55 | buttonFocusFgColor: *base 56 | buttonFocusBgColor: *pink 57 | labelFgColor: *rosewater 58 | fieldFgColor: *text 59 | 60 | frame: 61 | # Borders styles. 62 | border: 63 | fgColor: *mauve 64 | focusColor: *lavender 65 | 66 | # MenuView attributes and styles 67 | menu: 68 | fgColor: *text 69 | keyColor: *blue 70 | # Used for favorite namespaces 71 | numKeyColor: *maroon 72 | 73 | # CrumbView attributes for history navigation. 74 | crumbs: 75 | fgColor: *base 76 | bgColor: *maroon 77 | activeColor: *flamingo 78 | 79 | # Resource status and update styles 80 | status: 81 | newColor: *blue 82 | modifyColor: *lavender 83 | addColor: *green 84 | pendingColor: *peach 85 | errorColor: *red 86 | highlightColor: *sky 87 | killColor: *mauve 88 | completedColor: *overlay0 89 | 90 | # Border title styles. 91 | title: 92 | fgColor: *teal 93 | bgColor: *base 94 | highlightColor: *pink 95 | counterColor: *yellow 96 | filterColor: *green 97 | 98 | views: 99 | # Charts skins... 100 | charts: 101 | bgColor: *base 102 | chartBgColor: *base 103 | dialBgColor: *base 104 | defaultDialColors: 105 | - *green 106 | - *red 107 | defaultChartColors: 108 | - *green 109 | - *red 110 | resourceColors: 111 | cpu: 112 | - *mauve 113 | - *blue 114 | mem: 115 | - *yellow 116 | - *peach 117 | 118 | # TableView attributes. 119 | table: 120 | fgColor: *text #Doesn't Work 121 | bgColor: *base 122 | cursorFgColor: *surface0 # Doesn't Work 123 | cursorBgColor: *surface1 # should be rosewater 124 | markColor: *rosewater # Doesn't Work 125 | # Header row styles. 126 | header: 127 | fgColor: *yellow 128 | bgColor: *base 129 | sorterColor: *sky 130 | 131 | # Xray view attributes. 132 | xray: 133 | fgColor: *text #Doesn't Work 134 | bgColor: *base 135 | # Need to set this to a dark color since color text can't be changed 136 | # Ideally this would be rosewater 137 | cursorColor: *surface1 138 | cursorTextColor: *base #Doesn't Work 139 | graphicColor: *pink 140 | 141 | # YAML info styles. 142 | yaml: 143 | keyColor: *blue 144 | colonColor: *subtext0 145 | valueColor: *text 146 | 147 | # Logs styles. 148 | logs: 149 | fgColor: *text 150 | bgColor: *base 151 | indicator: 152 | fgColor: *lavender 153 | bgColor: *base 154 | 155 | help: 156 | fgColor: *text 157 | bgColor: *base 158 | sectionColor: *green 159 | keyColor: *blue 160 | numKeyColor: *maroon 161 | -------------------------------------------------------------------------------- /home/dots/k9s/views.yml: -------------------------------------------------------------------------------- 1 | # $XDG_CONFIG_HOME/k9s/views.yml 2 | k9s: 3 | views: 4 | # Alters the pod view column layout. Uses GVR as key 5 | v1/pods: 6 | columns: 7 | - NAMESPACE 8 | - NAME 9 | - STATUS 10 | - AGE 11 | - READY 12 | - IP 13 | - RESTARTS 14 | # - "%CPU/R" 15 | # - "%CPU/L" 16 | # - "%MEM/R" 17 | # - "%MEM/L" 18 | # - CPU 19 | # - MEM 20 | # - NODE 21 | # - PF 22 | 23 | # Alters the service view column layout 24 | v1/services: 25 | columns: 26 | - AGE 27 | - NAMESPACE 28 | - NAME 29 | - TYPE 30 | - CLUSTER-IP -------------------------------------------------------------------------------- /home/dots/macchina/assets/v.ascii: -------------------------------------------------------------------------------- 1 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣲⢄⠲⣤⢀⠀⠀⠀⠀⠀⠀⠀⠀ 2 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⡟⠋⠀⠀⣸⢳⣖⣷⣈⢢⣀⣀⣀⣀⡀⠄ 3 | ⠀⠀⠀⠀⠀⠀⠀⠀⣼⡟⠁⠀⣠⢞⣫⡾⣻⡾⣿⣧⢻⡉⠂⠙⠀⠀ 4 | ⠀⠀⠀⠀⠀⠀⠀⠰⢿⣼⣷⢿⢽⣿⣿⣷⡛⡷⣾⣯⡺⣳⡆⠀⠀⠀ 5 | ⠀⠀⠀⠀⠀⠀⠀⢠⣾⣽⣾⠾⡿⠾⣿⣧⢹⣧⠴⢕⡊⠩⠌⠁⠀⠀ 6 | ⠀⠀⠀⠀⣀⣀⣀⠈⠋⠁⠀⠀⠹⣳⣾⣿⡟⠃⢸⡯⢭⣉⠉⠀⠀⠀ 7 | ⠀⠀⢠⢋⣵⣶⣤⣅⡂⠤⠤⠤⠔⠋⠉⣽⡉⠀⣼⣇⣀⠈⠙⠄⠀⠀ 8 | ⠀⠀⠈⣸⣏⠀⠀⠉⠻⠶⣶⣤⣤⣤⣾⣿⢣⣻⠟⠃⢤⠀⢀⡤⠆⠀ 9 | ⢰⠀⠀⠘⣿⡄⠀⠀⠀⠀⠀⠀⢼⣿⡿⣿⣷⡞⠀⠀⢠⡟⠉⠀⠀⠀ 10 | ⠈⠳⣶⣮⡿⠁⠀⠀⠀⠀⠀⠀⠈⢾⣿⠭⠼⠁⠀⢠⠏⠀⠀⠀⠀⠀ 11 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡛⠀⠀⠀⠀⠀⠀ 12 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀ 13 | -------------------------------------------------------------------------------- /home/dots/macchina/macchina.toml: -------------------------------------------------------------------------------- 1 | # Specifies the network interface to use for the LocalIP readout 2 | interface = "wlan0" 3 | 4 | # Lengthen uptime output 5 | long_uptime = true 6 | 7 | # Lengthen shell output 8 | long_shell = false 9 | 10 | # Lengthen kernel output 11 | long_kernel = false 12 | 13 | # Toggle between displaying the current shell or your user's default one. 14 | current_shell = false 15 | 16 | # Toggle between displaying the number of physical or logical cores of your 17 | # processor. 18 | physical_cores = true 19 | 20 | # Display percentage next to memory usage 21 | # memory_percentage = false 22 | 23 | # Display percentage next to disk space usage 24 | # disk_space_percentage = false 25 | 26 | # Themes need to be placed in "$XDG_CONFIG_DIR/macchina/themes" beforehand. 27 | # e.g.: 28 | # if theme path is /home/foo/.config/macchina/themes/Sodium.toml 29 | # theme should be uncommented and set to "Sodium" 30 | # 31 | theme = "yttrium" 32 | 33 | # Displays only the specified readouts. 34 | # Accepted values (case-sensitive): 35 | # - Host 36 | # - Machine 37 | # - Kernel 38 | # - Distribution 39 | # - OperatingSystem 40 | # - DesktopEnvironment 41 | # - WindowManager 42 | # - Resolution 43 | # - Backlight 44 | # - Packages 45 | # - LocalIP 46 | # - Terminal 47 | # - Shell 48 | # - Uptime 49 | # - Processor 50 | # - ProcessorLoad 51 | # - Memory 52 | # - Battery 53 | # - GPU 54 | # - DiskSpace 55 | # Example: 56 | # show = ["Battery", "Memory", ...] 57 | -------------------------------------------------------------------------------- /home/dots/macchina/themes/yttrium.toml: -------------------------------------------------------------------------------- 1 | # Yttrium https://github.com/Macchina-CLI/macchina/discussions/222#discussioncomment-2748828 2 | 3 | spacing = 1 4 | padding = 0 5 | hide_ascii = false 6 | prefer_small_ascii = true 7 | separator = "λ" 8 | key_color = "#583ba3" 9 | separator_color = "White" 10 | 11 | 12 | [palette] 13 | type = "Dark" 14 | visible = true 15 | glyph = "[-][+] " 16 | 17 | [bar] 18 | # glyph = "||" 19 | symbol_open = '[' 20 | symbol_close = ']' 21 | hide_delimiters = true 22 | visible = false 23 | 24 | [box] 25 | title = "Yttrium" 26 | border = "double" 27 | visible = false 28 | 29 | [box.inner_margin] 30 | x = 2 31 | y = 0 32 | 33 | [custom_ascii] 34 | color = "#583ba3" 35 | path = "/etc/nixos/home/dots/macchina/assets/v.ascii" 36 | 37 | [randomize] 38 | key_color = false 39 | separator_color = false 40 | 41 | [keys] 42 | host = "Host" 43 | kernel = "Kernel" 44 | battery = "Battery" 45 | os = "OS" 46 | de = "DE" 47 | wm = "WM" 48 | distro = "Distro" 49 | terminal = "Terminal" 50 | shell = "Shell" 51 | packages = "Packages" 52 | uptime = "Uptime" 53 | memory = "Memory" 54 | machine = "Machine" 55 | local_ip = "Local IP" 56 | backlight = "Brightness" 57 | resolution = "Resolution" 58 | cpu_load = "CPU Load" 59 | cpu = "CPU" 60 | -------------------------------------------------------------------------------- /home/dots/ntfy-sh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/ntfy-sh.png -------------------------------------------------------------------------------- /home/dots/rofi/config.rasi: -------------------------------------------------------------------------------- 1 | configuration { 2 | location: 0; 3 | xoffset: 0; 4 | yoffset: 0; 5 | 6 | font: "Cascadia Code 10"; 7 | show-icons: false; 8 | case-sensitive: false; 9 | terminal: "ghostty"; 10 | 11 | clipboard { 12 | display-name: "󰅍"; 13 | } 14 | 15 | drun { 16 | display-name: "󰌧"; 17 | } 18 | 19 | run { 20 | display-name: ""; 21 | } 22 | 23 | window { 24 | display-name: ""; 25 | } 26 | 27 | power-menu { 28 | display-name: "󱓿"; 29 | } 30 | 31 | timeout { 32 | delay: 10; 33 | action: "kb-cancel"; 34 | } 35 | } 36 | 37 | * { 38 | border: 0; 39 | margin: 0; 40 | padding: 0; 41 | spacing: 0; 42 | 43 | bg: #eee0cb; 44 | bg-alt: #bdf7ea; 45 | fg: #839788; 46 | fg-alt: #2b345e; 47 | 48 | background-color: @bg; 49 | text-color: @fg; 50 | } 51 | 52 | window { 53 | transparency: "real"; 54 | width: 750px; 55 | } 56 | 57 | entry { 58 | background-color: inherit; 59 | padding: 12px 3px; 60 | } 61 | 62 | prompt { 63 | background-color: inherit; 64 | padding: 12px; 65 | } 66 | 67 | listview { 68 | lines: 8; 69 | } 70 | 71 | element-text { 72 | // text-color: @fg-alt; 73 | padding: 10px 20px; 74 | } 75 | 76 | element-text selected { 77 | text-color: @fg-alt; 78 | background-color: @bg-alt; 79 | } 80 | -------------------------------------------------------------------------------- /home/dots/rofi/rofi-network-manager.conf: -------------------------------------------------------------------------------- 1 | # Location 2 | # +---------- + 3 | # | 1 | 2 | 3 | 4 | # | 8 | 0 | 4 | 5 | # | 7 | 6 | 5 | 6 | # +-----------+ 7 | #The grid represents the screen with the numbers indicating the location of the window. 8 | #If you want the window to be in the upper right corner, set location to 3. 9 | LOCATION=3 10 | 11 | #This sets the anchor point for the window displaying the QR code. 12 | QRCODE_LOCATION=$LOCATION 13 | 14 | #X, Y Offset 15 | #This sets the distance of the window from the edge of the screen on the X and Y axis. 16 | Y_AXIS=50 17 | X_AXIS=-5 18 | 19 | #Use notifications or not 20 | #Values can be "true" or "false" 21 | NOTIFICATIONS="true" 22 | #Location of qrcode wifi image 23 | QRCODE_DIR="/tmp/" 24 | #WIDTH_FIX_MAIN/WIDTH_FIX_STATUS 25 | #These values can be adjusted if the text doesn't fit or 26 | #if there is too much space at the end when you launch the script. 27 | #It will depend on the font type and size. 28 | WIDTH_FIX_MAIN=20 29 | WIDTH_FIX_STATUS=10 30 | #Values can be "true" or "false" 31 | #Set it to true, if the script outputs the signal strength with asterisks 32 | #and you want bars. 33 | ASCII_OUT=false 34 | #Values can be "true" or "false" 35 | #Set it to true if you want to use custom icons 36 | #for the signal strength instead of the default ones. 37 | CHANGE_BARS=false 38 | #Custom signal strength indicators 39 | SIGNAL_STRENGTH_0="0" 40 | SIGNAL_STRENGTH_1="1" 41 | SIGNAL_STRENGTH_2="12" 42 | SIGNAL_STRENGTH_3="123" 43 | SIGNAL_STRENGTH_4="1234" 44 | -------------------------------------------------------------------------------- /home/dots/rofi/rofi-network-manager.rasi: -------------------------------------------------------------------------------- 1 | configuration { 2 | show-icons: false; 3 | sidebar-mode: false; 4 | hover-select: true; 5 | me-select-entry: ""; 6 | me-accept-entry: [MousePrimary]; 7 | } 8 | 9 | *{ 10 | font: "DejaVu Sans Mono 9"; //Font 11 | //Colors 12 | foreground: #f8f8f2; //Text 13 | background: #0A1229; //Background 14 | accent: #00BCD4; //Highlight 15 | foreground-selection: @foreground; //Selection_fg 16 | background-selection: #e34039; //Selection_bg 17 | 18 | transparent: #ffffff00; 19 | background-color: @transparent; 20 | text-color: @foreground; 21 | selected-normal-foreground: @foreground-selection; 22 | normal-foreground: @foreground; 23 | alternate-normal-background: @transparent; 24 | selected-urgent-foreground: @foreground; 25 | urgent-foreground: @foreground; 26 | alternate-urgent-background: @background; 27 | active-foreground: @accent; 28 | selected-active-foreground: @background-selection; 29 | alternate-normal-foreground: @foreground; 30 | alternate-active-background: @background; 31 | bordercolor: @background; 32 | normal-background: @transparent; 33 | selected-normal-background: @background-selection; 34 | separatorcolor: @accent; 35 | urgent-background: @accent; 36 | alternate-urgent-foreground: @foreground; 37 | selected-urgent-background: @accent; 38 | alternate-active-foreground: @foreground; 39 | selected-active-background: @transparent; 40 | active-background: @transparent; 41 | } 42 | 43 | window { 44 | text-color: @foreground; 45 | background-color: @background; 46 | border-radius: 6px; 47 | padding: 10; 48 | } 49 | 50 | mainbox { 51 | border: 0; 52 | padding: 0; 53 | } 54 | 55 | textbox { 56 | text-color: @foreground; 57 | } 58 | 59 | listview { 60 | spacing: 4px; 61 | dynamic: true; 62 | fixed-height: false; 63 | border: 0; 64 | scrollbar: false; 65 | text-color: @separatorcolor; 66 | } 67 | 68 | element { 69 | border: 0; 70 | padding: 0; 71 | border-radius: 4px; 72 | } 73 | 74 | element-text { 75 | background-color: inherit; 76 | text-color: inherit; 77 | } 78 | 79 | element.normal.normal { 80 | text-color: @normal-foreground; 81 | background-color: @normal-background; 82 | } 83 | 84 | element.normal.urgent { 85 | text-color: @urgent-foreground; 86 | background-color: @urgent-background; 87 | } 88 | 89 | element.normal.active { 90 | text-color: @active-foreground; 91 | background-color: @active-background; 92 | } 93 | 94 | element.selected.normal { 95 | text-color: @selected-normal-foreground; 96 | background-color: @selected-normal-background; 97 | } 98 | 99 | element.selected.urgent { 100 | text-color: @selected-urgent-foreground; 101 | background-color: @selected-urgent-background; 102 | } 103 | 104 | element.selected.active { 105 | text-color: @selected-active-foreground; 106 | background-color: @selected-active-background; 107 | } 108 | 109 | element.alternate.normal { 110 | text-color: @alternate-normal-foreground; 111 | background-color: @alternate-normal-background; 112 | } 113 | 114 | element.alternate.urgent { 115 | text-color: @alternate-urgent-foreground; 116 | background-color: @alternate-urgent-background; 117 | } 118 | 119 | element.alternate.active { 120 | text-color: @alternate-active-foreground; 121 | background-color: @alternate-active-background; 122 | } 123 | 124 | mode-switcher { 125 | border: 0; 126 | } 127 | 128 | button selected { 129 | text-color: @selected-normal-foreground; 130 | background-color: @selected-normal-background; 131 | } 132 | 133 | button normal { 134 | text-color: @foreground; 135 | } 136 | 137 | inputbar { 138 | children: [textbox-prompt-colon,entry]; 139 | } 140 | 141 | textbox-prompt-colon{ 142 | expand: false; 143 | margin: 0; 144 | str: ":"; 145 | } 146 | 147 | entry { 148 | placeholder: ""; 149 | } 150 | -------------------------------------------------------------------------------- /home/dots/wallpapers/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/wallpapers/1.jpg -------------------------------------------------------------------------------- /home/dots/wallpapers/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/wallpapers/2.jpg -------------------------------------------------------------------------------- /home/dots/wallpapers/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/wallpapers/3.jpg -------------------------------------------------------------------------------- /home/dots/wallpapers/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/wallpapers/4.jpg -------------------------------------------------------------------------------- /home/dots/wallpapers/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/wallpapers/5.jpg -------------------------------------------------------------------------------- /home/dots/wallpapers/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/wallpapers/6.jpg -------------------------------------------------------------------------------- /home/dots/wallpapers/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/wallpapers/7.jpg -------------------------------------------------------------------------------- /home/dots/wallpapers/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/wallpapers/8.png -------------------------------------------------------------------------------- /home/dots/wallpapers/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/dots/wallpapers/9.jpg -------------------------------------------------------------------------------- /home/modules/browser.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | system, 4 | pkgs, 5 | ... 6 | }: { 7 | xdg.mimeApps = let 8 | associations = builtins.listToAttrs (map (name: { 9 | inherit name; 10 | value = let 11 | zen-browser = inputs.zen-browser.packages.${system}.twilight; 12 | in 13 | zen-browser.meta.desktopFile; 14 | }) [ 15 | "application/x-extension-shtml" 16 | "application/x-extension-xhtml" 17 | "application/x-extension-html" 18 | "application/x-extension-xht" 19 | "application/x-extension-htm" 20 | "x-scheme-handler/unknown" 21 | "x-scheme-handler/mailto" 22 | "x-scheme-handler/chrome" 23 | "x-scheme-handler/about" 24 | "x-scheme-handler/https" 25 | "x-scheme-handler/http" 26 | "application/xhtml+xml" 27 | "application/json" 28 | "text/plain" 29 | "text/html" 30 | "image/*" 31 | ]); 32 | in { 33 | associations.added = associations; 34 | defaultApplications = associations; 35 | }; 36 | 37 | programs.zen-browser = { 38 | enable = true; 39 | policies = { 40 | AutofillAddressEnabled = true; 41 | AutofillCreditCardEnabled = false; 42 | DisableAppUpdate = true; 43 | DisableFeedbackCommands = true; 44 | DisableFirefoxStudies = true; 45 | DisablePocket = true; # save webs for later reading 46 | DisableTelemetry = true; 47 | DontCheckDefaultBrowser = true; 48 | NoDefaultBookmarks = true; 49 | OfferToSaveLogins = false; 50 | }; 51 | }; 52 | 53 | programs.librewolf = { 54 | enable = true; 55 | settings = { 56 | "beacon.enabled" = false; 57 | "browser.startup.page" = 3; 58 | "device.sensors.enabled" = false; 59 | "dom.battery.enabled" = false; 60 | "dom.event.clipboardevents.enabled" = false; 61 | "geo.enabled" = false; 62 | "media.peerconnection.enabled" = false; 63 | "privacy.clearHistory.cookiesAndStorage" = false; 64 | "privacy.clearHistory.siteSettings" = false; 65 | "privacy.firstparty.isolate" = true; 66 | "privacy.resistFingerprinting" = false; 67 | "privacy.trackingprotection.enabled" = true; 68 | "privacy.trackingprotection.socialtracking.enabled" = true; 69 | "webgl.disabled" = true; # may be annoying 70 | }; 71 | }; 72 | 73 | programs.chromium = { 74 | enable = true; 75 | package = pkgs.brave; 76 | extensions = let 77 | ids = [ 78 | "ficfmibkjjnpogdcfhfokmihanoldbfe" # File Icons for GitHub and GitLab 79 | ]; 80 | in 81 | builtins.map (id: {inherit id;}) ids; 82 | }; 83 | } 84 | -------------------------------------------------------------------------------- /home/modules/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./terminal 4 | ./desktop 5 | ./editors 6 | ./studio 7 | ./dev 8 | ./etc 9 | 10 | ./browser.nix 11 | ./discord.nix 12 | ./docker.nix 13 | ./file-manager.nix 14 | ./media.nix 15 | ./nao.nix 16 | ./password-store.nix 17 | ./spotify.nix 18 | ./systemless.nix 19 | ./work.nix 20 | ./xdg.nix 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /home/modules/desktop/cursor.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.pointerCursor = { 3 | gtk.enable = true; 4 | x11.enable = true; 5 | 6 | name = "Vimix-Cursors"; 7 | size = 32; 8 | package = pkgs.extra.vimix-cursor-theme; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /home/modules/desktop/default.nix: -------------------------------------------------------------------------------- 1 | {host, ...}: { 2 | imports = [ 3 | { 4 | "hyprland" = ./wayland/hyprland; 5 | "plasma" = ./x11/plasma; 6 | "i3" = ./x11/i3; 7 | } 8 | .${host.desktop} 9 | ]; 10 | 11 | xsession.enable = true; 12 | } 13 | -------------------------------------------------------------------------------- /home/modules/desktop/dunst.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | services.dunst = { 3 | enable = true; 4 | package = pkgs.dunst; 5 | 6 | iconTheme = { 7 | name = "Adwaita"; 8 | package = pkgs.adwaita-icon-theme; 9 | size = "16x16"; 10 | }; 11 | 12 | settings = let 13 | v2 = { 14 | global = { 15 | font = "Cascadia Code 9"; 16 | frame_color = "#1e1b29"; 17 | width = 330; 18 | height = 300; 19 | padding = 20; 20 | offset = "40x50"; 21 | origin = "top-right"; 22 | transparency = 10; # X11 only 23 | corner_radius = 3; 24 | notification_limit = 20; 25 | scale = 3; 26 | }; 27 | 28 | urgency_low = { 29 | background = "#1b1925"; 30 | foreground = "#cbcacf"; 31 | timeout = 10; 32 | }; 33 | 34 | urgency_normal = { 35 | background = "#1b1924de"; 36 | foreground = "#cbcacf"; 37 | timeout = 10; 38 | }; 39 | 40 | urgency_critical = { 41 | background = "#900000"; 42 | foreground = "#ffffff"; 43 | frame_color = "#ff0000"; 44 | timeout = 20; 45 | override_pause_level = 20; 46 | }; 47 | }; 48 | in 49 | v2; 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /home/modules/desktop/gtk.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | gtk = { 3 | enable = true; 4 | theme = { 5 | name = "WhiteSur"; 6 | package = pkgs.whitesur-gtk-theme; 7 | }; 8 | 9 | iconTheme = { 10 | name = "Adwaita"; 11 | package = pkgs.adwaita-icon-theme; 12 | }; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /home/modules/desktop/rofi.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.rofi = { 3 | enable = true; 4 | plugins = with pkgs; [ 5 | rofi-calc 6 | ]; 7 | }; 8 | 9 | xdg.configFile = { 10 | "rofi/config.rasi".text = builtins.readFile ./../../dots/rofi/config.rasi; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /home/modules/desktop/wayland/components/mako.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.mako = { 3 | enable = true; 4 | settings = { 5 | font = "Cascadia Code 9"; 6 | background-color = "#1b1924de"; 7 | text-color = "#cbcacf"; 8 | 9 | layer = "overlay"; 10 | anchor = "top-right"; 11 | width = 320; 12 | height = 130; 13 | padding = "20"; 14 | margin = "5"; 15 | 16 | border-color = "#1b1924de"; 17 | border-radius = 3; 18 | border-size = 2; 19 | 20 | default-timeout = 6000; 21 | progress-color = "over #2e1545"; 22 | max-icon-size = 25; 23 | icons = true; 24 | sort = "-time"; 25 | 26 | "urgency=low" = { 27 | border-color = "#444152"; 28 | }; 29 | 30 | "urgency=normal" = { 31 | border-color = "#1b1924de"; 32 | }; 33 | 34 | "urgency=high" = { 35 | border-color = "#ff5555"; 36 | default-timeout = 0; 37 | }; 38 | 39 | "category=mpd" = { 40 | default-timeout = 2000; 41 | group-by = "category"; 42 | }; 43 | }; 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /home/modules/desktop/wayland/components/swww.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | system, 4 | pkgs, 5 | ... 6 | }: { 7 | home.packages = [pkgs.swww]; 8 | 9 | xdg.configFile = let 10 | wallpaperFiles = pkgs.libx.fs.getFilesInDirectory ../../../../dots/wallpapers; 11 | 12 | inherit (inputs.nix-scripts.packages.${system}) swww-switcher; 13 | in { 14 | "hypr/hyprland.conf".text = '' 15 | exec-once = ${pkgs.swww}/bin/swww init 16 | exec = ${pkgs.swww}/bin/swww img ${../../../../dots/background.gif} 17 | 18 | bind = $mainMod, L, exec, ${swww-switcher}/bin/cli ${builtins.concatStringsSep " " (wallpaperFiles 19 | ++ [ 20 | ../../../../dots/background.gif 21 | ])} 22 | ''; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /home/modules/desktop/wayland/components/waybar/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | inputs, 4 | system, 5 | pkgs, 6 | lib, 7 | ... 8 | }: { 9 | programs.waybar = { 10 | enable = true; 11 | systemd = { 12 | enable = false; 13 | target = "graphical-session.target"; 14 | }; 15 | style = builtins.readFile ./styles/waybar-v1.css; 16 | settings = let 17 | runBtop = "${pkgs.lib.getExe config.programs.ghostty.package} --class=waybar.btop -e ${pkgs.btop}/bin/btop"; 18 | in [ 19 | { 20 | "position" = "top"; 21 | "layer" = "top"; 22 | 23 | modules-left = [ 24 | "custom/launcher" 25 | # "user" 26 | "hyprland/workspaces" 27 | "tray" 28 | ]; 29 | 30 | modules-center = [ 31 | "custom/clock" 32 | ]; 33 | 34 | modules-right = [ 35 | # "pulseaudio" 36 | # "backlight" 37 | "custom/mullvad" 38 | # "bluetooth" 39 | "memory" 40 | "cpu" 41 | "battery" 42 | "network" 43 | "custom/network-scan" 44 | "custom/power" 45 | ]; 46 | 47 | "hyprland/workspaces" = { 48 | "format" = "{icon}"; 49 | "format-icons" = { 50 | "1" = "一"; 51 | "2" = "二"; 52 | "3" = "三"; 53 | "4" = "四"; 54 | "5" = "五"; 55 | "6" = "六"; 56 | "7" = "七"; 57 | "8" = "八"; 58 | "9" = "九"; 59 | "10" = "十"; 60 | }; 61 | # "persistent-workspaces" = { 62 | # "*" = 10; 63 | # }; 64 | # "active-only" = true; 65 | }; 66 | 67 | "custom/launcher" = { 68 | "format" = " "; 69 | "on-click" = "pkill rofi || rofi2"; 70 | "on-click-middle" = "exec default_wall"; 71 | "on-click-right" = "exec wallpaper_random"; 72 | "tooltip" = false; 73 | }; 74 | 75 | "bluetooth" = { 76 | # "controller": "controller1"; # specify the alias of the controller if there are more than 1 on the system 77 | "format" = ""; 78 | "format-disabled" = ""; # an empty format will hide the module 79 | "format-connected" = " {num_connections}"; 80 | "format-connected-battery" = " {num_connections} [{device_battery_percentage}%]"; 81 | "tooltip-format" = "{controller_alias}\t{controller_address}"; 82 | "tooltip-format-connected" = "{controller_alias}\t{controller_address}\n\n{device_enumerate}"; 83 | "tooltip-format-enumerate-connected" = "{device_alias}\t{device_address}"; 84 | "on-click" = "${lib.getExe config.programs.ghostty.package} -e ${lib.getExe pkgs.bluetuith}"; 85 | }; 86 | 87 | "pulseaudio" = { 88 | "scroll-step" = 1; 89 | "format" = "{icon} {volume}%"; 90 | "format-muted" = "󰖁 Muted"; 91 | "format-icons" = { 92 | "default" = ["" "" ""]; 93 | }; 94 | "on-click" = "pamixer -t"; 95 | "tooltip" = false; 96 | }; 97 | 98 | "custom/mullvad" = let 99 | inherit (inputs.nix-scripts.packages.${system}) mullvad-status; 100 | in { 101 | "exec" = "${lib.getExe mullvad-status} --waybar \"{{emoji}} {{relay-id}}\""; 102 | "interval" = 2; 103 | "return-type" = "json"; 104 | "on-click" = "${lib.getExe mullvad-status} --toggle-connection"; 105 | }; 106 | 107 | "custom/network-scan" = let 108 | inherit (inputs.nix-scripts.packages.${system}) nmcli-wifi-scan-waybar; 109 | in { 110 | "exec" = "${lib.getExe nmcli-wifi-scan-waybar}"; 111 | "return-type" = "json"; 112 | "tooltip" = true; 113 | "interval" = 1; 114 | "tooltip-format" = "Scan wifi networks nearby"; 115 | "on-click" = "${lib.getExe nmcli-wifi-scan-waybar} --scan"; 116 | }; 117 | 118 | "custom/clock" = { 119 | "exec" = "date +' %H:%M'"; 120 | "interval" = 2; 121 | "tooltip" = false; 122 | "on-click" = "${pkgs.gsimplecal}/bin/gsimplecal"; 123 | }; 124 | 125 | "cpu" = { 126 | "interval" = 1; 127 | "format" = "󰍛 {usage}%"; 128 | "on-click" = runBtop; 129 | }; 130 | 131 | "memory" = { 132 | "interval" = 1; 133 | "format" = "󰻠 {percentage}%"; 134 | "states" = { 135 | "warning" = 80; 136 | "critical" = 95; 137 | }; 138 | "on-click" = runBtop; 139 | }; 140 | 141 | "battery" = { 142 | "states" = { 143 | "warning" = config.services.battery-notifier.settings.warn.threshold; 144 | "critical" = config.services.battery-notifier.settings.threat.threshold; 145 | }; 146 | "interval" = 3; 147 | "format" = "{icon} {capacity}%"; 148 | "format-charging" = "󰂄 {capacity}%"; 149 | "format-plugged" = "󱟠 {capacity}%"; 150 | "format-alt" = "{time} {icon}"; 151 | "format-full" = "󱟢 {capacity}%"; 152 | "format-icons" = ["󰁺" "󰁻" "󰁽" "󰁿" "󰂀" "󰂂"]; 153 | }; 154 | 155 | "network" = { 156 | "format-disconnected" = "󰯡 Disconnected"; 157 | "format-ethernet" = "↑ {bandwidthUpBytes} ↓ {bandwidthDownBytes} 󰀂 󰖩 {ifname} ({ipaddr})"; 158 | "format-linked" = "󰖪 {essid} (No IP)"; 159 | "format-wifi" = "↑ {bandwidthUpBytes} ↓ {bandwidthDownBytes}"; 160 | "tooltip-format" = "{ifname} ^ {essid} ({frequency}MHz)"; # 󰤨 161 | "tooltip" = true; 162 | "interval" = 1; 163 | "on-click" = "${lib.getExe config.programs.ghostty.package} --class=waybar.nmtui -e ${pkgs.networkmanager}/bin/nmtui connect"; 164 | }; 165 | 166 | "custom/power" = { 167 | "format" = ""; 168 | "on-click" = ''${pkgs.rofi}/bin/rofi -modi "power-menu:${pkgs.rofi-power-menu}/bin/rofi-power-menu" -show power-menu''; 169 | "tooltip" = false; 170 | }; 171 | 172 | "tray" = { 173 | "icon-size" = 15; 174 | "spacing" = 10; 175 | }; 176 | 177 | "user" = { 178 | "format" = "{avatar}"; 179 | "interval" = 60; 180 | "height" = 30; 181 | "width" = 30; 182 | "icon" = true; 183 | }; 184 | } 185 | ]; 186 | }; 187 | } 188 | -------------------------------------------------------------------------------- /home/modules/desktop/wayland/components/waybar/styles/waybar-v1.css: -------------------------------------------------------------------------------- 1 | * { 2 | font-family: "JetBrainsMono Nerd Font"; 3 | font-size: 10pt; 4 | font-weight: bold; 5 | border-radius: 8px; 6 | transition-property: background-color; 7 | transition-duration: 0.1s; 8 | } 9 | 10 | @keyframes blink_red { 11 | to { 12 | background-color: rgb(242, 143, 173); 13 | color: rgb(26, 24, 38); 14 | } 15 | } 16 | 17 | .warning, 18 | .critical, 19 | .urgent { 20 | animation-name: blink_red; 21 | animation-duration: 1s; 22 | animation-timing-function: linear; 23 | animation-iteration-count: infinite; 24 | animation-direction: alternate; 25 | } 26 | 27 | window#waybar { 28 | background-color: transparent; 29 | } 30 | 31 | window>box { 32 | margin-left: 5px; 33 | margin-right: 5px; 34 | margin-top: 5px; 35 | background-color: rgba(41, 20, 84, 0.4); 36 | padding: 3px; 37 | padding-left: 8px; 38 | border: 2px none #33ccff; 39 | } 40 | 41 | #workspaces { 42 | padding-left: 0px; 43 | padding-right: 4px; 44 | } 45 | 46 | 47 | #workspaces button { 48 | padding-top: 5px; 49 | padding-bottom: 5px; 50 | padding-left: 6px; 51 | padding-right: 6px; 52 | color: #fff; 53 | } 54 | 55 | #workspaces button.active { 56 | background-color: rgb(181, 232, 224); 57 | color: rgba(26, 24, 38, 0.8); 58 | } 59 | 60 | #workspaces button.urgent { 61 | color: rgba(26, 24, 38, 0.6); 62 | } 63 | 64 | #workspaces button:hover { 65 | background-color: rgba(26, 24, 38, 0.1); 66 | color: rgb(181, 232, 224); 67 | } 68 | 69 | tooltip { 70 | background: rgb(48, 45, 65); 71 | } 72 | 73 | tooltip label { 74 | color: rgb(217, 224, 238); 75 | } 76 | 77 | #custom-launcher { 78 | font-size: 20px; 79 | padding-left: 8px; 80 | padding-right: 6px; 81 | color: #7ebae4; 82 | } 83 | 84 | #mode, 85 | #temperature, 86 | #cpu, 87 | #mpd, 88 | #custom-wall, 89 | #temperature, 90 | #pulseaudio, 91 | #network, 92 | #battery, 93 | #memory, 94 | #user, 95 | #custom-power { 96 | padding: 0 8px; 97 | } 98 | 99 | #battery { 100 | color: #fff; 101 | } 102 | 103 | #memory { 104 | color: rgb(181, 232, 224); 105 | } 106 | 107 | #cpu { 108 | color: rgb(245, 194, 231); 109 | } 110 | 111 | #custom-clock { 112 | color: #e8cef5; 113 | padding: 0 12px; 114 | } 115 | 116 | #custom-wall { 117 | color: #33ccff; 118 | } 119 | 120 | #temperature { 121 | color: rgb(150, 205, 251); 122 | } 123 | 124 | #backlight { 125 | color: rgb(248, 189, 150); 126 | } 127 | 128 | #pulseaudio { 129 | color: rgb(245, 224, 220); 130 | } 131 | 132 | #network { 133 | color: #facaf4; 134 | } 135 | 136 | #network.disconnected { 137 | color: rgb(255, 255, 255); 138 | } 139 | 140 | #custom-network-scan { 141 | color: #795ee6; 142 | padding-right: 5px; 143 | font-size: 25px; 144 | } 145 | 146 | #custom-network-scan.scanning { 147 | color: #f26411; 148 | } 149 | 150 | #custom-mullvad { 151 | color: rgb(248, 134, 99); 152 | padding-right: 5px; 153 | } 154 | 155 | #custom-mullvad.connected { 156 | color: rgb(245, 172, 103); 157 | } 158 | 159 | #custom-mullvad.disconnected { 160 | font-weight: lighter; 161 | color: rgb(156, 152, 148); 162 | } 163 | 164 | #custom-power { 165 | color: rgb(242, 143, 173); 166 | padding-right: 15px; 167 | } 168 | 169 | #tray { 170 | padding-right: 8px; 171 | padding-left: 10px; 172 | } 173 | 174 | #bluetooth { 175 | color: rgba(119, 119, 119, 0.69); 176 | background-color: rgba(139, 205, 201, 0.1); 177 | padding: 0 15px; 178 | } 179 | 180 | #bluetooth.connected { 181 | color: rgba(154, 68, 235, 0.61); 182 | } -------------------------------------------------------------------------------- /home/modules/desktop/wayland/hyprland/binds.nix: -------------------------------------------------------------------------------- 1 | # https://wiki.hyprland.org/Configuring/Keywords/ 2 | { 3 | config, 4 | inputs, 5 | system, 6 | pkgs, 7 | ... 8 | }: let 9 | mainMod = "SUPER"; 10 | 11 | window = [ 12 | "${mainMod}, left, movefocus, l" 13 | "${mainMod}, right, movefocus, r" 14 | "${mainMod}, up, movefocus, u" 15 | "${mainMod}, down, movefocus, d" 16 | ]; 17 | 18 | workspaces = [ 19 | # Go-to 20 | "${mainMod}, 1, workspace, 1" 21 | "${mainMod}, 2, workspace, 2" 22 | "${mainMod}, 3, workspace, 3" 23 | "${mainMod}, 4, workspace, 4" 24 | "${mainMod}, 5, workspace, 5" 25 | "${mainMod}, 6, workspace, 6" 26 | "${mainMod}, 7, workspace, 7" 27 | "${mainMod}, 8, workspace, 8" 28 | "${mainMod}, 9, workspace, 9" 29 | "${mainMod}, 0, workspace, 10" 30 | 31 | # Move window 32 | "${mainMod} SHIFT, 1, movetoworkspace, 1" 33 | "${mainMod} SHIFT, 2, movetoworkspace, 2" 34 | "${mainMod} SHIFT, 3, movetoworkspace, 3" 35 | "${mainMod} SHIFT, 4, movetoworkspace, 4" 36 | "${mainMod} SHIFT, 5, movetoworkspace, 5" 37 | "${mainMod} SHIFT, 6, movetoworkspace, 6" 38 | "${mainMod} SHIFT, 7, movetoworkspace, 7" 39 | "${mainMod} SHIFT, 8, movetoworkspace, 8" 40 | "${mainMod} SHIFT, 9, movetoworkspace, 9" 41 | "${mainMod} SHIFT, 0, movetoworkspace, 10" 42 | 43 | # Resize window 44 | "${mainMod} SHIFT, h, resizeactive, -40 0" 45 | "${mainMod} SHIFT, l, resizeactive, 40 0" 46 | "${mainMod} SHIFT, k, resizeactive, 0 -40" 47 | "${mainMod} SHIFT, j, resizeactive, 0 40" 48 | 49 | # Scroll 50 | "${mainMod}, mouse_down, workspace, e+1" 51 | "${mainMod}, mouse_up, workspace, e-1" 52 | 53 | # Other actions 54 | "${mainMod}, SPACE, togglefloating" 55 | "${mainMod}, MINUS, togglesplit" 56 | "SUPER_SHIFT, W, killactive" 57 | "SUPER_SHIFT, MINUS, pseudo" 58 | "${mainMod}, F, fullscreen" 59 | ]; 60 | 61 | custom = let 62 | rofi-plugin-call = name: program-to-exec: ''${lib.getExe pkgs.rofi} -modi "${name}:${program-to-exec}" -show ${name}''; 63 | spotify-dbus-control = inputs.spotify-dbus-control.defaultPackage.${system}; 64 | hyprstfu = inputs.hyprstfu.defaultPackage.${system}; 65 | 66 | inherit (inputs.nix-scripts.packages.${system}) sys-sound sys-brightness cliphist-rofi; 67 | 68 | grimblast = inputs.hyprland-contrib.packages.${system}.grimblast.overrideAttrs (_oldAttrs: { 69 | prePatch = '' 70 | substituteInPlace ./grimblast --replace '-t 3000' '-t 3000 -i ${../../../../dots/icons/crop.512.png}' 71 | ''; 72 | }); 73 | 74 | inherit (pkgs) lib; 75 | in [ 76 | { 77 | "mod+key" = "${mainMod}, RETURN"; 78 | "dispatcher" = "exec, ${pkgs.lib.getExe config.programs.ghostty.package}"; 79 | } 80 | { 81 | "mod+key" = ",XF86AudioMicMute"; 82 | "dispatcher" = "exec, ${lib.getExe sys-sound} --toggle-mic"; 83 | } 84 | { 85 | "mod+key" = ",XF86AudioMute"; 86 | "dispatcher" = "exec, ${lib.getExe sys-sound} --toggle-vol"; 87 | } 88 | { 89 | "mod+key" = ",XF86AudioLowerVolume"; 90 | "dispatcher" = "exec, ${lib.getExe sys-sound} --dec"; 91 | } 92 | { 93 | "mod+key" = ",XF86AudioRaiseVolume"; 94 | "dispatcher" = "exec, ${lib.getExe sys-sound} --inc"; 95 | } 96 | { 97 | "mod+key" = "SUPER, XF86AudioRaiseVolume"; 98 | "dispatcher" = "exec, ${lib.getExe sys-sound} --inc --unleashed"; 99 | } 100 | { 101 | "mod+key" = "SUPER_SHIFT, Print"; 102 | "dispatcher" = "exec, ${lib.getExe grimblast} --freeze --notify copy area"; 103 | } 104 | { 105 | "mod+key" = "${mainMod}, Print"; 106 | "dispatcher" = "exec, ${lib.getExe grimblast} --notify copy active"; 107 | } 108 | { 109 | "mod+key" = ",Print"; 110 | "dispatcher" = "exec, ${lib.getExe grimblast} --notify copy screen"; 111 | } 112 | { 113 | "mod+key" = ",XF86MonBrightnessDown"; 114 | "dispatcher" = "exec, ${lib.getExe sys-brightness} --dec"; 115 | } 116 | { 117 | "mod+key" = ",XF86MonBrightnessUp"; 118 | "dispatcher" = "exec, ${lib.getExe sys-brightness} --inc"; 119 | } 120 | { 121 | "mod+key" = "SUPER_SHIFT, C"; 122 | "dispatcher" = "exec, ${rofi-plugin-call "clipboard" "${lib.getExe cliphist-rofi}"}"; 123 | } 124 | { 125 | "mod+key" = "SUPER_SHIFT, Q"; 126 | "dispatcher" = "exec, ${lib.getExe pkgs.rofi} -show window"; 127 | } 128 | { 129 | "mod+key" = "${mainMod}, Q"; 130 | "dispatcher" = "exec, ${lib.getExe pkgs.rofi} -show drun"; 131 | } 132 | { 133 | "mod+key" = "SUPER_SHIFT, E"; 134 | "dispatcher" = "exec, ${lib.getExe pkgs.bemoji}"; 135 | } 136 | { 137 | "mod+key" = "CTRL_SHIFT, braceleft"; 138 | "dispatcher" = "exec, ${lib.getExe spotify-dbus-control} --push-back"; 139 | } 140 | { 141 | "mod+key" = "CTRL_SHIFT, braceright"; 142 | "dispatcher" = "exec, ${lib.getExe spotify-dbus-control} --push-forward"; 143 | } 144 | { 145 | "mod+key" = "SUPER_SHIFT, braceright"; 146 | "dispatcher" = "exec, ${lib.getExe spotify-dbus-control} --next"; 147 | } 148 | { 149 | "mod+key" = "SUPER_SHIFT, braceleft"; 150 | "dispatcher" = "exec, ${lib.getExe spotify-dbus-control} --prev"; 151 | } 152 | { 153 | "mod+key" = "${mainMod}, Pause"; 154 | "dispatcher" = "exec, ${lib.getExe spotify-dbus-control} --toggle"; 155 | } 156 | { 157 | "mod+key" = "SUPER_SHIFT, R"; 158 | "dispatcher" = "exec, ${pkgs.hyprland}/bin/hyprctl reload"; 159 | } 160 | { 161 | "mod+key" = "SUPER_SHIFT, S"; 162 | "dispatcher" = "exec, ${pkgs.toybox}/bin/pkill glava || ${lib.getExe pkgs.glava} -d"; 163 | } 164 | { 165 | "mod+key" = "${mainMod}, M"; 166 | "dispatcher" = "exec, ${lib.getExe hyprstfu}"; 167 | } 168 | { 169 | "mod+key" = "${mainMod}, K"; 170 | "dispatcher" = "exec, ${lib.getExe pkgs.extra.hyprdrop} -i ghostty.hyprdrop 'ghostty --class=ghostty.hyprdrop'"; 171 | } 172 | ]; 173 | in 174 | window ++ workspaces ++ builtins.map (b: b."mod+key" + ", " + b.dispatcher) custom 175 | -------------------------------------------------------------------------------- /home/modules/desktop/wayland/hyprland/default.nix: -------------------------------------------------------------------------------- 1 | args @ { 2 | nixosConfig, 3 | pkgs, 4 | lib, 5 | ... 6 | }: { 7 | imports = [ 8 | ../components/swww.nix 9 | ../components/mako.nix 10 | ../components/waybar 11 | 12 | ../../cursor.nix 13 | ../../rofi.nix 14 | ../../gtk.nix 15 | ]; 16 | 17 | wayland.windowManager.hyprland = let 18 | mainMod = "SUPER"; 19 | in { 20 | enable = true; 21 | settings = { 22 | monitor = ",preferred,auto,1,mirror,eDP-1"; 23 | env = "XCURSOR_SIZE,24"; 24 | 25 | general = { 26 | layout = "dwindle"; 27 | gaps_in = 4; 28 | gaps_out = 20; 29 | border_size = 1; 30 | 31 | "col.active_border" = "rgba(595959aa)"; 32 | "col.inactive_border" = "rgba(595959aa)"; 33 | 34 | windowrule = [ 35 | "opacity 1.0 override 1.0 override,class:Emulator" 36 | ]; 37 | 38 | windowrulev2 = [ 39 | "float,center,forceinput, class:(Rofi)$" 40 | "float, title:^(Android Emulator -)" 41 | "float, title:^(Emulator)$" 42 | "float,center, class:^(ghostty.hyprdrop)$" 43 | "size 1280 720, class:^(ghostty.hyprdrop)$" 44 | "float,center, class:^(waybar.nmtui)$" 45 | "size 1050 720, class:^(waybar.nmtui)$" 46 | "float,center, class:^(waybar.btop)$" 47 | "size 1280 720, class:^(waybar.btop)$" 48 | ]; 49 | }; 50 | 51 | decoration = { 52 | rounding = 4; 53 | blur = { 54 | enabled = true; 55 | size = 3; 56 | passes = 1; 57 | }; 58 | active_opacity = 0.9; 59 | inactive_opacity = 1.0; 60 | fullscreen_opacity = 1.0; 61 | shadow = { 62 | enabled = true; 63 | range = 4; 64 | render_power = 3; 65 | color = "rgba(1a1a1aee)"; 66 | }; 67 | }; 68 | 69 | animations = { 70 | enabled = true; 71 | bezier = [ 72 | "myBezier, 0.05, 0.9, 0.1, 1.05" 73 | ]; 74 | animation = [ 75 | "windows, 1, 7, myBezier" 76 | "windowsOut, 1, 7, default, popin 80%" 77 | "border, 1, 10, default" 78 | "borderangle, 1, 8, default" 79 | "fade, 1, 7, default" 80 | "workspaces, 1, 6, default" 81 | ]; 82 | }; 83 | 84 | input = { 85 | numlock_by_default = true; 86 | sensitivity = 0.2; 87 | 88 | kb_layout = "latam"; 89 | kb_variant = ""; 90 | kb_model = ""; 91 | kb_options = ""; 92 | kb_rules = ""; 93 | 94 | follow_mouse = 1; 95 | 96 | touchpad = { 97 | natural_scroll = "no"; 98 | disable_while_typing = "no"; 99 | }; 100 | }; 101 | 102 | misc = { 103 | disable_autoreload = true; 104 | disable_hyprland_logo = true; 105 | focus_on_activate = false; 106 | new_window_takes_over_fullscreen = 1; 107 | initial_workspace_tracking = 2; 108 | }; 109 | 110 | dwindle = { 111 | # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more 112 | pseudotile = true; 113 | preserve_split = true; 114 | }; 115 | 116 | # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more 117 | master = { 118 | new_status = "master"; 119 | }; 120 | 121 | gestures = { 122 | workspace_swipe = "off"; 123 | }; 124 | 125 | ecosystem = { 126 | no_update_news = true; 127 | enforce_permissions = true; 128 | }; 129 | 130 | device = { 131 | name = "epic-mouse-v1"; 132 | sensitivity = "-0.5"; 133 | }; 134 | 135 | bind = import ./binds.nix args; 136 | bindm = [ 137 | "${mainMod}, mouse:272, movewindow" 138 | "${mainMod}, mouse:273, resizewindow" 139 | ]; 140 | 141 | exec-once = [ 142 | "${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.cliphist}/bin/cliphist store -max-items 200" 143 | "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" 144 | "[workspace 2 silent] ghostty" 145 | "${pkgs.extra.hyprdrop}/bin/hyprdrop -i ghostty.hyprdrop 'ghostty --class=ghostty.hyprdrop'; while [ -z \"$ADDRESS\" ] ; do ADDRESS=$(hyprctl clients -j | jq -r '.[] | select(.class == \"ghostty.hyprdrop\") | .address'); done; ${pkgs.extra.hyprdrop}/bin/hyprdrop -i ghostty.hyprdrop 'ghostty --class=ghostty.hyprdrop'" 146 | ]; 147 | 148 | exec = [ 149 | "pkill waybar & sleep 0.1 && waybar" 150 | ]; 151 | 152 | permission = [ 153 | "${lib.getExe pkgs.hyprpicker}, screencopy, allow" 154 | "${lib.getExe pkgs.grim}, screencopy, allow" 155 | "/nix/store/*-zen*/bin/(zen|zen-beta|zen-twilight), screencopy, allow" 156 | "${lib.getExe pkgs.brave}, screencopy, allow" 157 | "${lib.getExe pkgs.discord-canary}, screencopy, allow" 158 | "${lib.getExe pkgs.obs-studio}, screencopy, allow" 159 | "${nixosConfig.programs.hyprland.portalPackage}/bin/xdg-desktop-portal-hyprland, screencopy, allow" 160 | ]; 161 | }; 162 | 163 | extraConfig = '' 164 | $mainMod = "${mainMod}" 165 | ''; 166 | }; 167 | } 168 | -------------------------------------------------------------------------------- /home/modules/desktop/x11/i3/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | # https://github.com/Th0rgal/horus-nix-home/blob/master/configs/i3.nix 3 | # https://github.com/Th0rgal/horus-nix-home/blob/master/configs/compton.nix 4 | # https://www.reddit.com/r/unixporn/comments/fltmar/i3gaps_nixos_arch_my_incredible_nixos_desktop/ 5 | # https://i3wm.org/docs/userguide.html#configuring 6 | # https://www.google.com/search?q=i3+enable+transparency&oq=i3+enable+&aqs=chrome.4.69i57j0i19i512l3j0i19i22i30l6.6319j0j1&sourceid=chrome&ie=UTF-8 7 | # https://github.com/vivien/i3blocks#example 8 | # https://www.reddit.com/r/NixOS/comments/vdlq9e/how_to_use_window_managers_in_nixos/?rdt=38930 9 | # https://github.com/i3-wsman/i3-wsman 10 | # https://github.com/davatorium/rofi 11 | imports = [ 12 | ./i3status-rust.nix 13 | ./greenclip.nix 14 | ./picom.nix 15 | ./i3.nix 16 | 17 | ../../cursor.nix 18 | ../../dunst.nix 19 | ../../rofi.nix 20 | ../../gtk.nix 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /home/modules/desktop/x11/i3/greenclip.nix: -------------------------------------------------------------------------------- 1 | {user, ...}: { 2 | home.packages = with pkgs; [ 3 | greenclip 4 | ]; 5 | 6 | xdg.configFile = { 7 | "greenclip.toml".text = '' 8 | [greenclip] 9 | history_file = "/home/${user.alias}/.cache/greenclip.history" 10 | max_history_length = 50 11 | max_selection_size_bytes = 0 12 | trim_space_from_selection = true 13 | use_primary_selection_as_input = false 14 | blacklisted_applications = [] 15 | enable_image_support = true 16 | image_cache_directory = "/tmp/greenclip" 17 | static_history = ["what's the use of this"] 18 | ''; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /home/modules/desktop/x11/i3/i3.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | # https://i3wm.org/docs/userguide.html 3 | # https://mipmip.github.io/home-manager-option-search/?query=xsession.windowManager.i3.config 4 | xsession.windowManager.i3 = { 5 | enable = true; 6 | 7 | config = let 8 | fonts = { 9 | names = ["Jetbrains Mono"]; 10 | style = "Bold Semi-Condensed"; 11 | size = 10.0; 12 | }; 13 | in rec { 14 | modifier = "Mod4"; 15 | 16 | window = { 17 | border = 0; 18 | titlebar = false; 19 | }; 20 | 21 | gaps = { 22 | inner = 15; 23 | outer = 5; 24 | }; 25 | 26 | terminal = "ghostty"; 27 | 28 | inherit fonts; 29 | 30 | bars = [ 31 | { 32 | # I don't know how to reference the file internally created by i3status-rust.nix with xdg.configFile 33 | statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-bottom.toml"; 34 | command = "${pkgs.i3}/bin/i3bar -t"; 35 | position = "top"; 36 | 37 | inherit fonts; 38 | 39 | trayOutput = "none"; # application icons in status bar 40 | 41 | colors = { 42 | separator = "#666666"; 43 | background = "#00000000"; # Transparent 44 | statusline = "#dddddd"; 45 | 46 | focusedWorkspace = 47 | # "#0088CC #0088CC #ffffff"; 48 | { 49 | background = "#7317cf"; 50 | border = "#7317cf"; 51 | text = "#ffffff"; 52 | }; 53 | 54 | activeWorkspace = 55 | # "#333333 #333333 #ffffff"; 56 | { 57 | background = "#333333"; 58 | border = "#333333"; 59 | text = "#ffffff"; 60 | }; 61 | 62 | inactiveWorkspace = 63 | # "#333333 #333333 #888888"; 64 | { 65 | background = "#333333"; 66 | border = "#333333"; 67 | text = "#888888"; 68 | }; 69 | 70 | urgentWorkspace = 71 | #"#2f343a #900000 #ffffff"; 72 | { 73 | background = "#2f343a"; 74 | border = "#900000"; 75 | text = "#ffffff"; 76 | }; 77 | }; 78 | } 79 | ]; 80 | 81 | keybindings = with pkgs; let 82 | inherit (inputs.nix-scripts.packages.${system}) sys-brightness sys-sound screen-capture; 83 | 84 | sys-brightness-bin = "${sys-brightness}/bin/sys-brightness"; 85 | sys-sound-bin = "${sys-sound}/bin/sys-sound"; 86 | screen-capture-bin = "${screen-capture}/bin/screen-capture"; 87 | rofi-bin = "${rofi}/bin/rofi"; 88 | 89 | exec-nid = "exec --no-startup-id"; 90 | in 91 | lib.mkOptionDefault { 92 | "XF86AudioMicMute" = "${exec-nid} ${sys-sound-bin} --toggle-mic"; 93 | "XF86AudioMute" = "${exec-nid} ${sys-sound-bin} --toggle-vol"; 94 | "XF86AudioLowerVolume" = "${exec-nid} ${sys-sound-bin} --dec"; 95 | "XF86AudioRaiseVolume" = "${exec-nid} ${sys-sound-bin} --inc"; 96 | 97 | "XF86MonBrightnessDown" = "${exec-nid} ${sys-brightness-bin} --dec"; 98 | "XF86MonBrightnessUp" = "${exec-nid} ${sys-brightness-bin} --inc"; 99 | 100 | "${modifier}+Shift+braceright" = "${exec-nid} ${lib.getExe spotify-dbus-control} --next"; 101 | "${modifier}+Shift+braceleft" = "${exec-nid} ${lib.getExe spotify-dbus-control} --prev"; 102 | "${modifier}+Pause" = "${exec-nid} ${lib.getExe spotify-dbus-control} --toggle"; 103 | 104 | "Ctrl+Shift+e" = "${exec-nid} ${xdg-utils}/bin/xdg-open https://docs.google.com/spreadsheets/u/0/"; 105 | "${modifier}+b" = "exec ${brave}/bin/brave"; 106 | 107 | "${modifier}+Shift+q" = "exec ${rofi-bin} -show window"; 108 | "${modifier}+q" = "exec ${rofi-bin} -modi drun -show drun"; 109 | "${modifier}+Shift+c" = ''exec ${rofi-bin} -modi "clipboard:greenclip print" -show clipboard''; 110 | 111 | "${modifier}+Shift+minus" = "move scratchpad"; 112 | "${modifier}+minus" = "scratchpad show"; 113 | "${modifier}+Return" = "exec ${pkgs.lib.getExe config.programs.ghostty.package}"; 114 | "${modifier}+Shift+x" = "exec systemctl suspend"; 115 | 116 | # Closes the current window 117 | "${modifier}+Shift+w" = "kill"; 118 | 119 | # Screenshots 120 | "Print" = ''${exec-nid} ${screen-capture-bin} --screen''; 121 | "${modifier}+Print" = "${exec-nid} ${screen-capture-bin} --active-window"; 122 | "${modifier}+Shift+Print" = "${exec-nid} ${screen-capture-bin} --selection"; 123 | }; 124 | 125 | startup = let 126 | background-image = ../../../../dots/background.gif; 127 | in [ 128 | { 129 | command = "${pkgs.dex}/bin/dex --autostart --environment i3"; 130 | always = false; 131 | notification = false; 132 | } 133 | { 134 | command = "${pkgs.xss-lock}/bin/xss-lock --transfer-sleep-lock -- i3lock --nofork"; 135 | always = false; 136 | notification = false; 137 | } 138 | { 139 | command = "${pkgs.networkmanagerapplet}/bin/nm-applet"; 140 | always = false; 141 | notification = false; 142 | } 143 | { 144 | command = "${pkgs.volnoti}/bin/volnoti"; 145 | always = true; 146 | } 147 | { 148 | command = "${pkgs.picom-next}/bin/picom"; 149 | always = true; 150 | notification = false; 151 | } 152 | { 153 | command = "${pkgs.nitrogen}/bin/nitrogen --set-auto ${background-image}"; 154 | } 155 | { 156 | command = "${pkgs.numlockx}/bin/numlockx on"; 157 | } 158 | ]; 159 | }; 160 | }; 161 | } 162 | -------------------------------------------------------------------------------- /home/modules/desktop/x11/i3/i3status-rust.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | host, 4 | ... 5 | }: { 6 | # https://github.com/greshake/i3status-rust/blob/master/doc/themes.md 7 | programs.i3status-rust = { 8 | enable = true; 9 | package = pkgs.i3status-rust; 10 | bars = { 11 | bottom = { 12 | icons = "material-nf"; 13 | # theme = "space-villain"; 14 | settings = { 15 | theme = { 16 | theme = "ctp-mocha"; 17 | overrides = { 18 | idle_bg = "#343845"; 19 | idle_fg = "#abcdef"; 20 | }; 21 | }; 22 | }; 23 | 24 | blocks = 25 | [ 26 | { 27 | block = "sound"; 28 | format = "󰕾 {$volume.eng(w:2) |}"; 29 | } 30 | { 31 | block = "net"; 32 | format = " ^icon_net_down$speed_down.eng(prefix:K) ^icon_net_up$speed_up.eng(prefix:K) "; 33 | } 34 | { 35 | block = "vpn"; 36 | driver = "mullvad"; 37 | format_connected = "VPN 󱜠 "; 38 | format_disconnected = "VPN  "; 39 | state_connected = "good"; 40 | state_disconnected = "warning"; 41 | } 42 | { 43 | block = "custom"; 44 | command = "echo '' `curl api.ipify.org`"; 45 | interval = 60; 46 | } 47 | { 48 | block = "docker"; 49 | interval = 7; 50 | format = "󰡨 $running/$total "; 51 | } 52 | # { 53 | # block = "github"; 54 | # format = " $total.eng(w:1)t"; 55 | # interval = 40; 56 | # token = user.gitHubNotificationsToken; 57 | # hide_if_total_is_zero = false; 58 | # info = ["total"]; 59 | # warning = ["mention" "review_requested" "security_alert"]; 60 | # 61 | { 62 | block = "cpu"; 63 | interval = 5; 64 | format = " $utilization"; 65 | } 66 | { 67 | block = "memory"; 68 | format = "󰍛 $mem_used_percents.eng(w:1)"; 69 | interval = 30; 70 | warning_mem = 70; 71 | critical_mem = 85; 72 | } 73 | # { 74 | # block = "disk_space"; 75 | # path = "/"; 76 | # info_type = "available"; 77 | # format = "󰨣 $available/$total"; 78 | # interval = 60; 79 | # warning = 20.0; 80 | # alert = 10.0; 81 | # } 82 | # { 83 | # block = "nvidia_gpu"; 84 | # interval = 10; 85 | # format = "󰢮 $utilization $temperature"; 86 | # } 87 | { 88 | block = "time"; 89 | interval = 1; 90 | format = "  $timestamp.datetime(f:'%a %d/%m %R') "; 91 | } 92 | ] 93 | ++ ( 94 | if host.isLaptop 95 | then [ 96 | { 97 | block = "battery"; 98 | interval = 7; 99 | full_threshold = host.batteryThreshold; 100 | format = " $percentage {$time |}"; 101 | full_format = " 󱩰 "; 102 | } 103 | ] 104 | else [] 105 | ); 106 | }; 107 | }; 108 | }; 109 | } 110 | -------------------------------------------------------------------------------- /home/modules/desktop/x11/i3/picom.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | # https://mipmip.github.io/home-manager-option-search/?query=services.picom. 3 | services.picom = { 4 | enable = true; 5 | package = pkgs.picom-next; 6 | backend = "xrender"; 7 | 8 | fade = true; 9 | fadeDelta = 10; 10 | shadow = false; 11 | 12 | activeOpacity = 0.9; 13 | menuOpacity = 0.8; 14 | 15 | settings = { 16 | corner-radius = 10; 17 | detect-rounded-corners = false; 18 | # https://github.com/dunst-project/dunst/issues/697 19 | unredir-if-possible = true; 20 | }; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /home/modules/desktop/x11/plasma/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ../../cursor.nix 4 | ../../gtk.nix 5 | ]; 6 | } 7 | -------------------------------------------------------------------------------- /home/modules/dev/clients.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | insomnia # another REST client 4 | websocat 5 | ]; 6 | } 7 | -------------------------------------------------------------------------------- /home/modules/dev/database/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./editor.nix 4 | ./tools.nix 5 | ]; 6 | } 7 | -------------------------------------------------------------------------------- /home/modules/dev/database/editor.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | # jetbrains.datagrip 4 | sqlite-web 5 | pgweb 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /home/modules/dev/database/tools.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: let 6 | mysql-client = ( 7 | pkgs.linkFarm "mysql-client" [ 8 | { 9 | name = "bin/mysql"; 10 | path = "${pkgs.mariadb}/bin/mysql"; 11 | } 12 | ] 13 | ); 14 | 15 | postgresql-client = ( 16 | pkgs.linkFarm "postgresql-client" [ 17 | { 18 | name = "bin/psql"; 19 | path = "${pkgs.postgresql}/bin/psql"; 20 | } 21 | ] 22 | ); 23 | 24 | redis-cli = ( 25 | pkgs.linkFarm "redis-cli" [ 26 | { 27 | name = "bin/redis-cli"; 28 | path = "${pkgs.redis}/bin/redis-cli"; 29 | } 30 | ] 31 | ); 32 | in { 33 | home.packages = with pkgs; [ 34 | mysql-client # I prefer containers 35 | postgresql-client # for server stuff 36 | redis-cli 37 | mongosh 38 | litecli 39 | pgcli 40 | mycli 41 | sqlc 42 | ]; 43 | 44 | programs.zsh.initContent = let 45 | # TODO: try to directly add to the path 46 | inherit (config.home) homeDirectory; 47 | in '' 48 | export PATH="${homeDirectory}/.turso:$PATH" 49 | ''; 50 | } 51 | -------------------------------------------------------------------------------- /home/modules/dev/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./database 4 | ./git 5 | ./pwn 6 | ./ops 7 | ./go 8 | 9 | ./processors.nix 10 | ./clients.nix 11 | ./encore.nix 12 | ./mobile.nix 13 | ./writer.nix 14 | ./devenv.nix 15 | ./python.nix 16 | ./ocaml.nix 17 | ./node.nix 18 | ./rust.nix 19 | # ./llm.nix 20 | ./etc.nix 21 | ./zig.nix 22 | ]; 23 | } 24 | -------------------------------------------------------------------------------- /home/modules/dev/devenv.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = [ 3 | pkgs.devenv 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /home/modules/dev/encore.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.encore = { 3 | enable = true; 4 | settings = { 5 | browser = "never"; 6 | }; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /home/modules/dev/etc.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | system, 4 | pkgs, 5 | ... 6 | }: let 7 | passgen = inputs.passgen.defaultPackage.${system}; 8 | 9 | senv = inputs.senv.defaultPackage.${system}; 10 | in { 11 | home.packages = with pkgs; [ 12 | (inputs.zeroxgen.defaultPackage.${system}) 13 | 14 | nodePackages.firebase-tools 15 | nodePackages_latest.cspell 16 | license-generator 17 | # onlyoffice-bin 18 | gnumeric 19 | 20 | passgen 21 | hyperfine # benchmarking 22 | # asciinema 23 | rclone # cloud storages 24 | 25 | # Command runners 26 | gnumake 27 | just 28 | 29 | ngrok 30 | 31 | senv 32 | 33 | kondo # Clean up 34 | 35 | minify # HTML, CSS, and JavaScript minifier 36 | csvkit 37 | shfmt 38 | scc 39 | ]; 40 | } 41 | -------------------------------------------------------------------------------- /home/modules/dev/git/aliases.nix: -------------------------------------------------------------------------------- 1 | { 2 | home.shellAliases = rec { 3 | g = "git"; 4 | ga = "git add"; 5 | # Add file fragments 6 | gap = "${ga} --patch"; 7 | gaa = "${ga} --all"; 8 | 9 | gb = "git branch"; 10 | 11 | gcp = "git cherry-pick"; 12 | 13 | gc = "git commit -v"; 14 | gca = "${gc} --amend"; 15 | gcm = "${gc} --message"; 16 | 17 | gd = "git diff"; 18 | gds = "${gd} --staged"; 19 | 20 | gl = "git log --oneline"; 21 | gls = "${gl} | head -n 10"; 22 | gl1 = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"; 23 | gl2 = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"; 24 | 25 | gck = "git checkout"; 26 | ggc = "git gc --aggressive"; 27 | 28 | gf = "git fetch"; 29 | gfa = "${gf} --all"; 30 | 31 | # Git garbage collector over all subdirectories, skipping non-directories and non-git repositories 32 | gmgc = "find . -maxdepth 1 -type d | xargs -I {} bash -c 'if git -C {} rev-parse --git-dir > /dev/null 2>&1; then git -C {} gc --aggressive; fi'"; 33 | 34 | # Pull current branch 35 | gp = "git pull origin --ff-only $(git branch --show-current)"; 36 | gprb = "git pull --rebase origin $(git branch --show-current)"; 37 | 38 | # deprecated ↓ 39 | ggpull = gp; 40 | ggpullrb = gprb; 41 | 42 | # Show current branch in all subdirectories, skipping non-directories and non-git repositories 43 | gmb = ''find . -maxdepth 1 -type d | xargs -I {} bash -c 'if git -C {} rev-parse --git-dir > /dev/null 2>&1; then printf " ~ \033[0;94m{}\033[0m:"; git -C {} branch --show-current; fi' ''; 44 | # Pull the current branch of all subdirectories, skipping non-directories and non-git repositories 45 | gmpull = "find . -maxdepth 1 -type d | xargs -I {} bash -c 'if git -C {} rev-parse --git-dir > /dev/null 2>&1; then git -C {} pull; fi'"; 46 | # Push the current branch of all subdirectories, skipping non-directories and non-git repositories 47 | gmpush = "find . -maxdepth 1 -type d | xargs -I {} bash -c 'if git -C {} rev-parse --git-dir > /dev/null 2>&1; then git -C {} push; fi'"; 48 | # Push current branch 49 | ggpush = "git push origin $(git branch --show-current)"; 50 | 51 | # Show the last commit message before undoing 52 | gundo = "git log --format=%B -n 1 HEAD | head -n 1 && git undo"; 53 | 54 | # Git reset but it doesn't output anything 55 | gr = "git reset -q"; 56 | grv = "git revert"; 57 | 58 | # Lists the authors of a directory/file. 59 | gauthors = "git shortlog -n -s -- "; 60 | gss = "git status -s"; 61 | grb = "git rebase"; 62 | 63 | gs = "git stash"; 64 | gsiu = "${gs} --include-untracked"; 65 | gsp = "${gs} pop"; 66 | 67 | gt = "git tag"; 68 | gtd = "${gt} --delete"; 69 | # Lists last 5 tags 70 | gts = "${gt} --sort=v:refname | tac | head -n 5"; 71 | gcl = "git clone"; 72 | 73 | lg = "lazygit"; 74 | }; 75 | } 76 | -------------------------------------------------------------------------------- /home/modules/dev/git/cli.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | user, 4 | ... 5 | }: { 6 | programs.git = { 7 | enable = true; 8 | 9 | signing = { 10 | signByDefault = true; 11 | key = null; # letting GnuPG to decide what signing key to use depending on commit's author 12 | signer = "${pkgs.gnupg}/bin/gpg2"; 13 | }; 14 | 15 | userName = user.fullName; 16 | userEmail = user.gitEmail; 17 | ignores = [ 18 | "**/.cache/" 19 | "**/.idea/" 20 | "**/.~lock*" 21 | "**/.direnv/" 22 | "**/node_modules" 23 | "**/result" 24 | "**/result-*" 25 | ]; 26 | 27 | includes = [ 28 | (let 29 | folder = "~/Projects/github.com/INVERSIONESIO"; 30 | in { 31 | condition = "gitdir:${folder}/"; 32 | path = "${folder}/.gitconfig_include"; 33 | }) 34 | ]; 35 | 36 | extraConfig = { 37 | core = { 38 | editor = "nano -w"; 39 | whitespace = "trailing-space,space-before-tab"; 40 | }; 41 | 42 | url = { 43 | "ssh://git@github.com/" = { 44 | insteadOf = "https://github.com/"; 45 | }; 46 | 47 | "ssh://git@gitlab.com/" = { 48 | insteadOf = "https://gitlab.com/"; 49 | }; 50 | }; 51 | 52 | init.defaultBranch = "main"; 53 | apply.whitespace = "fix"; 54 | branch.sort = "object"; 55 | color.ui = "auto"; 56 | 57 | rebase.autoStash = true; 58 | pull.rebase = true; 59 | fetch.prune = true; 60 | }; 61 | 62 | aliases = { 63 | undo = "reset --soft HEAD^"; 64 | amend = "commit --amend"; 65 | }; 66 | }; 67 | } 68 | -------------------------------------------------------------------------------- /home/modules/dev/git/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./terminal.nix 4 | ./aliases.nix 5 | ./jujutsu.nix 6 | ./lazygit.nix 7 | ./github.nix 8 | ./cli.nix 9 | ./etc.nix 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /home/modules/dev/git/dots/lazygit/config.yml: -------------------------------------------------------------------------------- 1 | confirmOnQuit: false 2 | disableStartupPopups: false 3 | git: 4 | allBranchesLogCmd: git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium 5 | autoFetch: false 6 | autoRefresh: true 7 | branchLogCmd: git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} -- 8 | commit: 9 | signOff: false 10 | verbose: default 11 | diffContextSize: 3 12 | disableForcePushing: false 13 | log: 14 | order: topo-order 15 | showGraph: when-maximised 16 | showWholeGraph: false 17 | merging: 18 | args: "" 19 | manualCommit: false 20 | overrideGpg: false 21 | paging: 22 | colorArg: always 23 | useConfig: false 24 | parseEmoji: false 25 | skipHookPrefix: WIP 26 | gui: 27 | border: single 28 | commandLogSize: 8 29 | commitLength: 30 | show: true 31 | expandFocusedSidePanel: false 32 | language: en 33 | mainPanelSplitMode: flexible 34 | mouseEvents: true 35 | scrollHeight: 3 36 | scrollPastBottom: true 37 | showBottomLine: false 38 | showCommandLog: false 39 | showFileTree: true 40 | showIcons: true 41 | showListFooter: true 42 | showRandomTip: true 43 | sidePanelWidth: 0.3333 44 | skipDiscardChangeWarning: false 45 | skipRewordInEditorWarning: false 46 | skipStashWarning: false 47 | splitDiff: auto 48 | theme: 49 | activeBorderColor: 50 | - green 51 | - bold 52 | cherryPickedCommitBgColor: 53 | - cyan 54 | cherryPickedCommitFgColor: 55 | - blue 56 | defaultFgColor: 57 | - default 58 | inactiveBorderColor: 59 | - white 60 | optionsTextColor: 61 | - blue 62 | selectedLineBgColor: 63 | - blue 64 | selectedRangeBgColor: 65 | - blue 66 | unstagedChangesColor: 67 | - red 68 | timeFormat: 02/01/06 15:04 MST 69 | screenMode: half 70 | keybinding: 71 | branches: 72 | checkoutBranchByName: c 73 | createPullRequest: o 74 | createTag: T 75 | fastForward: f 76 | fetchRemote: f 77 | forceCheckoutBranch: F 78 | mergeIntoCurrentBranch: M 79 | pushTag: P 80 | rebaseBranch: r 81 | renameBranch: R 82 | setUpstream: u 83 | viewGitFlowOptions: i 84 | viewPullRequestOptions: O 85 | commitFiles: 86 | checkoutCommitFile: c 87 | commits: 88 | amendToCommit: A 89 | checkoutCommit: 90 | cherryPickCopy: c 91 | cherryPickCopyRange: C 92 | copyCommitMessageToClipboard: 93 | createFixupCommit: F 94 | markCommitAsFixup: f 95 | moveDownCommit: 96 | moveUpCommit: 97 | openLogMenu: 98 | pasteCommits: v 99 | pickCommit: p 100 | renameCommit: r 101 | renameCommitWithEditor: R 102 | resetCherryPick: 103 | revertCommit: t 104 | squashAboveCommits: S 105 | squashDown: s 106 | tagCommit: T 107 | viewBisectOptions: b 108 | viewResetOptions: g 109 | files: 110 | amendLastCommit: A 111 | commitChanges: c 112 | commitChangesWithEditor: C 113 | commitChangesWithoutHook: w 114 | fetch: f 115 | ignoreFile: i 116 | openMergeTool: M 117 | openStatusFilter: 118 | refreshFiles: r 119 | stashAllChanges: s 120 | toggleStagedAll: a 121 | toggleTreeView: "`" 122 | viewResetOptions: D 123 | viewStashOptions: S 124 | main: 125 | pickBothHunks: b 126 | toggleDragSelect: v 127 | toggleDragSelect-alt: V 128 | toggleSelectHunk: a 129 | stash: 130 | popStash: g 131 | renameStash: r 132 | status: 133 | checkForUpdate: u 134 | recentRepos: 135 | submodules: 136 | bulkMenu: b 137 | init: i 138 | update: u 139 | universal: 140 | appendNewline: 141 | confirm: 142 | confirm-alt1: y 143 | copyToClipboard: 144 | createPatchOptionsMenu: 145 | createRebaseOptionsMenu: m 146 | decreaseContextInDiffView: "{" 147 | diffingMenu: W 148 | diffingMenu-alt: 149 | edit: e 150 | executeShellCommand: ":" 151 | extrasMenu: "@" 152 | filteringMenu: 153 | goInto: 154 | gotoBottom: ">" 155 | gotoTop: < 156 | increaseContextInDiffView: "}" 157 | jumpToBlock: 158 | - "1" 159 | - "2" 160 | - "3" 161 | - "4" 162 | - "5" 163 | new: n 164 | nextBlock: 165 | nextItem: 166 | nextItem-alt: j 167 | nextMatch: n 168 | nextPage: . 169 | nextScreenMode: + 170 | nextTab: "]" 171 | openFile: o 172 | openRecentRepos: 173 | optionMenu: 174 | optionMenu-alt1: "?" 175 | prevBlock: 176 | prevBlock-alt: h 177 | prevItem: 178 | prevItem-alt: k 179 | prevMatch: N 180 | prevPage: "," 181 | prevScreenMode: _ 182 | prevTab: "[" 183 | pullFiles: p 184 | pushFiles: P 185 | quit: q 186 | quit-alt1: 187 | quitWithoutChangingDirectory: Q 188 | redo: 189 | refresh: R 190 | remove: d 191 | return: 192 | return-alt1: 193 | scrollDownMain: 194 | scrollDownMain-alt1: J 195 | scrollDownMain-alt2: 196 | scrollLeft: H 197 | scrollRight: L 198 | scrollUpMain: 199 | scrollUpMain-alt1: K 200 | scrollUpMain-alt2: 201 | select: 202 | submitEditorText: 203 | togglePanel: 204 | toggleWhitespaceInDiffView: 205 | undo: z 206 | notARepository: quit 207 | os: 208 | editCommand: "" 209 | editCommandTemplate: "" 210 | openCommand: "" 211 | promptToReturnFromSubprocess: true 212 | quitOnTopLevelReturn: false 213 | refresher: 214 | fetchInterval: 30 215 | refreshInterval: 5 216 | update: 217 | days: 14 218 | method: prompt 219 | -------------------------------------------------------------------------------- /home/modules/dev/git/dots/shell.zsh: -------------------------------------------------------------------------------- 1 | gbh() { 2 | typeset -gA branch_color 3 | branch_color=( 4 | ['refactor/*']='\033[38;2;70;117;90m' 5 | ['security/*']='\033[38;2;196;35;57m' 6 | ['chore/*']='\033[38;2;237;40;158m' 7 | ['style/*']='\033[38;2;56;93;245m' 8 | ['perf/*']='\033[38;2;40;237;122m' 9 | ['docs/*']='\033[38;2;89;87;222m' 10 | ['dev/*']='\033[38;2;121;48;230m' 11 | ['ci/*']='\033[38;2;240;222;22m' 12 | ['feat/*']='\033[0;92m' 13 | ['master']='\033[0;94m' 14 | ['fix/*']='\033[0;93m' 15 | ['main']='\033[0;94m' 16 | ) 17 | 18 | branch_keys=('feat/*' 'fix/*' 'refactor/*' 'ci/*' 'docs/*' 'dev/*' 'security/*' 'perf/*' 'chore/*' 'master' 'main') 19 | 20 | current_branch=$(git branch --show-current) 21 | 22 | git for-each-ref --color=always --sort=-committerdate \ 23 | --format='%(HEAD) %(refname:short) %(color:reset)' refs/heads/ | while read -r branch; do 24 | if [[ $branch == *"*"* ]]; then 25 | branch="${branch#* }" 26 | fi 27 | 28 | for pattern in "${branch_keys[@]}"; do 29 | if [[ $branch =~ $pattern ]]; then 30 | frags=($(echo "$branch" | tr '/' ' ')) 31 | 32 | if [ ${#frags[@]} = 3 ]; then 33 | if [[ "$branch" =~ $current_branch ]]; then 34 | branch="${branch_color[$pattern]}${frags[1]}/\033[0m${frags[2]} \033[38;2;93;201;196m← current\033[0m" 35 | else 36 | branch="${branch_color[$pattern]}${frags[1]}/\033[0m${frags[2]}" 37 | fi 38 | else 39 | if [[ "$branch" =~ $current_branch ]]; then 40 | branch="${branch_color[$pattern]}${frags[1]}\033[0m \033[38;2;93;201;196m← current\033[0m" 41 | else 42 | branch="${branch_color[$pattern]}${frags[1]}\033[0m" 43 | fi 44 | fi 45 | 46 | break 47 | fi 48 | done 49 | 50 | echo "$branch" 51 | done 52 | } 53 | 54 | ghinit() { 55 | pwd | grep -E '[a-z\d\-\_]+\.[a-z]+(/[a-z\d\-\_]+){2}$' >/dev/null || (echo 'current pwd must be in the following format: *///' && return 1) 56 | test -d .git && echo 'current directory is already a git repository' && return 1 57 | 58 | git init 59 | gh repo create --private --remote origin -s . 60 | } 61 | -------------------------------------------------------------------------------- /home/modules/dev/git/etc.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = [ 3 | pkgs.git-cliff 4 | pkgs.git-open 5 | ]; 6 | } 7 | -------------------------------------------------------------------------------- /home/modules/dev/git/github.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.github-tools = { 3 | enable = true; 4 | act = true; 5 | cli = true; # gh 6 | tui = true; # ght 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /home/modules/dev/git/jujutsu.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | programs.jujutsu = { 7 | enable = true; 8 | package = pkgs.jujutsu; 9 | 10 | # Full options: 11 | # https://github.com/martinvonz/jj/blob/main/docs/config.md 12 | settings = { 13 | user = { 14 | email = config.programs.git.userEmail; 15 | name = config.programs.git.userName; 16 | }; 17 | }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /home/modules/dev/git/lazygit.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.lazygit = { 3 | enable = true; 4 | package = pkgs.lazygit; 5 | }; 6 | 7 | xdg.configFile."lazygit/config.yml".source = builtins.path { 8 | name = "lazygit-config.yml"; 9 | path = ./dots/lazygit/config.yml; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /home/modules/dev/git/terminal.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.zsh.initContent = builtins.readFile (builtins.path { 3 | name = "git-shrc"; 4 | path = ./dots/shell.zsh; 5 | }); 6 | } 7 | -------------------------------------------------------------------------------- /home/modules/dev/go/cli.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.go = { 3 | enable = true; 4 | package = pkgs.go; 5 | 6 | goPrivate = [ 7 | "github.com/chanchitaapp" 8 | "github.com/0xc000022070" 9 | ]; 10 | 11 | goBin = "go/bin"; 12 | goPath = "go"; 13 | }; 14 | 15 | xdg.configFile = { 16 | "go/env".text = builtins.readFile ../../../dots/go/env; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /home/modules/dev/go/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./terminal.nix 4 | ./cli.nix 5 | ./etc.nix 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /home/modules/dev/go/dots/shell.sh: -------------------------------------------------------------------------------- 1 | gmt() { 2 | if test -e go.mod; then 3 | printf "\033[38;2;62;207;168mReviewing modules...\033[0m\n" 4 | go mod tidy 5 | else 6 | printf "\033[38;2;212;42;51mError: go.mod file not found\033[0m\n" >&2 7 | return 1 8 | fi 9 | } 10 | -------------------------------------------------------------------------------- /home/modules/dev/go/etc.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | air # hot reload 4 | delve # debugger 5 | errcheck # to check not handled errors 6 | gcc # to link C code 7 | go-protobuf 8 | gofumpt # gofmt but better 9 | golangci-lint # linter 10 | gopls # Go language server 11 | gotools # useful stuff for go 12 | govulncheck # audit dependencies 13 | grpc-tools 14 | panicparse # to help to debug panic errors 15 | # unconvert # linter to check unnecessary type conversions 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /home/modules/dev/go/terminal.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.sessionPath = ["$GORROT" "$GOPATH/bin"]; 3 | 4 | programs.zsh = { 5 | shellAliases = { 6 | gest = "go clean -testcache && ${pkgs.richgo}/bin/richgo test -v"; 7 | }; 8 | 9 | initContent = builtins.readFile (builtins.path { 10 | name = "go-shrc"; 11 | path = ./dots/shell.sh; 12 | }); 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /home/modules/dev/llm.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.ollama = { 3 | enable = true; 4 | acceleration = "cuda"; 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /home/modules/dev/mobile.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | home = let 7 | ANDROID_HOME = "${config.home.homeDirectory}/.android"; 8 | in { 9 | packages = with pkgs; [ 10 | android-studio 11 | android-tools 12 | 13 | maestro # Mobile UI Automation tool 14 | 15 | kotlin-language-server 16 | kotlin-native 17 | kotlin 18 | 19 | nodePackages.eas-cli 20 | 21 | sdkmanager # for me, "Accept The License - The CLI" 22 | ]; 23 | 24 | file = { 25 | "${ANDROID_HOME}/platform-tools" = { 26 | source = config.lib.file.mkOutOfStoreSymlink "${pkgs.android-tools}/bin"; 27 | }; 28 | 29 | # Oh, but we, we couldn't stay together 30 | # I knew this wouldn't last forever 31 | # forever, just more one time than never 32 | # this is the last string to sever 33 | ".gradle/gradle.properties".text = '' 34 | org.gradle.jvmargs=-Xmx14g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 35 | org.gradle.parallel=true 36 | org.gradle.configureondemand=true 37 | org.gradle.daemon=false 38 | ''; 39 | }; 40 | 41 | sessionPath = [ 42 | "${ANDROID_HOME}/platform-tools" 43 | "${ANDROID_HOME}/emulator" 44 | ]; 45 | 46 | sessionVariables = { 47 | inherit ANDROID_HOME; 48 | }; 49 | }; 50 | } 51 | -------------------------------------------------------------------------------- /home/modules/dev/node.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: { 7 | home = let 8 | npmGlobalDir = "${config.home.homeDirectory}/.npm-global"; 9 | in { 10 | packages = with pkgs; [ 11 | npm-check-updates # (ncu) Find newer versions of package dependencies and check outdated npm packages locally or globally. 12 | nodePackages.pnpm 13 | pkgs.extra.npkill # remove node_modules from child directories 14 | nest-cli 15 | nodejs 16 | husky 17 | biome 18 | bun 19 | ]; 20 | 21 | sessionVariables = { 22 | # https://github.com/npm/cli/issues/7857#issuecomment-2481331001 23 | NODE_OPTIONS = "--disable-warning=ExperimentalWarning"; 24 | }; 25 | 26 | sessionPath = ["${npmGlobalDir}/bin"]; 27 | 28 | activation.init = lib.hm.dag.entryAfter ["writeBoundary"] '' 29 | mkdir -p ${npmGlobalDir}/bin \ 30 | ${npmGlobalDir}/lib 31 | ''; 32 | 33 | file = { 34 | ".npmrc".text = '' 35 | prefix=${npmGlobalDir} 36 | //registry.npmjs.org/:_authToken=''${NPM_TOKEN} 37 | ''; 38 | 39 | ".bunfig.toml".text = '' 40 | [runtime] 41 | logLevel = "debug" 42 | telemetry = false 43 | 44 | [install] 45 | optional = true 46 | dev = true 47 | peer = true 48 | production = false 49 | exact = true 50 | 51 | auto = "fallback" 52 | ''; 53 | }; 54 | }; 55 | } 56 | -------------------------------------------------------------------------------- /home/modules/dev/ocaml.nix: -------------------------------------------------------------------------------- 1 | { 2 | user, 3 | pkgs, 4 | ... 5 | }: let 6 | opamInitScriptPath = "/home/${user.alias}/.opam/opam-init/init.zsh"; 7 | in { 8 | home.packages = with pkgs; [ 9 | ocamlPackages.utop 10 | dune-release 11 | ocamlformat 12 | dune_3 13 | ocaml 14 | ]; 15 | 16 | programs = { 17 | opam = { 18 | enable = true; 19 | package = pkgs.opam; 20 | enableZshIntegration = true; 21 | }; 22 | 23 | zsh.initContent = '' 24 | [[ ! -r ${opamInitScriptPath} ]] || source ${opamInitScriptPath} >/dev/null 2>/dev/null 25 | ''; 26 | }; 27 | 28 | # systemd.user.services = lib.mkIf config.programs.opam.enable { 29 | # opam-update = { 30 | # Unit.Description = "Automatically update and keep installed opam packages"; 31 | 32 | # Service = let 33 | # opam = pkgs.opam.overrideAttrs ( 34 | # p: { 35 | # postInstall = let 36 | # wrapperLine = '' 37 | # wrapProgram ${placeholder "out"}/bin/opam \ 38 | # --prefix PATH : ${lib.makeBinPath (with pkgs; [gnupatch gnutar gnumake gzip gcc])} 39 | # ''; 40 | # in 41 | # p.postInstall 42 | # + wrapperLine; 43 | # } 44 | # ); 45 | 46 | # packagesToInstall = lib.strings.concatMapStrings (p: p + " ") [ 47 | # "ocaml-lsp-server" 48 | # "base" 49 | # "core" 50 | # ]; 51 | 52 | # opam-init = pkgs.writeShellScriptBin "opam-init" '' 53 | # if ! test -f ${opamInitScriptPath}; then 54 | # return 55 | # fi 56 | 57 | # eval $(${opam}/bin/opam env) 58 | # source ${opamInitScriptPath} 59 | 60 | # sudo -Hu ${user.alias} ${pkgs.bash}/bin/bash -c '${opam}/bin/opam install -y ${packagesToInstall}' 61 | # ''; 62 | # in { 63 | # Type = "oneshot"; 64 | # ExecStart = "${opam-init}/bin/opam-init"; 65 | # Restart = "never"; 66 | # }; 67 | 68 | # Install = { 69 | # WantedBy = ["default.target"]; 70 | # }; 71 | # }; 72 | # }; 73 | } 74 | -------------------------------------------------------------------------------- /home/modules/dev/ops/aws.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | home = { 7 | packages = with pkgs; [ 8 | aws-lambda-rie 9 | pkgs.extra.s3-edit 10 | pkgs.extra.ecsview 11 | (awscli2.overrideAttrs 12 | (_old: { 13 | doCheck = false; 14 | })) 15 | stu 16 | ]; 17 | 18 | sessionVariables = rec { 19 | # default profiles are very ambiguous 20 | AWS_DEFAULT_PROFILE = "personal"; 21 | AWS_PROFILE = AWS_DEFAULT_PROFILE; 22 | AWS_REGION = "sa-east-1"; 23 | }; 24 | 25 | file = let 26 | inherit (config.home) homeDirectory; 27 | in { 28 | ".stu/config.toml".text = '' 29 | download_dir = "${homeDirectory}/Downloads/s3" 30 | ''; 31 | }; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /home/modules/dev/ops/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./terraform.nix 4 | ./tools.nix 5 | ./k8s.nix 6 | ./gdk.nix 7 | ./aws.nix 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /home/modules/dev/ops/gdk.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: let 2 | gdk = pkgs.google-cloud-sdk.withExtraComponents (with pkgs.google-cloud-sdk.components; [ 3 | gke-gcloud-auth-plugin 4 | ]); 5 | in { 6 | home.packages = [ 7 | gdk 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /home/modules/dev/ops/k8s.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home = { 3 | shellAliases = rec { 4 | k9s = "k9s --crumbsless --logoless --refresh=2"; 5 | kw = "k9s"; 6 | k = "kubectl"; 7 | mrk = k; # sometimes I want to call it like this 8 | }; 9 | 10 | packages = with pkgs; [ 11 | kubernetes 12 | minikube 13 | kubectl 14 | ]; 15 | }; 16 | 17 | programs.k9s = let 18 | inherit (pkgs.libx.formats) fromYAML; 19 | in { 20 | enable = true; 21 | skins.skin = fromYAML ../../../dots/k9s/skin.yml; 22 | views = fromYAML ../../../dots/k9s/views.yml; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /home/modules/dev/ops/terraform.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | ... 5 | }: { 6 | home.packages = with pkgs; [terraform terraformer]; 7 | 8 | programs.zsh.completionInit = '' 9 | complete -C ${lib.getExe pkgs.terraform} terraform 10 | ''; 11 | } 12 | -------------------------------------------------------------------------------- /home/modules/dev/ops/tools.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | argocd 4 | lego 5 | ]; 6 | } 7 | -------------------------------------------------------------------------------- /home/modules/dev/processors.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | htmlq 4 | yq-go 5 | ]; 6 | 7 | programs.jq = { 8 | enable = true; 9 | colors = { 10 | arrays = "1;37"; 11 | false = "0;37"; 12 | null = "1;30"; 13 | numbers = "0;37"; 14 | objects = "1;37"; 15 | strings = "0;32"; 16 | true = "0;37"; 17 | objectKeys = "1;34"; 18 | }; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /home/modules/dev/pwn/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./lammer.nix 4 | ./tools.nix 5 | ./osint.nix 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /home/modules/dev/pwn/lammer.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = [ 3 | pkgs.cmatrix 4 | pkgs.genact 5 | ]; 6 | } 7 | -------------------------------------------------------------------------------- /home/modules/dev/pwn/osint.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | exiftool 4 | # maigret # Broken -> ValueError: Hash algorithm not known for ed448 - use .cms_hash_algorithm for CMS purposes. More info at https://github.com/wbond/asn1crypto/pull/230. 5 | whois 6 | dig 7 | ]; 8 | } 9 | -------------------------------------------------------------------------------- /home/modules/dev/pwn/tools.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | osv-scanner 4 | aircrack-ng 5 | # error: cargoHash, cargoVendorDir, cargoDeps, or cargoLock must be set 6 | # pkgs.extra.havn 7 | semgrep 8 | nmap 9 | ]; 10 | } 11 | -------------------------------------------------------------------------------- /home/modules/dev/python.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | (python313.withPackages 4 | (p: 5 | with p; [ 6 | pipx # install and run apps in isolated environments 7 | pip 8 | ])) 9 | virtualenv # to create raw environments 10 | poetry # package manager 11 | pyright # linter 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /home/modules/dev/rust.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home = { 3 | packages = with pkgs; let 4 | cargo-plugins = [ 5 | cargo-sweep 6 | ]; 7 | in 8 | [ 9 | rust-analyzer 10 | rustfmt 11 | clippy 12 | 13 | cargo 14 | rustc 15 | ] 16 | ++ cargo-plugins; 17 | 18 | sessionPath = ["$HOME/.cargo/bin"]; 19 | 20 | file.".cargo/config.toml".source = (pkgs.formats.toml {}).generate "cargo-config" { 21 | net = { 22 | git-fetch-with-cli = true; 23 | }; 24 | }; 25 | }; 26 | 27 | systemd.user.services.rustup-default = { 28 | Unit = { 29 | Description = "Set the default Rust toolchain"; 30 | }; 31 | 32 | Service = { 33 | Type = "oneshot"; 34 | ExecStart = "${pkgs.rustup}/bin/rustup default stable"; 35 | Restart = "on-failure"; 36 | }; 37 | 38 | Install = { 39 | WantedBy = ["default.target"]; 40 | }; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /home/modules/dev/writer.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | typst 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /home/modules/dev/zig.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | # for fun, I guess 7 | programs.zig = { 8 | enable = true; 9 | package = pkgs.zig; 10 | enableZshIntegration = config.programs.zsh.enable; 11 | lsp = true; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /home/modules/discord.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = [ 3 | (pkgs.discord-canary.override { 4 | withVencord = true; 5 | withOpenASAR = true; 6 | nss = pkgs.nss_latest; 7 | }) 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /home/modules/docker.nix: -------------------------------------------------------------------------------- 1 | { 2 | nixosConfig, 3 | lib, 4 | ... 5 | }: { 6 | # https://github.com/jesseduffield/lazydocker/blob/master/docs/Config.md 7 | programs.lazydocker = lib.mkIf nixosConfig.virtualisation.docker.enable { 8 | enable = true; 9 | settings = { 10 | gui = { 11 | scrollHeight = 2; 12 | language = "en"; 13 | theme = { 14 | activeBorderColor = ["green" "bold"]; 15 | inactiveBorderColor = ["white"]; 16 | optionsTextColor = ["blue"]; 17 | }; 18 | returnImmediately = true; 19 | wrapMainPanel = true; 20 | sidePanelWidth = 0.333; 21 | showBottomLine = true; 22 | expandFocusedSidePanel = false; 23 | }; 24 | 25 | logs = { 26 | timestamps = false; 27 | since = "60m"; # set to '' to show all logs 28 | tail = ""; 29 | }; 30 | 31 | commandTemplates = { 32 | dockerCompose = "docker-compose"; 33 | restartService = "{{ .DockerCompose }} restart {{ .Service.Name }}"; 34 | up = "{{ .DockerCompose }} up -d"; 35 | down = "{{ .DockerCompose }} down"; 36 | downWithVolumes = "{{ .DockerCompose }} down --volumes"; 37 | upService = "{{ .DockerCompose }} up -d {{ .Service.Name }}"; 38 | startService = "{{ .DockerCompose }} start {{ .Service.Name }}"; 39 | stopService = "{{ .DockerCompose }} stop {{ .Service.Name }}"; 40 | serviceLogs = "{{ .DockerCompose }} logs --since=60m --follow {{ .Service.Name }}"; 41 | viewServiceLogs = "{{ .DockerCompose }} logs --follow {{ .Service.Name }}"; 42 | rebuildService = "{{ .DockerCompose }} up -d --build {{ .Service.Name }}"; 43 | recreateService = "{{ .DockerCompose }} up -d --force-recreate {{ .Service.Name }}"; 44 | allLogs = "{{ .DockerCompose }} logs --tail=300 --follow"; 45 | viewAlLogs = "{{ .DockerCompose }} logs"; 46 | dockerComposeConfig = "{{ .DockerCompose }} config"; 47 | checkDockerComposeConfig = "{{ .DockerCompose }} config --quiet"; 48 | serviceTop = "{{ .DockerCompose }} top {{ .Service.Name }}"; 49 | }; 50 | 51 | oS = { 52 | openCommand = "open {{filename}}"; 53 | openLinkCommand = "open {{link}}"; 54 | }; 55 | 56 | stats = { 57 | graphs = [ 58 | { 59 | caption = "CPU (%)"; 60 | statPath = "DerivedStats.CPUPercentage"; 61 | color = "blue"; 62 | } 63 | { 64 | caption = "Memory (%)"; 65 | statPath = "DerivedStats.MemoryPercentage"; 66 | color = "green"; 67 | } 68 | ]; 69 | }; 70 | }; 71 | }; 72 | } 73 | -------------------------------------------------------------------------------- /home/modules/editors/cursor.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = [ 3 | pkgs.re.code-cursor 4 | ]; 5 | 6 | # so the process is detached from the terminal 7 | programs.zsh.initContent = '' 8 | cursor() { 9 | (nohup cursor "$@" >/dev/null 2>&1 &) 10 | } 11 | ''; 12 | } 13 | -------------------------------------------------------------------------------- /home/modules/editors/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./cursor.nix 4 | ./vscode.nix 5 | ./nano.nix 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /home/modules/editors/dots/nanorc/hcl.nanorc: -------------------------------------------------------------------------------- 1 | ## Syntax highlighting for Hashicorp Terraform / HCL files. 2 | 3 | # See: https://github.com/hashicorp/hcl 4 | # Original author: John Boero 5 | # License: GPLv3 or newer 6 | 7 | syntax "hcl" "\.(tf|hcl)$" 8 | # No comments are permitted in JSON. 9 | comment "" 10 | 11 | # Numbers (used as value). 12 | color green ":[[:space:]]*\-?(0|[1-9][0-9]*)(\.[0-9]+)?([Ee]?[-+]?[0-9]+)?" 13 | # Values (well, any string). 14 | color brightmagenta "\".+\"" 15 | # Hex numbers (used as value). 16 | color green ":[[:space:]]*\"#[0-9abcdefABCDEF]+\"" 17 | # Escapes. 18 | color green "\\\\" "\\\"" "\\[bfnrt]" "\\u[0-9abcdefABCDEF]{4})" 19 | # Special words. 20 | color green "(true|false|null|output|path|vault|description|default|value)" 21 | 22 | color brightgreen "(variable|terraform|resource|provider|module)" 23 | 24 | # Names (very unlikely to contain a quote). 25 | color brightblue "\"[^"]+\"[[:space:]]*:" 26 | 27 | # Brackets, braces, and separators. 28 | color brightblue "\[" "\]" 29 | color brightred "\{" "\}" 30 | color brightred "," ":" 31 | 32 | # Comments. 33 | color cyan "(^|[[:space:]]+)(//|#).*$" 34 | 35 | # Trailing whitespace. 36 | color ,green "[[:space:]]+$" -------------------------------------------------------------------------------- /home/modules/editors/nano.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: let 2 | inherit (pkgs) nano; 3 | in { 4 | home = { 5 | packages = [nano]; 6 | 7 | file.".nanorc".text = let 8 | nanoDir = builtins.path { 9 | name = "personal-nanorc-files"; 10 | path = ./dots/nanorc; 11 | }; 12 | in '' 13 | include "${nano}/share/nano/*.nanorc" 14 | include "${nano}/share/nano/extra/*.nanorc" 15 | include "${nanoDir}/*.nanorc" 16 | 17 | set titlecolor white,magenta 18 | set positionlog 19 | set autoindent 20 | set tabsize 4 21 | set atblanks 22 | set zero 23 | ''; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /home/modules/editors/vscode.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.vscode = { 3 | enable = true; 4 | package = pkgs.vscode; 5 | mutableExtensionsDir = true; 6 | 7 | profiles.default = { 8 | enableExtensionUpdateCheck = true; 9 | enableUpdateCheck = true; 10 | 11 | extensions = with pkgs.vscode-extensions; [ 12 | # Go 13 | golang.go 14 | 15 | # Rust 16 | rust-lang.rust-analyzer 17 | 18 | # Nix 19 | arrterian.nix-env-selector 20 | brettm12345.nixfmt-vscode 21 | kamadorueda.alejandra 22 | jnoortheen.nix-ide 23 | bbenoist.nix 24 | 25 | # OCaml 26 | ocamllabs.ocaml-platform 27 | 28 | # Python 29 | ms-python.python 30 | 31 | # Git 32 | eamodio.gitlens 33 | 34 | # Formats 35 | redhat.vscode-yaml 36 | # dlasagno.rasi 37 | 38 | # Theme 39 | zhuangtongfa.material-theme 40 | 41 | # Misc 42 | christian-kohler.path-intellisense 43 | mechatroner.rainbow-csv 44 | usernamehw.errorlens 45 | ritwickdey.liveserver 46 | ]; 47 | }; 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /home/modules/etc/bat.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.bat = { 3 | enable = true; 4 | config = { 5 | theme = "Nord"; 6 | italic-text = "always"; 7 | }; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /home/modules/etc/btop.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | btop 4 | ]; 5 | 6 | xdg.configFile = { 7 | "btop/btop.conf".text = let 8 | cfgFile = builtins.path { 9 | name = "btop-config"; 10 | path = ../../dots/btop/btop.conf; 11 | }; 12 | in 13 | builtins.readFile cfgFile; 14 | 15 | "btop/themes/custom.theme".text = let 16 | themeFile = builtins.path { 17 | name = "btop-theme"; 18 | path = ../../dots/btop/themes/custom.theme; 19 | }; 20 | in 21 | builtins.readFile themeFile; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /home/modules/etc/color-picker.nix: -------------------------------------------------------------------------------- 1 | { 2 | isWayland, 3 | pkgs, 4 | lib, 5 | ... 6 | }: let 7 | package = let 8 | color-picker = 9 | if isWayland 10 | then { 11 | package = pkgs.wl-color-picker; 12 | extraArgs = ""; 13 | } 14 | else { 15 | package = pkgs.xcolor; 16 | extraArgs = "-s"; 17 | }; 18 | in 19 | color-picker.package.overrideAttrs ( 20 | old: { 21 | nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.copyDesktopItems]; 22 | 23 | desktopItems = [ 24 | (pkgs.makeDesktopItem rec { 25 | name = "Color Picker"; 26 | exec = "${lib.getExe color-picker.package} ${color-picker.extraArgs}"; 27 | icon = name; 28 | desktopName = name; 29 | genericName = let 30 | pname = 31 | if builtins.isString old.pname 32 | then old.pname 33 | else old.name; 34 | in "${pname} - ${old.meta.description}"; 35 | }) 36 | ]; 37 | } 38 | ); 39 | in { 40 | home = { 41 | packages = [package]; 42 | 43 | shellAliases = { 44 | "color-picker" = "${lib.getExe package}"; 45 | }; 46 | }; 47 | } 48 | -------------------------------------------------------------------------------- /home/modules/etc/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./bat.nix 4 | ./color-picker.nix 5 | ./translator.nix 6 | ./gsimplecal.nix 7 | ./macchina.nix 8 | ./ntfy-sh.nix 9 | ./zathura.nix 10 | ./btop.nix 11 | ./man.nix 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /home/modules/etc/gsimplecal.nix: -------------------------------------------------------------------------------- 1 | {host, ...}: { 2 | # https://github.com/dmedvinsky/gsimplecal/blob/master/src/Config.cpp 3 | xdg.configFile."gsimplecal/config".text = '' 4 | show_calendar = 1 5 | show_timezones = 1 6 | mark_today = 1 7 | show_week_numbers = 1 8 | close_on_unfocus = 0 9 | clock_format = %a %d %b %H:%M 10 | force_lang = en_US.utf8t 11 | mainwindow_decorated = 1 12 | mainwindow_keep_above = 1 13 | mainwindow_sticky = 0 14 | mainwindow_skip_taskbar = 1 15 | mainwindow_resizable = 0 16 | mainwindow_position = center # I think that this option is useless in hyprland 17 | mainwindow_xoffset = 250 18 | mainwindow_yoffset = 12 19 | clock_label = . … 20 | clock_tz = :${host.timeZone} 21 | ''; 22 | } 23 | -------------------------------------------------------------------------------- /home/modules/etc/macchina.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | macchina 4 | ]; 5 | 6 | xdg.configFile = { 7 | "macchina/macchina.toml".text = builtins.readFile ../../dots/macchina/macchina.toml; 8 | "macchina/assets/v.ascii".text = builtins.readFile ../../dots/macchina/assets/v.ascii; 9 | "macchina/themes/yttrium.toml".text = builtins.readFile ../../dots/macchina/themes/yttrium.toml; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /home/modules/etc/man.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | tealdeer 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /home/modules/etc/ntfy-sh.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | services.ntfy-sh-client = { 3 | enable = true; 4 | 5 | options = let 6 | ntfy-icon = builtins.path { 7 | name = "ntfy-sh.png"; 8 | path = ../../dots/ntfy-sh.png; 9 | }; 10 | in { 11 | default-command = ''${pkgs.libnotify}/bin/notify-send --icon=${ntfy-icon} "ntfy.sh/$NTFY_TOPIC" "$NTFY_MESSAGE"''; 12 | subscribe = [ 13 | { 14 | topic = "hello"; 15 | } 16 | ]; 17 | }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /home/modules/etc/translator.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | translate-shell 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /home/modules/etc/zathura.nix: -------------------------------------------------------------------------------- 1 | { 2 | # https://github.com/escherdragon/zathura/blob/master/zathura.desktop 3 | xdg = { 4 | desktopEntries = { 5 | zathura = { 6 | name = "zathura"; 7 | type = "Application"; 8 | comment = "A minimalistic PDF viewer"; 9 | exec = "zathura --fork %f"; 10 | terminal = false; 11 | categories = ["Office" "Viewer"]; 12 | mimeType = ["application/pdf"]; 13 | }; 14 | }; 15 | 16 | mimeApps.defaultApplications = { 17 | "application/pdf" = "zathura.desktop"; 18 | }; 19 | }; 20 | 21 | programs.zathura = { 22 | enable = true; 23 | options = { 24 | window-title-page = true; 25 | window-height = 850; 26 | 27 | scroll-page-aware = true; 28 | scroll-full-overlap = "0.01"; 29 | scroll-step = 100; 30 | 31 | zoom-min = 5; 32 | guioptions = "v"; 33 | 34 | font = "inconsolata 15"; 35 | 36 | default-bg = "#000000"; 37 | default-fg = "#F7F7F6"; 38 | 39 | statusbar-fg = "#B0B0B0"; 40 | statusbar-bg = "#202020"; 41 | 42 | notification-bg = "#90A959"; 43 | notification-fg = "#151515"; 44 | 45 | notification-error-bg = "#dedede"; 46 | notification-error-fg = "#ac4142"; 47 | 48 | notification-warning-bg = "#AC4142"; 49 | notification-warning-fg = "#151515"; 50 | 51 | highlight-color = "#F4BF75"; 52 | highlight-active-color = "#6A9FB5"; 53 | 54 | completion-bg = "#303030"; 55 | completion-fg = "#E0E0E0"; 56 | 57 | completion-highlight-fg = "#151515"; 58 | completion-highlight-bg = "#90A959"; 59 | 60 | render-loading = true; 61 | }; 62 | }; 63 | } 64 | -------------------------------------------------------------------------------- /home/modules/file-manager.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | pkgs.ranger 4 | nautilus 5 | ]; 6 | 7 | programs.xplr = { 8 | enable = true; 9 | package = pkgs.xplr; 10 | plugins = { 11 | wl-clipboard = pkgs.fetchFromGitHub { 12 | owner = "sayanarijit"; 13 | repo = "wl-clipboard.xplr"; 14 | rev = "a3ffc87460c5c7f560bffea689487ae14b36d9c3"; 15 | hash = "sha256-I4rh5Zks9hiXozBiPDuRdHwW5I7ppzEpQNtirY0Lcks="; 16 | }; 17 | }; 18 | 19 | extraConfig = '' 20 | require("wl-clipboard").setup { 21 | copy_command = "wl-copy -t text/uri-list", 22 | paste_command = "wl-paste", 23 | keep_selection = true, 24 | } 25 | ''; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /home/modules/media.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = let 3 | feh = pkgs.feh.overrideAttrs (old: { 4 | nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.copyDesktopItems]; 5 | 6 | desktopItems = [ 7 | (pkgs.makeDesktopItem { 8 | name = "feh"; 9 | exec = "feh --bg-scale %f"; 10 | icon = "feh"; 11 | desktopName = "feh"; 12 | genericName = "Image Viewer"; 13 | }) 14 | ]; 15 | }); 16 | in [ 17 | pkgs.vlc 18 | feh 19 | ]; 20 | } 21 | -------------------------------------------------------------------------------- /home/modules/nao.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.nao = { 3 | enable = true; 4 | config = { 5 | editor.name = "nano"; 6 | theme = "rose-pine"; 7 | readOnlyOnConflict = false; 8 | }; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /home/modules/password-store.nix: -------------------------------------------------------------------------------- 1 | { 2 | isWayland, 3 | config, 4 | pkgs, 5 | lib, 6 | ... 7 | }: { 8 | programs.password-store = { 9 | enable = true; 10 | package = 11 | if isWayland 12 | then pkgs.pass-wayland 13 | else pkgs.pass; 14 | }; 15 | 16 | home.sessionVariables = { 17 | PASSWORD_STORE_DIR = lib.mkForce ( 18 | let 19 | inherit (config.home) homeDirectory; 20 | in "${homeDirectory}/.password-store" # this could be your attach vector! 21 | ); 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /home/modules/spotify.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | system, 4 | pkgs, 5 | ... 6 | }: let 7 | spicetify = inputs.spicetify-nix.legacyPackages.${system}; 8 | in { 9 | programs.spicetify = with spicetify; { 10 | enable = true; 11 | theme = themes.text; 12 | 13 | spotifyPackage = pkgs.spotify; 14 | 15 | enabledExtensions = with extensions; [ 16 | volumePercentage 17 | historyShortcut 18 | fullAppDisplay 19 | fullAlbumDate 20 | betterGenres 21 | hidePodcasts 22 | popupLyrics 23 | songStats 24 | skipStats 25 | powerBar 26 | adblock 27 | shuffle 28 | wikify 29 | ]; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /home/modules/studio/3d.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = [ 3 | pkgs.blender 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /home/modules/studio/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./3d.nix 4 | ./images.nix 5 | ./video.nix 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /home/modules/studio/images.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = [ 3 | pkgs.gimp 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /home/modules/studio/video.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = [ 3 | # pkgs.davinci-resolve 4 | pkgs.shotcut 5 | pkgs.ffmpeg 6 | ]; 7 | 8 | programs.obs-studio = { 9 | enable = true; 10 | 11 | plugins = with pkgs; [ 12 | obs-studio-plugins.wlrobs 13 | ]; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /home/modules/systemless.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | host, 4 | ... 5 | }: { 6 | services = { 7 | battery-notifier = { 8 | enable = host.isLaptop; 9 | settings = { 10 | interval_ms = 700; 11 | reminder.threshold = host.batteryThreshold / 2; 12 | warn.threshold = 15; 13 | threat.threshold = 5; 14 | }; 15 | }; 16 | 17 | playerctld.enable = true; 18 | 19 | udiskie = { 20 | enable = true; 21 | automount = true; 22 | notify = true; 23 | tray = "auto"; 24 | }; 25 | }; 26 | 27 | home.packages = [ 28 | pkgs.libnotify 29 | ]; 30 | } 31 | -------------------------------------------------------------------------------- /home/modules/terminal/alacritty.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.alacritty = { 3 | enable = true; 4 | package = pkgs.alacritty; 5 | }; 6 | 7 | xdg.configFile = { 8 | "alacritty.toml".text = builtins.readFile ./dots/alacritty.toml; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /home/modules/terminal/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./alacritty.nix 4 | ./tty-tools.nix 5 | ./ghostty.nix 6 | ./direnv.nix 7 | ./tmux.nix 8 | ./fzf.nix 9 | ./zsh.nix 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /home/modules/terminal/direnv.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.direnv = { 3 | enable = true; 4 | enableZshIntegration = true; 5 | enableBashIntegration = true; 6 | config = { 7 | global = { 8 | load_dotenv = true; 9 | warn_timeout = "5s"; 10 | }; 11 | 12 | whitelist = { 13 | prefix = [ 14 | "$HOME/Projects/github.com/Qompa-Fi" 15 | "$HOME/Projects/github.com/luisnquin" 16 | "$HOME/Projects/github.com/chanchitaapp" 17 | "$HOME/Projects/github.com/0xc000022070" 18 | "$HOME/.dotfiles" 19 | ]; 20 | }; 21 | }; 22 | 23 | nix-direnv.enable = true; 24 | }; 25 | 26 | home.sessionVariables = { 27 | DIRENV_LOG_FORMAT = "direnv: %s"; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /home/modules/terminal/dots/.gitmux.conf: -------------------------------------------------------------------------------- 1 | tmux: 2 | symbols: 3 | branch: "⎇ " 4 | hashprefix: ":" 5 | ahead: ↑· 6 | behind: ↓· 7 | staged: "● " 8 | conflict: "✖ " 9 | modified: "✚ " 10 | untracked: "… " 11 | stashed: "⚑ " 12 | clean: ✔ 13 | styles: 14 | clear: "#[fg=default]" 15 | state: "#[fg=red,bold]" 16 | branch: "#[fg=white,bold]" 17 | remote: "#[fg=cyan]" 18 | staged: "#[fg=green,bold]" 19 | conflict: "#[fg=red,bold]" 20 | modified: "#[fg=red,bold]" 21 | untracked: "#[fg=magenta,bold]" 22 | stashed: "#[fg=cyan,bold]" 23 | clean: "#[fg=green,bold]" 24 | divergence: "#[fg=default]" 25 | layout: [branch, .., remote-branch, divergence, " - ", flags] 26 | options: 27 | branch_max_len: 0 28 | branch_trim: right 29 | -------------------------------------------------------------------------------- /home/modules/terminal/dots/.tmux.conf: -------------------------------------------------------------------------------- 1 | unbind r 2 | bind r source-file ~/.config/tmux/tmux.conf 3 | 4 | set-option -ga terminal-overrides ",*256col*:Tc:RGB" 5 | set -g default-terminal "xterm-256color" 6 | 7 | setw -g pane-base-index 200 8 | set -g base-index 100 9 | 10 | set-window-option -g mode-keys vi 11 | set -g window-status-separator '' 12 | set -g status-interval 5 13 | set -g display-time 4000 14 | 15 | setw -g mouse on 16 | setw -g aggressive-resize off 17 | setw -g clock-mode-style 24 18 | set -s escape-time 500 19 | set -g history-limit 1000000 20 | 21 | set -g @plugin 'tmux-plugins/tmux-pain-control' 22 | set -g @plugin "janoamaral/tokyo-night-tmux" 23 | # set -g @plugin 'fabioluciano/tmux-tokyo-night' 24 | set -g @plugin 'tmux-plugins/tmux-sensible' 25 | set -g @plugin 'tmux-plugins/tmux-logging' 26 | set -g @plugin 'tmux-plugins/tmux-copycat' 27 | set -g @plugin 'rickstaa/tmux-notify' 28 | 29 | set -g @tokyo-night-tmux_theme night 30 | set -g @tokyo-night-tmux_transparent 0 31 | 32 | # Theme configuration 33 | set -g @theme_variation 'storm' 34 | set -g @theme_enable_icons 1 35 | set -g @theme_left_separator '' 36 | set -g @theme_right_separator '' 37 | set -g @theme_status_bell_style 'bold' 38 | 39 | # Tmux package manager 40 | set -g @plugin 'tmux-plugins/tpm' 41 | run '~/.tmux/plugins/tpm/tpm' 42 | 43 | set -g status-right '#(gitmux -cfg $HOME/.config/.gitmux.conf "#{pane_current_path}")' 44 | -------------------------------------------------------------------------------- /home/modules/terminal/dots/alacritty.toml: -------------------------------------------------------------------------------- 1 | [cursor] 2 | blink_interval = 550 3 | blink_timeout = 0 4 | thickness = 0.2 5 | 6 | [cursor.style] 7 | blinking = "Always" 8 | shape = "Beam" 9 | 10 | [env] 11 | TERM = "alacritty" 12 | 13 | [font] 14 | builtin_box_drawing = true 15 | size = 10.5 16 | 17 | [font.bold] 18 | family = "Cascadia Code" 19 | style = "Bold" 20 | 21 | [font.bold_italic] 22 | family = "Cascadia Code" 23 | style = "Bold Italic" 24 | 25 | [font.italic] 26 | family = "Cascadia Code" 27 | style = "Italic" 28 | 29 | [font.normal] 30 | family = "Cascadia Code" 31 | style = "Regular" 32 | 33 | [font.offset] 34 | x = 0 35 | y = 1 36 | 37 | [[keyboard.bindings]] 38 | action = "ToggleFullscreen" 39 | key = "F11" 40 | 41 | [selection] 42 | save_to_clipboard = true 43 | semantic_escape_chars = ",│`|:\"' ()[]{}<>\t" 44 | 45 | [window] 46 | decorations = "full" 47 | dynamic_title = true 48 | opacity = 0.7 49 | startup_mode = "Windowed" 50 | title = "Dev shell 🫐⛄" 51 | 52 | [general] 53 | live_config_reload = false 54 | 55 | [window.class] 56 | general = "Alacritty" 57 | instance = "Alacritty" 58 | 59 | [window.dimensions] 60 | columns = 132 61 | lines = 37 62 | 63 | [window.padding] 64 | x = 15 65 | y = 1 66 | 67 | [window.position] 68 | x = 550 69 | y = 250 70 | -------------------------------------------------------------------------------- /home/modules/terminal/dots/completionInit.zsh: -------------------------------------------------------------------------------- 1 | #!bin/zsh 2 | 3 | autoload -U compinit && compinit 4 | 5 | complete -C "$(which aws_completer)" aws 6 | 7 | source <(senv completion zsh) 8 | 9 | # Show only Makefile rules unless they aren't defined 10 | zstyle ':completion::complete:make::' tag-order targets variables 11 | -------------------------------------------------------------------------------- /home/modules/terminal/fzf.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs = { 3 | fzf = { 4 | enable = true; 5 | enableBashIntegration = true; 6 | enableZshIntegration = true; 7 | 8 | # https://vitormv.github.io/fzf-themes/#eyJib3JkZXJTdHlsZSI6InJvdW5kZWQiLCJib3JkZXJMYWJlbCI6IiIsImJvcmRlckxhYmVsUG9zaXRpb24iOjAsInByZXZpZXdCb3JkZXJTdHlsZSI6InJvdW5kZWQiLCJwYWRkaW5nIjoiMCIsIm1hcmdpbiI6IjAiLCJwcm9tcHQiOiI+ICIsIm1hcmtlciI6Ij4iLCJwb2ludGVyIjoi4peGIiwic2VwYXJhdG9yIjoi4pSAIiwic2Nyb2xsYmFyIjoi4pSCIiwibGF5b3V0IjoiZGVmYXVsdCIsImluZm8iOiJkZWZhdWx0IiwiY29sb3JzIjoiZmc6I2U4ZDRmMyxmZys6I2QwZDBkMCxiZys6IzIyMTMyNixobDojNGViMGQwLGhsKzojNGViOGRjLGluZm86I2QyZDI4NixtYXJrZXI6Izc4MmNjZSxwcm9tcHQ6IzNkODQ4YixzcGlubmVyOiNhZjVmZmYscG9pbnRlcjojYWY1ZmZmLGhlYWRlcjojODdhZmFmLGJvcmRlcjojMjYyNjI2LGxhYmVsOiNhZWFlYWUscXVlcnk6I2Q5ZDlkOSJ9 9 | colors = { 10 | "fg" = "#e8d4f3"; 11 | "fg+" = "#d0d0d0"; 12 | "bg" = "-1"; 13 | "bg+" = "#221326"; 14 | "hl" = "#4eb0d0"; 15 | "hl+" = "#4eb8dc"; 16 | 17 | "spinner" = "#af5fff"; 18 | "marker" = "#782cce"; 19 | "prompt" = "#3d848b"; 20 | "pointer" = "#af5fff"; 21 | "header" = "#87afaf"; 22 | "info" = "#d2d286"; 23 | 24 | "border" = "#262626"; 25 | "query" = "#d9d9d9"; 26 | "label" = "#aeaeae"; 27 | }; 28 | 29 | defaultOptions = [ 30 | "--border=rounded" 31 | "--preview-window=border-rounded" 32 | "--prompt='> '" 33 | "--marker='>'" 34 | "--pointer='◆'" 35 | "--separator='─'" 36 | "--scrollbar='│'" 37 | ]; 38 | }; 39 | 40 | emoji-fzf.enable = true; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /home/modules/terminal/ghostty.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | system, 4 | ... 5 | }: { 6 | programs.ghostty = { 7 | enable = true; 8 | package = inputs.ghostty.packages.${system}.default; 9 | enableZshIntegration = true; 10 | enableBashIntegration = true; 11 | 12 | settings = { 13 | font-synthetic-style = "bold"; 14 | font-size = "10.8"; 15 | 16 | theme = "iceberg-dark"; 17 | 18 | cursor-style = "bar"; 19 | cursor-style-blink = "true"; 20 | 21 | background-opacity = "0.8"; 22 | background-blur-radius = "20"; 23 | 24 | link-url = "true"; 25 | class = "com.mitchellh.ghostty"; 26 | 27 | working-directory = "home"; 28 | 29 | window-padding-x = "15,4"; 30 | window-padding-y = "8,6"; 31 | 32 | # https://ghostty.org/docs/config/reference#window-vsync 33 | window-vsync = "false"; 34 | window-decoration = "false"; 35 | 36 | window-save-state = "never"; 37 | 38 | clipboard-read = "allow"; 39 | clipboard-write = "allow"; 40 | 41 | clipboard-trim-trailing-spaces = "true"; 42 | clipboard-paste-protection = "true"; 43 | 44 | shell-integration = "zsh"; 45 | 46 | desktop-notifications = "true"; 47 | 48 | auto-update = "off"; 49 | auto-update-channel = "tip"; 50 | 51 | # Saves screen in tpm file and opens it with the default app (in this case, Zen Browser) 52 | keybind = "ctrl+f=write_screen_file:open"; 53 | }; 54 | }; 55 | } 56 | -------------------------------------------------------------------------------- /home/modules/terminal/tmux.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.tmux = { 3 | enable = true; 4 | package = pkgs.tmux; 5 | extraConfig = builtins.readFile ./dots/.tmux.conf; 6 | }; 7 | 8 | home.packages = [ 9 | pkgs.gitmux 10 | ]; 11 | 12 | xdg.configFile = { 13 | ".gitmux.conf".text = builtins.readFile ./dots/.gitmux.conf; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /home/modules/terminal/tty-tools.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | system, 4 | ... 5 | }: { 6 | home.packages = let 7 | inherit (inputs.nix-scripts.packages.${system}) sys-brightness sys-sound; 8 | in [ 9 | sys-brightness 10 | sys-sound 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /home/modules/terminal/zsh.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.zsh = { 3 | enable = true; 4 | enableCompletion = true; 5 | completionInit = builtins.readFile ./dots/completionInit.zsh + builtins.readFile ../../../tools/nyx/completions.zsh; 6 | 7 | history = { 8 | expireDuplicatesFirst = true; 9 | ignoreSpace = true; 10 | save = 10000 * 2; 11 | }; 12 | 13 | # (relative to $HOME) 14 | dotDir = ".zsh"; 15 | 16 | # historySubstringSearch = { 17 | # enable = true; 18 | # searchUpKey = "^[[A"; 19 | # searchDownKey = "^[[B"; 20 | # }; 21 | 22 | plugins = with pkgs; [ 23 | { 24 | name = "nix-shell"; 25 | file = "nix-shell.plugin.zsh"; 26 | src = fetchFromGitHub { 27 | owner = "chisui"; 28 | repo = "zsh-nix-shell"; 29 | rev = "227d284ab2dc2f5153826974e0094a1990b1b5b9"; 30 | sha256 = "11mkq58ssafvkq8sq27v0dl19mi2myi392nhxgi1q2q9q0gazcaa"; 31 | }; 32 | } 33 | { 34 | name = "you-should-use"; 35 | file = "you-should-use.plugin.zsh"; 36 | src = fetchFromGitHub { 37 | owner = "MichaelAquilina"; 38 | repo = "zsh-you-should-use"; 39 | rev = "5b316f4af3ac90e044f386003aacdaa0ad606488"; 40 | sha256 = "192jb680f1sc5xpgzgccncsb98xa414aysprl52a0bsmd1slnyxs"; 41 | }; 42 | } 43 | { 44 | # Such a name, "Auto close and delete matching delimiters in zsh" 45 | name = "hlissner/zsh-autopair"; 46 | file = "autopair.zsh"; 47 | src = fetchFromGitHub { 48 | owner = "hlissner"; 49 | repo = "zsh-autopair"; 50 | rev = "376b586c9739b0a044192747b337f31339d548fd"; 51 | hash = "sha256-mtDrt4Q5kbddydq/pT554ph0hAd5DGk9jci9auHx0z0="; 52 | }; 53 | } 54 | { 55 | name = "extract"; 56 | file = "extract.sh"; 57 | src = fetchFromGitHub { 58 | owner = "xvoland"; 59 | repo = "Extract"; 60 | rev = "439e92c5b355b40c36d8a445636d0e761ec08217"; 61 | sha256 = "1yaphcdnpxcdrlwidw47waix8kmv2lb5a9ccmf8dynlwvhyvh1wi"; 62 | }; 63 | } 64 | { 65 | name = "zinsults"; 66 | file = "zinsults.plugin.zsh"; 67 | src = fetchFromGitHub { 68 | owner = "ahmubashshir"; 69 | repo = "zinsults"; 70 | rev = "1ea07a3d1535d7343344176b73fec7f5c760225c"; 71 | sha256 = "1zi7ni5sri8a8favkk4vxwn6n5sawvvi5lhn9c48hkv0rf5y84nr"; 72 | }; 73 | } 74 | { 75 | name = "zsh-better-npm-completion"; 76 | file = "zsh-better-npm-completion.plugin.zsh"; 77 | src = fetchFromGitHub { 78 | owner = "lukechilds"; 79 | repo = "zsh-better-npm-completion"; 80 | rev = "47e5987ca422de43784f9d76311d764f82af2717"; 81 | sha256 = "0n9pd29rr7y6k5v4rzhpd94nsixsscdmhgvwisvbfz843pfikr5f"; 82 | }; 83 | } 84 | # { 85 | # name = "fast-syntax-highlighting"; # The reason why the shell startup is slow 86 | # src = fetchFromGitHub { 87 | # owner = "zdharma-continuum"; 88 | # repo = "fast-syntax-highlighting"; 89 | # rev = "cf318e06a9b7c9f2219d78f41b46fa6e06011fd9"; 90 | # sha256 = "1bmrb724vphw7y2gwn63rfssz3i8lp75ndjvlk5ns1g35ijzsma5"; 91 | # }; 92 | # } 93 | ]; 94 | }; 95 | } 96 | -------------------------------------------------------------------------------- /home/modules/work.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; [ 3 | mattermost-desktop 4 | zoom-us 5 | slack 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /home/modules/xdg.nix: -------------------------------------------------------------------------------- 1 | {config, ...}: { 2 | xdg = { 3 | enable = true; 4 | userDirs = let 5 | home = config.home.homeDirectory; 6 | in { 7 | enable = true; 8 | createDirectories = true; 9 | desktop = null; 10 | download = "${home}/Downloads"; 11 | documents = "${home}/Documents"; 12 | pictures = "${home}/Pictures"; 13 | music = null; 14 | publicShare = null; 15 | templates = "${home}/Experiments"; 16 | videos = "${home}/Videos"; 17 | extraConfig = { 18 | XDG_PROJECTS_DIR = "${home}/Projects"; 19 | XDG_WORK_DIR = "${home}/Work"; 20 | }; 21 | }; 22 | 23 | mimeApps = let 24 | dolphin = ["org.kde.dolphin.desktop"]; 25 | vlc = ["vlc.desktop"]; 26 | zathura = ["zathura.desktop"]; 27 | vscode = ["code.desktop"]; 28 | zen = ["zen.desktop"]; 29 | 30 | associations = { 31 | "inode/directory" = dolphin; 32 | "x-scheme-handler/geo" = "wheelmap-geo-handler.desktop"; 33 | "x-scheme-handler/slack" = "slack.desktop"; 34 | 35 | "application/pdf" = zathura; 36 | 37 | "video/*" = vlc; # not working as expected... 38 | "video/x-matroska" = vlc; 39 | "video/quicktime" = vlc; 40 | 41 | "image/svg+xml" = zen; 42 | "image/png" = zen; 43 | "image/jpeg" = zen; 44 | 45 | "video/mp4" = vlc; 46 | "audio/mpeg" = vlc; 47 | "audio/*" = vlc; 48 | 49 | "text/x-python" = vscode; 50 | }; 51 | in { 52 | enable = true; 53 | associations.added = associations; 54 | defaultApplications = associations; 55 | }; 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /home/options/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./emoji-fzf.nix 4 | ./ntfy-sh.nix 5 | ./github.nix 6 | ./zig.nix 7 | ]; 8 | } 9 | -------------------------------------------------------------------------------- /home/options/emoji-fzf.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: let 7 | cfg = config.programs.emoji-fzf; 8 | in 9 | with lib; { 10 | options = { 11 | programs.emoji-fzf.enable = mkEnableOption "emoji-fzf"; 12 | }; 13 | 14 | config = mkIf cfg.enable { 15 | home.packages = [ 16 | pkgs.extra.emoji-fzf 17 | ]; 18 | 19 | programs.zsh.plugins = [ 20 | { 21 | name = "emoji-fzf"; 22 | file = "emoji-fzf.zsh"; 23 | src = pkgs.fetchFromGitHub { 24 | owner = "pschmitt"; 25 | repo = "emoji-fzf.zsh"; 26 | rev = "958e4f60a8c43823f35f0bd29b06a08cd0bdea0e"; 27 | hash = "sha256-fF9Sm1q7k9bWLeMt3Uhb5WbH3LU7RpnFCZMgaYSv77g="; 28 | }; 29 | } 30 | ]; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /home/options/github.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | with lib; let 8 | cfg = config.programs.github-tools; 9 | in { 10 | options = { 11 | programs.github-tools = { 12 | enable = mkEnableOption "github"; 13 | 14 | act = mkOption { 15 | type = types.bool; 16 | default = true; 17 | }; 18 | 19 | cli = mkOption { 20 | type = types.bool; 21 | default = true; 22 | }; 23 | 24 | tui = mkOption { 25 | type = types.bool; 26 | default = true; 27 | }; 28 | }; 29 | }; 30 | 31 | config = mkIf cfg.enable { 32 | home = { 33 | packages = 34 | [ 35 | pkgs.hub 36 | ] 37 | ++ ( 38 | if cfg.act 39 | then [pkgs.act] 40 | else [] 41 | ) 42 | ++ ( 43 | if cfg.tui 44 | then [pkgs.extra.ght] 45 | else [] 46 | ) 47 | ++ ( 48 | if cfg.cli 49 | then [pkgs.gh] 50 | else [] 51 | ); 52 | 53 | shellAliases = { 54 | git = "hub"; 55 | }; 56 | }; 57 | }; 58 | } 59 | -------------------------------------------------------------------------------- /home/options/ntfy-sh.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | with lib; let 8 | cfg = config.services.ntfy-sh-client; 9 | in { 10 | options = { 11 | services.ntfy-sh-client = { 12 | enable = lib.mkEnableOption "ntfy-sh-client"; 13 | 14 | options = lib.mkOption { 15 | type = types.attrsOf types.anything; 16 | description = '' 17 | Client options to pass to ntfy-sh-client. 18 | ''; 19 | }; 20 | }; 21 | }; 22 | 23 | config = mkIf cfg.enable { 24 | home.packages = with pkgs; [ 25 | ntfy-sh 26 | ]; 27 | 28 | systemd.user.services.ntfy-sh-client = let 29 | clientConfig = (pkgs.formats.yaml {}).generate "ntfy-sh-client.yaml" cfg.options; 30 | in { 31 | Unit = { 32 | Description = "ntfy-sh client"; 33 | }; 34 | 35 | Service = { 36 | Type = "simple"; 37 | ExecStart = "${pkgs.ntfy-sh}/bin/ntfy sub --config ${clientConfig} --from-config"; 38 | Restart = "on-failure"; 39 | # https://github.com/the-argus/nixsys/blob/521b733b31cf305a2b12cf2022e5079ad9f640d1/user/primary/ntfy.nix#L10 40 | RestartForceExitStatus = 11; 41 | RestartSec = 0; 42 | 43 | # disallow writing to /usr, /bin, /sbin, ... 44 | ProtectSystem = "yes"; 45 | # more paranoid security settings 46 | NoNewPrivileges = "yes"; 47 | ProtectKernelTunables = "yes"; 48 | ProtectControlGroups = "yes"; 49 | RestrictNamespaces = "yes"; 50 | }; 51 | 52 | Install = { 53 | WantedBy = ["default.target"]; 54 | }; 55 | }; 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /home/options/zig.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | with lib; let 8 | cfg = config.programs.zig; 9 | in { 10 | options = { 11 | programs.zig = { 12 | enable = mkEnableOption "zig"; 13 | package = mkPackageOption pkgs "zig" {}; 14 | enableZshIntegration = mkOption { 15 | default = false; 16 | type = types.bool; 17 | }; 18 | lsp = mkOption { 19 | default = true; 20 | type = types.bool; 21 | }; 22 | }; 23 | }; 24 | 25 | config = mkIf cfg.enable { 26 | home.packages = 27 | [ 28 | cfg.package 29 | ] 30 | ++ ( 31 | if cfg.lsp 32 | then [pkgs.zls] 33 | else [] 34 | ); 35 | 36 | programs.zsh.plugins = mkIf cfg.enableZshIntegration [ 37 | { 38 | name = "zig-zsh-completions-plugin"; 39 | file = "zig-shell-completions.plugin.zsh"; 40 | src = pkgs.fetchFromGitHub { 41 | owner = "ziglang"; 42 | repo = "shell-completions"; 43 | rev = "31d3ad12890371bf467ef7143f5c2f31cfa7b7c1"; 44 | sha256 = "1fzl1x56b4m11wajk1az4p24312z7wlj2cqa3b519v30yz9clgr0"; 45 | }; 46 | } 47 | ]; 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /home/profiles/luisnquin/.face: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/home/profiles/luisnquin/.face -------------------------------------------------------------------------------- /home/profiles/luisnquin/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [./home.nix]; 3 | } 4 | -------------------------------------------------------------------------------- /home/profiles/luisnquin/home.nix: -------------------------------------------------------------------------------- 1 | { 2 | user, 3 | nix, 4 | ... 5 | }: { 6 | imports = [ 7 | ../../services 8 | ../../modules 9 | ]; 10 | 11 | home = { 12 | inherit (nix) stateVersion; 13 | 14 | enableNixpkgsReleaseCheck = true; 15 | homeDirectory = "/home/${user.alias}"; 16 | username = "${user.alias}"; 17 | 18 | file.".face".source = ./.face; 19 | }; 20 | 21 | # disabledModules = ["misc/news.nix"]; 22 | 23 | news.display = "silent"; 24 | 25 | programs.home-manager.enable = true; 26 | } 27 | -------------------------------------------------------------------------------- /home/services/bluetooth-mpris.nix: -------------------------------------------------------------------------------- 1 | { 2 | nixosConfig, 3 | pkgs, 4 | lib, 5 | ... 6 | }: { 7 | systemd.user.services = lib.mkIf nixosConfig.hardware.bluetooth.enable { 8 | bluetooth-mpris-proxy = { 9 | Unit = { 10 | Description = "Bluetooth mpris proxy"; 11 | }; 12 | 13 | Service = { 14 | Type = "simple"; 15 | ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; 16 | Restart = "on-failure"; 17 | }; 18 | 19 | Install = { 20 | # After = ["network.target" "sound.target"]; 21 | WantedBy = ["default.target"]; 22 | }; 23 | }; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /home/services/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./bluetooth-mpris.nix 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /lib/base64.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | decode = encodedStr: let 3 | outFile = pkgs.runCommand "decode-base64" {} "echo '${encodedStr}' | base64 --decode > $out"; 4 | in 5 | builtins.readFile outFile; 6 | } 7 | -------------------------------------------------------------------------------- /lib/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | }: 5 | builtins.mapAttrs (_name: path: import path {inherit pkgs lib;}) { 6 | formats = ./formats.nix; 7 | base64 = ./base64.nix; 8 | fs = ./fs.nix; 9 | } 10 | // import ./metadata.nix {inherit lib;} 11 | // import ./machine.nix 12 | -------------------------------------------------------------------------------- /lib/formats.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | fromYAML = 3 | # Read a YAML file into a Nix datatype using IFD. 4 | # 5 | # Similar to: 6 | # 7 | # > builtins.fromJSON (builtins.readFile ./somefile) 8 | # 9 | # but takes an input file in YAML instead of JSON. 10 | # 11 | # readYAML :: Path -> a 12 | # 13 | # where `a` is the Nixified version of the input file. 14 | # 15 | # Source: https://github.com/cdepillabout/stacklock2nix/blob/65a34bec929e7b0e50fdf4606d933b13b47e2f17/nix/build-support/stacklock2nix/read-yaml.nix 16 | path: let 17 | jsonOutputDrv = pkgs.runCommand "from-yaml" { 18 | nativeBuildInputs = [pkgs.remarshal]; 19 | } "remarshal -if yaml -i \"${path}\" -of json -o \"$out\""; 20 | in 21 | builtins.fromJSON (builtins.readFile jsonOutputDrv); 22 | } 23 | -------------------------------------------------------------------------------- /lib/fs.nix: -------------------------------------------------------------------------------- 1 | {lib, ...}: { 2 | # Retrieves a list of file paths within the specified directory path. 3 | # 4 | # Arguments: 5 | # - folderPath: A path to the directory. 6 | # 7 | # Returns: 8 | # A list of regular file paths within the directory. 9 | getFilesInDirectory = with builtins; 10 | folderPath: let 11 | inputError = message: throw "input error: ${message}"; 12 | 13 | fileNames = 14 | if lib.isPath folderPath 15 | then 16 | if readFileType folderPath == "directory" 17 | then let 18 | rawEntries = readDir folderPath; 19 | entries = lib.attrsets.filterAttrs (_n: v: v == "regular") rawEntries; 20 | in 21 | attrNames entries 22 | else inputError "expected a path to folder" 23 | else inputError "value is not a path"; 24 | in 25 | map (p: folderPath + ("/" + p)) fileNames; 26 | } 27 | -------------------------------------------------------------------------------- /lib/machine.nix: -------------------------------------------------------------------------------- 1 | let 2 | mkNixos = { 3 | nixosModules, 4 | configArgs, 5 | hmConfig, 6 | nixpkgs, 7 | pkgs, 8 | }: let 9 | specialArgs = 10 | configArgs 11 | // { 12 | inherit hmConfig; 13 | }; 14 | in 15 | nixpkgs.lib.nixosSystem { 16 | inherit (pkgs) system; 17 | inherit specialArgs pkgs; 18 | 19 | modules = nixosModules; 20 | }; 21 | 22 | mkHome = { 23 | home-manager, 24 | nixosConfig, 25 | homeModules, 26 | configArgs, 27 | pkgs, 28 | }: let 29 | extraSpecialArgs = 30 | configArgs 31 | // { 32 | inherit nixosConfig; 33 | }; 34 | in 35 | home-manager.lib.homeManagerConfiguration { 36 | inherit pkgs extraSpecialArgs; 37 | 38 | modules = homeModules; 39 | }; 40 | in { 41 | mkSetup = { 42 | nixosModules, 43 | profilesPath, 44 | homeModules, 45 | specialArgs, 46 | hostsPath, 47 | flakes, 48 | host, 49 | user, 50 | nix, 51 | pkgs, 52 | }: let 53 | configArgs = specialArgs // {inherit host user nix;}; 54 | in rec 55 | { 56 | nixosConfigurations."${host.name}" = mkNixos { 57 | inherit configArgs pkgs; 58 | inherit (flakes) nixpkgs; 59 | 60 | nixosModules = 61 | nixosModules 62 | ++ [ 63 | (hostsPath + "/${host.name}") 64 | ]; 65 | 66 | hmConfig = homeConfigurations."${user.alias}".config; 67 | }; 68 | 69 | homeConfigurations."${user.alias}" = mkHome { 70 | inherit configArgs pkgs; 71 | inherit (flakes) home-manager; 72 | 73 | homeModules = 74 | homeModules 75 | ++ [ 76 | (profilesPath + "/${user.alias}") 77 | ]; 78 | 79 | nixosConfig = nixosConfigurations."${host.name}".config; 80 | }; 81 | }; 82 | } 83 | -------------------------------------------------------------------------------- /lib/metadata.nix: -------------------------------------------------------------------------------- 1 | {lib, ...}: { 2 | mkMetadata = flakeToml: usagePredicate: let 3 | metadataFileError = message: builtins.throw "flake.toml file error: ${message}"; 4 | metadata = builtins.fromTOML (builtins.readFile flakeToml); 5 | 6 | useFileError = message: builtins.throw "use.conf file error: ${message}"; 7 | use = let 8 | fragments = lib.strings.splitString "@" usagePredicate; 9 | in 10 | if builtins.length fragments == 2 11 | then { 12 | user = builtins.elemAt fragments 0; 13 | host = builtins.elemAt fragments 1; 14 | } 15 | else useFileError "format must be @ (e.g.: max@myhost)"; 16 | 17 | notEmptyString = x: x != null && x != ""; 18 | in { 19 | user = let 20 | id = use.user; 21 | in 22 | if builtins.hasAttr id metadata.users 23 | then metadata.users."${id}" // {alias = "${id}";} 24 | else metadataFileError "missing user '${id}' in users collection"; 25 | 26 | host = let 27 | id = use.host; 28 | in 29 | if builtins.hasAttr id metadata.hosts 30 | then metadata.hosts."${id}" // {name = "${id}";} 31 | else metadataFileError "missing host '${id}' in hosts collection"; 32 | 33 | nix = 34 | if notEmptyString metadata.nix.stateVersion && notEmptyString metadata.nix.channel 35 | then metadata.nix 36 | else metadataFileError "missing one or more attributes of 'nix'"; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /overlays/nixpkgs-beta.nix: -------------------------------------------------------------------------------- 1 | [ 2 | ( 3 | self: super: { 4 | ranger = 5 | super.ranger.overrideAttrs 6 | (r: { 7 | propagatedBuildInputs = r.propagatedBuildInputs ++ [self.ueberzugpp]; 8 | 9 | preConfigure = 10 | r.preConfigure 11 | + '' 12 | substituteInPlace ranger/ext/img_display.py \ 13 | --replace-fail '"ueberzug"' '"ueberzugpp"' 14 | 15 | substituteInPlace ranger/config/rc.conf \ 16 | --replace-fail 'set preview_images_method w3m' 'set preview_images_method ueberzugpp' 17 | ''; 18 | }); 19 | } 20 | ) 21 | ] 22 | -------------------------------------------------------------------------------- /overlays/nixpkgs.nix: -------------------------------------------------------------------------------- 1 | [ 2 | ( 3 | _self: super: { 4 | logkeys = super.logkeys.overrideAttrs (prev: { 5 | postPatch = 6 | prev.postPatch 7 | + '' 8 | mkdir -p $out/etc/logkeys/keymaps 9 | cp $src/keymaps/es_ES.map $out/etc/logkeys/keymaps 10 | 11 | substituteInPlace scripts/logkeys-start.sh \ 12 | --replace 'logkeys --start' 'logkeys --keymap $out/etc/logkeys/keymaps/es_ES.map --start' 13 | ''; 14 | }); 15 | } 16 | ) 17 | ( 18 | _self: super: { 19 | panicparse = super.panicparse.overrideAttrs (_old: { 20 | postInstall = '' 21 | mv $out/bin/panicparse $out/bin/pp 22 | ''; 23 | }); 24 | } 25 | ) 26 | ] 27 | -------------------------------------------------------------------------------- /secrets/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | system, 3 | agenix, 4 | }: { 5 | age.secrets = { 6 | # spotify-access-secret = { 7 | # file = ./spotify-access-secret.age; 8 | # }; 9 | }; 10 | 11 | environment.systemPackages = [agenix.packages.${system}.default]; 12 | } 13 | -------------------------------------------------------------------------------- /secrets/secrets.nix: -------------------------------------------------------------------------------- 1 | # let 2 | # luisnquin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPgB5sEmG7PDxQ8D240uM2uSJKUPXmY/zMxtfr2jf7Pl lpaandres2020@gmail.com"; 3 | # in 4 | { 5 | # "spotify-access-secret.age".publicKeys = [luisnquin]; 6 | } 7 | -------------------------------------------------------------------------------- /system/hosts/nyx/configuration.nix: -------------------------------------------------------------------------------- 1 | { 2 | host, 3 | pkgs, 4 | nix, 5 | ... 6 | }: { 7 | imports = [ 8 | ../../services 9 | ../../modules 10 | 11 | ./hardware-configuration.nix 12 | ]; 13 | 14 | hardware = { 15 | enableRedistributableFirmware = true; 16 | cpu.intel.updateMicrocode = true; 17 | }; 18 | 19 | time = { 20 | inherit (host) timeZone; 21 | # Without this option, the machine will have a UTC time 22 | hardwareClockInLocalTime = true; 23 | }; 24 | 25 | i18n.defaultLocale = host.i18nLocale; 26 | location.provider = "geoclue2"; 27 | 28 | system.activationScripts = { 29 | banner.text = '' 30 | echo ' . + . . . . . .' 31 | sleep 0.3 32 | echo ' . . . *' 33 | echo ' . * . . . . . . + .' 34 | sleep 0.2 35 | echo ' (You Are Here) . . + . . .' 36 | echo ' . | . . . . . .' 37 | echo ' | . . . +. + .' 38 | sleep 0.5 39 | echo ' ↓ . . . .' 40 | echo ' . . . . * . . . . + .' 41 | echo ' + ° <- (nyx) * . . +' 42 | echo '<==[{ . . + .+. .' 43 | sleep 0.3 44 | echo ' . . . + . . . . .' 45 | echo ' . . . . . . . . ! /' 46 | echo ' * . . . + . . - O - ←- (The sun)' 47 | echo ' . . . + . . * . . / |' 48 | echo ' . + . . . .. + .' 49 | echo ' . + . . . * . * . +.. . *' 50 | echo ' . . . . . . . . + . . +' 51 | echo 52 | 53 | random_bool=$(( RANDOM % 2 )) 54 | i=0 55 | while [ $i -le 15 ]; do 56 | if [[ $random_bool -eq 0 ]]; then 57 | echo "${pkgs.libx.base64.decode "RGVsdXNpb25zIHdvbid0IGNob2tlIHlvdX4gSW5kZXhPZj1lbnQlCg=="}" 58 | else 59 | echo '${pkgs.libx.base64.decode "VGFrZSBhbGwgdGhlIGJsYW1lIQo="}' 60 | fi 61 | 62 | sleep 0.05 63 | i=$(( i + 1 )) 64 | done 65 | sleep 0.8 66 | ''; 67 | }; 68 | 69 | system = { 70 | inherit (nix) stateVersion; 71 | autoUpgrade = { 72 | enable = true; 73 | allowReboot = false; 74 | channel = "https://nixos.org/channels/${nix.channel}"; 75 | }; 76 | }; 77 | } 78 | -------------------------------------------------------------------------------- /system/hosts/nyx/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./configuration.nix 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /system/hosts/nyx/disk-config.nix: -------------------------------------------------------------------------------- 1 | { 2 | # Won't be imported anywhere until I have a free disk on my laptop because I also have a Windows partition. 3 | # https://github.com/nix-community/disko/blob/master/docs/quickstart.md#quickstart-guide 4 | # 5 | # Code below is just copy and it will need to be updated. Check `lsblk`. 6 | disko.devices = { 7 | disk = { 8 | nvme0n1 = { 9 | device = "/dev/nvme0n1"; 10 | }; 11 | 12 | nvme0n6 = { 13 | device = "/dev/nvme0n6"; 14 | type = "disk"; 15 | content = { 16 | type = "gpt"; 17 | partitions = { 18 | ESP = { 19 | type = "EF00"; # EFI partition type. 20 | size = "500M"; 21 | content = { 22 | type = "filesystem"; 23 | format = "vfat"; 24 | mountpoint = "/boot"; 25 | }; 26 | }; 27 | root = { 28 | start = "901G"; # Start immediately after Windows partition. 29 | size = "100%"; # Takes the remaining half of the disk space. 30 | content = { 31 | type = "filesystem"; 32 | format = "ext4"; 33 | mountpoint = "/"; 34 | }; 35 | }; 36 | }; 37 | }; 38 | }; 39 | }; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /system/hosts/nyx/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 | imports = [ 11 | (modulesPath + "/installer/scan/not-detected.nix") 12 | ]; 13 | 14 | boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "vmd" "nvme"]; 15 | boot.initrd.kernelModules = []; 16 | boot.kernelModules = ["kvm-intel"]; 17 | boot.extraModulePackages = []; 18 | 19 | fileSystems."/" = { 20 | device = "/dev/disk/by-uuid/aff2e32d-1bf2-4294-a8cf-23949fc6ed2d"; 21 | fsType = "ext4"; 22 | }; 23 | 24 | fileSystems."/boot" = { 25 | device = "/dev/disk/by-uuid/66ED-4092"; 26 | fsType = "vfat"; 27 | options = ["fmask=0077" "dmask=0077"]; 28 | }; 29 | 30 | swapDevices = []; 31 | 32 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 33 | # (the default) this is the recommended approach. When using systemd-networkd it's 34 | # still possible to use this option, but it's recommended to use it in conjunction 35 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`. 36 | networking.useDHCP = lib.mkDefault true; 37 | # networking.interfaces.eno2.useDHCP = lib.mkDefault true; 38 | # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; 39 | 40 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 41 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 42 | } 43 | -------------------------------------------------------------------------------- /system/modules/android.nix: -------------------------------------------------------------------------------- 1 | {user, ...}: { 2 | programs = { 3 | adb.enable = true; 4 | nix-ld.enable = true; # I'm just a desperate shell 5 | }; 6 | 7 | users.users.${user.alias}.extraGroups = ["adbusers"]; 8 | } 9 | -------------------------------------------------------------------------------- /system/modules/audio.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | security.rtkit.enable = 0 == 0; 3 | programs.noisetorch.enable = true; 4 | 5 | services = { 6 | pulseaudio.enable = 0 != 0; 7 | 8 | pipewire = { 9 | enable = true; 10 | alsa.enable = true; 11 | alsa.support32Bit = true; 12 | pulse.enable = true; 13 | jack.enable = true; 14 | }; 15 | 16 | # ALSA provides a udev rule for restoring volume settings. 17 | # udev.packages = [pkgs.alsa-utils]; 18 | }; 19 | 20 | # pulseaudio doesn't give a good support for some programs 21 | 22 | environment.systemPackages = with pkgs; [ 23 | pulseaudio 24 | alsa-utils 25 | ]; 26 | 27 | boot.kernelModules = ["snd_pcm_oss"]; 28 | 29 | systemd.services.alsa-store = { 30 | description = "Store Sound Card State"; 31 | wantedBy = ["multi-user.target"]; 32 | unitConfig.RequiresMountsFor = "/var/lib/alsa"; 33 | unitConfig.ConditionVirtualization = "!systemd-nspawn"; 34 | serviceConfig = { 35 | Type = "oneshot"; 36 | RemainAfterExit = true; 37 | ExecStart = "${pkgs.coreutils}/bin/mkdir -p /var/lib/alsa"; 38 | ExecStop = "${pkgs.alsa-utils}/sbin/alsactl store --ignore"; 39 | }; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /system/modules/battery.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | system, 4 | pkgs, 5 | host, 6 | user, 7 | lib, 8 | ... 9 | }: let 10 | powerSupplyBatteryPath = "/sys/class/power_supply/BAT1"; 11 | in { 12 | environment.systemPackages = let 13 | inherit (inputs.nix-scripts.packages.${system}) batlimit; 14 | in [ 15 | (batlimit.override {inherit powerSupplyBatteryPath;}) 16 | ]; 17 | 18 | security.sudo.extraRules = [ 19 | { 20 | users = [user.alias]; 21 | commands = [ 22 | { 23 | command = "/run/current-system/sw/bin/batlimit"; 24 | options = ["NOPASSWD"]; 25 | } 26 | ]; 27 | } 28 | ]; 29 | 30 | programs.zsh.interactiveShellInit = '' 31 | batty() { 32 | cat ${powerSupplyBatteryPath}/capacity 33 | } 34 | ''; 35 | 36 | services = { 37 | watt = lib.mkIf host.isLaptop { 38 | enable = true; 39 | settings = { 40 | charger = { 41 | governor = "performance"; 42 | turbo = "auto"; 43 | epp = "performance"; 44 | epb = "balance_performance"; 45 | platform_profile = "performance"; 46 | min_freq_mhz = 800; 47 | max_freq_mhz = 3500; 48 | }; 49 | 50 | battery = { 51 | governor = "powersave"; 52 | turbo = "auto"; 53 | epp = "power"; 54 | epb = "balance_power"; 55 | platform_profile = "low-power"; 56 | min_freq_mhz = 800; 57 | max_freq_mhz = 2500; 58 | }; 59 | 60 | daemon = { 61 | poll_interval_sec = 4; 62 | adaptive_interval = true; 63 | min_poll_interval_sec = 1; 64 | max_poll_interval_sec = 30; 65 | throttle_on_battery = true; 66 | }; 67 | }; 68 | }; 69 | 70 | logind.lidSwitchExternalPower = "ignore"; # prevent lid switch from triggering a suspend 71 | }; 72 | 73 | systemd.services.battery-charge-threshold = { 74 | enable = host.isLaptop; 75 | description = "Set the battery charge threshold"; 76 | serviceConfig = let 77 | offset = 1; 78 | 79 | batteryThreshold = builtins.toString (host.batteryThreshold + offset); 80 | batteryChargeThresholdPath = "${powerSupplyBatteryPath}/charge_control_end_threshold"; 81 | in { 82 | Type = "oneshot"; 83 | ExecStart = ''${pkgs.bash}/bin/bash -c "echo ${batteryThreshold} > ${batteryChargeThresholdPath}"''; 84 | }; 85 | wantedBy = ["multi-user.target"]; 86 | }; 87 | } 88 | -------------------------------------------------------------------------------- /system/modules/bloatware.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.java.enable = true; 3 | } 4 | -------------------------------------------------------------------------------- /system/modules/bluetooth.nix: -------------------------------------------------------------------------------- 1 | { 2 | isTiling, 3 | config, 4 | pkgs, 5 | ... 6 | }: { 7 | hardware.bluetooth = { 8 | enable = true; 9 | powerOnBoot = true; 10 | }; 11 | 12 | environment.systemPackages = [ 13 | pkgs.bluetuith 14 | ]; 15 | 16 | services.blueman.enable = config.hardware.bluetooth.enable && isTiling; 17 | } 18 | -------------------------------------------------------------------------------- /system/modules/boot/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./loader.nix 4 | ./grub.nix 5 | ]; 6 | } 7 | -------------------------------------------------------------------------------- /system/modules/boot/dots/splash-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/system/modules/boot/dots/splash-image.png -------------------------------------------------------------------------------- /system/modules/boot/grub.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | system, 4 | host, 5 | ... 6 | }: { 7 | boot.loader.grub = { 8 | enable = true; 9 | device = "nodev"; 10 | 11 | forceInstall = false; 12 | useOSProber = true; 13 | 14 | # For a better future: https://github.com/NixOS/nixpkgs/issues/23926 15 | configurationLimit = 42; 16 | efiSupport = true; 17 | efiInstallAsRemovable = true; 18 | 19 | gfxmodeBios = host.resolution; 20 | gfxmodeEfi = host.resolution; 21 | 22 | splashImage = ./dots/splash-image.png; 23 | theme = let 24 | grub-pkgs = inputs.grub-themes.packages.${system}; 25 | in 26 | grub-pkgs.fallout; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /system/modules/boot/loader.nix: -------------------------------------------------------------------------------- 1 | {...}: { 2 | boot.loader = { 3 | efi = { 4 | canTouchEfiVariables = false; 5 | efiSysMountPoint = "/boot"; 6 | }; 7 | timeout = 15; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /system/modules/clipboard.nix: -------------------------------------------------------------------------------- 1 | { 2 | isWayland, 3 | pkgs, 4 | ... 5 | }: 6 | if isWayland 7 | then { 8 | environment.systemPackages = with pkgs; [ 9 | wl-clipboard 10 | cliphist 11 | ]; 12 | } 13 | else { 14 | environment = { 15 | systemPackages = [pkgs.xclip]; 16 | 17 | shellAliases = { 18 | xclip = "xclip -selection c"; 19 | }; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /system/modules/dbus.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | d-spy 4 | ]; 5 | 6 | services.dbus = { 7 | implementation = "dbus"; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /system/modules/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./terminal 4 | ./security 5 | ./desktop 6 | ./network 7 | ./boot 8 | ./fs 9 | ./vm 10 | 11 | # https://github.com/NixOS/nixpkgs/pull/249369 12 | # https://github.com/NixOS/nixpkgs/issues/249138 13 | ./essentials.nix 14 | ./bloatware.nix 15 | ./bluetooth.nix 16 | ./clipboard.nix 17 | ./graphics.nix 18 | ./battery.nix 19 | ./android.nix 20 | ./systemd.nix 21 | ./kernel.nix 22 | ./docker.nix 23 | ./gaming.nix 24 | ./thunar.nix 25 | ./fonts.nix 26 | ./audio.nix 27 | ./dbus.nix 28 | ./nix.nix 29 | ]; 30 | } 31 | -------------------------------------------------------------------------------- /system/modules/desktop/common.nix: -------------------------------------------------------------------------------- 1 | { 2 | isTiling, 3 | config, 4 | pkgs, 5 | host, 6 | lib, 7 | ... 8 | }: { 9 | programs.dconf.enable = true; 10 | 11 | services = { 12 | xserver = { 13 | enable = true; 14 | autorun = true; 15 | xkb.layout = host.keyboardLayout; 16 | 17 | displayManager.gdm = { 18 | enable = true; 19 | autoSuspend = false; 20 | wayland = true; 21 | }; 22 | 23 | desktopManager.xterm.enable = true; 24 | }; 25 | 26 | libinput = { 27 | enable = true; 28 | 29 | touchpad = { 30 | tapping = true; 31 | naturalScrolling = true; 32 | middleEmulation = true; 33 | }; 34 | }; 35 | }; 36 | 37 | programs.kdeconnect.enable = true; 38 | 39 | xdg.portal.extraPortals = lib.mkIf (isTiling && config.programs.kdeconnect.enable) [ 40 | pkgs.libsForQt5.xdg-desktop-portal-kde 41 | ]; 42 | } 43 | -------------------------------------------------------------------------------- /system/modules/desktop/default.nix: -------------------------------------------------------------------------------- 1 | {host, ...}: let 2 | desktopModule = 3 | { 4 | "hyprland" = ./hyprland.nix; 5 | "plasma" = ./plasma.nix; 6 | "i3" = ./i3.nix; 7 | } 8 | .${host.desktop}; 9 | in { 10 | imports = [ 11 | desktopModule 12 | ./common.nix 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /system/modules/desktop/hyprland.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.pathsToLink = ["/libexec"]; 3 | 4 | xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-wlr]; 5 | 6 | programs = { 7 | hyprland = { 8 | enable = true; 9 | package = pkgs.hyprland; 10 | portalPackage = pkgs.xdg-desktop-portal-hyprland; 11 | }; 12 | 13 | xwayland.enable = true; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /system/modules/desktop/i3.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.pathsToLink = ["/libexec"]; 3 | 4 | services.xserver = { 5 | displayManager.defaultSession = "none+i3"; 6 | 7 | windowManager.i3 = { 8 | enable = true; 9 | 10 | extraPackages = with pkgs; [ 11 | numlockx 12 | nitrogen 13 | i3blocks 14 | i3lock 15 | clipit 16 | ]; 17 | }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /system/modules/desktop/plasma.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | lightly-qt 4 | flat-remix-gtk 5 | tela-icon-theme 6 | ]; 7 | 8 | services.xserver = { 9 | displayManager = { 10 | defaultSession = "plasma"; 11 | startx.enable = true; 12 | }; 13 | 14 | desktopManager.plasma5 = { 15 | enable = true; 16 | runUsingSystemd = true; 17 | }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /system/modules/docker.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | networking.firewall.trustedInterfaces = ["docker0"]; 3 | 4 | virtualisation = { 5 | docker = { 6 | enable = true; 7 | autoPrune = { 8 | enable = true; 9 | dates = "daily"; 10 | }; 11 | }; 12 | }; 13 | 14 | hardware.nvidia-container-toolkit.enable = true; 15 | 16 | environment = { 17 | systemPackages = with pkgs; [ 18 | docker 19 | ]; 20 | 21 | shellAliases = { 22 | dka = "docker kill $(docker ps -qa) 2> /dev/null"; 23 | dra = "docker rm -f $(docker ps -qa) 2> /dev/null"; 24 | dkra = "dka; dra"; 25 | dria = "docker rmi -f $(docker image ls -qa)"; 26 | dils = "docker image ls"; 27 | dcp = "docker cp"; 28 | dps = "docker ps -a"; 29 | dl = "docker logs"; 30 | ld = "lazydocker"; 31 | }; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /system/modules/essentials.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment = { 3 | systemPackages = with pkgs; [ 4 | stdenv_32bit 5 | libsecret 6 | coreutils 7 | binutils 8 | gparted 9 | openssl 10 | cmake 11 | tree 12 | lsof 13 | wget 14 | eza # ls command replacement 15 | 16 | bison 17 | flex 18 | 19 | steam-run 20 | 21 | # ntfs 22 | ntfs3g 23 | exfat 24 | 25 | p7zip 26 | unzip 27 | unar 28 | zip 29 | ]; 30 | 31 | localBinInPath = true; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /system/modules/fonts.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | fonts = { 3 | packages = with pkgs; [ 4 | nerd-fonts.fira-code 5 | nerd-fonts.symbols-only 6 | pkgs.extra.coders-crux 7 | jetbrains-mono 8 | cascadia-code 9 | roboto-mono 10 | inconsolata 11 | fira-code 12 | roboto 13 | ]; 14 | 15 | fontDir.enable = true; 16 | }; 17 | 18 | environment.systemPackages = [pkgs.fontpreview]; 19 | } 20 | -------------------------------------------------------------------------------- /system/modules/fs/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./incron.nix 4 | ]; 5 | 6 | boot = { 7 | supportedFilesystems = ["ntfs"]; 8 | tmp.cleanOnBoot = true; 9 | }; 10 | 11 | services.udisks2.enable = true; 12 | } 13 | -------------------------------------------------------------------------------- /system/modules/fs/incron.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | user, 4 | ... 5 | }: { 6 | services.incron = { 7 | enable = false; 8 | 9 | # Packages available to the system incrontab. 10 | extraPackages = [pkgs.coreutils]; 11 | 12 | systab = let 13 | homeDirectory = "/home/${user.alias}"; 14 | in '' 15 | ${homeDirectory} IN_CREATE rm -f ${homeDirectory}/discord_{krisp,utils}.log $# 16 | ''; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /system/modules/gaming.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | pkgs, 4 | user, 5 | ... 6 | }: { 7 | programs = { 8 | steam = { 9 | enable = true; 10 | gamescopeSession.enable = true; 11 | }; 12 | 13 | gamemode.enable = true; 14 | }; 15 | 16 | environment = { 17 | systemPackages = [ 18 | pkgs.protonup # ensure to run it the first time 19 | inputs.prismlauncher.packages.${pkgs.system}.default # jailbreak offline accounts 20 | ]; 21 | 22 | sessionVariables = { 23 | STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/${user.alias}/.steam/root/compatibilitytools.d"; 24 | }; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /system/modules/graphics.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: let 6 | nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' 7 | export __NV_PRIME_RENDER_OFFLOAD=1 8 | export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 9 | export __GLX_VENDOR_LIBRARY_NAME=nvidia 10 | export __VK_LAYER_NV_optimus=NVIDIA_only 11 | exec "$@" 12 | ''; 13 | in { 14 | # https://nixos.wiki/wiki/Nvidia" 15 | environment.systemPackages = [nvidia-offload]; 16 | services.xserver.videoDrivers = ["nvidia"]; 17 | 18 | # boot.blacklistedKernelModules = ["nouveau"]; 19 | # boot.initrd.kernelModules = ["nvidia" "nvidia_modeset" "nvidia-uvm" "nvidia_drm" "kvm-intel"]; 20 | 21 | hardware = { 22 | # renamed from `hardware.opengl` 23 | graphics = { 24 | enable = true; 25 | enable32Bit = true; 26 | }; 27 | 28 | nvidia = { 29 | modesetting.enable = true; 30 | # open source (nouveau) 31 | open = false; 32 | nvidiaSettings = true; # `$ nvidia-settings` 33 | 34 | powerManagement = { 35 | enable = true; 36 | finegrained = true; 37 | }; 38 | 39 | prime = { 40 | allowExternalGpu = false; 41 | 42 | # Values below differ from laptop to laptop 43 | nvidiaBusId = "PCI:1:0:0"; 44 | intelBusId = "PCI:0:2:0"; 45 | 46 | # recommended by nvidia 47 | offload = { 48 | enable = true; 49 | enableOffloadCmd = true; 50 | }; 51 | }; 52 | 53 | package = let 54 | inherit (config.boot.kernelPackages) nvidiaPackages; 55 | in 56 | nvidiaPackages.beta; 57 | }; 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /system/modules/graphics.patch: -------------------------------------------------------------------------------- 1 | diff --git a/system/modules/graphics.nix b/system/modules/graphics.nix 2 | index ee7409a..9ccc3ba 100644 3 | --- a/system/modules/graphics.nix 4 | +++ b/system/modules/graphics.nix 5 | @@ -12,27 +12,19 @@ 6 | ''; 7 | in { 8 | # https://nixos.wiki/wiki/Nvidia" 9 | - environment = { 10 | - systemPackages = [ 11 | - nvidia-offload 12 | - pkgs.nvtop 13 | - ]; 14 | - 15 | - sessionVariables = { 16 | - NIXOS_OZONE_WL = "1"; 17 | - WLR_NO_HARDWARE_CURSORS = "1"; 18 | - LIBVA_DRIVER_NAME = "nvidia"; 19 | - GBM_BACKEND = "nvidia-drm"; 20 | - __GLX_VENDOR_LIBRARY_NAME = "nvidia"; 21 | - }; 22 | - }; 23 | - 24 | + environment.systemPackages = [nvidia-offload]; 25 | services.xserver.videoDrivers = ["nvidia"]; 26 | 27 | # boot.blacklistedKernelModules = ["nouveau"]; 28 | # boot.initrd.kernelModules = ["nvidia" "nvidia_modeset" "nvidia-uvm" "nvidia_drm" "kvm-intel"]; 29 | 30 | hardware = { 31 | + opengl = { 32 | + enable = true; 33 | + driSupport = true; 34 | + driSupport32Bit = true; 35 | + }; 36 | + 37 | nvidia = { 38 | modesetting.enable = true; 39 | # open source (nouveau) 40 | @@ -59,11 +51,5 @@ in { 41 | 42 | package = config.boot.kernelPackages.nvidiaPackages.beta; 43 | }; 44 | - 45 | - opengl = { 46 | - enable = true; 47 | - driSupport = true; 48 | - driSupport32Bit = true; 49 | - }; 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /system/modules/kernel.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | boot = { 3 | kernelParams = ["i8042.reset=1"]; 4 | kernelPackages = pkgs.linuxPackages_latest; 5 | extraModprobeConfig = '' 6 | options snd-intel-dspcfg dsp_driver=1 7 | ''; 8 | }; 9 | 10 | # can't build anymore 11 | # environment.systemPackages = [ 12 | # pkgs.extra.kmon 13 | # ]; 14 | } 15 | -------------------------------------------------------------------------------- /system/modules/network/acme.nix: -------------------------------------------------------------------------------- 1 | {user, ...}: { 2 | security.acme = { 3 | acceptTerms = true; 4 | defaults = { 5 | inherit (user) email; 6 | group = "nginx"; 7 | }; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /system/modules/network/cloudflare.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | environment.systemPackages = [ 7 | pkgs.cloudflared 8 | ]; 9 | 10 | services.resolved = { 11 | enable = true; 12 | fallbackDns = builtins.map (name: "${name}#cloudflare-dns.com") config.networking.nameservers; 13 | dnsovertls = "true"; # not opportunistic 14 | domains = ["~."]; 15 | }; 16 | 17 | networking.nameservers = ["1.1.1.1" "1.0.0.1"]; 18 | } 19 | -------------------------------------------------------------------------------- /system/modules/network/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | host, 4 | ... 5 | }: { 6 | imports = [ 7 | ./cloudflare.nix 8 | ./firewall.nix 9 | ./hosts.nix 10 | ./nginx.nix 11 | ./vpn.nix 12 | ]; 13 | 14 | networking = { 15 | networkmanager = { 16 | enable = true; 17 | unmanaged = ["wlp0s20f0u2"]; 18 | }; 19 | wlanInterfaces = { 20 | wlp0s20f0u2 = { 21 | device = "wlp0s20f0u2"; 22 | type = "monitor"; 23 | flags = "control"; 24 | }; 25 | }; 26 | 27 | hostName = host.name; 28 | 29 | wireguard.enable = true; 30 | }; 31 | 32 | environment = { 33 | systemPackages = with pkgs; [ 34 | wirelesstools 35 | wireshark 36 | inetutils 37 | iptables 38 | netcat 39 | nload 40 | ]; 41 | 42 | interactiveShellInit = builtins.readFile (builtins.path { 43 | name = "network-module-sh-script"; 44 | path = ./shell.sh; 45 | }); 46 | }; 47 | 48 | programs.wireshark.enable = true; 49 | } 50 | -------------------------------------------------------------------------------- /system/modules/network/firewall.nix: -------------------------------------------------------------------------------- 1 | { 2 | networking = { 3 | firewall = let 4 | ports = [5900 8081]; 5 | in { 6 | enable = true; 7 | allowedTCPPorts = ports; 8 | interfaces."wlo1".allowedTCPPorts = ports; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /system/modules/network/hosts.nix: -------------------------------------------------------------------------------- 1 | { 2 | networking.hosts = { 3 | "127.0.0.1" = [ 4 | # "www.instagram.com" 5 | # "web.facebook.com" 6 | # "facebook.com" 7 | "www.tiktok.com" # no fucking way I'm going to use this 8 | "www.pinterest.es" 9 | ]; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /system/modules/network/nginx.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: let 7 | enableAll = false; 8 | in { 9 | services.nginx = { 10 | enable = enableAll; 11 | package = pkgs.nginxStable; 12 | 13 | defaultSSLListenPort = 443; 14 | enableReload = false; 15 | 16 | group = "nginx"; 17 | user = "nginx"; 18 | 19 | httpConfig = let 20 | rustypaste = { 21 | domain = "rp.localhost"; 22 | }; 23 | 24 | static-web-server = { 25 | address = let 26 | port = lib.strings.removePrefix "[::]:" config.services.static-web-server.listen; 27 | in "0.0.0.0:${port}"; 28 | 29 | domain = "localhost"; 30 | }; 31 | 32 | localhost = let 33 | domainsDir = "${config.security.acme.certs."localhost.luisquinones.me".directory}"; 34 | in { 35 | crt = "${domainsDir}/cert.pem"; 36 | key = "${domainsDir}/key.pem"; 37 | }; 38 | 39 | luisquinones-me = let 40 | domainsDir = "${config.security.acme.certs."luisquinones.me".directory}"; 41 | in { 42 | crt = "${domainsDir}/cert.pem"; 43 | key = "${domainsDir}/key.pem"; 44 | }; 45 | in '' 46 | log_format main 47 | '$remote_addr - $remote_user [$time_local] "$request" ' 48 | '$status $body_bytes_sent "$http_referer" ' 49 | '"$http_user_agent" "$http_x_forwarded_for"'; 50 | 51 | client_max_body_size 10M; 52 | 53 | server { 54 | listen 80 default_server; 55 | server_name ${static-web-server.domain}; 56 | return 301 https://$host$request_uri; 57 | } 58 | 59 | server { 60 | listen 443 ssl; 61 | server_name ${static-web-server.domain}; 62 | 63 | ssl_certificate ${localhost.crt}; 64 | ssl_certificate_key ${localhost.key}; 65 | 66 | location / { 67 | proxy_pass http://${static-web-server.address}; 68 | proxy_set_header Host $host; 69 | proxy_set_header X-Real-IP $remote_addr; 70 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 71 | proxy_set_header X-Forwarded-Proto $scheme; 72 | } 73 | } 74 | 75 | server { 76 | listen 443 ssl; 77 | server_name ${rustypaste.domain}; 78 | 79 | ssl_certificate ${luisquinones-me.crt}; 80 | ssl_certificate_key ${luisquinones-me.key}; 81 | 82 | location / { 83 | proxy_pass http://${rustypaste.address}; 84 | proxy_set_header Host $host; 85 | proxy_set_header X-Real-IP $remote_addr; 86 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 87 | proxy_set_header X-Forwarded-Proto $scheme; 88 | } 89 | } 90 | ''; 91 | }; 92 | } 93 | -------------------------------------------------------------------------------- /system/modules/network/shell.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | netscan() { 4 | nmcli radio wifi on && nmcli --fields SSID,SECURITY,BARS device wifi list ifname "$(nmcli device | awk '$2 == "wifi" {print $1}')" --rescan yes 5 | } 6 | 7 | netport() { 8 | sudo ss -lptn "sport = :$1" 9 | } 10 | 11 | myip() { 12 | curl -s ifconfig.me && echo 13 | } 14 | -------------------------------------------------------------------------------- /system/modules/network/vpn.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.mullvad-vpn.enable = true; 3 | } 4 | -------------------------------------------------------------------------------- /system/modules/nix.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | pkgs, 4 | user, 5 | ... 6 | }: { 7 | nix = { 8 | gc = { 9 | automatic = true; 10 | dates = "daily"; 11 | options = "--delete-older-than 3d"; 12 | }; 13 | 14 | # Nix store 15 | optimise = { 16 | automatic = true; 17 | dates = ["13:00"]; # I normally lunch at this hour 18 | }; 19 | 20 | # https://nixos.org/manual/nix/stable/command-ref/conf-file.html 21 | settings = rec { 22 | # Nix automatically detects files in the store that have identical contents, and replaces them with hard links to a single copy. 23 | auto-optimise-store = true; 24 | keep-outputs = true; 25 | warn-dirty = false; 26 | download-attempts = 3; 27 | experimental-features = ["nix-command" "flakes"]; 28 | # Required by cachix 29 | trusted-users = ["root" "${user.alias}"]; 30 | allowed-users = trusted-users; 31 | # Defines the maximum number of jobs that Nix will try to build in parallel. 32 | max-jobs = 6; 33 | # When free disk space in /nix/store drops below min-free during a build, Nix performs a garbage-collection. 34 | min-free = 10000000000; # 10GB 35 | # Number of seconds between checking free disk space. 36 | min-free-check-interval = 30; 37 | # https://nix.dev/recipes/faq#what-to-do-if-a-binary-cache-is-down-or-unreachable 38 | trusted-public-keys = [ 39 | "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" 40 | ]; 41 | trusted-substituters = [ 42 | "https://cache.nixos.org" 43 | ]; 44 | substituters = [ 45 | "https://nix-gaming.cachix.org" 46 | "https://cache.nixos.org" 47 | ]; 48 | }; 49 | }; 50 | 51 | tools.nyx.enable = true; 52 | 53 | environment = { 54 | systemPackages = with pkgs; let 55 | inherit (inputs.nix-scripts.packages.${system}) nixgrep; 56 | in [ 57 | nix-output-monitor 58 | nix-prefetch-git 59 | cached-nix-shell 60 | deadnix 61 | nixgrep 62 | statix 63 | nurl 64 | nil # lsp 65 | nvd # package diff 66 | 67 | nixpkgs-review 68 | nixpkgs-lint 69 | 70 | # Formatters 71 | nixfmt-classic 72 | nixpkgs-fmt 73 | alejandra 74 | ]; 75 | 76 | shellAliases = { 77 | nix-shell = "cached-nix-shell"; 78 | ns = "nix-shell"; 79 | }; 80 | 81 | variables.NIXPKGS_ALLOW_UNFREE = "1"; 82 | }; 83 | } 84 | -------------------------------------------------------------------------------- /system/modules/security/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./protocols.nix 4 | ./keyring.nix 5 | ./groups.nix 6 | ./user.nix 7 | ./sudo.nix 8 | ./tools 9 | ]; 10 | 11 | security.polkit.enable = true; 12 | } 13 | -------------------------------------------------------------------------------- /system/modules/security/groups.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | user, 4 | lib, 5 | ... 6 | }: { 7 | users.groups = { 8 | vboxusers.members = [user.alias]; 9 | 10 | control = { 11 | name = "pain-control"; 12 | members = [user.alias]; 13 | }; 14 | 15 | nginx = lib.mkForce { 16 | gid = config.ids.gids.nginx; 17 | }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /system/modules/security/keyring.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | seahorse 4 | ]; 5 | 6 | services.gnome.gnome-keyring.enable = true; 7 | } 8 | -------------------------------------------------------------------------------- /system/modules/security/protocols.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | user, 4 | ... 5 | }: { 6 | programs.gnupg.agent = { 7 | enable = true; 8 | enableSSHSupport = true; 9 | }; 10 | 11 | environment = { 12 | systemPackages = with pkgs; [ 13 | fast-ssh 14 | ]; 15 | 16 | shellAliases = { 17 | fssh = "fast-ssh"; 18 | }; 19 | }; 20 | 21 | services.openssh = { 22 | enable = true; 23 | banner = pkgs.libx.base64.decode "SXQncyB0cnVlLCB5b3UgY2FuIG5ldmVyIGVhdCBhIHBldCB5b3UgbmFtZQ=="; 24 | ports = [ 25 | 357 26 | ]; 27 | openFirewall = false; 28 | 29 | hostKeys = [ 30 | { 31 | bits = 4096; 32 | path = "/etc/ssh/ssh_host_rsa_key"; 33 | type = "rsa"; 34 | } 35 | { 36 | path = "/etc/ssh/ssh_host_ed25519_key"; 37 | type = "ed25519"; 38 | } 39 | { 40 | path = "/home/${user.alias}/.ssh/id_ed25519"; 41 | type = "ed25519"; 42 | } 43 | { 44 | path = "/home/${user.alias}/.ssh/id_ed25520"; 45 | type = "ed25519"; 46 | } 47 | ]; 48 | 49 | # https://github.com/NixOS/nixpkgs/issues/234683 50 | settings = { 51 | PasswordAuthentication = true; 52 | }; 53 | }; 54 | } 55 | -------------------------------------------------------------------------------- /system/modules/security/sudo.nix: -------------------------------------------------------------------------------- 1 | { 2 | security.sudo = { 3 | enable = true; 4 | wheelNeedsPassword = true; 5 | 6 | configFile = '' 7 | Defaults insults 8 | ''; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /system/modules/security/tools/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./logkeys.nix 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /system/modules/security/tools/logkeys.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | environment.systemPackages = [pkgs.extra.logkeys]; 7 | 8 | security.sudo.extraRules = [ 9 | { 10 | groups = [config.users.groups."control".name]; 11 | commands = 12 | builtins.map (command: { 13 | inherit command; 14 | options = ["NOPASSWD" "SETENV"]; 15 | }) [ 16 | "/run/current-system/sw/bin/logkeys" 17 | "/run/current-system/sw/bin/llkk" 18 | "/run/current-system/sw/bin/llk" 19 | "${pkgs.extra.logkeys}/bin/logkeys" 20 | "${pkgs.extra.logkeys}/bin/llkk" 21 | "${pkgs.extra.logkeys}/bin/llk" 22 | ]; 23 | } 24 | ]; 25 | } 26 | -------------------------------------------------------------------------------- /system/modules/security/user.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | user, 4 | pkgs, 5 | lib, 6 | ... 7 | }: { 8 | users = { 9 | motd = pkgs.libx.base64.decode "Q29uZnJvbnQgW2hpXXN0b3J5"; 10 | defaultUserShell = pkgs.zsh; 11 | 12 | users = { 13 | ${user.alias} = { 14 | description = ''Dorian 🍂''; 15 | 16 | home = ''/home/${user.alias}/''; 17 | hashedPassword = null; 18 | isNormalUser = true; 19 | 20 | extraGroups = [ 21 | "networkmanager" 22 | "wireshark" 23 | "docker" 24 | "wheel" 25 | ]; 26 | 27 | shell = pkgs.zsh; 28 | }; 29 | 30 | nginx = lib.mkForce { 31 | group = "nginx"; 32 | isSystemUser = true; 33 | uid = config.ids.uids.nginx; 34 | }; 35 | }; 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /system/modules/systemd.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | user, 4 | ... 5 | }: { 6 | environment.systemPackages = [pkgs.systemctl-tui]; 7 | 8 | security.sudo.extraRules = [ 9 | { 10 | users = [user.alias]; 11 | commands = let 12 | commands = ["systemctl" "journalctl"]; 13 | in 14 | builtins.map (cmd: { 15 | command = "/run/current-system/sw/bin/${cmd}"; 16 | options = ["NOPASSWD"]; 17 | }) 18 | commands; 19 | } 20 | ]; 21 | } 22 | -------------------------------------------------------------------------------- /system/modules/terminal/aliases.nix: -------------------------------------------------------------------------------- 1 | { 2 | environment.shellAliases = { 3 | # Instant tp to some directories 4 | dot = "cd ~/.dotfiles/"; 5 | down = "cd ~/Downloads/"; 6 | pr = "cd ~/Projects/"; 7 | 8 | tmp = "cd /tmp/"; 9 | 10 | # Overwriten program calls 11 | rm = "rm --interactive"; 12 | du = "du --human-readable"; 13 | ls = "exa --icons"; 14 | sls = "exa --icons -Ta -I=.git"; 15 | ll = "exa -l"; 16 | la = "exa -a"; 17 | cat = "bat -p"; 18 | 19 | "........" = "cd ../../../../../../.."; 20 | "......." = "cd ../../../../../.."; 21 | "......" = "cd ../../../../.."; 22 | "....." = "cd ../../../.."; 23 | "...." = "cd ../../.."; 24 | "..." = "cd ../.."; 25 | ".." = "cd .."; 26 | "~" = "cd /home/$USER/"; 27 | 28 | utc-date = "date --rfc-3339=seconds | sed 's/ /T/'"; 29 | lsd = "echo 'lsd? lol'"; 30 | 31 | open = "xdg-open"; 32 | rc = "rclone"; 33 | tt = "ranger"; 34 | poff = "poweroff"; 35 | neofetch = "macchina"; 36 | whoseport = "netstat -tulpln 2> /dev/null | grep :"; 37 | nyancat = "nyancat --no-counter"; 38 | ale = "alejandra --quiet"; 39 | dud = "du --human-readable --summarize"; 40 | man = "tldr"; 41 | py = "python3"; 42 | share = "ngrok http"; 43 | top = "btop"; 44 | unrar = "unar"; 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /system/modules/terminal/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | host, 4 | ... 5 | }: { 6 | imports = [ 7 | ./starship.nix 8 | ./aliases.nix 9 | ./zsh.nix 10 | ]; 11 | 12 | console = { 13 | font = "Lat2-Terminus16"; 14 | keyMap = "es"; 15 | }; 16 | 17 | environment = { 18 | interactiveShellInit = builtins.readFile (builtins.path { 19 | name = "${host.name}-system-shrc-script"; 20 | path = ./dots/.shrc; 21 | }); 22 | 23 | variables.EDITOR = "nano"; 24 | 25 | shells = [pkgs.zsh]; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /system/modules/terminal/dots/.shrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | hex2ansi() { 4 | local hex=${1} 5 | 6 | if [[ $hex =~ ^#[0-9A-Fa-f]{6}$ ]]; then 7 | r=$(printf '%d' 0x"${hex:1:2}") 8 | g=$(printf '%d' 0x"${hex:3:2}") 9 | b=$(printf '%d' 0x"${hex:5:2}") 10 | 11 | echo -e "\033[38;2;$r;$g;${b}mplaceholder\033[0m" | wl-copy 12 | echo -e "\033[38;2;$r;$g;${b}mCopied to clipboard! \033[0m" 13 | else 14 | printf "\033[38;2;240;91;106mInvalid hex color code\033[0m\n" 15 | 16 | return 1 17 | fi 18 | } 19 | 20 | cheat() { 21 | curl "cheat.sh/$1" 22 | } 23 | 24 | unsafe_env() { 25 | cd "$(mktemp -d --suffix="-unsafe-env")" || exit 1 26 | } 27 | 28 | take() { 29 | mkdir -p "$1" 30 | cd "$1" || exit 1 31 | } 32 | -------------------------------------------------------------------------------- /system/modules/terminal/dots/.zshrc: -------------------------------------------------------------------------------- 1 | export GID UID 2 | 3 | # This keybindings allows for fast navigation from left to right and back. 4 | bindkey '^[[1;5D' backward-word 5 | bindkey '^[[1;5C' forward-word 6 | 7 | # Case-less when searching for files/directories 8 | zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*' 9 | 10 | # https://stackoverflow.com/a/11873793 11 | setopt interactivecomments 12 | 13 | # On deleting with + stops the behavior until finding 14 | # a non-alphanumeric character 15 | # Ref: https://unix.stackexchange.com/questions/313806/zsh-make-altbackspace-stop-at-non-alphanumeric-characters 16 | delete_until_not_alphanumerics() { 17 | local WORDCHARS='~!#$%^&*(){}[]<>?+;' 18 | zle backward-delete-word 19 | } 20 | 21 | zle -N delete_until_not_alphanumerics 22 | 23 | bindkey '\e^?' delete_until_not_alphanumerics 24 | 25 | if test -f /home/"$USER"/Work/.bashrc; then source /home/"$USER"/Work/.bashrc; fi 26 | -------------------------------------------------------------------------------- /system/modules/terminal/zsh.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | host, 4 | ... 5 | }: { 6 | environment.systemPackages = [ 7 | pkgs.zsh-completions 8 | ]; 9 | 10 | programs.zsh = { 11 | enable = true; 12 | 13 | autosuggestions = { 14 | enable = true; 15 | async = true; 16 | 17 | highlightStyle = "fg=#9eadab"; 18 | strategy = [ 19 | "history" 20 | ]; 21 | }; 22 | 23 | syntaxHighlighting = { 24 | enable = true; 25 | }; 26 | 27 | enableBashCompletion = true; 28 | enableCompletion = true; 29 | 30 | promptInit = '' 31 | if [ "$TMUX" = "" ] && [ "$TERM_PROGRAM" != "vscode" ] && [ ! "$USER" = "root" ]; then 32 | exec ${pkgs.tmux}/bin/tmux 33 | fi 34 | ''; 35 | 36 | interactiveShellInit = builtins.readFile (builtins.path { 37 | name = "${host.name}-system-zshrc-script"; 38 | path = ./dots/.zshrc; 39 | }); 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /system/modules/thunar.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.thunar = { 3 | enable = true; 4 | plugins = with pkgs.xfce; [ 5 | thunar-volman 6 | ]; 7 | }; 8 | 9 | services = { 10 | gvfs.enable = true; 11 | tumbler.enable = true; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /system/modules/vm/base.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | virtualisation = { 3 | libvirtd = { 4 | enable = true; 5 | onBoot = "start"; # Other value: ignore 6 | onShutdown = "suspend"; # Other value: shutdown 7 | 8 | qemu.runAsRoot = true; 9 | }; 10 | 11 | virtualbox.host.enable = true; 12 | }; 13 | 14 | environment.systemPackages = with pkgs; [ 15 | virt-manager 16 | # vagrant 17 | qemu 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /system/modules/vm/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./base.nix 4 | ./vnc.nix 5 | ]; 6 | } 7 | -------------------------------------------------------------------------------- /system/modules/vm/vnc.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = [pkgs.tigervnc]; 3 | } 4 | -------------------------------------------------------------------------------- /system/services/clean-trash-bin.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | user, 4 | ... 5 | }: { 6 | systemd = { 7 | services.clean-computer-trash-bin = { 8 | enable = true; 9 | description = "Cleans the bin folder"; 10 | serviceConfig = { 11 | Type = "simple"; 12 | ExecStart = ''${pkgs.bash}/bin/bash -c "rm -rf /home/${user.alias}/.local/share/Trash/files/{*,.*}"''; 13 | }; 14 | 15 | wantedBy = ["timers.target"]; 16 | }; 17 | 18 | timers.clean-computer-trash-bin = { 19 | description = "Timer for the service to clean the bin folder"; 20 | timerConfig = { 21 | OnBootSec = "1min"; 22 | OnUnitActiveSec = "1w"; 23 | Persistent = true; 24 | }; 25 | 26 | wantedBy = ["timers.target"]; 27 | }; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /system/services/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./successful-ping-to-google.nix 4 | ./clean-trash-bin.nix 5 | ./ensure-home-fs.nix 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /system/services/ensure-home-fs.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | user, 4 | ... 5 | }: { 6 | systemd.services.ensure-home-fs = { 7 | enable = true; 8 | serviceConfig = { 9 | Type = "oneshot"; 10 | ExecStart = '' 11 | ${pkgs.bash}/bin/bash \ 12 | -c 'mkdir -p /home/${user.alias}/Projects/playground/ \ 13 | /home/${user.alias}/Saves/ \ 14 | /home/${user.alias}/Work/ \ 15 | /home/${user.alias}/Work/ \ 16 | /home/${user.alias}/Temp/ \ 17 | /home/${user.alias}/.etc/' 18 | ''; 19 | }; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /system/services/successful-ping-to-google.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | systemd.services.successful-ping-to-google = { 3 | enable = true; 4 | description = "Service that works until Google is successfully pinged"; 5 | serviceConfig = { 6 | Type = "oneshot"; 7 | ExecStart = "${pkgs.bash}/bin/bash -c 'until ${pkgs.iputils}/bin/ping -c1 google.com; do sleep 1; done'"; 8 | }; 9 | 10 | after = ["network-online.target"]; 11 | wants = ["network-online.target"]; 12 | wantedBy = ["multi-user.target"]; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /tools/nix/hm-options/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = []; 3 | } 4 | -------------------------------------------------------------------------------- /tools/nix/nixos-options/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./nyx.nix 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /tools/nix/nixos-options/nyx.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | with lib; let 8 | cfg = config.tools.nyx; 9 | in { 10 | options = { 11 | tools.nyx = { 12 | enable = mkEnableOption "nyx"; 13 | 14 | notificationIcon = mkOption { 15 | type = types.nullOr types.bool; 16 | default = null; 17 | }; 18 | 19 | dotfilesDir = mkOption { 20 | type = types.nullOr types.str; 21 | default = "$HOME/.dotfiles"; 22 | }; 23 | }; 24 | }; 25 | 26 | config = mkIf cfg.enable { 27 | environment = { 28 | systemPackages = let 29 | nyx = pkgs.callPackage ../../nyx ( 30 | lib.filterAttrs (n: v: !(lib.elem n ["enable" "dotfilesDir"]) && v != null) cfg 31 | ); 32 | in [nyx]; 33 | 34 | variables = { 35 | "DOTFILES_PATH" = cfg.dotfilesDir; 36 | }; 37 | }; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /tools/nyx/assets/nix-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisnquin/nixos-config/e113d03b187be8f94570d2096b966083880a776b/tools/nyx/assets/nix-logo.png -------------------------------------------------------------------------------- /tools/nyx/completions.zsh: -------------------------------------------------------------------------------- 1 | _nyx() { 2 | if [[ "$words[2]" == "update" ]]; then 3 | compadd home system all 4 | else 5 | compadd update ls inspect style clean 6 | fi 7 | } 8 | 9 | compdef _nyx nyx 10 | -------------------------------------------------------------------------------- /tools/nyx/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs ? import {}, 3 | notificationIcon ? ./assets/nix-logo.png, 4 | }: 5 | assert builtins.isPath notificationIcon; let 6 | runtimePackages = with pkgs; [ 7 | libnotify 8 | alejandra 9 | eza 10 | ]; 11 | 12 | inherit (pkgs) lib; 13 | in 14 | pkgs.stdenv.mkDerivation rec { 15 | name = "nyx"; 16 | src = builtins.path { 17 | inherit name; 18 | path = ./.; 19 | }; 20 | 21 | nativeBuildInputs = [pkgs.makeWrapper]; 22 | 23 | propagatedBuildInputs = runtimePackages; 24 | 25 | postPatch = '' 26 | substituteInPlace ./main.bash \ 27 | --replace-fail '/path/to/nix-logo.png' '${notificationIcon}' 28 | ''; 29 | 30 | installPhase = '' 31 | runHook preInstall 32 | 33 | mkdir -p $out/bin 34 | 35 | cp ./main.bash $out/bin/nyx 36 | chmod +x $out/bin/nyx 37 | 38 | runHook postInstall 39 | ''; 40 | 41 | postInstall = '' 42 | wrapProgram ${placeholder "out"}/bin/nyx \ 43 | --prefix PATH : ${lib.makeBinPath runtimePackages} 44 | ''; 45 | } 46 | -------------------------------------------------------------------------------- /tools/nyx/main.bash: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | NIX_LOGO_PATH="/path/to/nix-logo.png" 4 | 5 | PROGRAM_NAME="nyx" 6 | 7 | if [ -z "$DOTFILES_PATH" ]; then 8 | echo "unable to read DOTFILES_PATH variable..." 9 | exit 1 10 | fi 11 | 12 | main() { 13 | set -e 14 | 15 | case "$1" in 16 | update) 17 | case "$2" in 18 | system | home | all | "") 19 | shift 1 20 | update_computer "$@" 21 | ;; 22 | -h | --h | -help | --help) ;; 23 | *) 24 | shift 1 25 | help_and_exit_1 "$@" 26 | ;; 27 | esac 28 | ;; 29 | clean) 30 | clean_computer 31 | shift 1 32 | ;; 33 | inspect) 34 | inspect_files 35 | shift 1 36 | ;; 37 | style) 38 | format_nix_files 39 | shift 1 40 | ;; 41 | -h | --h | -help | --help) 42 | program_help 43 | shift 1 44 | exit 0 45 | ;; 46 | -* | *) 47 | help_and_exit_1 "$1" 48 | ;; 49 | esac 50 | } 51 | 52 | update_computer() { 53 | body_message="" 54 | 55 | case "$1" in 56 | system) 57 | shift 1 58 | update_system "$@" 59 | body_message="Your system workspace have been updated." 60 | ;; 61 | home) 62 | update_home 63 | body_message="Your home workspace have been updated." 64 | ;; 65 | all | "") 66 | update_system "$@" 67 | update_home 68 | body_message="Your system and home workspace have been updated." 69 | ;; 70 | *) 71 | echo "Unknown argument for 'update' command" 72 | exit 1 73 | ;; 74 | esac 75 | 76 | if [ "$(command -v notify-send)" ]; then 77 | notify-send "NixOS update ($PROGRAM_NAME)" "$body_message" --icon="$NIX_LOGO_PATH" --app-name="$PROGRAM_NAME" 78 | fi 79 | 80 | printf "\n\033[1;34mSuccessfully updated! ❄️❄️❄️\033[0m\n" 81 | } 82 | 83 | clean_computer() { 84 | nb_of_removed_gens=$(($(nix-env --list-generations | wc -l) - 1)) 85 | version=$(nixos-version) 86 | 87 | before=$(df --output=size,used,pcent --human-readable / | tail -n +2) 88 | sudo nix-collect-garbage --delete-old 89 | nix-store --delete 90 | sudo rm -rf /tmp/* 91 | rm -rf ~/.npm/_npx 92 | docker system prune --volumes -f 93 | 94 | after=$(df --output=size,used,pcent --human-readable / | tail -n +2) 95 | 96 | printf "\nNix version: %s" "$version" 97 | printf "\nRoot directory:\n" 98 | 99 | if [ "$before" = "$after" ]; then 100 | printf "\033[0;34m%s <- before\033[0m\n\033[0;34m%s <- after\033[0m" "$before" "$after" 101 | else 102 | printf "\033[0;31m%s <- before\033[0m\n\033[0;32m%s <- after\033[0m" "$before" "$after" 103 | fi 104 | 105 | printf "\nGenerations:\n" 106 | nix-env --list-generations | sort -r | head 107 | 108 | if [ "$nb_of_removed_gens" != 0 ]; then 109 | printf "\n%s generations has been removed\n" "$nb_of_removed_gens" 110 | fi 111 | } 112 | 113 | inspect_files() { 114 | stat "$DOTFILES_PATH/.git/" >/dev/null 115 | 116 | nix_files=$(find "$DOTFILES_PATH" -type f -name "*.nix") 117 | 118 | ( 119 | cd "$DOTFILES_PATH" 120 | 121 | for file in $nix_files; do 122 | changes=$(git diff --compact-summary "$file") 123 | if [ "$changes" != "" ]; then 124 | printf "\n%s\n\n" "$changes" 125 | else 126 | printf "no changes | %s\n" "${file##*/}" 127 | fi 128 | done 129 | ) 130 | } 131 | 132 | update_system() { 133 | pre_update() { 134 | require_sudo 135 | 136 | printf "\n\033[0;92mStarting update process...\033[0m\n\n" 137 | printf "\033[38;2;240;89;104mUpdating system...\033[0m\n" 138 | } 139 | 140 | case "$1" in 141 | "" | --switch) # no argument 142 | pre_update 143 | 144 | ( 145 | cd "$DOTFILES_PATH" 146 | log_command_to_execute "sudo nixos-rebuild" "switch --upgrade --flake ." 147 | sudo nixos-rebuild switch --upgrade --flake . 148 | ) 149 | ;; 150 | --boot) 151 | pre_update 152 | 153 | ( 154 | cd "$DOTFILES_PATH" 155 | log_command_to_execute "sudo nixos-rebuild" "boot --upgrade --flake ." 156 | sudo nixos-rebuild boot --upgrade --flake . 157 | ) 158 | ;; 159 | *) 160 | echo "The -help usage wasn't developed yet but still, you can optionally add the '--boot' flag" 161 | exit 1 162 | ;; 163 | esac 164 | } 165 | 166 | update_home() { 167 | printf "\n\033[38;2;240;89;104mUpdating home...\033[0m\n" 168 | 169 | ( 170 | cd "$DOTFILES_PATH" 171 | log_command_to_execute "home-manager" "switch --flake ." 172 | home-manager switch --flake . 173 | ) 174 | } 175 | 176 | format_nix_files() { 177 | ( 178 | cd "$DOTFILES_PATH" 179 | alejandra --quiet ./*.nix 180 | ) 181 | } 182 | 183 | check_nix_files_format() { 184 | ( 185 | cd "$DOTFILES_PATH" 186 | alejandra --check --quiet ./*.nix 187 | ) 188 | } 189 | 190 | require_sudo() { 191 | if [ "$(id -u)" -ne 0 ]; then sudo echo -n ""; fi 192 | } 193 | 194 | log_command_to_execute() { 195 | printf "\n\e[38;2;112;112;112m(%s)\033[0;32m %s\033[0m %s\n" "$(basename "$DOTFILES_PATH")" "$1" "$2" 196 | } 197 | 198 | ensure_symlinks() { 199 | sudo rm -rf /etc/nixos/ 200 | sudo mkdir -p /etc/nixos/ 201 | sudo ln -sf ~/.dotfiles/* /etc/nixos/ 202 | } 203 | 204 | program_help() { 205 | WHITE_PINK="\e[38;2;232;232;232m" 206 | SKY_BLUE="\e[38;2;136;192;208m" 207 | MAGENTA="\e[38;2;154;32;201m" 208 | ORANGE="\e[38;2;242;161;56m" 209 | DIRTY="\e[38;2;133;133;133m" 210 | YELLOW="\e[38;2;219;245;76m" 211 | RED="\e[38;2;191;97;106m" 212 | 213 | UNDERLINE="\e[4m" 214 | SPECIAL_END="\e[0m" 215 | 216 | echo -e "$DIRTY$PROGRAM_NAME$SPECIAL_END [command] [flags]" 217 | echo 218 | echo -e "${UNDERLINE}Available commands:$SPECIAL_END" 219 | echo -e " ${SKY_BLUE}update $SPECIAL_END Updates your computer using your ${MAGENTA}system${SPECIAL_END} and/or ${ORANGE}home${SPECIAL_END} configuration" 220 | echo -e " ${YELLOW}inspect$SPECIAL_END Verifies if the configuration.nix file has been changed and not saved to a git repository" 221 | echo -e " ${WHITE_PINK}style$SPECIAL_END 💅 Applies alejandra style to all .nix files" 222 | echo -e " ${RED}clean$SPECIAL_END Cleans with the old generations" 223 | echo 224 | echo -e "${UNDERLINE}Global flags:${SPECIAL_END}" 225 | echo " -h, --help Print help information" 226 | } 227 | 228 | help_and_exit_1() { 229 | printf "unknown option: %s\nRun '%s --help' for usage\n" "$1" "$PROGRAM_NAME" >&2 230 | exit 1 231 | } 232 | 233 | main "$@" 234 | --------------------------------------------------------------------------------