From 7879122dfc8e7ca7b905e10d5f55df09f9051295 Mon Sep 17 00:00:00 2001 From: arpitchakladar Date: Wed, 9 Sep 2026 19:42:48 +0530 Subject: feat(users/arpit)!: moved modules/private to user specific config BREAKING CHANGES: modules/private isn't used anymore --- .gitignore | 5 +- flake.nix | 7 +-- modules/private/calcurse.example.nix | 13 ---- modules/private/email.example.nix | 23 ------- modules/private/git.example.nix | 20 ------- modules/private/gopass.example.nix | 13 ---- modules/system/nix-update/nix-update.sh | 10 ++-- users/arpit.nix | 103 -------------------------------- users/arpit/default.nix | 100 +++++++++++++++++++++++++++++++ users/arpit/private.example.nix | 55 +++++++++++++++++ 10 files changed, 164 insertions(+), 185 deletions(-) delete mode 100644 modules/private/calcurse.example.nix delete mode 100644 modules/private/email.example.nix delete mode 100644 modules/private/git.example.nix delete mode 100644 modules/private/gopass.example.nix delete mode 100644 users/arpit.nix create mode 100644 users/arpit/default.nix create mode 100644 users/arpit/private.example.nix diff --git a/.gitignore b/.gitignore index 7831fa7..b69855c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,8 @@ .pre-commit-config.yaml .devenv -# Private/secret configuration - track *.example.nix, ignore *.nix -modules/private/*.nix -!modules/private/*.example.nix +# Private/secret configuration - track example, ignore actual +users/*/private.nix # nix testing bulid directory result* diff --git a/flake.nix b/flake.nix index 5458226..2316fee 100644 --- a/flake.nix +++ b/flake.nix @@ -63,10 +63,9 @@ git-hooks.hooks.forbid-private = { enable = true; name = "Forbid committing private files"; - entry = "found private file in staging! Do not commit files under modules/private/ (except .example.nix files)."; + entry = "found private file in staging! Do not commit users/arpit/private.nix."; language = "fail"; - files = "modules/private/"; - excludes = [ "\\.example\\.nix$" ]; + files = "users/arpit/private\\.nix$"; }; languages = { @@ -107,7 +106,7 @@ home-manager.lib.homeManagerConfiguration { inherit pkgs; modules = [ - ./users/arpit.nix + ./users/arpit ./modules base16.homeManagerModule { diff --git a/modules/private/calcurse.example.nix b/modules/private/calcurse.example.nix deleted file mode 100644 index 681d343..0000000 --- a/modules/private/calcurse.example.nix +++ /dev/null @@ -1,13 +0,0 @@ -# Calcurse - Template for configuring calcurse, specially syncing -{ ... }: -{ - config = { - office.calcurse.sync = { - remote = "YOUR_REPOSITORY_URL"; - credential = { - username = "example"; - passwordGopassPath = "websites/github.com/example/tokens/calendar"; - }; - }; - }; -} diff --git a/modules/private/email.example.nix b/modules/private/email.example.nix deleted file mode 100644 index e6b4c2f..0000000 --- a/modules/private/email.example.nix +++ /dev/null @@ -1,23 +0,0 @@ -# Email example - Template for configuring neomutt email accounts -{ ... }: -{ - config = { - communication.neomutt.accounts = { - "example@gmail.com" = { - realName = "Example User"; - address = "user@gmail.com"; - passwordGopassSecret = "mail/user@gmail.com"; - flavor = "gmail.com"; - primary = true; - neomutt.extraConfig = '' - set pgp_default_key = YOUR_GPG_KEY_FINGERPRINT - ''; - gpg = { - key = "YOUR_GPG_KEY_ID"; - signByDefault = true; - encryptByDefault = false; # set true only if you also want auto-encrypt - }; - }; - }; - }; -} diff --git a/modules/private/git.example.nix b/modules/private/git.example.nix deleted file mode 100644 index 00999cd..0000000 --- a/modules/private/git.example.nix +++ /dev/null @@ -1,20 +0,0 @@ -# Git example - Template for configuring git identity and signing -{ ... }: -{ - config = { - development.git = { - username = "Your Name"; - email = "you@example.com"; - signing = { - key = "EXAMPLE_GPG_KEY_ID"; - signByDefault = true; - }; - }; - - # SSH keys to load from gopass (entries under ssh/ in the gopass store) - security.ssh.gopassKeys = [ - "github" - "gitlab" - ]; - }; -} diff --git a/modules/private/gopass.example.nix b/modules/private/gopass.example.nix deleted file mode 100644 index 2d783c9..0000000 --- a/modules/private/gopass.example.nix +++ /dev/null @@ -1,13 +0,0 @@ -# Gopass - Template for configuring gopass, specially syncing -{ ... }: -{ - config = { - security.gopass.sync = { - remote = "YOUR_REPOSITORY_URL"; - credential = { - username = "example"; - passwordGopassPath = "websites/github.com/example/tokens/calendar"; - }; - }; - }; -} diff --git a/modules/system/nix-update/nix-update.sh b/modules/system/nix-update/nix-update.sh index 0f1c0c1..0f499db 100644 --- a/modules/system/nix-update/nix-update.sh +++ b/modules/system/nix-update/nix-update.sh @@ -61,8 +61,8 @@ update_home_manager() { echo "==> Updating home-manager..." cd "$HM_DIR" - echo " Staging modules/private..." - git add modules/private -f + echo " Staging users/arpit/private.nix..." + git add users/arpit/private.nix -f if [[ "$ONLY_SWITCH" == false ]]; then echo " Running nix flake update..." @@ -74,10 +74,8 @@ update_home_manager() { home-manager switch --flake "$HM_DIR#arpit" fi - echo " Unstaging modules/private..." - for f in modules/private/*.nix; do - [[ "$f" == *.example.nix ]] || git rm --cached "$f" - done + echo " Unstaging users/arpit/private.nix..." + git rm --cached users/arpit/private.nix echo "==> home-manager update complete" } diff --git a/users/arpit.nix b/users/arpit.nix deleted file mode 100644 index 837d2bf..0000000 --- a/users/arpit.nix +++ /dev/null @@ -1,103 +0,0 @@ -# User-specific home-manager configuration -{ config, ... }: -{ - imports = [ - ../modules/private/calcurse.nix - ../modules/private/email.nix - ../modules/private/git.nix - ../modules/private/gopass.nix - ]; - - nixpkgs.config.allowUnfree = true; - - home.username = "arpit"; - home.homeDirectory = "/home/${config.home.username}"; - home.stateVersion = "25.05"; - - # Desktop environment - desktop.enable = true; - desktop.hardware.gpu = { - nvidia.enable = true; - amd.enable = true; - }; - - # Gaming - gaming.heroic.enable = true; - gaming.steam.enable = false; - - # Communication - communication.neomutt.enable = true; - - # Development - development.bruno.enable = true; - development.delta.enable = true; - development.git.enable = true; - development.git.signing.signByDefault = true; - development.lazygit.enable = true; - development.nixvim.enable = true; - development.opencode.enable = true; - development.qemu.enable = true; - development.vscodium.enable = true; - - # File Management - file-management.eza.enable = true; - file-management.ouch.enable = true; - file-management.usb.enable = true; - file-management.yazi.enable = true; - file-management.yazi.file-chooser.enable = true; - - # Media - media.swayimg.enable = true; - media.grim.enable = true; - media.pamixer.enable = true; - media.playerctl.enable = true; - media.slurp.enable = true; - media.vlc.enable = true; - media.wf-recorder.enable = true; - - # Networking - networking.impala.enable = true; - networking.bluetui.enable = true; - networking.usque.enable = true; - networking.usque.warp.enable = true; - - # Office - office.calcurse.enable = true; - office.calcurse.sync.enable = true; - office.zathura.enable = true; - - # Security - security.gopass.enable = true; - security.gopass.ssh-agent.enable = true; - security.gopass.sync.enable = true; - security.gpg.enable = true; - security.gpg.backup.enable = true; - security.gpg-tui.enable = true; - security.ssh.enable = true; - - # System - system.brightnessctl.enable = true; - system.btop.enable = true; - system.deep-clean.enable = true; - system.htop.enable = true; - system.nix-update.enable = true; - system.nvtop.enable = true; - system.systemctl-tui.enable = true; - - # Terminal - terminal.bat.enable = true; - terminal.fzf.enable = true; - terminal.kitty.enable = true; - terminal.less.enable = true; - terminal.starship.enable = true; - terminal.tmux.enable = true; - terminal.zsh.enable = true; - - # Web - web.aria2.enable = true; - web.chawan.enable = true; - web.chromium.enable = true; - web.chromium.useOpenGL = false; - - programs.home-manager.enable = true; -} diff --git a/users/arpit/default.nix b/users/arpit/default.nix new file mode 100644 index 0000000..9348884 --- /dev/null +++ b/users/arpit/default.nix @@ -0,0 +1,100 @@ +# User-specific home-manager configuration +{ config, ... }: +{ + imports = [ + ./private.nix + ]; + + nixpkgs.config.allowUnfree = true; + + home.username = "arpit"; + home.homeDirectory = "/home/${config.home.username}"; + home.stateVersion = "25.05"; + + # Desktop environment + desktop.enable = true; + desktop.hardware.gpu = { + nvidia.enable = true; + amd.enable = true; + }; + + # Gaming + gaming.heroic.enable = true; + gaming.steam.enable = false; + + # Communication + communication.neomutt.enable = true; + + # Development + development.bruno.enable = true; + development.delta.enable = true; + development.git.enable = true; + development.git.signing.signByDefault = true; + development.lazygit.enable = true; + development.nixvim.enable = true; + development.opencode.enable = true; + development.qemu.enable = true; + development.vscodium.enable = true; + + # File Management + file-management.eza.enable = true; + file-management.ouch.enable = true; + file-management.usb.enable = true; + file-management.yazi.enable = true; + file-management.yazi.file-chooser.enable = true; + + # Media + media.swayimg.enable = true; + media.grim.enable = true; + media.pamixer.enable = true; + media.playerctl.enable = true; + media.slurp.enable = true; + media.vlc.enable = true; + media.wf-recorder.enable = true; + + # Networking + networking.impala.enable = true; + networking.bluetui.enable = true; + networking.usque.enable = true; + networking.usque.warp.enable = true; + + # Office + office.calcurse.enable = true; + office.calcurse.sync.enable = true; + office.zathura.enable = true; + + # Security + security.gopass.enable = true; + security.gopass.ssh-agent.enable = true; + security.gopass.sync.enable = true; + security.gpg.enable = true; + security.gpg.backup.enable = true; + security.gpg-tui.enable = true; + security.ssh.enable = true; + + # System + system.brightnessctl.enable = true; + system.btop.enable = true; + system.deep-clean.enable = true; + system.htop.enable = true; + system.nix-update.enable = true; + system.nvtop.enable = true; + system.systemctl-tui.enable = true; + + # Terminal + terminal.bat.enable = true; + terminal.fzf.enable = true; + terminal.kitty.enable = true; + terminal.less.enable = true; + terminal.starship.enable = true; + terminal.tmux.enable = true; + terminal.zsh.enable = true; + + # Web + web.aria2.enable = true; + web.chawan.enable = true; + web.chromium.enable = true; + web.chromium.useOpenGL = false; + + programs.home-manager.enable = true; +} diff --git a/users/arpit/private.example.nix b/users/arpit/private.example.nix new file mode 100644 index 0000000..77e5f54 --- /dev/null +++ b/users/arpit/private.example.nix @@ -0,0 +1,55 @@ +{ ... }: +{ + # Calcurse - Template for configuring calcurse, specially syncing + config.office.calcurse.sync = { + remote = "YOUR_REPOSITORY_URL"; + credential = { + username = "example"; + passwordGopassPath = "websites/github.com/example/tokens/calendar"; + }; + }; + + # Email - Template for configuring neomutt email accounts + config.communication.neomutt.accounts = { + "example@gmail.com" = { + realName = "Example User"; + address = "user@gmail.com"; + passwordGopassSecret = "mail/user@gmail.com"; + flavor = "gmail.com"; + primary = true; + neomutt.extraConfig = '' + set pgp_default_key = YOUR_GPG_KEY_FINGERPRINT + ''; + gpg = { + key = "YOUR_GPG_KEY_ID"; + signByDefault = true; + encryptByDefault = false; # set true only if you also want auto-encrypt + }; + }; + }; + + # Git - Template for configuring git identity and signing + config.development.git = { + username = "Your Name"; + email = "you@example.com"; + signing = { + key = "EXAMPLE_GPG_KEY_ID"; + signByDefault = true; + }; + }; + + # SSH keys to load from gopass (entries under ssh/ in the gopass store) + config.security.ssh.gopassKeys = [ + "github" + "gitlab" + ]; + + # Gopass - Template for configuring gopass, specially syncing + config.security.gopass.sync = { + remote = "YOUR_REPOSITORY_URL"; + credential = { + username = "example"; + passwordGopassPath = "websites/github.com/example/tokens/calendar"; + }; + }; +} -- cgit v1.2.3