aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarpitchakladar <arpitchakladar@gmail.com>2026-09-09 19:42:48 +0530
committerarpitchakladar <arpitchakladar@gmail.com>2026-09-09 19:42:48 +0530
commit7879122dfc8e7ca7b905e10d5f55df09f9051295 (patch)
treee57194d5efb8d67f569549790e847684de03614c
parent140394b7ab67124f186358a4471164cb4a1ae967 (diff)
downloadhome-manager-config-7879122dfc8e7ca7b905e10d5f55df09f9051295.tar.gz
home-manager-config-7879122dfc8e7ca7b905e10d5f55df09f9051295.zip
feat(users/arpit)!: moved modules/private to user specific config
BREAKING CHANGES: modules/private isn't used anymore
-rw-r--r--.gitignore5
-rw-r--r--flake.nix7
-rw-r--r--modules/private/calcurse.example.nix13
-rw-r--r--modules/private/email.example.nix23
-rw-r--r--modules/private/git.example.nix20
-rw-r--r--modules/private/gopass.example.nix13
-rw-r--r--modules/system/nix-update/nix-update.sh10
-rw-r--r--users/arpit/default.nix (renamed from users/arpit.nix)5
-rw-r--r--users/arpit/private.example.nix55
9 files changed, 65 insertions, 86 deletions
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/default.nix
index 837d2bf..9348884 100644
--- a/users/arpit.nix
+++ b/users/arpit/default.nix
@@ -2,10 +2,7 @@
{ config, ... }:
{
imports = [
- ../modules/private/calcurse.nix
- ../modules/private/email.nix
- ../modules/private/git.nix
- ../modules/private/gopass.nix
+ ./private.nix
];
nixpkgs.config.allowUnfree = 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";
+ };
+ };
+}