dotfiles

My PC Dotfiles & Website
commit 53e94584c1271c2a3cd2c20eceb217620ddaf24d
parent 5cd75b955e57ec0e5537208c54b84eb420cddd24
Author: maydayv7 <maydayv7@gmail.com>
Date:   Sat, 10 Oct 2026 17:09:12 +0530

fix: `firefox` sandbox GPU

And update READMEs

Diffstat:

D.devcontainer/devcontainer.json | 10----------
MREADME.md | 34++++++++++++++--------------------
Mflake.lock | 18+++++++++---------
Mflake.nix | 1-
Dlib/README.md | 24------------------------
Dlib/_module.nix | 14--------------
Mmodules/README.md | 13+++++++------
Dmodules/apps/_mcp.nix | 26--------------------------
Amodules/apps/ai/_common.nix | 32++++++++++++++++++++++++++++++++
Amodules/apps/ai/antigravity.nix | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/apps/ai/claude.nix | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/apps/ai/codex.nix | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dmodules/apps/antigravity.nix | 54------------------------------------------------------
Dmodules/apps/claude.nix | 51---------------------------------------------------
Dmodules/apps/codex.nix | 57---------------------------------------------------------
Mmodules/apps/tools.nix | 7-------
Mmodules/apps/wine.nix | 2+-
Mmodules/hosts/valkyrie/_asus/default.nix | 2++
Mmodules/hosts/valkyrie/_dev.nix | 8+-------
Amodules/lib/README.md | 25+++++++++++++++++++++++++
Rlib/build.nix -> modules/lib/_build.nix | 0
Rlib/map.nix -> modules/lib/_map.nix | 0
Rlib/_mime.nix -> modules/lib/_mime.nix | 0
Rlib/types.nix -> modules/lib/_types.nix | 0
Amodules/lib/default.nix | 14++++++++++++++
Mmodules/system/base.nix | 2++
Mmodules/system/security/_browser.nix | 11++++++++++-
Mmodules/users/v7/default.nix | 17+++++++++++++----
Mpackages/README.md | 4++--
Mpackages/_module.nix | 2+-
Msecrets/README.md | 2+-
Msite/README.md | 1+
32 files changed, 297 insertions(+), 296 deletions(-)

diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json @@ -1,10 +0,0 @@ -{ - "image": "mcr.microsoft.com/devcontainers/base:alpine", - "features": { - "ghcr.io/devcontainers/features/nix:1": { - "multiUser": true, - "version": "latest", - "extraNixConfig": "experimental-features = nix-command flakes" - } - } -} diff --git a/README.md b/README.md @@ -130,13 +130,12 @@ $ nix flake show github:maydayv7/dotfiles ├───apps │ └───x86_64-linux -│ ├───sysutils: app │ ├───hyprutils: app │ ├───install: app -│ ├───nixos: app -│ └───default: app +│ └───os: app ├───checks │ └───x86_64-linux +│ ├───configurations:nixos:install: derivation │ ├───configurations:nixos:futura: derivation │ ├───configurations:nixos:valkyrie: derivation │ ├───configurations:nixos:vortex: derivation @@ -174,7 +173,7 @@ github:maydayv7/dotfiles ├───packages │ └───x86_64-linux │ ├───install: package 'os-install' -│ ├───nixos: package 'nixos' +│ ├───os: package 'os' │ └───website: package 'website-stable' ├───patchedPkgs: patched package source └───templates @@ -191,9 +190,6 @@ github:maydayv7/dotfiles ├── secrets │ └── passwords ├── shells -├── lib -│ ├── build.nix -│ └── map.nix ├── scripts │ ├── install.nix │ └── os.nix @@ -202,7 +198,9 @@ github:maydayv7/dotfiles │ └── patches └── modules ├── core + ├── lib ├── hosts + ├── users ├── apps ├── desktop ├── games @@ -210,7 +208,6 @@ github:maydayv7/dotfiles ├── hardware ├── shell ├── system - ├── users └── virt ``` @@ -220,12 +217,12 @@ github:maydayv7/dotfiles - [`files`](./files/README.md): `dotfiles` and program configuration - [`site`](./site/README.md): personal website generated using [`zola`](https://www.getzola.org/) - [`secrets`](./secrets/README.md): authentication credentials and user passwords managed using [`sops-nix`](https://github.com/Mic92/sops-nix) -- `shells`: sand-boxed shells for development purposes -- [`lib`](./lib/README.md): custom functions designed for conveniently defining configuration +- [`shells`](./shells): sand-boxed shells for development purposes - [`scripts`](./scripts/README.md): useful system management scripts - [`packages`](./packages/README.md): locally built custom packages -- `overlays`: overrides for pre-built packages +- [`overlays`](./packages/overlays): overrides for pre-built packages - [`modules`](./modules/README.md): custom configuration modules for additional functionality +- [`lib`](./modules/lib/README.md): custom functions designed for conveniently defining configuration ## Installation @@ -262,9 +259,9 @@ To use my configuration as-is for a fresh NixOS installation, you can try the fo gpg --output private.pgp --armor --export-secret-key <b><i>USER</i></b>@<b><i>EMAIL</i></b> </code></pre> - _Save the keys `public.gpg` and `private.gpg` in a secure location_ + _Save the keys `public.pgp` and `private.pgp` in a secure location_ -4. Import all required GPG Keys into a convenient location (like `/etc/gpg`) using <code>gpg --homedir <i>DIR</i> import</code> and specify it at `config.sops.gnupg.home` (Required for decryption of `secrets` on boot, can also be on an external drive) +4. Import all required GPG Keys into a convenient location (like `/etc/gpg`) using <code>gpg --homedir <i>DIR</i> --import <i>KEY_FILE</i></code> and specify it at `config.sops.gnupg.home` (Required for decryption of `secrets` on boot, can also be on an external drive) 5. Make new `secrets` and `passwords` in the desired directories by appending the paths to `secrets.yaml` and then using the following command (The [`os`](./scripts/README.md) script can be used to simplify the process): _Replace_ **_PATH_** _with the path to the `secret`_ @@ -276,15 +273,13 @@ To use my configuration as-is for a fresh NixOS installation, you can try the fo </details> -</details> - <details> <summary><b>From Scratch</b></summary> > [!IMPORTANT] > These instructions are mainly intended for personal use -To download the Install Media, click on the latest successsful run listed [here](../../actions/workflows/install.yml) and download the image artifact. +To download the Install Media, click on the latest successful run listed [here](https://github.com/maydayv7/dotfiles/actions/workflows/install.yml) and download the image artifact. Burn it to a USB using a flashing utility such as [Etcher](https://www.balena.io/etcher/). The image supports both UEFI and legacy BIOS USB boot with Secure Boot disabled. @@ -361,8 +356,7 @@ It is not recommended to use NixOS if you are a beginner just starting out, with _May change according to available hardware_ -This configuration works well with an Intel CPU + iGPU, and is currently being improved to support an AMD APU + Nvidia GPU. Any other setup is untested. -The `hardware.modules` option can be used to load relevant configuration from [`nixos-hardware`](https://github.com/nixos/nixos-hardware). +This configuration works well with an Intel CPU + iGPU, and is currently being improved to support an AMD APU + Nvidia GPU. Any other setup is untested. See [this](./modules/hardware/README.md) for additional information @@ -372,12 +366,12 @@ The system build cache is publicly hosted using [Cachix](https://www.cachix.org) ### Continuous Integration -This repository makes use of [`GitHub Actions`](./.github/workflows) in order to automatically check the configuration syntax & format on every commit, update the `inputs` and build the Install Media `.iso` every month, and upload the build cache to [Cachix](https://app.cachix.org/cache/maydayv7-dotfiles). +This repository makes use of [`GitHub Actions`](./.github/workflows) to evaluate configurations, update `inputs` and custom packages, build the Install Media `.iso` every month, and upload the build cache to [Cachix](https://app.cachix.org/cache/maydayv7-dotfiles). A `git` [hook](./files/git/hooks) is used to check the commit message to adhere to the [`Conventional Commits`](https://www.conventionalcommits.org) specification ##### Variables -- [`ACCESS_TOKEN`](./secrets/github-token.secret): Personal Access Token +- [`GITHUB_TOKEN`](./secrets/github-token.secret): Personal Access Token (To create one, see [this](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)) - [`CACHIX_TOKEN`](./secrets/cachix-token.secret): Cachix Authentication Token diff --git a/flake.lock b/flake.lock @@ -487,11 +487,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1791001326, - "narHash": "sha256-pwJhtpRcNX1pJ9luUy3Eh1EYUFsZjv5m2xSqZ1hEhMU=", + "lastModified": 1791612911, + "narHash": "sha256-gG794N9c3eyZgIolqXwNuIuSbTNzOlMZ2p5MkXvNdGs=", "owner": "numtide", "repo": "llm-agents.nix", - "rev": "83984ebbbe5322b261d9fdc24eb15cf44f23abec", + "rev": "32b0d7443782bdeacea2bed59ef66d522b8a2097", "type": "github" }, "original": { @@ -1007,11 +1007,11 @@ }, "systems": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1791244623, + "narHash": "sha256-uuanbkFk8a313Zfrxdcz8Us/yQtaxNnKJtX8v0ZPpd8=", "owner": "nix-systems", "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "rev": "d36eeed142f88b5a636f2e3856a53c61654cf29b", "type": "github" }, "original": { @@ -1124,11 +1124,11 @@ ] }, "locked": { - "lastModified": 1786901030, - "narHash": "sha256-WSFCsDSE5ffgD2MqzkM2CYjeFiKhRF/dJUN8uedb6YE=", + "lastModified": 1791490544, + "narHash": "sha256-qScE7Wz6Zg7eg8ItUpnkmKgst8weWschGe0E8jM4rj4=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "27b3b12a8e6375f28ebe122f07d230ca5459bbfa", + "rev": "4cfe8d7065cc8ca91c0a50361b6dd74920eeb1f5", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix @@ -223,7 +223,6 @@ imports = [ (inputs.import-tree ./modules) ./files/_module.nix - ./lib/_module.nix ./packages/_module.nix ./secrets/_module.nix ./site/_module.nix diff --git a/lib/README.md b/lib/README.md @@ -1,24 +0,0 @@ -### Custom Library Functions - -The `lib` directory contains custom-made utility functions (exposed as the `util` [`flake-parts`](https://flake.parts/) option), created in order to simplify the configuration and conveniently define and support multiple use-cases. The following is a summary of all the present functions: - -[`util`](./_module.nix) - - -- [`build`](./build.nix): Configuration building functions for efficient system management and declaration - - - `mime`: Builds and sets `mimetype` values for specified application - - `script`: Builds script from specified file by removing `shebangs` and exporting as a _string_ - - `theme`: Builds specified file by replacing placeholders with provided theming elements - -- [`map`](./map.nix): Mapping functions primarily aimed at shortening code complexity - - - `array`: Maps required parameter to all elements present in `list` - - `filter`: Filters out unneeded `attrs` and maps required ones to specified function - - `files`: Maps all files with a particular extension adhering to a particular condition stored in a directory as an `attrset` acted upon by specified function. Enable `recursive` in order to recursively search inside directories - - `folder`: Maps all files with a particular extension stored in a directory to a given path as an `attrset` acted upon by specified function. Use `replace` in order to modify placeholder text - - `modules`: Maps all configuration modules stored in a directory as an `attrset` acted upon by specified function - - `list`: Maps all configuration files stored in a directory into a list for easy import - - `name`: Same as `list`, but maps file names instead of paths - - `patches`: Maps all file patches stored in a directory, if available - - `secrets`: Maps binary `sops` encrypted secrets stored in a directory - -- [`types`](./types.nix): Custom module option types - - - `configuration`: A `submodule` describing a buildable configuration, used to declare `configurations.nixos` and `configurations.homeManager` diff --git a/lib/_module.nix b/lib/_module.nix @@ -1,14 +0,0 @@ -## Custom Library Functions ## -{lib, ...}: { - options.util = lib.mkOption { - type = lib.types.anything; - readOnly = true; - description = "Custom utility library functions"; - }; - - config.util = { - map = import ./map.nix lib; - build = import ./build.nix lib; - types = import ./types.nix lib; - }; -} diff --git a/modules/README.md b/modules/README.md @@ -5,6 +5,7 @@ The `modules` directory contains the custom configuration modules that form the - Directories are purely organizational - Files prefixed with `_` are not auto-imported - [`core`](./core): `flake-parts` plumbing that wires everything together +- [`lib`](./lib/README.md): custom utility functions exposed through `util`, with helper files excluded from auto-import - [`hosts`](./hosts): per-device configuration, declared as `configurations.nixos.<host>` and `configurations.homeManager.<user@host>`, composing the modules below - [`users`](./users/): user-specific Home Manager configurations @@ -30,8 +31,8 @@ An overview of every configuration module in this repository. | `syncthing` | Home Manager | Syncthing file sync | | `youtube` | Home Manager | YouTube Music & TUI | | `vscode` | Home Manager | Visual Studio Code editor | -| `antigravity` | Home Manager | Google Antigravity | | `zed` | Home Manager | Zed Editor | +| `antigravity` | Home Manager | Google Antigravity | | `codex` | Home Manager | OpenAI Codex | | `claude` | Home Manager | Anthropic Claude | | `flatpak` | Both | Flatpak app sandboxing | @@ -100,7 +101,7 @@ An overview of every configuration module in this repository. | `filesystem` ★ | Both | File system layout | | `nix` ★ | Both | Nix daemon & settings | | `user` ★ | Both | User accounts & Home Manager wiring | -| `security` | NixOS | Security & hardening | +| `security` | Both | Security & hardening | ### [`virt`](./virt) @@ -113,9 +114,9 @@ An overview of every configuration module in this repository. ### [`secrets`](../secrets) -| Module | Type | Description | -| ----------- | ----- | ------------------ | -| `secrets` ★ | NixOS | Secrets management | +| Module | Type | Description | +| ----------- | ---- | ------------------ | +| `secrets` ★ | Both | Secrets management | ## Options @@ -157,7 +158,7 @@ The following are the custom configuration options exposed by the modules above: - `model`: Discrete GPU Model - `null / "nvidia"` - [`system`](./system) - - - `kernel`: Linux Kernel Variant to be used - `"lts" / "variant"` + - `kernel`: Linux Kernel Variant to be used - `"lts"` or a suffix from `pkgs.linuxKernel.kernels` - `kernelModules`: Linux Kernel Modules to load - `scheme`: Supported Boot Firmware Scheme - `null / "mbr" / "efi" / "secure"` - `fs` - diff --git a/modules/apps/_mcp.nix b/modules/apps/_mcp.nix @@ -1,26 +0,0 @@ -## Model Context Protocol Servers ## -{ - lib, - pkgs, - ... -}: { - programs.mcp = { - enable = true; - servers = { - # NixOS MCP - nixos.command = lib.getExe pkgs.mcp-nixos; - - # Library documentation - context7.url = "https://mcp.context7.com/mcp"; - - # GitHub MCP - github = { - url = "https://api.githubcopilot.com/mcp/"; - bearer_token_env_var = "MCP_GITHUB_PERSONAL_ACCESS_TOKEN"; - }; - - # Figma MCP - figma.url = "https://mcp.figma.com/mcp"; - }; - }; -} diff --git a/modules/apps/ai/_common.nix b/modules/apps/ai/_common.nix @@ -0,0 +1,32 @@ +{ + lib, + pkgs, + ... +}: { + ## Model Context Protocol Servers + programs.mcp = { + enable = true; + servers = { + # NixOS MCP + nixos.command = lib.getExe pkgs.mcp-nixos; + + # Library documentation + context7.url = "https://mcp.context7.com/mcp"; + + # GitHub MCP + github = { + url = "https://api.githubcopilot.com/mcp/"; + bearer_token_env_var = "MCP_GITHUB_PERSONAL_ACCESS_TOKEN"; + }; + + # Figma MCP + figma.url = "https://mcp.figma.com/mcp"; + }; + }; + + ## Utilities + home.packages = with pkgs; [ + poppler-utils # PDF to Text + repomix # Repo to XML + ]; +} diff --git a/modules/apps/ai/antigravity.nix b/modules/apps/ai/antigravity.nix @@ -0,0 +1,54 @@ +## Google Antigravity ## +{config, ...}: let + inherit (config.flake) files; +in { + flake.modules.homeManager.antigravity = { + config, + lib, + pkgs, + osConfig ? {}, + ... + }: let + font = config.stylix.fonts.monospace.name; + isGnome = osConfig.services.desktopManager.gnome.enable or false; + isWM = (osConfig.programs.hyprland.enable or false) || (osConfig.programs.niri.enable or false); + in { + imports = [ + ./_common.nix + (import ../vscode/_mutable.nix { + program = "antigravity"; + configDir = "Antigravity"; + }) + ]; + + # IDE + programs.antigravity = { + enable = true; + package = pkgs.antigravity; + profiles.default = import ../vscode/_profile.nix { + inherit lib pkgs files font isGnome isWM; + }; + }; + + # CLI + programs.antigravity-cli = { + enable = true; + package = pkgs.llm.antigravity-cli; + enableMcpIntegration = true; + settings.altScreenMode = "always"; + permissions = { + deny = ["command(rm -rf)"]; + ask = ["command(*)"]; + }; + }; + + home = { + file.".gemini/antigravity-cli/settings.json".force = true; + persist.directories = [ + ".config/Antigravity" + ".antigravity" + ".gemini" + ]; + }; + }; +} diff --git a/modules/apps/ai/claude.nix b/modules/apps/ai/claude.nix @@ -0,0 +1,51 @@ +## Anthropic Claude ## +_: { + flake.modules.homeManager.claude = { + config, + lib, + pkgs, + ... + }: { + imports = [./_common.nix]; + + programs.vscode.profiles.default.extensions = + lib.mkIf config.programs.vscode.enable + [pkgs.vscode-marketplace.anthropic.claude-code]; + + home = { + packages = [pkgs.llm.claude-desktop]; + persist = { + files = [".claude.json"]; + directories = [ + ".claude" + ".config/Claude" + ".cache/Claude" + ]; + }; + }; + + programs.claude-code = { + enable = true; + package = pkgs.llm.claude-code; + enableMcpIntegration = true; + + settings = { + attribution = { + commit = ""; + pr = ""; + }; + permissions = { + allow = [ + "Bash(git diff:*)" + "Bash(git status:*)" + "Bash(git log:*)" + ]; + deny = [ + "Bash(rm -rf /*)" + "Read(~/.ssh/**)" + ]; + }; + }; + }; + }; +} diff --git a/modules/apps/ai/codex.nix b/modules/apps/ai/codex.nix @@ -0,0 +1,57 @@ +## OpenAI Codex ## +_: { + flake.modules.homeManager.codex = { + config, + lib, + pkgs, + ... + }: { + imports = [./_common.nix]; + + programs.vscode.profiles.default.extensions = + lib.mkIf config.programs.vscode.enable + (with pkgs.vscode-marketplace.openai; [chatgpt codex-audio]); + + home = { + packages = [pkgs.llm.chatgpt]; + persist.directories = [ + ".codex" + ".config/Codex" + ".cache/Codex" + ]; + + file.".codex/config.toml" = { + force = true; + mutable = true; + }; + }; + + programs.codex = { + enable = true; + package = pkgs.llm.codex; + enableMcpIntegration = true; + + settings = { + approval_policy = "on-request"; + personality = "pragmatic"; + sandbox_mode = "workspace-write"; + sandbox_workspace_write.network_access = true; + web_search = "live"; + + tui = { + notifications = true; + notification_condition = "unfocused"; + status_line = [ + "model-with-reasoning" + "current-dir" + "git-branch" + "approval-mode" + "context-remaining" + "weekly-limit" + "task-progress" + ]; + }; + }; + }; + }; +} diff --git a/modules/apps/antigravity.nix b/modules/apps/antigravity.nix @@ -1,54 +0,0 @@ -## Google Antigravity ## -{config, ...}: let - inherit (config.flake) files; -in { - flake.modules.homeManager.antigravity = { - config, - lib, - pkgs, - osConfig ? {}, - ... - }: let - font = config.stylix.fonts.monospace.name; - isGnome = osConfig.services.desktopManager.gnome.enable or false; - isWM = (osConfig.programs.hyprland.enable or false) || (osConfig.programs.niri.enable or false); - in { - imports = [ - ./_mcp.nix - (import ./vscode/_mutable.nix { - program = "antigravity"; - configDir = "Antigravity"; - }) - ]; - - # IDE - programs.antigravity = { - enable = true; - package = pkgs.antigravity; - profiles.default = import ./vscode/_profile.nix { - inherit lib pkgs files font isGnome isWM; - }; - }; - - # CLI - programs.antigravity-cli = { - enable = true; - package = pkgs.llm.antigravity-cli; - enableMcpIntegration = true; - settings.altScreenMode = "always"; - permissions = { - deny = ["command(rm -rf)"]; - ask = ["command(*)"]; - }; - }; - - home = { - file.".gemini/antigravity-cli/settings.json".force = true; - persist.directories = [ - ".config/Antigravity" - ".antigravity" - ".gemini" - ]; - }; - }; -} diff --git a/modules/apps/claude.nix b/modules/apps/claude.nix @@ -1,51 +0,0 @@ -## Anthropic Claude ## -_: { - flake.modules.homeManager.claude = { - config, - lib, - pkgs, - ... - }: { - imports = [./_mcp.nix]; - - programs.vscode.profiles.default.extensions = - lib.mkIf config.programs.vscode.enable - [pkgs.vscode-marketplace.anthropic.claude-code]; - - home = { - packages = [pkgs.llm.claude-desktop]; - persist = { - files = [".claude.json"]; - directories = [ - ".claude" - ".config/Claude" - ".cache/Claude" - ]; - }; - }; - - programs.claude-code = { - enable = true; - package = pkgs.llm.claude-code; - enableMcpIntegration = true; - - settings = { - attribution = { - commit = ""; - pr = ""; - }; - permissions = { - allow = [ - "Bash(git diff:*)" - "Bash(git status:*)" - "Bash(git log:*)" - ]; - deny = [ - "Bash(rm -rf /*)" - "Read(~/.ssh/**)" - ]; - }; - }; - }; - }; -} diff --git a/modules/apps/codex.nix b/modules/apps/codex.nix @@ -1,57 +0,0 @@ -## OpenAI Codex ## -_: { - flake.modules.homeManager.codex = { - config, - lib, - pkgs, - ... - }: { - imports = [./_mcp.nix]; - - programs.vscode.profiles.default.extensions = - lib.mkIf config.programs.vscode.enable - (with pkgs.vscode-marketplace.openai; [chatgpt codex-audio]); - - home = { - packages = [pkgs.llm.chatgpt]; - persist.directories = [ - ".codex" - ".config/Codex" - ".cache/Codex" - ]; - - file.".codex/config.toml" = { - force = true; - mutable = true; - }; - }; - - programs.codex = { - enable = true; - package = pkgs.llm.codex; - enableMcpIntegration = true; - - settings = { - approval_policy = "on-request"; - personality = "pragmatic"; - sandbox_mode = "workspace-write"; - sandbox_workspace_write.network_access = true; - web_search = "live"; - - tui = { - notifications = true; - notification_condition = "unfocused"; - status_line = [ - "model-with-reasoning" - "current-dir" - "git-branch" - "approval-mode" - "context-remaining" - "weekly-limit" - "task-progress" - ]; - }; - }; - }; - }; -} diff --git a/modules/apps/tools.nix b/modules/apps/tools.nix @@ -18,17 +18,12 @@ in { homeManager.tools = {pkgs, ...}: { home.packages = with pkgs; [ # Utilities - clapgrep freefilesync gearlever popsicle # Media pitivi - poppler-utils - xnviewmp - - # Graphics drawing identity vipsdisp @@ -51,12 +46,10 @@ in { files = [".config/rncbc.org/qpwgraph"]; directories = [ ".appimages" - ".config/de.leopoldluley.Clapgrep" ".config/easyeffects" ".config/FreeFileSync" ".config/obs-studio" ".config/pitivi" - ".config/xnviewmp" ".local/share/easyeffects" ]; }; diff --git a/modules/apps/wine.nix b/modules/apps/wine.nix @@ -21,7 +21,7 @@ _: { hardware.graphics.enable32Bit = true; environment.systemPackages = with pkgs.wine // pkgs; ( - builtins.map + map ( name: if (name.override.__functionArgs ? wine) diff --git a/modules/hosts/valkyrie/_asus/default.nix b/modules/hosts/valkyrie/_asus/default.nix @@ -40,6 +40,8 @@ _: { }; home = {lib, ...}: { + home.persist.directories = [".config/rog"]; + # Keybinds wayland.windowManager.hyprland.settings.bind = let inline = lib.generators.mkLuaInline; diff --git a/modules/hosts/valkyrie/_dev.nix b/modules/hosts/valkyrie/_dev.nix @@ -26,10 +26,7 @@ _: { # Tools systemPackages = with pkgs; [ - cloudflared - dig gcc - repomix mongodb-compass # Node @@ -45,14 +42,11 @@ _: { }; }; - home = {config, ...}: { - programs.ssh.includes = [config.sops.secrets."ssh-config.secret".path]; - + home = _: { home = { persist.directories = [ ".mongodb" ".npm" - ".config/rog" ".config/MongoDB Compass" ".local/share/cloudflare-warp-gui" ]; diff --git a/modules/lib/README.md b/modules/lib/README.md @@ -0,0 +1,25 @@ +### Custom Library Functions + +This directory contains custom-made utility functions (exposed as the `util` [`flake-parts`](https://flake.parts/) option), created in order to simplify the configuration and conveniently define and support multiple use-cases. +The following is a summary of all the present functions: + +[`util`](./default.nix) - + +- [`build`](./_build.nix): Configuration building functions for efficient system management and declaration - + - `mime`: Builds and sets `mimetype` values for specified application + - `script`: Builds script from specified file by removing `shebangs` and exporting as a _string_ + - `theme`: Builds specified file by replacing placeholders with provided theming elements + +- [`map`](./_map.nix): Mapping functions primarily aimed at shortening code complexity - + - `array`: Maps required parameter to all elements present in `list` + - `filter`: Filters out unneeded `attrs` and maps required ones to specified function + - `files`: Maps all files with a particular extension adhering to a particular condition stored in a directory as an `attrset` acted upon by specified function. Enable `recursive` in order to recursively search inside directories + - `folder`: Maps all files with a particular extension stored in a directory to a given path as an `attrset` acted upon by specified function. Use `replace` in order to modify placeholder text + - `modules`: Maps all configuration modules stored in a directory as an `attrset` acted upon by specified function + - `list`: Maps all configuration files stored in a directory into a list for easy import + - `name`: Same as `list`, but maps file names instead of paths + - `patches`: Maps all file patches stored in a directory, if available + - `secrets`: Maps binary `sops` encrypted secrets stored in a directory + +- [`types`](./_types.nix): Custom module option types - + - `configuration`: A `submodule` describing a buildable configuration, used to declare `configurations.nixos` and `configurations.homeManager` diff --git a/lib/build.nix b/modules/lib/_build.nix diff --git a/lib/map.nix b/modules/lib/_map.nix diff --git a/lib/_mime.nix b/modules/lib/_mime.nix diff --git a/lib/types.nix b/modules/lib/_types.nix diff --git a/modules/lib/default.nix b/modules/lib/default.nix @@ -0,0 +1,14 @@ +## Custom Library Functions ## +{lib, ...}: { + options.util = lib.mkOption { + type = lib.types.anything; + readOnly = true; + description = "Custom utility library functions"; + }; + + config.util = { + map = import ./_map.nix lib; + build = import ./_build.nix lib; + types = import ./_types.nix lib; + }; +} diff --git a/modules/system/base.nix b/modules/system/base.nix @@ -102,10 +102,12 @@ _: { pulse.enable = true; }; + # Wireless networking = { networkmanager.enable = true; firewall.enable = true; }; + systemd.network.wait-online.enable = false; hardware.bluetooth = { enable = true; diff --git a/modules/system/security/_browser.nix b/modules/system/security/_browser.nix @@ -69,6 +69,9 @@ bind.ro = [ "/sys/bus/pci" + "/sys/class/drm" + "/run/udev/data" + "/etc/egl/egl_external_platform.d" ["${firefox}/lib/firefox" "/app/etc/firefox"] (sloth.concat' sloth.homeDir "/.mozilla/native-messaging-hosts") @@ -86,7 +89,13 @@ "/etc/zoneinfo" ]; - bind.dev = ["/dev/shm"]; + bind.dev = [ + "/dev/shm" + "/dev/nvidia0" + "/dev/nvidiactl" + "/dev/nvidia-modeset" + "/dev/nvidia-uvm" + ]; tmpfs = ["/tmp"]; newSession = true; }; diff --git a/modules/users/v7/default.nix b/modules/users/v7/default.nix @@ -19,7 +19,6 @@ in { }; home = { - packages = [pkgs.home-manager]; persist.directories = [ "TBD" "Projects" @@ -34,6 +33,12 @@ in { file://${homeDir}/Projects Projects ''; }; + + packages = with pkgs; [ + home-manager + cloudflared + dig + ]; }; sops.templates = let @@ -59,8 +64,12 @@ in { ''; }; - programs.zsh.initContent = lib.mkIf github-mcp (lib.mkAfter '' - source ${config.sops.templates."github-mcp.sh".path} - ''); + programs = { + zsh.initContent = lib.mkIf github-mcp (lib.mkAfter '' + source ${config.sops.templates."github-mcp.sh".path} + ''); + + ssh.includes = [config.sops.secrets."ssh-config.secret".path]; + }; }; } diff --git a/packages/README.md b/packages/README.md @@ -1,6 +1,6 @@ ### Packages -The `packages` directory contains custom-built packages (can be accessed by `github:maydayv7/dotfiles#packages.${system}`). Packages which have a separate `metadata.nix` can be automatically updated using `sh update.sh` +The `packages` directory contains custom-built packages (can be accessed by `github:maydayv7/dotfiles#packages.${system}`). Packages which have a separate `metadata.nix` can be automatically updated by running `./update.sh` from the `packages` directory. The `overlays` directory contains overrides for pre-built packages (See [this](https://wiki.nixos.org/wiki/Overlays) for more information) @@ -17,4 +17,4 @@ Otherwise run <code>nix hash convert --hash-algo sha256 $(nix-prefetch-url <b>ur ### Patches -The `nixpkgs` package channel can be patched by simply dropping a valid `.patch` file into the `patches` directory +The `nixpkgs` package channel can be patched by simply dropping a valid `.patch` or `.diff` file into the `patches` directory diff --git a/packages/_module.nix b/packages/_module.nix @@ -5,7 +5,7 @@ lib, ... }: let - map = import ../lib/map.nix lib; + map = import ../modules/lib/_map.nix lib; inherit (builtins) any attrValues isPath; in { perSystem = { diff --git a/secrets/README.md b/secrets/README.md @@ -3,7 +3,7 @@ The authentication credentials are managed using [`sops-nix`](https://github.com/Mic92/sops-nix) at `secrets`. The [`sops`](https://github.com/mozilla/sops) encrypted secrets (using GPG) are stored at multiple places, like in this directory, as well as [`passwords`](./passwords). User passwords are generated using `mkpasswd -m sha-512` and specified using the `hashedPasswordFile` option. -The `sops` encrypted secrets are of `binary` format (and have the extension `.secret`) and can be conveniently managed using the [`nixos`](../scripts/README.md) `secret` command. +The `sops` encrypted secrets are of `binary` format (and have the extension `.secret`) and can be conveniently managed using the [`os`](../scripts/README.md) `secret` command. The `keys` directory contains the _public_ User GPG Keys which are automatically imported To create a secret, use the `os secret create` command, and append the directory along with requisite access permissions to the `secrets.yaml` file. diff --git a/site/README.md b/site/README.md @@ -25,6 +25,7 @@ The build also subsets webfonts, retaining text glyphs, ligatures, and Nerd icon To produce the same optimized assets from the `site` development shell: ```sh +cd site zola build python3 scripts/optimize_fonts.py public ```