dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 17a2ddc22a36b59368b7504315f1549f569447b2 parent dc1ab759a95c8c8b19814b8a98babaaa1e1f6190 Author: maydayv7 <maydayv7@gmail.com> Date: Thu, 22 Oct 2026 01:04:26 +0530 feat!: NixOS on WSL
Diffstat:
| M | .gitattributes | | | 3 | ++- |
| M | CHANGELOG.md | | | 3 | +++ |
| M | README.md | | | 8 | ++++++-- |
| M | files/colors/README.md | | | 2 | +- |
| A | files/colors/campbell.yaml | | | 27 | +++++++++++++++++++++++++++ |
| M | files/windows/README.md | | | 2 | +- |
| M | files/windows/windhawk.zip | | | 4 | ++-- |
| D | files/windows/wsl/.zsh_plugins.txt | | | 3 | --- |
| D | files/windows/wsl/.zshrc | | | 74 | -------------------------------------------------------------------------- |
| M | flake.lock | | | 39 | +++++++++++++++++++++++++++++++++++++++ |
| M | flake.nix | | | 6 | ++++++ |
| M | modules/README.md | | | 137 | +++++++++++++++++++++++++++++++++++++++++++++---------------------------------- |
| M | modules/apps/ai/antigravity.nix | | | 20 | +++++++++++++------- |
| M | modules/apps/ai/codex.nix | | | 22 | +++++++++++++++------- |
| M | modules/apps/git/git.nix | | | 38 | +++++++++++++++++++++++++------------- |
| M | modules/core/home-manager.nix | | | 17 | ++++++----------- |
| M | modules/core/nixos.nix | | | 29 | +++++++++++++++-------------- |
| A | modules/core/profiles.nix | | | 28 | ++++++++++++++++++++++++++++ |
| M | modules/gui/theme.nix | | | 33 | +++++++++++++++++++++++++++++++++ |
| M | modules/hosts/futura.nix | | | 24 | +++++++----------------- |
| M | modules/hosts/valkyrie/default.nix | | | 46 | ++++++++++++++++++++-------------------------- |
| M | modules/hosts/vortex.nix | | | 40 | +++++++++++++++------------------------- |
| A | modules/hosts/wsl/_fetch.nix | | | 18 | ++++++++++++++++++ |
| A | modules/hosts/wsl/_vscode.nix | | | 19 | +++++++++++++++++++ |
| A | modules/hosts/wsl/_windows.nix | | | 105 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | modules/hosts/wsl/default.nix | | | 82 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | modules/lib/_types.nix | | | 7 | +++++++ |
| M | modules/shell/shell.nix | | | 44 | ++++++++++++++++++++++++-------------------- |
| D | modules/system/base-ext.nix | | | 86 | ------------------------------------------------------------------------------- |
| M | modules/system/base.nix | | | 51 | +++++++++++++++++++++++++++++++++++++-------------- |
| A | modules/system/crypt.nix | | | 58 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | modules/system/extbase.nix | | | 32 | ++++++++++++++++++++++++++++++++ |
| M | modules/system/filesystem.nix | | | 17 | +++-------------- |
| M | modules/system/nix.nix | | | 6 | ++---- |
| M | modules/system/user/default.nix | | | 107 | +++++++++++++++++++++++++++++++++++++++++++------------------------------------ |
| M | modules/users/navya.nix | | | 15 | +++++++++++++++ |
| M | modules/users/v7/default.nix | | | 43 | +++++++++++++++++++++++++++++++++---------- |
| M | shells/js.nix | | | 1 | - |
38 files changed, 835 insertions(+), 461 deletions(-)
diff --git a/.gitattributes b/.gitattributes @@ -1,3 +1,4 @@ +* text=auto eol=lf *.secret binary -site/static/js/* linguist-vendored +site/static/js/katex.js linguist-vendored *.zip filter=lfs diff=lfs merge=lfs -text diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -2,6 +2,9 @@ ### October +- Windows + - NixOS on WSL! + - YASB Improvements - Allow automatic package updates with `srcs` - Add some SKILLS - Add `easyeffects-presets` diff --git a/README.md b/README.md @@ -96,6 +96,7 @@ It also builds and deploys my website to [maydayv7.dev](https://maydayv7.dev). - Automatically builds and deploys my [Website](./site) - Credentials management using the [`sops-nix`](https://github.com/Mic92/sops-nix) module and [`gnupg`](https://gnupg.org/) keys - Comprehensive User Configuration using the [`home-manager`](https://github.com/nix-community/home-manager) module +- Support for [NixOS on WSL](./modules/hosts/wsl) with shared CLI configuration - Ephemeral, opt-in filesystem state using the [`impermanence`](https://github.com/nix-community/impermanence) module and [ZFS](https://zfsonlinux.org/) - Declarative disk partitioning and installation using [`disko`](https://github.com/nix-community/disko) - Support for Secure Boot using [`lanzaboote`](https://github.com/nix-community/lanzaboote) @@ -139,6 +140,7 @@ github:maydayv7/dotfiles │ ├───configurations:nixos:futura: derivation │ ├───configurations:nixos:valkyrie: derivation │ ├───configurations:nixos:vortex: derivation +│ ├───configurations:nixos:wsl: derivation │ └───treefmt: derivation 'treefmt-check' ├───devShells │ └───x86_64-linux @@ -160,7 +162,8 @@ github:maydayv7/dotfiles ├───homeConfigurations │ ├───navya@futura: Home Manager configuration │ ├───v7@valkyrie: Home Manager configuration -│ └───v7@vortex: Home Manager configuration +│ ├───v7@vortex: Home Manager configuration +│ └───v7@wsl: Home Manager configuration ├───legacyPackages │ └───x86_64-linux (Default package channel) ├───modules: dendritic configuration modules @@ -168,7 +171,8 @@ github:maydayv7/dotfiles │ ├───futura: NixOS configuration │ ├───install: NixOS configuration │ ├───valkyrie: NixOS configuration -│ └───vortex: NixOS configuration +│ ├───vortex: NixOS configuration +│ └───wsl: NixOS configuration ├───overlays ├───packages │ └───x86_64-linux diff --git a/files/colors/README.md b/files/colors/README.md @@ -4,7 +4,7 @@ The color schemes are specified according to the following format - ```yaml scheme: Name -author: Maker +author: Maintainer base00: Base base01: Mantle base02: Surface0 diff --git a/files/colors/campbell.yaml b/files/colors/campbell.yaml @@ -0,0 +1,27 @@ +scheme: "Campbell" +author: "Microsoft" +base00: "#0C0C0C" +base01: "#0C0C0C" +base02: "#262626" +base03: "#363636" +base04: "#767676" +base05: "#CCCCCC" +base06: "#F2F2F2" +base07: "#F2F2F2" +base08: "#C50F1F" +base09: "#C19C00" +base0A: "#C19C00" +base0B: "#13A10E" +base0C: "#3A96DD" +base0D: "#0037DA" +base0E: "#881798" +base0F: "#C19C00" + +base10: "#0C0C0C" +base11: "#0C0C0C" +base12: "#E74856" +base13: "#F9F1A5" +base14: "#16C60C" +base15: "#61D6D6" +base16: "#3B78FF" +base17: "#B4009E" diff --git a/files/windows/README.md b/files/windows/README.md @@ -10,7 +10,7 @@ Use [UniGetUI](https://github.com/devolutions/unigetui) to install all [programs Can't live without this quintessential piece of software on this otherwise dysfunctional OS. -Use [scorpion421/Windhawk-Services-Backup-Utility](https://github.com/scorpion421/Windhawk-Services-Backup-Utility) to backup/restore all mods. +Use [Windhawk-Backup-Manager](https://github.com/osmanonurkoc/Windhawk-Backup-Manager) to backup/restore all mods. ## AutoHotKey v2 diff --git a/files/windows/windhawk.zip b/files/windows/windhawk.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:85b467466d7ddbfd2e2bc4098d622877fa8e12dcf90ca34d91ba41c015f3207e -size 10760087 +oid sha256:4208c2f5ca57df9e9e39458aa4fea4cb818dbb341c150d8b6bcd22e1bc381392 +size 5805166 diff --git a/files/windows/wsl/.zsh_plugins.txt b/files/windows/wsl/.zsh_plugins.txt @@ -1,3 +0,0 @@ -zsh-users/zsh-completions -zsh-users/zsh-autosuggestions -zsh-users/zsh-syntax-highlighting diff --git a/files/windows/wsl/.zshrc b/files/windows/wsl/.zshrc @@ -1,74 +0,0 @@ -# Plugins -source ~/.antidote/antidote.zsh -antidote load -autoload -Uz compinit && compinit - -# Keybinds -bindkey '^[[1;5C' forward-word -bindkey '^[[1;5D' backward-word -bindkey '^[[3;5~' kill-word -bindkey '^[[3~' delete-char -bindkey '^[[5~' beginning-of-history -bindkey '^[[6~' end-of-history -bindkey '^[[A' up-line-or-search -bindkey '^[[B' down-line-or-search -bindkey '^[[C' forward-char -bindkey '^[[D' backward-char -bindkey '^[[F' end-of-linegestures -bindkey '^[[H' beginning-of-line -bindkey '^H' backward-kill-word -bindkey '^J' backward-kill-line - -# Command Aliases -alias c="bat" -alias l="eza -b -h -l -F --octal-permissions --time-style iso" -alias grep="grep --color" -alias sike="fastfetch" -alias whome="cd /mnt/c/Users" - -# Editor -np() { - local notepad_exe="/mnt/c/Windows/System32/notepad.exe" - - if [ $# -eq 0 ] - then - "$notepad_exe" > /dev/null 2>&1 &! - return - fi - - local win_path - win_path="$(wslpath -aw "$1")" || return - "$notepad_exe" "$win_path" > /dev/null 2>&1 &! -} - -# Command History -HISTFILE=~/.zsh_history -HISTSIZE=10000 -SAVEHIST=10000 -SAVEHIST_EXPIRE_DUPS_FIRST=1 -setopt APPEND_HISTORY -setopt SHARE_HISTORY -setopt INC_APPEND_HISTORY -setopt HIST_IGNORE_DUPS -setopt HIST_IGNORE_SPACE - -export HSTR_CONFIG=hicolor -hstr_no_tiocsti() { - zle -I - { HSTR_OUT="$( { </dev/tty hstr -- ${BUFFER}; } 2>&1 1>&3 3>&- )"; } 3>&1; - BUFFER="${HSTR_OUT}" - CURSOR=${#BUFFER} - zle redisplay -} -zle -N hstr_no_tiocsti -bindkey '\C-r' hstr_no_tiocsti -export HSTR_TIOCSTI=n - -# Command Not Found -source /usr/share/doc/pkgfile/command-not-found.zsh - -# Node Version Manager -source /usr/share/nvm/init-nvm.sh - -# Prompt -eval "$(starship init zsh)" diff --git a/flake.lock b/flake.lock @@ -246,6 +246,22 @@ "type": "github" } }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -635,6 +651,28 @@ "type": "github" } }, + "nixos-wsl": { + "inputs": { + "flake-compat": "flake-compat_3", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1789157919, + "narHash": "sha256-3+r8UDwPkTlB9hhHoN4rjGtZow3+wEFOganBKurhJhY=", + "owner": "nix-community", + "repo": "NixOS-WSL", + "rev": "b98199a76ab180be55f7a6a97bd4984a87c99964", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-26.05", + "repo": "NixOS-WSL", + "type": "github" + } + }, "nixpak": { "inputs": { "flake-parts": [ @@ -869,6 +907,7 @@ "minecraft": "minecraft", "niri": "niri", "nixcord": "nixcord", + "nixos-wsl": "nixos-wsl", "nixpak": "nixpak", "nixpkgs": [ "stable" diff --git a/flake.nix b/flake.nix @@ -110,6 +110,12 @@ inputs.nixpkgs.follows = "unstable"; }; + # Windows Subsystem for Linux + nixos-wsl = { + url = "github:nix-community/NixOS-WSL?ref=release-26.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # Declarative Disk Partitioning disko = { url = "github:nix-community/disko/v1.13.0"; diff --git a/modules/README.md b/modules/README.md @@ -7,42 +7,49 @@ The `modules` directory contains the custom configuration modules that form the - [`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 +- [`users`](./users/): user accounts and user-specific Home Manager configurations ## Module List An overview of every configuration module in this repository. -**Type** indicates whether a module extends `flake.modules.nixos`, `flake.modules.homeManager`, or both. +- **Type** indicates whether a module extends `flake.modules.nixos`, `flake.modules.homeManager`, or both +- **★** marks modules imported by default +- **◇** marks WSL-compatible modules (' for HM-only) -**★** marks modules imported by default +#### WSL + +The [`wsl` host](./hosts/wsl) provides [NixOS-WSL](https://github.com/nix-community/NixOS-WSL) configuration. +`<name>-cli` holds reusable command-line settings when `<name>` also includes desktop/native-host configuration. ### [`apps`](./apps) -| Module | Type | Description | -| ------------- | ------------ | ---------------------------------- | -| `auth` | Home Manager | Authentication credential managers | -| `discord` | Home Manager | Discord chat client | -| `firefox` | Home Manager | Firefox browser | -| `internet` | Home Manager | Internet apps | -| `notes` | Home Manager | Obsidian note-taking | -| `spotify` | Home Manager | Spotify music client | -| `stream` | Home Manager | Streaming tools | -| `syncthing` | Home Manager | Syncthing file sync | -| `youtube` | Home Manager | YouTube Music & TUI | -| `vscode` | Home Manager | Visual Studio Code editor | -| `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 | -| `latex` | Both | LaTeX typesetting | -| `office` | Both | Office suite environment | -| `tools` | Both | General CLI/GUI tools | -| `wine` | Both | Wine Windows compatibility | -| `git` | Both | `git` version control | -| `git-hosting` | NixOS | Gitea code hosting | -| `git-runner` | NixOS | GitHub/GitLab CI runner | +| Module | Type | Description | +| ------------------- | ------------ | ---------------------------------- | +| `auth` | Home Manager | Authentication credential managers | +| `discord` | Home Manager | Discord chat client | +| `firefox` | Home Manager | Firefox browser | +| `internet` | Home Manager | Internet apps | +| `notes` | Home Manager | Obsidian note-taking | +| `spotify` | Home Manager | Spotify music client | +| `stream` | Home Manager | Streaming tools | +| `syncthing` ◇ | Home Manager | Syncthing file sync | +| `youtube` | Home Manager | YouTube Music & TUI | +| `vscode` | Home Manager | Visual Studio Code editor | +| `zed` | Home Manager | Zed Editor | +| `antigravity-cli` ◇ | Home Manager | Google Antigravity CLI | +| `antigravity` | Home Manager | Antigravity CLI + IDE | +| `codex-cli` ◇ | Home Manager | OpenAI Codex CLI | +| `codex` | Home Manager | Codex CLI + Desktop | +| `claude` | Home Manager | Anthropic Claude | +| `flatpak` | Both | Flatpak app sandboxing | +| `latex` | Both | LaTeX typesetting | +| `office` | Both | Office suite environment | +| `tools` | Both | General CLI/GUI tools | +| `wine` | Both | Wine Windows compatibility | +| `git` ◇ | Both | `git` version control | +| `git-hosting` ◇ | NixOS | Gitea code hosting | +| `git-runner` ◇ | NixOS | GitHub/GitLab CI runner | ### [`desktop`](./desktop) @@ -64,44 +71,55 @@ An overview of every configuration module in this repository. ### [`gui`](./gui) -| Module | Type | Description | -| --------- | ----- | ------------------- | -| `theme` ★ | Both | System-wide theming | -| `fonts` ★ | NixOS | System fonts | -| `gtk` | Both | GTK theming | -| `qt` | Both | Qt theming | +| Module | Type | Description | +| ------------- | ----- | ------------------- | +| `theme` ★ | Both | System-wide theming | +| `theme-cli` ◇ | Both | CLI/TUI theming | +| `fonts` ★ | NixOS | System fonts | +| `gtk` | Both | GTK theming | +| `qt` | Both | Qt theming | ### [`hardware`](./hardware) -| Module | Type | Description | -| ------------ | ----- | ------------------- | -| `cpu` ★ | NixOS | CPU configuration | -| `gpu` ★ | NixOS | GPU configuration | -| `laptop` | Both | Laptop tweaks | -| `mouse` | Both | Mouse configuration | -| `mobile` | NixOS | Mobile firmware | -| `printer` | NixOS | Printer firmware | -| `blockchain` | NixOS | Blockchain support | +| Module | Type | Description | +| -------------- | ----- | ------------------- | +| `cpu` ★ | NixOS | CPU configuration | +| `gpu` ★ | NixOS | GPU configuration | +| `laptop` | Both | Laptop tweaks | +| `mouse` | Both | Mouse configuration | +| `mobile` | NixOS | Mobile firmware | +| `printer` | NixOS | Printer firmware | +| `blockchain` ◇ | NixOS | Blockchain support | ### [`shell`](./shell) -| Module | Type | Description | -| ------------- | ----- | ------------------- | -| `shell` ★ | Both | Shell configuration | -| `shell-utils` | Both | Shell utilities | -| `prompt` | NixOS | Shell prompt | +| Module | Type | Description | +| --------------- | ----- | ------------------- | +| `shell` ★ ◇' | Both | Shell configuration | +| `shell-cli` ◇ | NixOS | Shells & TUIs | +| `shell-utils` ◇ | Both | Shell utilities | +| `prompt` ◇ | NixOS | Shell prompt | ### [`system`](./system) -| Module | Type | Description | -| -------------- | ----- | ----------------------------------- | -| `base` ★ | Both | Base system configuration | -| `base-ext` | Both | Extended base configuration | -| `boot` ★ | NixOS | Boot loader configuration | -| `filesystem` ★ | Both | File system layout | -| `nix` ★ | Both | Nix daemon & settings | -| `user` ★ | Both | User accounts & Home Manager wiring | -| `security` | Both | Security & hardening | +| Module | Type | Description | +| ----------------- | ----- | ------------------------------------ | +| `base` ★ ◇' | Both | Base system configuration | +| `base-cli` ◇ | NixOS | Shared base utilities & declarations | +| `extbase` | NixOS | Extended base configuration | +| `extbase-cli` ◇ | NixOS | Extended base CLI configuration | +| `crypt` ◇ | Both | GPG agent & SSH client/server | +| `boot` ★ | NixOS | Boot loader configuration | +| `filesystem` ★ ◇' | Both | File system layout | +| `nix` ★ ◇ | Both | Nix daemon & settings | +| `user-cli` ◇ | Both | User CLI setup | +| `user` ★ | Both | User accounts & Home Manager wiring | +| `security` | Both | Security & hardening | + +### [`users`](./users) + +The `core` Home Manager profiles `default` and `cli` compose the standard and +CLI base modules respectively. ### [`virt`](./virt) @@ -114,9 +132,9 @@ An overview of every configuration module in this repository. ### [`secrets`](../secrets) -| Module | Type | Description | -| ----------- | ---- | ------------------ | -| `secrets` ★ | Both | Secrets management | +| Module | Type | Description | +| ------------- | ---- | ------------------ | +| `secrets` ★ ◇ | Both | Secrets management | ## Options @@ -124,6 +142,7 @@ The following are the custom configuration options exposed by the modules above: - [`apps`](./apps) - - `git` - + - `package`: System `git` package - Ex. `pkgs.gitFull` - `hosting` - - `enable`: Enable Gitea Code Hosting - `true / false` - `domain`: Website Domain Name - Ex. `maydayv7.dev` diff --git a/modules/apps/ai/antigravity.nix b/modules/apps/ai/antigravity.nix @@ -1,6 +1,6 @@ ## Google Antigravity ## {config, ...}: let - inherit (config.flake) files; + inherit (config.flake) files modules; in { flake.modules.homeManager.antigravity = { config, @@ -14,7 +14,7 @@ in { isWM = (osConfig.programs.hyprland.enable or false) || (osConfig.programs.niri.enable or false); in { imports = [ - ./_common.nix + modules.homeManager.antigravity-cli (import ../vscode/_mutable.nix { program = "antigravity"; configDir = "Antigravity"; @@ -30,6 +30,16 @@ in { }; }; + home.persist.directories = [".config/Antigravity"]; + }; + + flake.modules.homeManager.antigravity-cli = { + config, + pkgs, + ... + }: { + imports = [./_common.nix]; + # CLI programs.antigravity-cli = { enable = true; @@ -45,11 +55,7 @@ in { home = { file.".gemini/antigravity-cli/settings.json".force = true; - persist.directories = [ - ".config/Antigravity" - ".antigravity" - ".gemini" - ]; + persist.directories = [".antigravity" ".gemini"]; }; }; } diff --git a/modules/apps/ai/codex.nix b/modules/apps/ai/codex.nix @@ -1,12 +1,14 @@ ## OpenAI Codex ## -_: { +{config, ...}: let + inherit (config.flake) modules; +in { flake.modules.homeManager.codex = { config, lib, pkgs, ... }: { - imports = [./_common.nix]; + imports = [modules.homeManager.codex-cli]; programs.vscode.profiles.default.extensions = lib.mkIf config.programs.vscode.enable @@ -14,12 +16,18 @@ _: { home = { packages = [pkgs.llm.chatgpt]; - persist.directories = [ - ".codex" - ".config/Codex" - ".cache/Codex" - ]; + persist.directories = [".config/Codex" ".cache/Codex"]; + }; + }; + flake.modules.homeManager.codex-cli = { + config, + pkgs, + ... + }: { + imports = [./_common.nix]; + home = { + persist.directories = [".codex"]; file.".codex/config.toml" = { force = true; mutable = true; diff --git a/modules/apps/git/git.nix b/modules/apps/git/git.nix @@ -3,16 +3,29 @@ inherit (config.flake) files; in { flake.modules = { - nixos.git = {pkgs, ...}: { - # Utilities - environment.systemPackages = with pkgs; [ - gitFull - git-crypt - git-lfs - gh - tig - treefmt - ]; + nixos.git = { + config, + lib, + pkgs, + ... + }: { + options.apps.git.package = lib.mkOption { + description = "System 'git' package"; + type = lib.types.package; + default = pkgs.gitFull; + }; + + config = { + # Utilities + environment.systemPackages = with pkgs; [ + config.apps.git.package + git-crypt + git-lfs + gh + tig + treefmt + ]; + }; }; homeManager.git = { @@ -22,7 +35,6 @@ in { }: let cfg = config.credentials; in { - # User Credentials assertions = [ { assertion = cfg.mail != ""; @@ -89,7 +101,7 @@ in { }; }; - # 'git' Settings + ## 'git' Settings git = { enable = true; lfs.enable = true; @@ -112,7 +124,7 @@ in { settings = { color.ui = "auto"; core.hooksPath = "~/.git-hooks"; - credential.helper = ["libsecret"]; + credential.helper = lib.mkDefault ["libsecret"]; diff.colorMoved = "default"; init.defaultBranch = "main"; pull.rebase = "true"; diff --git a/modules/core/home-manager.nix b/modules/core/home-manager.nix @@ -17,6 +17,7 @@ in { name: { module, system, + defaults, }: inputs.home-manager.lib.homeManagerConfiguration { pkgs = config.flake.legacyPackages.${system}; @@ -26,10 +27,8 @@ in { module # Compatibility - inputs.stylix.homeModules.stylix ( {lib, ...}: { - config.stylix.base16Scheme = lib.mkDefault files.colors.catppuccin; options.home.persistence = lib.mkOption { type = lib.types.attrsOf lib.types.anything; default = {}; @@ -39,15 +38,11 @@ in { ] ++ # Default Modules - util.map.array [ - "base" - "filesystem" - "user" - "nix" - "shell" - "theme" - ] - modules.homeManager; + lib.optionals defaults [ + inputs.stylix.homeModules.stylix + ({lib, ...}: {stylix.base16Scheme = lib.mkDefault files.colors.catppuccin;}) + modules.homeManager.default + ]; } ) config.configurations.homeManager; diff --git a/modules/core/nixos.nix b/modules/core/nixos.nix @@ -16,6 +16,7 @@ in { name: { module, system, + defaults, }: lib.nixosSystem { modules = @@ -28,20 +29,20 @@ in { ] ++ # Default Modules - util.map.array [ - "base" - "boot" - "filesystem" - "cpu" - "gpu" - "nix" - "user" - "secrets" - "shell" - "theme" - "fonts" - ] - flake.modules.nixos; + lib.optionals defaults (util.map.array [ + "base" + "boot" + "filesystem" + "cpu" + "gpu" + "nix" + "user" + "secrets" + "shell" + "theme" + "fonts" + ] + flake.modules.nixos); } ) config.configurations.nixos; diff --git a/modules/core/profiles.nix b/modules/core/profiles.nix @@ -0,0 +1,28 @@ +{config, ...}: let + inherit (config) util; + inherit (config.flake.modules) homeManager; +in { + flake.modules.homeManager = { + default.imports = + util.map.array [ + "base" + "filesystem" + "user" + "nix" + "shell" + "theme" + ] + homeManager; + + cli.imports = + util.map.array [ + "base" + "filesystem" + "user-cli" + "nix" + "shell" + "theme-cli" + ] + homeManager; + }; +} diff --git a/modules/gui/theme.nix b/modules/gui/theme.nix @@ -5,8 +5,41 @@ ... }: let inherit (config.flake) files; + cli = {lib, ...}: { + stylix = { + enable = lib.mkDefault true; + image = lib.mkDefault files.wallpapers.Beauty; + polarity = lib.mkDefault "dark"; + base16Scheme = files.colors.campbell; + }; + }; in { flake.modules = { + nixos.theme-cli = { + imports = [inputs.stylix.nixosModules.stylix cli]; + stylix = { + autoEnable = false; + homeManagerIntegration.autoImport = false; + }; + }; + + homeManager.theme-cli = { + config, + lib, + options, + ... + }: { + imports = [inputs.stylix.homeModules.stylix cli]; + stylix = { + autoEnable = true; + targets = + lib.mapAttrs (name: _: { + enable = lib.mkDefault (config.programs.${name}.enable or false); + }) + options.stylix.targets; + }; + }; + nixos.theme = { config, lib, diff --git a/modules/hosts/futura.nix b/modules/hosts/futura.nix @@ -17,13 +17,10 @@ in { configurations.nixos.futura = { system = "x86_64-linux"; - module = { - config, - pkgs, - ... - }: { + module = _: { imports = util.map.array [ + "navya" "security" "laptop" "office" @@ -65,18 +62,11 @@ in { flake = "github:maydayv7/dotfiles"; }; - users.users.navya = { - isNormalUser = true; - description = "Navya"; - uid = 1000; - group = "users"; - shell = pkgs.zsh; - hashedPasswordFile = config.sops.secrets."navya.secret".path; - extraGroups = [ - "wheel" - "networkmanager" - ]; - }; + # User + users.users.navya.extraGroups = [ + "wheel" + "networkmanager" + ]; home-manager.users.navya.imports = sharedHmModules diff --git a/modules/hosts/valkyrie/default.nix b/modules/hosts/valkyrie/default.nix @@ -8,6 +8,8 @@ inherit (config) util; nixosModules = [ + "v7" + "extbase" "prompt" "mobile" "printer" @@ -36,7 +38,7 @@ ]; mixedModules = [ - "base-ext" + "crypt" "security" "laptop" "mouse" @@ -156,31 +158,23 @@ in { hugepages = 16; }; - # User V7 - users.users.v7 = { - isNormalUser = true; - description = "V 7"; - uid = 1000; - group = "users"; - shell = pkgs.zsh; - hashedPasswordFile = config.sops.secrets."v7.secret".path; - extraGroups = [ - "wheel" - "keys" - "adbusers" - "docker" - "i2c" - "input" - "lp" - "networkmanager" - "scanner" - "systemd-journal" - "video" - "minecraft" - "kvm" - "libvirtd" - ]; - }; + # User + users.users.v7.extraGroups = [ + "wheel" + "keys" + "adbusers" + "docker" + "i2c" + "input" + "lp" + "networkmanager" + "scanner" + "systemd-journal" + "video" + "minecraft" + "kvm" + "libvirtd" + ]; home-manager.users.v7.imports = hmImports diff --git a/modules/hosts/vortex.nix b/modules/hosts/vortex.nix @@ -24,14 +24,11 @@ in { configurations.nixos.vortex = { system = "x86_64-linux"; - module = { - config, - pkgs, - ... - }: { + module = _: { imports = util.map.array [ + "v7" "security" "laptop" "mobile" @@ -84,26 +81,19 @@ in { fancy = true; }; - users.users.v7 = { - isNormalUser = true; - description = "V 7"; - uid = 1000; - group = "users"; - shell = pkgs.zsh; - hashedPasswordFile = config.sops.secrets."v7.secret".path; - extraGroups = [ - "wheel" - "keys" - "networkmanager" - "adbusers" - "lp" - "scanner" - "kvm" - "libvirtd" - "input" - "video" - ]; - }; + # User + users.users.v7.extraGroups = [ + "wheel" + "keys" + "networkmanager" + "adbusers" + "lp" + "scanner" + "kvm" + "libvirtd" + "input" + "video" + ]; home-manager.users.v7.imports = hmModules ++ [homeManager.v7]; }; diff --git a/modules/hosts/wsl/_fetch.nix b/modules/hosts/wsl/_fetch.nix @@ -0,0 +1,18 @@ +## WSL Fastfetch ## +{config, ...}: let + inherit (config.flake) files; +in { + nixos = {pkgs, ...}: { + environment.etc."fastfetch/config.jsonc".text = let + original = builtins.fromJSON files.fetch; + omitted = ["bios" "display" "de" "wm" "lm" "wmtheme" "theme" "icons" "cursor"]; + in + pkgs.lib.mkForce (builtins.toJSON (original + // { + modules = + builtins.filter + (entry: builtins.isString entry || !(builtins.elem entry.type omitted)) + original.modules; + })); + }; +} diff --git a/modules/hosts/wsl/_vscode.nix b/modules/hosts/wsl/_vscode.nix @@ -0,0 +1,19 @@ +## Remote VS Code ## +{config, ...}: let + inherit (config.flake) files; +in { + home = { + lib, + pkgs, + ... + }: { + home = { + packages = with pkgs; [nixd alejandra]; + file.".vscode-server/data/Machine/settings.json" = { + text = builtins.toJSON (lib.filterAttrs (name: _: lib.hasPrefix "nix." name || name == "[nix]") files.vscode.settings); + force = true; + mutable = true; + }; + }; + }; +} diff --git a/modules/hosts/wsl/_windows.nix b/modules/hosts/wsl/_windows.nix @@ -0,0 +1,105 @@ +## Windows Integration ## +_: { + nixos = {pkgs, ...}: { + wsl = { + enable = true; + interop.includePath = false; + docker-desktop.enable = true; + extraBin = map (name: {src = "${pkgs.coreutils}/bin/${name}";}) [ + "install" + "mv" + "rm" + "stat" + "test" + ]; + }; + }; + + home = { + lib, + pkgs, + osConfig ? null, + ... + }: let + mountRoot = + if osConfig == null + then "/mnt" + else osConfig.wsl.wslConf.automount.root; + + system32 = "${mountRoot}/c/Windows/System32"; + powershell = "${system32}/WindowsPowerShell/v1.0/powershell.exe"; + + windowsCommands = pkgs.symlinkJoin { + name = "windows-commands"; + paths = lib.mapAttrsToList (name: command: + pkgs.writeShellScriptBin name '' + exec ${lib.escapeShellArg command} "$@" + '') { + "cmd.exe" = "${system32}/cmd.exe"; + "explorer.exe" = "${mountRoot}/c/Windows/explorer.exe"; + "notepad.exe" = "${system32}/notepad.exe"; + "powershell.exe" = powershell; + }; + }; + + copy = pkgs.writeShellScriptBin "win-copy" '' + exec "${powershell}" -NoLogo -NoProfile -NonInteractive -Command \ + '[Console]::InputEncoding = [Text.UTF8Encoding]::new(); Set-Clipboard -Value ([Console]::In.ReadToEnd())' + ''; + + paste = pkgs.writeShellScriptBin "win-paste" '' + exec "${powershell}" -NoLogo -NoProfile -NonInteractive -Command \ + '[Console]::OutputEncoding = [Text.UTF8Encoding]::new(); [Console]::Out.Write((Get-Clipboard -Raw))' + ''; + + clipboard = pkgs.writeShellScriptBin "xclip" '' + for argument in "$@" + do + case "$argument" in + -o|-out) exec ${lib.getExe paste} ;; + esac + done + exec ${lib.getExe copy} + ''; + + code = pkgs.writeShellScriptBin "code" '' + exec ${lib.getExe pkgs.bash} "${mountRoot}/c/Program Files/Microsoft VS Code/bin/code" "$@" + ''; + + editor = pkgs.writeShellScriptBin "np" '' + if [ "$#" -eq 0 ] + then + exec "${system32}/notepad.exe" + fi + exec "${system32}/notepad.exe" "$(wslpath -aw "$1")" + ''; + + open = pkgs.writeShellScriptBin "xdg-open" '' + if [ "$#" -ne 1 ] + then + echo 'Usage: xdg-open FILE_OR_URL' >&2 + exit 2 + fi + target="$1" + case "$target" in + *://*|mailto:*) ;; + *) target="$(wslpath -aw "$target")" ;; + esac + printf '%s' "$target" | "${powershell}" -NoLogo -NoProfile -NonInteractive -Command \ + '[Console]::InputEncoding = [Text.UTF8Encoding]::new(); Start-Process -FilePath ([Console]::In.ReadToEnd())' + ''; + in { + home = { + packages = [windowsCommands copy paste clipboard code editor open]; + sessionVariables.BROWSER = lib.getExe open; + shellAliases.whome = "cd ${mountRoot}/c/Users"; + }; + + programs = { + git.settings.credential.helper = []; + zsh.initContent = '' + export GPG_TTY="$(tty)" + ''; + }; + }; +} diff --git a/modules/hosts/wsl/default.nix b/modules/hosts/wsl/default.nix @@ -0,0 +1,82 @@ +# WSL - NixOS on Windows +{ + config, + inputs, + ... +} @ args: let + inherit (config) util; + inherit (config.flake) modules; + + windows = import ./_windows.nix {}; + fetch = import ./_fetch.nix args; + vscode = import ./_vscode.nix args; + + hmModules = + util.map.array [ + "v7-cli" + "secrets" + "crypt" + "shell-utils" + "git" + "codex-cli" + ] + modules.homeManager + ++ [ + windows.home + vscode.home + ({lib, ...}: { + systemd.user.services.sops-nix.Install.WantedBy = lib.mkForce ["default.target"]; + }) + ]; +in { + configurations.nixos.wsl = { + defaults = false; + module = {pkgs, ...}: { + imports = + [ + inputs.nixos-wsl.nixosModules.default + windows.nixos + fetch.nixos + ] + ++ util.map.array [ + "base-cli" + "extbase-cli" + "crypt" + "nix" + "user-cli" + "v7" + "secrets" + "shell-cli" + "shell-utils" + "prompt" + "theme-cli" + "git" + ] + modules.nixos; + + time.timeZone = "Asia/Kolkata"; + i18n.defaultLocale = "en_IN"; + environment.variables.LC_ALL = "en_IN.UTF-8"; + + system.nix.index = true; + apps.git.package = pkgs.git; + programs.gnupg.agent.pinentryPackage = pkgs.pinentry-curses; + + wsl.defaultUser = "v7"; + users.users.v7.extraGroups = ["wheel" "keys" "systemd-journal"]; + home-manager.users.v7.imports = hmModules; + }; + }; + + configurations.homeManager."v7@wsl" = { + defaults = false; + module = { + imports = [modules.homeManager.cli] ++ hmModules; + home = { + username = "v7"; + homeDirectory = "/home/v7"; + stateVersion = "26.05"; + }; + }; + }; +} diff --git a/modules/lib/_types.nix b/modules/lib/_types.nix @@ -6,6 +6,13 @@ lib: { module = lib.mkOption { type = lib.types.deferredModule; }; + + defaults = lib.mkOption { + description = "Import core system modules"; + type = lib.types.bool; + default = true; + }; + system = lib.mkOption { type = lib.types.str; default = "x86_64-linux"; diff --git a/modules/shell/shell.nix b/modules/shell/shell.nix @@ -1,6 +1,6 @@ ## Shell Configuration ## {config, ...}: let - inherit (config.flake) files; + inherit (config.flake) files modules; editor = { autoindent = true; @@ -24,7 +24,15 @@ }; in { flake.modules = { - nixos.shell = {pkgs, ...}: { + nixos.shell = { + imports = [modules.nixos.shell-cli]; + programs = { + bash.vteIntegration = true; + zsh.vteIntegration = true; + }; + }; + + nixos.shell-cli = {pkgs, ...}: { config = { environment = { shells = [pkgs.bashInteractive]; @@ -53,24 +61,21 @@ in { }; # Bourne Shell - bash = { - vteIntegration = true; - promptInit = '' - shopt -s autocd - shopt -s cdspell - shopt -s checkjobs - shopt -s checkwinsize - shopt -s cmdhist - shopt -s extglob - shopt -s globstar - shopt -s histappend + bash.promptInit = '' + shopt -s autocd + shopt -s cdspell + shopt -s checkjobs + shopt -s checkwinsize + shopt -s cmdhist + shopt -s extglob + shopt -s globstar + shopt -s histappend - HISTCONTROL=erasedups:ignoredups:ignorespace - HISTFILESIZE=100000 - HISTIGNORE=rm:killall - HISTSIZE=100000 - ''; - }; + HISTCONTROL=erasedups:ignoredups:ignorespace + HISTFILESIZE=100000 + HISTIGNORE=rm:killall + HISTSIZE=100000 + ''; # Z Shell zsh = { @@ -78,7 +83,6 @@ in { autosuggestions.enable = true; enableCompletion = false; syntaxHighlighting.enable = true; - vteIntegration = true; setOptions = [ "autocd" "EXTENDED_HISTORY" diff --git a/modules/system/base-ext.nix b/modules/system/base-ext.nix @@ -1,86 +0,0 @@ -## Extended Base Configuration ## -_: { - flake.modules = { - nixos.base-ext = { - config, - lib, - ... - }: { - # Binaries - programs.nix-ld.enable = true; - programs.appimage = { - enable = true; - binfmt = true; - }; - - # Documentation - documentation = { - dev.enable = true; - man.enable = true; - }; - - # TTY - services.kmscon = { - enable = true; - hwRender = false; - extraConfig = '' - mouse - font-name=${config.stylix.fonts.monospace.name} - ''; - }; - - # GPG & SSH - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - environment.persist.directories = ["/etc/ssh"]; - services.openssh = { - enable = true; - settings = { - PasswordAuthentication = false; - PermitRootLogin = lib.mkForce "no"; - }; - - hostKeys = [ - { - comment = "Host SSH Key"; - bits = 4096; - type = "ed25519"; - path = "/etc/ssh/ssh_key"; - } - ]; - }; - }; - - homeManager.base-ext = _: { - home.persist.directories = [ - { - directory = ".gnupg"; - mode = "0700"; - } - { - directory = ".ssh"; - mode = "0700"; - } - ]; - - programs.ssh = { - enable = true; - settings."*" = { - ForwardAgent = false; - AddKeysToAgent = "no"; - Compression = false; - ServerAliveInterval = 0; - ServerAliveCountMax = 3; - HashKnownHosts = false; - UserKnownHostsFile = "~/.ssh/known_hosts"; - ControlMaster = "no"; - ControlPath = "~/.ssh/master-%r@%n:%p"; - ControlPersist = "no"; - }; - }; - }; - }; -} diff --git a/modules/system/base.nix b/modules/system/base.nix @@ -1,6 +1,40 @@ ## Base Configuration ## -_: { +{ + config, + inputs, + ... +}: let + inherit (config.flake) files modules; +in { flake.modules = { + nixos.base-cli = { + lib, + pkgs, + ... + }: { + system.stateVersion = lib.mkDefault lib.trivial.release; + + imports = [ + inputs.impermanence.nixosModule + (lib.mkAliasOptionModule ["environment" "persist"] ["environment" "persistence" files.path.persist]) + ]; + environment.persist.enable = lib.mkDefault false; + + environment.systemPackages = with pkgs; [ + custom.os + curl + file + killall + man-pages + mkpasswd + net-tools + rsync + unrar + unzip + wget + ]; + }; + nixos.base = { config, options, @@ -10,6 +44,8 @@ _: { }: let cfg = config.system; in { + imports = [modules.nixos.base-cli]; + options.system = { kernel = lib.mkOption { description = "Linux Kernel Variant to be used"; @@ -29,9 +65,6 @@ _: { }; config = { - # System version - system.stateVersion = lib.mkDefault lib.trivial.release; - # Kernel Configuration boot = { kernelPackages = @@ -58,24 +91,14 @@ _: { # Essential Utilities systemPackages = with pkgs; [ - custom.os cryptsetup - file inxi - killall - man-pages - mkpasswd - net-tools ntfsprogs parted pciutils - rsync sdparm smartmontools - unrar - unzip usbutils - wget alsa-utils ]; }; diff --git a/modules/system/crypt.nix b/modules/system/crypt.nix @@ -0,0 +1,58 @@ +## GPG & SSH Configuration ## +_: { + flake.modules = { + nixos.crypt = {lib, ...}: { + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + environment.persist.directories = ["/etc/ssh"]; + services.openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + PermitRootLogin = lib.mkForce "no"; + }; + + hostKeys = [ + { + comment = "Host SSH Key"; + bits = 4096; + type = "ed25519"; + path = "/etc/ssh/ssh_key"; + } + ]; + }; + }; + + homeManager.crypt = _: { + home.persist.directories = [ + { + directory = ".gnupg"; + mode = "0700"; + } + { + directory = ".ssh"; + mode = "0700"; + } + ]; + + programs.ssh = { + enable = true; + settings."*" = { + ForwardAgent = false; + AddKeysToAgent = "no"; + Compression = false; + ServerAliveInterval = 0; + ServerAliveCountMax = 3; + HashKnownHosts = false; + UserKnownHostsFile = "~/.ssh/known_hosts"; + ControlMaster = "no"; + ControlPath = "~/.ssh/master-%r@%n:%p"; + ControlPersist = "no"; + }; + }; + }; + }; +} diff --git a/modules/system/extbase.nix b/modules/system/extbase.nix @@ -0,0 +1,32 @@ +## Extended Base Configuration ## +{config, ...}: let + inherit (config.flake) modules; +in { + flake.modules = { + nixos.extbase-cli = _: { + programs.nix-ld.enable = true; + documentation = { + dev.enable = true; + man.enable = true; + }; + }; + + nixos.extbase = {config, ...}: { + imports = [modules.nixos.extbase-cli]; + programs.appimage = { + enable = true; + binfmt = true; + }; + + # TTY + services.kmscon = { + enable = true; + hwRender = false; + extraConfig = '' + mouse + font-name=${config.stylix.fonts.monospace.name} + ''; + }; + }; + }; +} diff --git a/modules/system/filesystem.nix b/modules/system/filesystem.nix @@ -31,16 +31,6 @@ in { in { imports = [ inputs.disko.nixosModules.disko - inputs.impermanence.nixosModule - ( - mkAliasOptionModule - ["environment" "persist"] - [ - "environment" - "persistence" - files.path.persist - ] - ) ( mkAliasOptionModule ["system" "fs" "persist"] @@ -81,6 +71,8 @@ in { config = mkMerge [ { warnings = optional (cfg.scheme == null) "Disk Filesystem Scheme is unset"; + system.fs.persist.enable = mkDefault false; + boot = { supportedFilesystems = { ntfs = true; @@ -90,9 +82,6 @@ in { zfs.forceImportRoot = false; }; - environment.persist.enable = mkDefault false; - system.fs.persist.enable = mkDefault false; - ## Disk Layout disko.devices = mkMerge [ (mkIf (cfg.scheme != null) { @@ -320,7 +309,7 @@ in { osConfig ? null, ... }: let - advanced = osConfig != null && osConfig.system.fs.scheme == "advanced"; + advanced = osConfig != null && (osConfig.system.fs.scheme or null) == "advanced"; in { imports = [(lib.mkAliasOptionModule ["home" "persist"] ["home" "persistence" files.path.data])]; diff --git a/modules/system/nix.nix b/modules/system/nix.nix @@ -57,7 +57,6 @@ max-free = ${builtins.toString (10 * 1024 * 1024 * 1024)} ''; - ## Nix Registry ## # Registry nixPath = ["/etc/nix/inputs"]; registry = builtins.mapAttrs (_: value: {flake = value;}) ( @@ -79,8 +78,7 @@ }) inputs; - ## Nix Tools ## - # Nix Tools + ## Tools nix.settings.system-features = mkIf config.system.nix.tools [ "kvm" "big-parallel" @@ -102,7 +100,7 @@ }; }; - ## Package Indexer ## + ## Package Indexer homeManager.nix = { lib, osConfig ? null, diff --git a/modules/system/user/default.nix b/modules/system/user/default.nix @@ -10,6 +10,11 @@ in { flake.modules = { # Base User Configuration nixos.user = { + imports = [modules.nixos.user-cli]; + system.homeModules = [modules.homeManager.default]; + }; + + nixos.user-cli = { config, lib, ... @@ -18,16 +23,18 @@ in { in { imports = [inputs.home-manager.nixosModules.home-manager]; + options.system.homeModules = lib.mkOption { + type = lib.types.listOf lib.types.deferredModule; + default = [modules.homeManager.cli]; + description = "Shared system Home Manager modules"; + }; + config = { users.mutableUsers = false; users.extraUsers.root = { isNormalUser = false; extraGroups = ["wheel"]; - hashedPasswordFile = - mkIf ( - config.sops.secrets ? "root.secret" - ) - config.sops.secrets."root.secret".path; + hashedPasswordFile = mkIf (config.sops.secrets ? "root.secret") config.sops.secrets."root.secret".path; }; # User Passwords @@ -47,16 +54,7 @@ in { extraSpecialArgs = {inherit inputs;}; # Default Modules - sharedModules = - util.map.array [ - "base" - "filesystem" - "user" - "nix" - "shell" - "theme" - ] - modules.homeManager; + sharedModules = config.system.homeModules; }; # XDG directories @@ -74,6 +72,49 @@ in { config, lib, ... + }: { + imports = [modules.homeManager.user-cli]; + config = { + # Environment Settings + home.file = { + ".local/share/backgrounds".source = files.wallpapers.path; + ".config/gtk-3.0/bookmarks" = { + text = lib.mkBefore '' + file://${config.home.homeDirectory}/Downloads Downloads + file://${config.home.homeDirectory}/Pictures Pictures + file://${config.home.homeDirectory}/Documents Documents + ''; + force = true; + }; + }; + + # User Directories + xdg = { + enable = true; + mime.enable = true; + mimeApps.enable = true; + configFile."mimeapps.list".force = true; + userDirs = { + enable = true; + createDirectories = true; + desktop = "$HOME/Desktop"; + documents = "$HOME/Documents"; + download = "$HOME/Downloads"; + music = "$HOME/Music"; + pictures = "$HOME/Pictures"; + publicShare = "$HOME/Public"; + templates = "$HOME/Templates"; + videos = "$HOME/Videos"; + extraConfig."SCREENSHOTS" = "$HOME/Pictures/Screenshots"; + }; + }; + }; + }; + + homeManager.user-cli = { + config, + lib, + ... }: let inherit (lib) mkIf mkOption types; cfg = config.credentials; @@ -111,6 +152,8 @@ in { }; config = { + xdg.enable = true; + # Update News news.display = "show"; @@ -120,19 +163,6 @@ in { startServices = true; }; - # Environment Settings - home.file = { - ".local/share/backgrounds".source = files.wallpapers.path; - ".config/gtk-3.0/bookmarks" = { - text = lib.mkBefore '' - file://${config.home.homeDirectory}/Downloads Downloads - file://${config.home.homeDirectory}/Pictures Pictures - file://${config.home.homeDirectory}/Documents Documents - ''; - force = true; - }; - }; - # GPG Keys programs.gpg = { settings = mkIf (cfg.key != "") { @@ -160,27 +190,6 @@ in { ) ); }; - - # User Directories - xdg = { - enable = true; - mime.enable = true; - mimeApps.enable = true; - configFile."mimeapps.list".force = true; - userDirs = { - enable = true; - createDirectories = true; - desktop = "$HOME/Desktop"; - documents = "$HOME/Documents"; - download = "$HOME/Downloads"; - music = "$HOME/Music"; - pictures = "$HOME/Pictures"; - publicShare = "$HOME/Public"; - templates = "$HOME/Templates"; - videos = "$HOME/Videos"; - extraConfig."SCREENSHOTS" = "$HOME/Pictures/Screenshots"; - }; - }; }; }; }; diff --git a/modules/users/navya.nix b/modules/users/navya.nix @@ -1,4 +1,19 @@ _: { + flake.modules.nixos.navya = { + config, + pkgs, + ... + }: { + users.users.navya = { + isNormalUser = true; + description = "Navya"; + uid = 1000; + group = "users"; + shell = pkgs.zsh; + hashedPasswordFile = config.sops.secrets."navya.secret".path; + }; + }; + flake.modules.homeManager.navya = _: { }; } diff --git a/modules/users/v7/default.nix b/modules/users/v7/default.nix @@ -1,10 +1,41 @@ {config, ...}: let - inherit (config.flake) files; + inherit (config.flake) files modules; name = "maydayv7"; in { + flake.modules.nixos.v7 = { + config, + pkgs, + ... + }: { + users.users.v7 = { + isNormalUser = true; + description = "V 7"; + uid = 1000; + group = "users"; + shell = pkgs.zsh; + hashedPasswordFile = config.sops.secrets."v7.secret".path; + }; + }; + flake.modules.homeManager.v7 = { config, lib, + ... + }: { + imports = [modules.homeManager.v7-cli]; + home.file = { + ".face".source = ./profile.png; + ".config/goa-1.0/accounts.conf".text = builtins.readFile ./accounts.conf; + ".config/gtk-3.0/bookmarks".text = lib.mkBefore '' + file://${config.home.homeDirectory}/TBD TBD + file://${config.home.homeDirectory}/Projects Projects + ''; + }; + }; + + flake.modules.homeManager.v7-cli = { + config, + lib, pkgs, ... }: let @@ -24,15 +55,7 @@ in { "Projects" ]; - file = { - ".face".source = ./profile.png; - ".config/goa-1.0/accounts.conf".text = builtins.readFile ./accounts.conf; - "Projects/dotfiles".source = config.lib.file.mkOutOfStoreSymlink files.path.system; - ".config/gtk-3.0/bookmarks".text = lib.mkBefore '' - file://${homeDir}/TBD TBD - file://${homeDir}/Projects Projects - ''; - }; + file."Projects/dotfiles".source = config.lib.file.mkOutOfStoreSymlink files.path.system; packages = with pkgs; [ home-manager diff --git a/shells/js.nix b/shells/js.nix @@ -7,6 +7,5 @@ pkgs: { eslint nodemon - postman ]; }