dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 2e30eb2fc5bb24d6caace533fa44079370791492 parent 04e0918a51b09157c05129bc390dbd9984e9072f Author: maydayv7 <maydayv7@gmail.com> Date: Wed, 21 Jan 2026 18:02:57 +0530 feat: Update `impermanence` setup `user.persist` -> `home.persist`
Diffstat:
| M | CHANGELOG.md | | | 1 | + |
| M | README.md | | | 1 | - |
| M | devices/valkyrie/settings/default.nix | | | 47 | +++++++++++++++++++++++------------------------ |
| M | files/flake.nix | | | 6 | +++--- |
| M | flake.lock | | | 15 | +++++++++++---- |
| M | flake.nix | | | 8 | +++++++- |
| M | modules/README.md | | | 1 | - |
| M | modules/apps/discord.nix | | | 132 | +++++++++++++++++++++++++++++++++++++++---------------------------------------- |
| M | modules/apps/firefox.nix | | | 188 | +++++++++++++++++++++++++++++++++++++++---------------------------------------- |
| M | modules/apps/flatpak.nix | | | 2 | +- |
| M | modules/apps/games/default.nix | | | 6 | +++--- |
| M | modules/apps/games/minecraft.nix | | | 2 | +- |
| M | modules/apps/games/osu.nix | | | 2 | +- |
| M | modules/apps/git/default.nix | | | 242 | ++++++++++++++++++++++++++++++++++++++++---------------------------------------- |
| M | modules/apps/internet.nix | | | 2 | +- |
| M | modules/apps/latex.nix | | | 6 | +++--- |
| M | modules/apps/notes.nix | | | 4 | ++-- |
| M | modules/apps/office.nix | | | 48 | ++++++++++++++++++++++++------------------------ |
| M | modules/apps/spotify.nix | | | 46 | ++++++++++++++++++++++------------------------ |
| M | modules/apps/stream.nix | | | 2 | +- |
| M | modules/apps/tools.nix | | | 24 | +++++++++++------------- |
| M | modules/apps/vscode/default.nix | | | 116 | +++++++++++++++++++++++++++++++++++++++---------------------------------------- |
| M | modules/apps/wine.nix | | | 2 | +- |
| M | modules/apps/youtube.nix | | | 4 | ++-- |
| M | modules/base/firmware.nix | | | 2 | +- |
| M | modules/gui/default.nix | | | 6 | +++--- |
| M | modules/gui/desktop/_shared/files.nix | | | 166 | +++++++++++++++++++++++++++++++++++++++---------------------------------------- |
| M | modules/gui/desktop/_shared/media.nix | | | 38 | ++++++++++++++++++-------------------- |
| M | modules/gui/desktop/_shared/notify.nix | | | 2 | +- |
| M | modules/gui/desktop/_shared/text.nix | | | 68 | ++++++++++++++++++++++++++++++++++---------------------------------- |
| M | modules/gui/desktop/gnome/default.nix | | | 48 | +++++++++++++++++++++--------------------------- |
| M | modules/gui/desktop/gnome/settings/extensions.nix | | | 8 | ++++++++ |
| M | modules/gui/desktop/hyprland/apps/launcher.nix | | | 110 | +++++++++++++++++++++++++++++++++++++++---------------------------------------- |
| M | modules/gui/desktop/hyprland/apps/utilities.nix | | | 76 | ++++++++++++++++++++++++++++++++++++++-------------------------------------- |
| M | modules/gui/desktop/hyprland/default.nix | | | 6 | +++--- |
| M | modules/gui/desktop/niri/apps/launcher.nix | | | 28 | ++++++++++++++-------------- |
| M | modules/gui/desktop/pantheon/default.nix | | | 24 | ++++++++++++------------ |
| M | modules/gui/gtk.nix | | | 46 | +++++++++++++++++++++++----------------------- |
| M | modules/hardware/README.md | | | 3 | ++- |
| M | modules/hardware/filesystem.nix | | | 203 | +++++++++++++++++++++++++++++++++++++------------------------------------------ |
| M | modules/hardware/virtualisation/android.nix | | | 2 | +- |
| M | modules/hardware/virtualisation/default.nix | | | 19 | +++++++++++-------- |
| M | modules/nix/default.nix | | | 2 | +- |
| M | modules/nix/tools.nix | | | 2 | +- |
| D | modules/shell/bash.nix | | | 42 | ------------------------------------------ |
| M | modules/shell/default.nix | | | 8 | ++++---- |
| A | modules/shell/list/bash.nix | | | 42 | ++++++++++++++++++++++++++++++++++++++++++ |
| A | modules/shell/list/zsh.nix | | | 58 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| D | modules/shell/zsh.nix | | | 58 | ---------------------------------------------------------- |
| M | modules/user/default.nix | | | 3 | +-- |
| M | users/default.nix | | | 7 | +------ |
| M | users/navya.nix | | | 6 | +----- |
| M | users/v7/default.nix | | | 16 | ++++++++++++---- |
| R | files/images/Profile.png -> users/v7/profile.png | | | 0 |
54 files changed, 997 insertions(+), 1009 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -2,6 +2,7 @@ ### January +- Update `impermanence` setup (`user.persist` -> `home.persist`) - Update Hyprland to v0.53 - Update mimetypes - Refactor `apps` diff --git a/README.md b/README.md @@ -463,7 +463,6 @@ The system `config` can be accessed using the `sys` parameter in `home-manager` - Remove `pkgs.custom.copyous` after [merge](https://github.com/NixOS/nixpkgs/pull/469919) - Update Niri Configuration after [merge](https://github.com/sodiboo/niri-flake/pull/1548) - Update `minecraft` after [merge](https://github.com/Infinidoge/nix-minecraft/pull/161) -- Update `impermanence` after [upstream](https://github.com/nix-community/impermanence) stabilizes </details> diff --git a/devices/valkyrie/settings/default.nix b/devices/valkyrie/settings/default.nix @@ -34,33 +34,32 @@ in auraConfigs."19b6".text = builtins.readFile ./aura.ron; }; - user = { - persist.directories = [ ".config/rog" ]; - homeConfig = { - wayland.windowManager.hyprland.settings.bindl = mkIf (hasPrefix "hyprland" config.gui.desktop) [ - ", XF86Launch3, exec, asusctl led-mode -n" - ", XF86Launch4, exec, asusctl profile -n" - ]; + user.homeConfig = { + home.persist.directories = [ ".config/rog" ]; - dconf.settings = mkIf (hasPrefix "gnome" config.gui.desktop) { - "org/gnome/settings-daemon/plugins/media-keys" = { - custom-keybindings = [ - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/" - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/" - ]; - }; + wayland.windowManager.hyprland.settings.bindl = mkIf (hasPrefix "hyprland" config.gui.desktop) [ + ", XF86Launch3, exec, asusctl led-mode -n" + ", XF86Launch4, exec, asusctl profile -n" + ]; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3" = { - binding = "Launch3"; - command = "asusctl led-mode -n"; - name = "Keyboard Mode"; - }; + dconf.settings = mkIf (hasPrefix "gnome" config.gui.desktop) { + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = [ + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/" + ]; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3" = { + binding = "Launch3"; + command = "asusctl led-mode -n"; + name = "Keyboard Mode"; + }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4" = { - binding = "Launch4"; - command = "asusctl profile -n"; - name = "Fan Control"; - }; + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4" = { + binding = "Launch4"; + command = "asusctl profile -n"; + name = "Fan Control"; }; }; }; diff --git a/files/flake.nix b/files/flake.nix @@ -100,9 +100,9 @@ }; # Pictures - images = { - profile = ./images/Profile.png; - transparent = ./images/transparent.png; + images = map.files { + directory = ./images; + extension = ".png"; }; # Logseq Notes diff --git a/flake.lock b/flake.lock @@ -1320,17 +1320,24 @@ } }, "impermanence": { + "inputs": { + "home-manager": [ + "home" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, "locked": { - "lastModified": 1737831083, - "narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=", + "lastModified": 1768941735, + "narHash": "sha256-OyxsfXNcOkt06/kM+4bnuC8moDx+t7Qr+RB0BBa83Ig=", "owner": "nix-community", "repo": "impermanence", - "rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170", + "rev": "69ecf31e8fddc9354a4b418f3a517445d486bb54", "type": "github" }, "original": { "owner": "nix-community", - "ref": "home-manager-v1", "repo": "impermanence", "type": "github" } diff --git a/flake.nix b/flake.nix @@ -120,7 +120,13 @@ }; # Filesystem State Handler - impermanence.url = "github:nix-community/impermanence?ref=home-manager-v1"; + impermanence = { + url = "github:nix-community/impermanence"; + inputs = { + nixpkgs.follows = "nixpkgs"; + home-manager.follows = "home"; + }; + }; # Nix Index Database index = { diff --git a/modules/README.md b/modules/README.md @@ -83,7 +83,6 @@ Configuration [Builder](./configuration.nix) - [`user`](./user): Module that controls User Creation and Security Settings - - `groups`: Additional User Groups - Ex. `[ "wheel" ]` - - `persist`: User Files to Preserve across Reboots (while using `advanced` File System Layout) - `homeConfig`: Shared User Home Configuration (Alias for `home-manager.users.${username}`) - - `credentials`: Individual User Credentials - - `name`: Alternative (Work) User Name diff --git a/modules/apps/discord.nix b/modules/apps/discord.nix @@ -13,77 +13,75 @@ in ## Discord Configuration ## config = lib.mkIf enable { environment.systemPackages = [ package ]; - user = { - persist.directories = [ ".config/vesktop" ]; - homeConfig = { - imports = [ inputs.nixcord.homeModules.nixcord ]; - programs.nixcord = { + user.homeConfig = { + imports = [ inputs.nixcord.homeModules.nixcord ]; + home.persist.directories = [ ".config/vesktop" ]; + programs.nixcord = { + enable = true; + discord.enable = false; + vesktop = { enable = true; - discord.enable = false; - vesktop = { - enable = true; - inherit package; - }; + inherit package; + }; - config = { - # Theming - useQuickCss = true; - frameless = false; - transparent = false; + config = { + # Theming + useQuickCss = true; + frameless = false; + transparent = false; - # Vencord Plugins - plugins = { - betterFolders = { - enable = true; - showFolderIcon = 2; - closeAllHomeButton = true; - }; - betterGifAltText.enable = true; - betterGifPicker.enable = true; - betterRoleContext.enable = true; - betterSessions.enable = true; - betterSettings.enable = true; - biggerStreamPreview.enable = true; - BlurNSFW.enable = true; - copyEmojiMarkdown.enable = true; - copyFileContents.enable = true; - CopyUserURLs.enable = true; - crashHandler.enable = true; - decor.enable = true; - expressionCloner.enable = true; - favoriteEmojiFirst.enable = true; - favoriteGifSearch.enable = true; - fixImagesQuality.enable = true; - fixSpotifyEmbeds.enable = true; - friendsSince.enable = true; - fullSearchContext.enable = true; - imageZoom.enable = true; - memberCount.enable = true; - mentionAvatars.enable = true; - messageClickActions.enable = true; - messageLinkEmbeds.enable = true; - PinDMs.enable = true; - platformIndicators.enable = true; - previewMessage.enable = true; - quickMention.enable = true; - readAllNotificationsButton.enable = true; - relationshipNotifier.enable = true; - replyTimestamp.enable = true; - serverInfo.enable = true; - serverListIndicators.enable = true; - showHiddenChannels.enable = true; - showHiddenThings.enable = true; - showMeYourName.enable = true; - showTimeoutDuration.enable = true; - typingTweaks.enable = true; - validUser.enable = true; - voiceChatDoubleClick.enable = true; - voiceDownload.enable = true; - voiceMessages.enable = true; - volumeBooster.enable = true; - webKeybinds.enable = true; - webScreenShareFixes.enable = true; + # Vencord Plugins + plugins = { + betterFolders = { + enable = true; + showFolderIcon = 2; + closeAllHomeButton = true; }; + betterGifAltText.enable = true; + betterGifPicker.enable = true; + betterRoleContext.enable = true; + betterSessions.enable = true; + betterSettings.enable = true; + biggerStreamPreview.enable = true; + BlurNSFW.enable = true; + copyEmojiMarkdown.enable = true; + copyFileContents.enable = true; + CopyUserURLs.enable = true; + crashHandler.enable = true; + decor.enable = true; + expressionCloner.enable = true; + favoriteEmojiFirst.enable = true; + favoriteGifSearch.enable = true; + fixImagesQuality.enable = true; + fixSpotifyEmbeds.enable = true; + friendsSince.enable = true; + fullSearchContext.enable = true; + imageZoom.enable = true; + memberCount.enable = true; + mentionAvatars.enable = true; + messageClickActions.enable = true; + messageLinkEmbeds.enable = true; + PinDMs.enable = true; + platformIndicators.enable = true; + previewMessage.enable = true; + quickMention.enable = true; + readAllNotificationsButton.enable = true; + relationshipNotifier.enable = true; + replyTimestamp.enable = true; + serverInfo.enable = true; + serverListIndicators.enable = true; + showHiddenChannels.enable = true; + showHiddenThings.enable = true; + showMeYourName.enable = true; + showTimeoutDuration.enable = true; + typingTweaks.enable = true; + validUser.enable = true; + voiceChatDoubleClick.enable = true; + voiceDownload.enable = true; + voiceMessages.enable = true; + volumeBooster.enable = true; + webKeybinds.enable = true; + webScreenShareFixes.enable = true; }; }; }; diff --git a/modules/apps/firefox.nix b/modules/apps/firefox.nix @@ -17,115 +17,113 @@ in sessionVariables."MOZ_USE_XINPUT2" = "1"; }; - user = { - persist.directories = [ + user.homeConfig = { + xdg.mimeApps.defaultApplications = util.build.mime { + browser = [ "firefox.desktop" ]; + }; + + home.persist.directories = [ ".cache/mozilla/firefox" ".mozilla/firefox" ]; - homeConfig = { - xdg.mimeApps.defaultApplications = util.build.mime { - browser = [ "firefox.desktop" ]; - }; - - programs.firefox = { - enable = true; - inherit package; - policies = { - # Policies - DisableTelemetry = true; - DisableFirefoxStudies = true; - DisablePocket = true; - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; + programs.firefox = { + enable = true; + inherit package; + policies = { + # Policies + DisableTelemetry = true; + DisableFirefoxStudies = true; + DisablePocket = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; - # Extensions - ExtensionSettings = - let - extension = shortId: uuid: { - name = uuid; - value = { - installation_mode = "normal_installed"; - install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; - }; + # Extensions + ExtensionSettings = + let + extension = shortId: uuid: { + name = uuid; + value = { + installation_mode = "normal_installed"; + install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; }; - in - builtins.listToAttrs [ - (extension "clearurls" "{74145f27-f039-47ce-a470-a662b129930a}") - (extension "setupvpn" "@setupvpncom") - (extension "stylus" "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}") - (extension "tabliss" "extension@tabliss.io") - (extension "uaswitcher" "user-agent-switcher@ninetailed.ninja") - (extension "ublock-origin" "uBlock0@raymondhill.net") - ]; - }; + }; + in + builtins.listToAttrs [ + (extension "clearurls" "{74145f27-f039-47ce-a470-a662b129930a}") + (extension "setupvpn" "@setupvpncom") + (extension "stylus" "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}") + (extension "tabliss" "extension@tabliss.io") + (extension "uaswitcher" "user-agent-switcher@ninetailed.ninja") + (extension "ublock-origin" "uBlock0@raymondhill.net") + ]; + }; - profiles.default = { - isDefault = true; - containersForce = true; - settings = { - ## Flags - # General - "browser.disableResetPrompt" = true; - "browser.onboarding.enabled" = false; - "browser.aboutConfig.showWarning" = false; - "browser.shell.checkDefaultBrowser" = false; - "browser.sessionstore.interval" = "1800000"; - "browser.toolbars.bookmarks.visibility" = "always"; - "browser.urlbar.showSearchSuggestionsFirst" = false; - "browser.urlbar.speculativeConnect.enabled" = false; - "browser.urlbar.dnsResolveSingleWordsAfterSearch" = 0; + profiles.default = { + isDefault = true; + containersForce = true; + settings = { + ## Flags + # General + "browser.disableResetPrompt" = true; + "browser.onboarding.enabled" = false; + "browser.aboutConfig.showWarning" = false; + "browser.shell.checkDefaultBrowser" = false; + "browser.sessionstore.interval" = "1800000"; + "browser.toolbars.bookmarks.visibility" = "always"; + "browser.urlbar.showSearchSuggestionsFirst" = false; + "browser.urlbar.speculativeConnect.enabled" = false; + "browser.urlbar.dnsResolveSingleWordsAfterSearch" = 0; - # Features - "browser.search.openintab" = true; - "layout.spellcheckDefault" = 2; + # Features + "browser.search.openintab" = true; + "layout.spellcheckDefault" = 2; - # New Tab - "browser.newtabpage.activity-stream.feeds.section.highlights" = false; - "browser.newtabpage.activity-stream.feeds.section.topstories" = false; - "browser.newtabpage.activity-stream.feeds.topsites" = false; - "browser.newtabpage.activity-stream.showSearch" = true; - "browser.newtabpage.activity-stream.showSponsored" = false; - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; - "browser.newtabpage.activity-stream.feeds.section.highlights.includePocket" = false; + # New Tab + "browser.newtabpage.activity-stream.feeds.section.highlights" = false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.feeds.topsites" = false; + "browser.newtabpage.activity-stream.showSearch" = true; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; + "browser.newtabpage.activity-stream.feeds.section.highlights.includePocket" = false; - # Theming - "browser.uidensity" = 0; - "devtools.theme" = "dark"; - "layers.acceleration.force-enabled" = true; - "mozilla.widget.use-argb-visuals" = true; - "svg.context-properties.content.enabled" = true; - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + # Theming + "browser.uidensity" = 0; + "devtools.theme" = "dark"; + "layers.acceleration.force-enabled" = true; + "mozilla.widget.use-argb-visuals" = true; + "svg.context-properties.content.enabled" = true; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - # Passwords - "signon.autofillForms" = false; - "signon.rememberSignons" = false; - "signon.generation.enabled" = false; - "signon.management.page.breach-alerts.enabled" = false; + # Passwords + "signon.autofillForms" = false; + "signon.rememberSignons" = false; + "signon.generation.enabled" = false; + "signon.management.page.breach-alerts.enabled" = false; - # Extensions - "extensions.pocket.enabled" = false; - "extensions.htmlaboutaddons.inline-options.enabled" = false; - "extensions.htmlaboutaddons.recommendations.enabled" = false; + # Extensions + "extensions.pocket.enabled" = false; + "extensions.htmlaboutaddons.inline-options.enabled" = false; + "extensions.htmlaboutaddons.recommendations.enabled" = false; - # Security - "security.family_safety.mode" = 0; - "security.pki.sha1_enforcement_level" = 1; - "security.tls.enable_0rtt_data" = false; + # Security + "security.family_safety.mode" = 0; + "security.pki.sha1_enforcement_level" = 1; + "security.tls.enable_0rtt_data" = false; - # Reports - "breakpad.reportURL" = ""; - "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; - "browser.tabs.crashReporting.sendReport" = false; - "datareporting.healthreport.service.enabled" = false; - "datareporting.healthreport.uploadEnabled" = false; - "datareporting.policy.dataSubmissionEnabled" = false; - }; + # Reports + "breakpad.reportURL" = ""; + "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; + "browser.tabs.crashReporting.sendReport" = false; + "datareporting.healthreport.service.enabled" = false; + "datareporting.healthreport.uploadEnabled" = false; + "datareporting.policy.dataSubmissionEnabled" = false; }; }; }; diff --git a/modules/apps/flatpak.nix b/modules/apps/flatpak.nix @@ -26,7 +26,7 @@ in system.activationScripts.updateDesktopDatabase.text = "${pkgs.desktop-file-utils}/bin/update-desktop-database /var/lib/flatpak/exports/share/applications"; environment.persist.directories = [ "/var/lib/flatpak" ]; - user.persist.directories = [ + user.homeConfig.home.persist.directories = [ ".cache/flatpak" ".local/share/flatpak" ".var/app" diff --git a/modules/apps/games/default.nix b/modules/apps/games/default.nix @@ -46,14 +46,14 @@ in gui.fancy = mkOverride 999 false; programs.gamemode.enable = true; # Use 'gamemoderun %command%' - user = { + user.homeConfig = { # Runner - homeConfig.xdg.dataFile."lutris/runners/wine/wine-system" = mkIf wine { + xdg.dataFile."lutris/runners/wine/wine-system" = mkIf wine { source = config.apps.wine.package; }; # Directories - persist.directories = [ + home.persist.directories = [ "Games" ".local/share/bottles" diff --git a/modules/apps/games/minecraft.nix b/modules/apps/games/minecraft.nix @@ -8,6 +8,6 @@ ## Minecraft ## config = lib.mkIf (builtins.elem "minecraft" config.apps.games) { environment.systemPackages = [ pkgs.prismlauncher ]; - user.persist.directories = [ ".local/share/PrismLauncher" ]; + user.homeConfig.home.persist.directories = [ ".local/share/PrismLauncher" ]; }; } diff --git a/modules/apps/games/osu.nix b/modules/apps/games/osu.nix @@ -8,6 +8,6 @@ ## OSU! ## config = lib.mkIf (builtins.elem "osu" config.apps.games) { environment.systemPackages = [ pkgs.osu-lazer-bin ]; - user.persist.directories = [ ".local/share/osu" ]; + user.homeConfig.home.persist.directories = [ ".local/share/osu" ]; }; } diff --git a/modules/apps/git/default.nix b/modules/apps/git/default.nix @@ -24,142 +24,142 @@ ]; # Settings - user = { - persist.directories = [ - ".git-hooks" - ".config/gh" - ]; + user.homeConfig = { + imports = [ ./user.nix ]; - homeConfig = { - imports = [ ./user.nix ]; + home = { + persist.directories = [ + ".git-hooks" + ".config/gh" + ]; # Hooks - home.file.".git-hooks" = { + file.".git-hooks" = { source = files.git.hooks; recursive = true; }; + }; - # GitHub CLI - programs = { - gh = { - enable = true; - gitCredentialHelper.enable = true; - settings = { - prompt = "enabled"; - git_protocol = "https"; - aliases = rec { - a = "alias list"; - b = "browse"; - cfg = "config"; - ci = "run"; - co = "${p} checkout"; - g = "gpg-key"; - i = "issue"; - ic = "${i} close"; - is = "${i} status"; - iv = "${i} view"; - p = "pr"; - pm = "${p} merge"; - pv = "${p} view"; - r = "repo"; - rd = "${rl} download"; - rl = "release"; - rv = "${rl} view"; - s = "secret"; - w = "workflow"; - }; + # GitHub CLI + programs = { + gh = { + enable = true; + gitCredentialHelper.enable = true; + settings = { + prompt = "enabled"; + git_protocol = "https"; + aliases = rec { + a = "alias list"; + b = "browse"; + cfg = "config"; + ci = "run"; + co = "${p} checkout"; + g = "gpg-key"; + i = "issue"; + ic = "${i} close"; + is = "${i} status"; + iv = "${i} view"; + p = "pr"; + pm = "${p} merge"; + pv = "${p} view"; + r = "repo"; + rd = "${rl} download"; + rl = "release"; + rv = "${rl} view"; + s = "secret"; + w = "workflow"; }; }; + }; - # Pager - delta = { - enable = true; - enableGitIntegration = true; - options = { - line-numbers = true; - theme = "Monokai Extended"; - conflictstyle = "diff3"; - }; + # Pager + delta = { + enable = true; + enableGitIntegration = true; + options = { + line-numbers = true; + theme = "Monokai Extended"; + conflictstyle = "diff3"; }; + }; - # 'git' Settings - git = { - enable = true; - lfs.enable = true; + # 'git' Settings + git = { + enable = true; + lfs.enable = true; - # Globally Ignored Files - ignores = [ - "*~*" - "*.bak" - ".direnv" - ".vscode" - "result" - "result-*" - "tags.*" - ]; + # Globally Ignored Files + ignores = [ + "*~*" + "*.bak" + ".direnv" + ".vscode" + "result" + "result-*" + "tags.*" + ]; - settings = { - color.ui = "auto"; - core.hooksPath = "~/.git-hooks"; - credential.helper = [ "libsecret" ]; - diff.colorMoved = "default"; - init.defaultBranch = "main"; - pull.rebase = "true"; - safe.directory = files.path.system; + settings = { + color.ui = "auto"; + core.hooksPath = "~/.git-hooks"; + credential.helper = [ "libsecret" ]; + diff.colorMoved = "default"; + init.defaultBranch = "main"; + pull.rebase = "true"; + safe.directory = files.path.system; - # Command Aliases - alias = rec { - a = "add"; - ad = "${a} -A ."; - ai = "${a} -i"; - ap = "${a} -p"; - b = "branch"; - bc = "${b} --show-current"; - bd = "${b} -D"; - backup = ''!sh -c 'CURRENT=$(git ${bc}) && git ${st} && git ${co} -B backup && git ${st} apply && git ${ad} && git ${cam} "backup" && git ${pf} $1 && git ${co} $CURRENT && git ${stp} && git ${bd} backup' -''; - cfg = "config"; - ci = "commit -v"; - cam = "${ci} -am"; - cia = "${ci} -a"; - cmx = ''!sh -c 'msg=$(cat ./.git/COMMIT_EDITMSG); echo "''${msg%%#*}"' -''; - co = "checkout"; - cp = "cherry-pick"; - cpp = "!sh -c 'CURRENT=$(git ${bc}) && git ${st} && git ${co} -B $2 $3 && git ${cp} $1 && git ${pf} $4 && git ${co} $CURRENT && git ${stp}' -"; - d = "diff"; - df = "${d} HEAD"; - dx = "${d} --color-words"; - dc = "${d} --cached"; - dcx = "${dc} --color-words"; - l = "log --graph --decorate --abbrev-commit"; - l1 = "${l} --pretty=oneline --all"; - lf = "log -p --follow"; - lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n' --abbrev-commit --date=relative --branches"; - ll = "${l} -p"; - m = "merge"; - ms = "${m} --squash"; - p = "push"; - pf = "${p} --force"; - pl = "!sh -c 'git pull && git fetch -p' -"; - pt = "${p} --tag"; - pu = "${p} --set-upstream"; - rb = "rebase"; - record = "!sh -c '(git ${a} -p -- $@ && git ${ci}) || git ${r}' --"; - ro = "restore"; - r = "reset"; - rs = "${r} --soft"; - rh = "${r} --hard"; - rsh = "${rs} HEAD^"; - s = "!git --no-pager status"; - sm = "submodule"; - st = "stash"; - std = "${st} drop"; - sti = "${st} --keep-index"; - stp = "${st} pop"; - sync = "${pf} --mirror"; - t = "tag"; - td = "!sh -c 'git ${t} -d $1 && git ${p} origin :$1' -"; - tl = "${t} -l"; - }; + # Command Aliases + alias = rec { + a = "add"; + ad = "${a} -A ."; + ai = "${a} -i"; + ap = "${a} -p"; + b = "branch"; + bc = "${b} --show-current"; + bd = "${b} -D"; + backup = ''!sh -c 'CURRENT=$(git ${bc}) && git ${st} && git ${co} -B backup && git ${st} apply && git ${ad} && git ${cam} "backup" && git ${pf} $1 && git ${co} $CURRENT && git ${stp} && git ${bd} backup' -''; + cfg = "config"; + ci = "commit -v"; + cam = "${ci} -am"; + cia = "${ci} -a"; + cmx = ''!sh -c 'msg=$(cat ./.git/COMMIT_EDITMSG); echo "''${msg%%#*}"' -''; + co = "checkout"; + cp = "cherry-pick"; + cpp = "!sh -c 'CURRENT=$(git ${bc}) && git ${st} && git ${co} -B $2 $3 && git ${cp} $1 && git ${pf} $4 && git ${co} $CURRENT && git ${stp}' -"; + d = "diff"; + df = "${d} HEAD"; + dx = "${d} --color-words"; + dc = "${d} --cached"; + dcx = "${dc} --color-words"; + l = "log --graph --decorate --abbrev-commit"; + l1 = "${l} --pretty=oneline --all"; + lf = "log -p --follow"; + lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n' --abbrev-commit --date=relative --branches"; + ll = "${l} -p"; + m = "merge"; + ms = "${m} --squash"; + p = "push"; + pf = "${p} --force"; + pl = "!sh -c 'git pull && git fetch -p' -"; + pt = "${p} --tag"; + pu = "${p} --set-upstream"; + rb = "rebase"; + record = "!sh -c '(git ${a} -p -- $@ && git ${ci}) || git ${r}' --"; + ro = "restore"; + r = "reset"; + rs = "${r} --soft"; + rh = "${r} --hard"; + rsh = "${rs} HEAD^"; + s = "!git --no-pager status"; + sm = "submodule"; + st = "stash"; + std = "${st} drop"; + sti = "${st} --keep-index"; + stp = "${st} pop"; + sync = "${pf} --mirror"; + t = "tag"; + td = "!sh -c 'git ${t} -d $1 && git ${p} origin :$1' -"; + tl = "${t} -l"; }; }; }; diff --git a/modules/apps/internet.nix b/modules/apps/internet.nix @@ -34,7 +34,7 @@ in zoom-us ]; - user.persist = { + user.homeConfig.home.persist = { files = [ ".config/zoomus.conf" ]; directories = [ ".config/BraveSoftware" diff --git a/modules/apps/latex.nix b/modules/apps/latex.nix @@ -16,9 +16,9 @@ in setzer ]; - user = { - persist.directories = [ ".config/setzer" ]; - homeConfig.xdg.mimeApps.defaultApplications = util.build.mime { + user.homeConfig = { + home.persist.directories = [ ".config/setzer" ]; + xdg.mimeApps.defaultApplications = util.build.mime { latex = [ "org.cvfosammmm.Setzer.desktop" ]; }; }; diff --git a/modules/apps/notes.nix b/modules/apps/notes.nix @@ -27,13 +27,13 @@ in config = mkIf enable { environment.systemPackages = [ pkgs.logseq ]; - user = { + user.homeConfig.home = { persist.directories = [ ".logseq" ".config/Logseq" ]; - homeConfig.home.file = + file = with files.logseq; { ".config/logseq/configs.edn".text = ''{:window/native-titlebar? true}''; diff --git a/modules/apps/office.nix b/modules/apps/office.nix @@ -43,34 +43,34 @@ in ]; }; - user = { - persist = { - files = [ ".config/gscan2pdfrc" ]; - directories = [ - ".calibre" - ".config/calibre" - ".config/GIMP" - ".cache/gimp" - ".config/inkscape" - ".config/keepassxc" - ".cache/keepassxc" - ".config/libreoffice" - ".config/onlyoffice" - ".local/share/onlyoffice" - ".local/share/data" - ]; + user.homeConfig = { + xdg.mimeApps.defaultApplications = util.build.mime { + office = [ "onlyoffice-desktopeditors.desktop" ]; + password = [ "org.keepassxc.KeePassXC.desktop" ]; }; - homeConfig = { - xdg.mimeApps.defaultApplications = util.build.mime { - office = [ "onlyoffice-desktopeditors.desktop" ]; - password = [ "org.keepassxc.KeePassXC.desktop" ]; - }; + # Password Manager + programs.keepassxc.enable = true; - # Password Manager - programs.keepassxc.enable = true; + home = { + persist = { + files = [ ".config/gscan2pdfrc" ]; + directories = [ + ".calibre" + ".config/calibre" + ".config/GIMP" + ".cache/gimp" + ".config/inkscape" + ".config/keepassxc" + ".cache/keepassxc" + ".config/libreoffice" + ".config/onlyoffice" + ".local/share/onlyoffice" + ".local/share/data" + ]; + }; - home.file = { + file = { # Document Templates "Templates" = rec { source = files.templates; diff --git a/modules/apps/spotify.nix b/modules/apps/spotify.nix @@ -17,37 +17,35 @@ in spicetify-cli ]; - user = { - persist.directories = [ + user.homeConfig = { + imports = [ inputs.spicetify.homeManagerModules.default ]; + home.persist.directories = [ ".config/spotify" ".cache/spotify" ".cache/spot" ]; - homeConfig = { - imports = [ inputs.spicetify.homeManagerModules.default ]; - programs.spicetify = { - enable = true; + programs.spicetify = { + enable = true; - # Player Improvements - enabledCustomApps = with pkgs.spicetify.apps; [ - betterLibrary - localFiles - newReleases - ]; + # Player Improvements + enabledCustomApps = with pkgs.spicetify.apps; [ + betterLibrary + localFiles + newReleases + ]; - enabledExtensions = with pkgs.spicetify.extensions; [ - beautifulLyrics - goToSong - history - loopyLoop - playNext - popupLyrics - seekSong - showQueueDuration - volumePercentage - ]; - }; + enabledExtensions = with pkgs.spicetify.extensions; [ + beautifulLyrics + goToSong + history + loopyLoop + playNext + popupLyrics + seekSong + showQueueDuration + volumePercentage + ]; }; }; }; diff --git a/modules/apps/stream.nix b/modules/apps/stream.nix @@ -11,7 +11,7 @@ in ## Streaming Configuration ## config = lib.mkIf enable { environment.systemPackages = [ pkgs.stremio-linux-shell ]; - user.persist.directories = [ + user.homeConfig.home.persist.directories = [ ".stremio-server" ".local/share/stremio" ]; diff --git a/modules/apps/tools.nix b/modules/apps/tools.nix @@ -38,8 +38,17 @@ in ]; }; - user = { - persist = { + user.homeConfig = { + # AppImage Manager + dconf.settings."it/mijorus/gearlever".appimages-default-folder = "~/.appimages"; + xdg.mimeApps.defaultApplications = util.build.mime { + appimage = [ "it.mijorus.gearlever.desktop" ]; + }; + + # Audio Effects + services.easyeffects.enable = true; + + home.persist = { files = [ ".config/rncbc.org/qpwgraph" ]; directories = [ ".appimages" @@ -48,17 +57,6 @@ in ".config/pitivi" ]; }; - - homeConfig = { - # AppImage Manager - dconf.settings."it/mijorus/gearlever".appimages-default-folder = "~/.appimages"; - xdg.mimeApps.defaultApplications = util.build.mime { - appimage = [ "it.mijorus.gearlever.desktop" ]; - }; - - # Audio Effects - services.easyeffects.enable = true; - }; }; }; } diff --git a/modules/apps/vscode/default.nix b/modules/apps/vscode/default.nix @@ -20,75 +20,73 @@ in pkgs.nil ]; - user = { - persist.directories = [ + user.homeConfig = { + # Mutable Configuration File + imports = [ ./mutable.nix ]; + + # Environment + xdg.mimeApps.defaultApplications = util.build.mime { + code = [ "code.desktop" ]; + markdown = [ "code.desktop" ]; + text = [ "code.desktop" ]; + }; + + home.persist.directories = [ ".config/Code" ".vscode" ]; - homeConfig = { - # Mutable Configuration File - imports = [ ./mutable.nix ]; - - # Environment - xdg.mimeApps.defaultApplications = util.build.mime { - code = [ "code.desktop" ]; - markdown = [ "code.desktop" ]; - text = [ "code.desktop" ]; - }; - - programs.vscode = { - enable = true; - inherit package; - profiles.default = with files.vscode; { - # Keyboard Shortcuts - inherit keybindings; + programs.vscode = { + enable = true; + inherit package; + profiles.default = with files.vscode; { + # Keyboard Shortcuts + inherit keybindings; - # Settings - userSettings = settings // { - "editor.fontFamily" = "'${font}', 'monospace', monospace"; - }; + # Settings + userSettings = settings // { + "editor.fontFamily" = "'${font}', 'monospace', monospace"; + }; - ## Editor Extensions - extensions = - with pkgs.vscode-extensions; - [ - aaron-bond.better-comments # Annotations - editorconfig.editorconfig # .editorconfig - esbenp.prettier-vscode # Formatter - file-icons.file-icons # File Icons - naumovs.color-highlight # Color Viewer - johnpapa.vscode-peacock # Workspace Color + ## Editor Extensions + extensions = + with pkgs.vscode-extensions; + [ + aaron-bond.better-comments # Annotations + editorconfig.editorconfig # .editorconfig + esbenp.prettier-vscode # Formatter + file-icons.file-icons # File Icons + naumovs.color-highlight # Color Viewer + johnpapa.vscode-peacock # Workspace Color - # Git - eamodio.gitlens - github.vscode-pull-request-github + # Git + eamodio.gitlens + github.vscode-pull-request-github - github.copilot # Copilot AI - dart-code.flutter # Flutter - divyanshuagrawal.competitive-programming-helper # CP - jnoortheen.nix-ide # Nix - ms-python.python # Python - ms-vscode.cpptools # C/C++ - redhat.java # Java - rust-lang.rust-analyzer # Rust - tomoki1207.pdf # PDF Viewer - yzhang.markdown-all-in-one # Markdown + github.copilot # Copilot AI + dart-code.flutter # Flutter + divyanshuagrawal.competitive-programming-helper # CP + jnoortheen.nix-ide # Nix + ms-python.python # Python + ms-vscode.cpptools # C/C++ + redhat.java # Java + rust-lang.rust-analyzer # Rust + tomoki1207.pdf # PDF Viewer + yzhang.markdown-all-in-one # Markdown - # HTML+CSS+XML - ecmel.vscode-html-css - formulahendry.auto-rename-tag - redhat.vscode-xml + # HTML+CSS+XML + ecmel.vscode-html-css + formulahendry.auto-rename-tag + redhat.vscode-xml - # JS - dbaeumer.vscode-eslint - ritwickdey.liveserver - ] - ++ (with pkgs.vscode-marketplace; [ - kisstkondoros.vscode-gutter-preview # Image Preview - fwcd.kotlin # Kotlin - ]); - }; + # JS + dbaeumer.vscode-eslint + ritwickdey.liveserver + ] + ++ (with pkgs.vscode-marketplace; [ + kisstkondoros.vscode-gutter-preview # Image Preview + fwcd.kotlin # Kotlin + ]); }; }; }; diff --git a/modules/apps/wine.nix b/modules/apps/wine.nix @@ -37,7 +37,7 @@ in hardware.graphics.enable32Bit = true; # Utilities - user.persist.directories = [ + user.homeConfig.home.persist.directories = [ ".wine" ".cache/wine" ".cache/winetricks" diff --git a/modules/apps/youtube.nix b/modules/apps/youtube.nix @@ -31,14 +31,14 @@ in yt-dlp ]; - user = { + user.homeConfig.home = { persist.directories = [ ".config/YouTube Music" ".config/youtube-tui" ".local/share/youtube-tui" ]; - homeConfig.home.file.".config/YouTube Music/config.json" = { + file.".config/YouTube Music/config.json" = { text = replaceStrings [ "@theme" ] diff --git a/modules/base/firmware.nix b/modules/base/firmware.nix @@ -82,7 +82,7 @@ in }; # Persisted Files - user.persist.directories = [ + user.homeConfig.home.persist.directories = [ { directory = ".gnupg"; mode = "0700"; diff --git a/modules/gui/default.nix b/modules/gui/default.nix @@ -54,13 +54,13 @@ in seahorse.enable = true; }; - user = { - persist.directories = [ + user.homeConfig = { + home.persist.directories = [ ".config/autostart" ".local/share/gvfs-metadata" ]; - homeConfig.services = { + services = { poweralertd.enable = true; # Power alerts mpris-proxy.enable = true; # Audio devices }; diff --git a/modules/gui/desktop/_shared/files.nix b/modules/gui/desktop/_shared/files.nix @@ -33,99 +33,97 @@ in lxqt.pcmanfm-qt ]); - user = { - persist.directories = [ - ".config/nemo" - ".local/share/nemo" - ".config/pcmanfm-qt" - ]; + user.homeConfig = { + xdg.mimeApps.defaultApplications = util.build.mime { + archive = [ "org.gnome.FileRoller.desktop" ]; + directory = [ "nemo.desktop" ]; + }; + + # Settings + dconf.settings = { + "org/gtk/gtk4/settings/file-chooser".sort-directories-first = true; + "org/nemo/search".search-reverse-sort = false; + "org/nemo/desktop".show-desktop-icons = false; + "org/nemo/plugins".disabled-actions = [ "change-background.nemo_action" ]; + "org/nemo/icon-view".captions = [ + "size" + "type" + "date_modified" + ]; - homeConfig = { - xdg.mimeApps.defaultApplications = util.build.mime { - archive = [ "org.gnome.FileRoller.desktop" ]; - directory = [ "nemo.desktop" ]; + "org/nemo/preferences" = { + click-policy = "double"; + date-format = "informal"; + inherit-folder-viewer = true; + quick-renames-with-pause-in-between = true; + show-advanced-permissions = true; + show-new-folder-icon-toolbar = false; + show-show-thumbnails-toolbar = true; + tooltips-in-icon-view = true; + tooltips-in-list-view = false; + tooltips-show-access-date = true; + tooltips-show-birth-date = true; + tooltips-show-file-type = true; + tooltips-show-mod-date = true; }; - # Settings - dconf.settings = { - "org/gtk/gtk4/settings/file-chooser".sort-directories-first = true; - "org/nemo/search".search-reverse-sort = false; - "org/nemo/desktop".show-desktop-icons = false; - "org/nemo/plugins".disabled-actions = [ "change-background.nemo_action" ]; - "org/nemo/icon-view".captions = [ - "size" - "type" - "date_modified" - ]; + "org/nemo/preferences/menu-config" = { + background-menu-open-in-terminal = false; + selection-menu-open-in-terminal = false; + }; + }; - "org/nemo/preferences" = { - click-policy = "double"; - date-format = "informal"; - inherit-folder-viewer = true; - quick-renames-with-pause-in-between = true; - show-advanced-permissions = true; - show-new-folder-icon-toolbar = false; - show-show-thumbnails-toolbar = true; - tooltips-in-icon-view = true; - tooltips-in-list-view = false; - tooltips-show-access-date = true; - tooltips-show-birth-date = true; - tooltips-show-file-type = true; - tooltips-show-mod-date = true; - }; + home = { + persist.directories = [ + ".config/nemo" + ".local/share/nemo" + ".config/pcmanfm-qt" + ]; - "org/nemo/preferences/menu-config" = { - background-menu-open-in-terminal = false; - selection-menu-open-in-terminal = false; - }; - }; + # Bulk Renamer + activation.nemo-rename = hm.dag.entryAfter [ "writeBoundary" ] '' + if [[ -v DBUS_SESSION_BUS_ADDRESS ]] + then + export DCONF_DBUS_RUN_SESSION="" + else + export DCONF_DBUS_RUN_SESSION="${getExe' pkgs.dbus "dbus-run-session"} --dbus-daemon=${getExe' pkgs.dbus "dbus-daemon"}" + fi - home = { - # Bulk Renamer - activation.nemo-rename = hm.dag.entryAfter [ "writeBoundary" ] '' - if [[ -v DBUS_SESSION_BUS_ADDRESS ]] - then - export DCONF_DBUS_RUN_SESSION="" - else - export DCONF_DBUS_RUN_SESSION="${getExe' pkgs.dbus "dbus-run-session"} --dbus-daemon=${getExe' pkgs.dbus "dbus-daemon"}" - fi + run $DCONF_DBUS_RUN_SESSION ${getExe pkgs.dconf} write /org/nemo/preferences/bulk-rename-tool "b'bulky'" + unset DCONF_DBUS_RUN_SESSION + ''; - run $DCONF_DBUS_RUN_SESSION ${getExe pkgs.dconf} write /org/nemo/preferences/bulk-rename-tool "b'bulky'" - unset DCONF_DBUS_RUN_SESSION + file = { + # Open in Terminal + ".local/share/nemo/actions/terminal.nemo_action".text = '' + [Nemo Action] + Name=Open in Terminal + Comment=Opens ${terminal} in the selected folder + Exec=${terminal} --working-directory=%F + Icon-Name=${terminal} + Selection=any + Extensions=dir; + EscapeSpaces=true ''; - file = { - # Open in Terminal - ".local/share/nemo/actions/terminal.nemo_action".text = '' - [Nemo Action] - Name=Open in Terminal - Comment=Opens ${terminal} in the selected folder - Exec=${terminal} --working-directory=%F - Icon-Name=${terminal} - Selection=any - Extensions=dir; - EscapeSpaces=true - ''; - - # Desktop Icons - ".config/pcmanfm-qt/default/settings.conf".text = - replaceStrings - [ - "@icon" - "@font" - "@terminal" - "@wallpaper" - "@archiver" - ] - [ - icons.name - config.stylix.fonts.sansSerif.name - terminal - (builtins.toString files.images.transparent) - "file-roller" - ] - files.pcmanfm; - }; + # Desktop Icons + ".config/pcmanfm-qt/default/settings.conf".text = + replaceStrings + [ + "@icon" + "@font" + "@terminal" + "@wallpaper" + "@archiver" + ] + [ + icons.name + config.stylix.fonts.sansSerif.name + terminal + (builtins.toString files.images.transparent) + "file-roller" + ] + files.pcmanfm; }; }; }; diff --git a/modules/gui/desktop/_shared/media.nix b/modules/gui/desktop/_shared/media.nix @@ -17,9 +17,19 @@ transmission_4-gtk ]; - user = { + user.homeConfig = { + # Default Applications + xdg.mimeApps.defaultApplications = util.build.mime { + audio = [ "org.gnome.Lollypop.desktop" ]; + document = [ "org.gnome.Papers.desktop" ]; + image = [ "org.gnome.Shotwell-Viewer.desktop" ]; + magnet = [ "transmission-gtk.desktop" ]; + pdf = [ "org.gnome.Papers.desktop" ]; + video = [ "io.github.celluloid_player.Celluloid.desktop" ]; + }; + # Persisted Files - persist.directories = [ + home.persist.directories = [ ".config/mpv" ".config/shotwell" ".local/share/lollypop" @@ -27,24 +37,12 @@ ".cache/shotwell" ]; - homeConfig = { - # Default Applications - xdg.mimeApps.defaultApplications = util.build.mime { - audio = [ "org.gnome.Lollypop.desktop" ]; - document = [ "org.gnome.Papers.desktop" ]; - image = [ "org.gnome.Shotwell-Viewer.desktop" ]; - magnet = [ "transmission-gtk.desktop" ]; - pdf = [ "org.gnome.Papers.desktop" ]; - video = [ "io.github.celluloid_player.Celluloid.desktop" ]; - }; - - # Media Player - services.playerctld.enable = true; - programs.mpv = { - enable = true; - defaultProfiles = [ "gpu-hq" ]; - scripts = [ pkgs.mpvScripts.mpris ]; - }; + # Media Player + services.playerctld.enable = true; + programs.mpv = { + enable = true; + defaultProfiles = [ "gpu-hq" ]; + scripts = [ pkgs.mpvScripts.mpris ]; }; }; }; diff --git a/modules/gui/desktop/_shared/notify.nix b/modules/gui/desktop/_shared/notify.nix @@ -12,9 +12,9 @@ in ## Notifications Configuration config = mkIf config._shared.enable { # Phone Connect - user.persist.directories = [ ".config/kdeconnect" ]; programs.kdeconnect.enable = true; user.homeConfig = { + home.persist.directories = [ ".config/kdeconnect" ]; services.kdeconnect = { enable = true; indicator = true; diff --git a/modules/gui/desktop/_shared/text.nix b/modules/gui/desktop/_shared/text.nix @@ -13,49 +13,49 @@ in ## Text Configuration config = lib.mkIf enable { environment.systemPackages = [ pkgs.geany ]; - user = { - persist.directories = [ - ".config/clipse" - ".config/geany" - ]; + user.homeConfig = { + # Text Editor + xdg.mimeApps.defaultApplications = util.build.mime { + markdown = [ "geany.desktop" ]; + text = [ "geany.desktop" ]; + }; - homeConfig = { - # Text Editor - xdg.mimeApps.defaultApplications = util.build.mime { - markdown = [ "geany.desktop" ]; - text = [ "geany.desktop" ]; - }; + home = { + persist.directories = [ + ".config/clipse" + ".config/geany" + ]; - home.file = with files.geany; { + file = with files.geany; { ".config/geany/geany.conf".text = settings; ".config/geany/keybindings.conf".text = keybindings; ".config/geany/colorschemes/theme.conf".source = with theme; "${pkgs.custom.geany-catppuccin}/share/geany/colorschemes/${name}-${variant}.conf"; }; + }; - # Clipboard Manager - services.clipse = { - enable = true; - allowDuplicates = false; - historySize = 150; - imageDisplay.type = "kitty"; - theme = with config.lib.stylix.colors; { - useCustomTheme = true; - DimmedDesc = "#${base07}"; - DimmedTitle = "#${base07}"; - FilteredMatch = "#${base08}"; - NormalTitle = "#${base08}"; - NormalDesc = "#${base0B}"; - SelectedDesc = "#${base0D}"; - SelectedTitle = "#${base0D}"; - SelectedBorder = "#${base0D}"; - SelectedDescBorder = "#${base0D}"; - TitleFore = "#${base05}"; - Titleback = "#${base01}"; - StatusMsg = "#${base0E}"; - PinIndicatorColor = "#${base0F}"; - }; + # Clipboard Manager + services.clipse = { + enable = true; + allowDuplicates = false; + historySize = 150; + imageDisplay.type = "kitty"; + theme = with config.lib.stylix.colors; { + useCustomTheme = true; + DimmedDesc = "#${base07}"; + DimmedTitle = "#${base07}"; + FilteredMatch = "#${base08}"; + NormalTitle = "#${base08}"; + NormalDesc = "#${base0B}"; + SelectedDesc = "#${base0D}"; + SelectedTitle = "#${base0D}"; + SelectedBorder = "#${base0D}"; + SelectedDescBorder = "#${base0D}"; + TitleFore = "#${base05}"; + Titleback = "#${base01}"; + StatusMsg = "#${base0E}"; + PinIndicatorColor = "#${base0F}"; }; }; }; diff --git a/modules/gui/desktop/gnome/default.nix b/modules/gui/desktop/gnome/default.nix @@ -125,33 +125,6 @@ in gnuchess ]; - ## Persisted Files - user.persist.directories = [ - # Apps - ".config/evolution" - ".config/ghostty" - ".config/gnome-boxes" - ".config/gnome-builder" - ".local/share/epiphany" - ".local/share/evolution" - ".local/share/geary" - ".local/share/gnome-boxes" - ".local/share/gnome-builder" - ".local/share/lollypop" - ".local/share/nautilus" - ".local/share/sounds" - ".local/share/telepathy" - ".local/share/webkitgtk" - ".cache/evolution" - ".cache/fractal" - ".cache/gnome-builder" - - # Extensions - ".cache/copyous@boerdereinar.dev" - ".config/copyous@boerdereinar.dev" - ".local/share/copyous@boerdereinar.dev" - ]; - user.homeConfig = { ## Desktop Settings imports = [ ./settings ]; @@ -178,6 +151,27 @@ in virtualization = [ "org.gnome.Boxes.desktop" ]; }; + # Persisted Files + home.persist.directories = [ + ".config/evolution" + ".config/ghostty" + ".config/gnome-boxes" + ".config/gnome-builder" + ".local/share/epiphany" + ".local/share/evolution" + ".local/share/geary" + ".local/share/gnome-boxes" + ".local/share/gnome-builder" + ".local/share/lollypop" + ".local/share/nautilus" + ".local/share/sounds" + ".local/share/telepathy" + ".local/share/webkitgtk" + ".cache/evolution" + ".cache/fractal" + ".cache/gnome-builder" + ]; + ## Terminal programs.ghostty = { enable = true; diff --git a/modules/gui/desktop/gnome/settings/extensions.nix b/modules/gui/desktop/gnome/settings/extensions.nix @@ -587,5 +587,13 @@ in home = { packages = [ pkgs.dconf2nix ] ++ builtins.map (ext: ext.package) extensions; file.".config/guillotine.json".source = files.gnome.menu; # Action Menu + persist.directories = [ + ".local/share/gnome-shell/extensions" + + # Clipboard + ".cache/copyous@boerdereinar.dev" + ".config/copyous@boerdereinar.dev" + ".local/share/copyous@boerdereinar.dev" + ]; }; } diff --git a/modules/gui/desktop/hyprland/apps/launcher.nix b/modules/gui/desktop/hyprland/apps/launcher.nix @@ -7,75 +7,73 @@ }: { ## Launcher Configuration - user = { - persist.directories = [ + user.homeConfig = { + imports = [ inputs.hyprshell.homeModules.default ]; + home.persist.directories = [ ".local/share/hyprshell" ".cache/hyprshell" ]; - homeConfig = { - imports = [ inputs.hyprshell.homeModules.default ]; - programs.hyprshell = { + programs.hyprshell = { + enable = true; + systemd.enable = true; + styleFile = util.build.theme { + inherit (config.lib.stylix) colors; + file = files.hyprland.hyprshell; + }; + + settings.windows = { enable = true; - systemd.enable = true; - styleFile = util.build.theme { - inherit (config.lib.stylix) colors; - file = files.hyprland.hyprshell; - }; + scale = 9.0; + items_per_row = 3; - settings.windows = { + overview = { enable = true; - scale = 9.0; - items_per_row = 3; + modifier = "super"; + key = "tab"; - overview = { - enable = true; - modifier = "super"; - key = "tab"; - - launcher = { - launch_modifier = "alt"; - default_terminal = "kitty"; - width = 700; - max_items = 4; - show_when_empty = true; - plugins = { - applications = { - run_cache_weeks = 4; - show_execs = true; - show_actions_submenu = true; - }; - calc.enable = true; - path.enable = true; - terminal.enable = true; - websearch.engines = [ - { - url = "https://www.google.com/search?q={}"; - name = "Google"; - key = "g"; - } - { - url = "https://en.wikipedia.org/wiki/Special:Search?search={}"; - name = "Wikipedia"; - key = "w"; - } - ]; + launcher = { + launch_modifier = "alt"; + default_terminal = "kitty"; + width = 700; + max_items = 4; + show_when_empty = true; + plugins = { + applications = { + run_cache_weeks = 4; + show_execs = true; + show_actions_submenu = true; }; + calc.enable = true; + path.enable = true; + terminal.enable = true; + websearch.engines = [ + { + url = "https://www.google.com/search?q={}"; + name = "Google"; + key = "g"; + } + { + url = "https://en.wikipedia.org/wiki/Special:Search?search={}"; + name = "Wikipedia"; + key = "w"; + } + ]; }; }; + }; - switch = { - enable = true; - modifier = "alt"; - filter_by = [ "current_workspace" ]; - }; + switch = { + enable = true; + modifier = "alt"; + filter_by = [ "current_workspace" ]; + }; - switch_2 = { - enable = true; - modifier = "alt"; - key = "grave"; - filter_by = [ "same_class" ]; - }; + switch_2 = { + enable = true; + modifier = "alt"; + key = "grave"; + filter_by = [ "same_class" ]; }; }; }; diff --git a/modules/gui/desktop/hyprland/apps/utilities.nix b/modules/gui/desktop/hyprland/apps/utilities.nix @@ -28,50 +28,50 @@ in waycorner ]; - user = { - persist.directories = [ ".config/nwg-displays" ]; - homeConfig = { - services = { - # Wallpaper Daemon - hyprpaper = { - enable = true; - settings = { - ipc = false; - splash = true; - }; + user.homeConfig = { + services = { + # Wallpaper Daemon + hyprpaper = { + enable = true; + settings = { + ipc = false; + splash = true; }; + }; - # Display Temperature - hyprsunset = { - enable = true; - extraArgs = [ "--identity" ]; - settings.profile = [ - { - time = "7:00"; - temperature = 6000; - } - { - time = "19:00"; - temperature = 4500; - } - ]; - }; + # Display Temperature + hyprsunset = { + enable = true; + extraArgs = [ "--identity" ]; + settings.profile = [ + { + time = "7:00"; + temperature = 6000; + } + { + time = "19:00"; + temperature = 4500; + } + ]; }; + }; - systemd.user.services.waycorner = - let - target = [ "graphical-session.target" ]; - in - { - Install.WantedBy = target; - Unit = { - Description = "Hot Corners"; - After = target; - }; - Service.ExecStart = getExe pkgs.waycorner; + systemd.user.services.waycorner = + let + target = [ "graphical-session.target" ]; + in + { + Install.WantedBy = target; + Unit = { + Description = "Hot Corners"; + After = target; }; + Service.ExecStart = getExe pkgs.waycorner; + }; - home.file = with files.hyprland; { + home = { + persist.directories = [ ".config/nwg-displays" ]; + file = with files.hyprland; { # Application Drawer ".config/nwg-drawer/drawer.css".text = drawer; diff --git a/modules/gui/desktop/hyprland/default.nix b/modules/gui/desktop/hyprland/default.nix @@ -54,9 +54,9 @@ in # Settings _shared.enable = true; - user = { - persist.directories = [ ".config/hypr" ]; - homeConfig.imports = [ ./settings ]; + user.homeConfig = { + imports = [ ./settings ]; + home.persist.directories = [ ".config/hypr" ]; }; } ] diff --git a/modules/gui/desktop/niri/apps/launcher.nix b/modules/gui/desktop/niri/apps/launcher.nix @@ -7,21 +7,21 @@ }: { ## Launcher Configuration - user = { - persist.directories = [ ".cache/rofi" ]; - homeConfig = { - programs.rofi = { - enable = true; - package = pkgs.rofi; - configPath = ".config/rofi/main.rasi"; - plugins = with pkgs; [ - rofi-calc - rofi-emoji - ]; - }; + user.homeConfig = { + programs.rofi = { + enable = true; + package = pkgs.rofi; + configPath = ".config/rofi/main.rasi"; + plugins = with pkgs; [ + rofi-calc + rofi-emoji + ]; + }; - stylix.targets.rofi.enable = true; - home.file.".config/rofi/config.rasi".text = util.build.theme { + stylix.targets.rofi.enable = true; + home = { + persist.directories = [ ".cache/rofi" ]; + file.".config/rofi/config.rasi".text = util.build.theme { inherit (config.lib.stylix) colors; file = files.niri.rofi; }; diff --git a/modules/gui/desktop/pantheon/default.nix b/modules/gui/desktop/pantheon/default.nix @@ -67,18 +67,6 @@ in pantheon-tweaks ]; - # Persisted Files - user.persist.directories = [ - ".config/evolution" - ".local/share/contractor" - ".local/share/evolution" - ".local/share/Emote" - ".local/share/io.elementary.code" - ".local/share/io.elementary.photos" - ".cache/evolution" - ".cache/io.elementary.appcenter" - ]; - user.homeConfig = { ## Desktop Settings imports = [ ./settings.nix ]; @@ -118,6 +106,18 @@ in }; home = { + # Persisted Files + persist.directories = [ + ".config/evolution" + ".local/share/contractor" + ".local/share/evolution" + ".local/share/Emote" + ".local/share/io.elementary.code" + ".local/share/io.elementary.photos" + ".cache/evolution" + ".cache/io.elementary.appcenter" + ]; + file = { # Firefox Elementary Theme ".mozilla/firefox/default/chrome/userChrome.css".source = diff --git a/modules/gui/gtk.nix b/modules/gui/gtk.nix @@ -44,36 +44,36 @@ in # Desktop Integration programs.gnupg.agent.pinentryPackage = pkgs.pinentry-gtk2; - user = { - # Configuration - persist.directories = [ - ".config/dconf" - ".config/gtk-3.0" - ".config/gtk-4.0" - ]; + user.homeConfig = { + home = { + # Configuration + persist.directories = [ + ".config/dconf" + ".config/gtk-3.0" + ".config/gtk-4.0" + ]; - homeConfig = { # Bookmarks - home.file.".config/gtk-3.0/bookmarks" = { + file.".config/gtk-3.0/bookmarks" = { text = files.bookmarks; force = true; }; + }; - # Theming - stylix.targets.gtk.enable = false; - dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; - gtk = { - enable = true; - inherit (cfg) theme; - cursorTheme = config.gui.cursors; - font = with config.stylix.fonts; { - inherit (sansSerif) package name; - size = sizes.applications; - }; - - gtk3.extraConfig.gtk-application-prefer-dark-theme = 1; - gtk4.extraConfig.gtk-application-prefer-dark-theme = 1; + # Theming + stylix.targets.gtk.enable = false; + dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; + gtk = { + enable = true; + inherit (cfg) theme; + cursorTheme = config.gui.cursors; + font = with config.stylix.fonts; { + inherit (sansSerif) package name; + size = sizes.applications; }; + + gtk3.extraConfig.gtk-application-prefer-dark-theme = 1; + gtk4.extraConfig.gtk-application-prefer-dark-theme = 1; }; }; }; diff --git a/modules/hardware/README.md b/modules/hardware/README.md @@ -19,7 +19,8 @@ The system may be set up using either a `simple` or `advanced` filesystem scheme #### Data Storage -All important, persisted user files are stored at `/data`, while persisted system files are stored at `/nix/state`. Personal files and media are stored at `/data/files` +All important persisted files are stored at `/data` (declared using either `hardware.fs.persist`, or `home.persist` for user files), while persisted system files are stored at `/nix/state` (declared using `environment.persist`). +Personal files and media are stored at `/data/files` ### Virtualisation diff --git a/modules/hardware/filesystem.nix b/modules/hardware/filesystem.nix @@ -8,13 +8,13 @@ ... }: let - inherit (builtins) listToAttrs mapAttrs; + inherit (builtins) listToAttrs map; inherit (lib) filterAttrs + getExe hasPrefix - mkAfter mkAliasOptionModule - mkForce + mkDefault mkIf mkMerge mkOption @@ -35,31 +35,15 @@ in (mkAliasOptionModule [ "hardware" "fs" "persist" ] [ "environment" "persistence" files.path.data ]) ]; - options = with types; { - hardware.fs.scheme = mkOption { - description = "Disk Filesystem Scheme"; - type = nullOr (enum [ + options.hardware.fs.scheme = mkOption { + description = "Disk Filesystem Scheme"; + type = + with types; + nullOr (enum [ "simple" "advanced" ]); - default = null; - }; - - user.persist = { - files = mkOption { - description = "Additional User Files to Preserve"; - type = listOf str; - default = [ ]; - example = [ ".bash_history" ]; - }; - - directories = mkOption { - description = "Additional User Directories to Preserve"; - type = listOf (either str attrs); - default = [ ]; - example = [ "Downloads" ]; - }; - }; + default = null; }; config = mkMerge [ @@ -111,6 +95,14 @@ in }) ## Advanced File System Configuration using ZFS ## + { + environment.persist.enable = mkDefault false; + hardware.fs.persist.enable = mkDefault false; + user.homeConfig.imports = [ + (mkAliasOptionModule [ "home" "persist" ] [ "home" "persistence" files.path.data ]) + (_: { home.persist.enable = mkDefault false; }) + ]; + } (mkIf (scheme == "advanced") ( let rollback = '' @@ -138,10 +130,17 @@ in neededForBoot = true; }; } + # Early Boot Requirements // filterAttrs (name: _: hasPrefix "/etc" name) ( listToAttrs ( map ( - item: nameValuePair item.directory { neededForBoot = true; } + item: + nameValuePair item.directory { + device = "${files.path.persist}${item.directory}"; + fsType = "none"; + options = [ "bind" ]; + neededForBoot = true; + } ) config.environment.persist.directories ) ); @@ -172,50 +171,6 @@ in }; }; - # Debug - specialisation.recovery.configuration = { - boot.initrd = { - systemd.enable = mkForce false; - postResumeCommands = mkAfter rollback; - }; - }; - - # Persisted Files - environment.persistence = { - "${files.path.persist}" = { - files = [ "/etc/machine-id" ]; - directories = [ - files.path.system - "/var/log" - "/var/lib/AccountsService" - "/var/lib/nixos" - "/var/lib/systemd/coredump" - ]; - }; - - "${files.path.data}" = { - hideMounts = true; - users = mapAttrs (_: _: { - inherit (config.user.persist) files; - directories = [ - "Desktop" - "Documents" - "Downloads" - "Music" - "Pictures" - "Projects" - "Public" - "Videos" - { - directory = ".local/share/keyrings"; - mode = "0700"; - } - ] - ++ config.user.persist.directories; - }) config.user.settings; - }; - }; - # Maintainence services.zfs = { trim.enable = true; @@ -229,43 +184,77 @@ in }; }; - systemd.user.services.persist-trash = { - description = "Persist Trash Folder"; - wantedBy = [ "default.target" ]; - path = [ pkgs.coreutils ]; - serviceConfig = - let - run = - script: - "${ - pkgs.writeShellApplication { - name = "script"; - runtimeInputs = [ pkgs.coreutils ]; - text = '' - LOCAL="$HOME/.local/share/Trash" - PERSIST="${files.path.data}/home/$USER/Trash" - mkdir -p "$LOCAL" - ${script} - ''; - } - }/bin/script"; - in - { - Type = "oneshot"; - RemainAfterExit = true; - StandardOutput = "journal"; - ExecStart = run '' - if [ -d "$PERSIST" ] - then - cp -r "$PERSIST"/. "$LOCAL" - rm -rf "$PERSIST" - fi - ''; - ExecStop = run '' - mkdir -p "$PERSIST" - cp -r "$LOCAL"/. "$PERSIST" - ''; - }; + # Persisted Files + hardware.fs.persist.enable = true; + environment.persistence."${files.path.persist}" = { + enable = true; + files = [ "/etc/machine-id" ]; + directories = [ + files.path.system + "/var/log" + "/var/lib/AccountsService" + "/var/lib/nixos" + "/var/lib/systemd/coredump" + ]; + }; + + user.homeConfig = { + home.persistence."${files.path.data}" = { + enable = true; + allowTrash = true; + hideMounts = true; + directories = [ + "Desktop" + "Documents" + "Downloads" + "Music" + "Pictures" + "Public" + "Videos" + { + directory = ".local/share/keyrings"; + mode = "0700"; + } + ]; + }; + + systemd.user.services.persist-trash = { + Unit.Description = "Persist Trash Folder"; + Install.WantedBy = [ "default.target" ]; + Service = + let + run = + script: + getExe ( + pkgs.writeShellApplication { + name = "script"; + runtimeInputs = [ pkgs.coreutils ]; + text = '' + LOCAL="$HOME/.local/share/Trash" + PERSIST="${files.path.data}/home/$USER/Trash" + mkdir -p "$LOCAL" + ${script} + ''; + } + ); + in + { + Type = "oneshot"; + RemainAfterExit = true; + StandardOutput = "journal"; + ExecStart = run '' + if [ -d "$PERSIST" ] + then + cp -r "$PERSIST"/. "$LOCAL" + rm -rf "$PERSIST" + fi + ''; + ExecStop = run '' + mkdir -p "$PERSIST" + cp -r "$LOCAL"/. "$PERSIST" + ''; + }; + }; }; } )) diff --git a/modules/hardware/virtualisation/android.nix b/modules/hardware/virtualisation/android.nix @@ -31,7 +31,7 @@ in user = { groups = [ "android" ]; - persist.directories = [ ".local/share/waydroid" ]; + homeConfig.home.persist.directories = [ ".local/share/waydroid" ]; }; environment.persist.directories = [ diff --git a/modules/hardware/virtualisation/default.nix b/modules/hardware/virtualisation/default.nix @@ -16,15 +16,18 @@ in ## Virtualisation Settings ## config = lib.mkIf enable { # Environment Setup - user.groups = [ - "kvm" - "libvirtd" - ]; - user.persist.directories = [ - ".config/libvirt" - ".local/share/libvirt" - ]; environment.persist.directories = [ "/var/lib/libvirt" ]; + user = { + groups = [ + "kvm" + "libvirtd" + ]; + homeConfig.home.persist.directories = [ + ".config/libvirt" + ".local/share/libvirt" + ]; + }; + security.virtualisation.flushL1DataCache = "cond"; boot = { kernelModules = [ "kvm-${model}" ]; diff --git a/modules/nix/default.nix b/modules/nix/default.nix @@ -9,7 +9,7 @@ config = { # Settings - user.persist.directories = [ ".cache/nix" ]; + user.homeConfig.home.persist.directories = [ ".cache/nix" ]; nix = { # Version package = pkgs.nixFlakes; diff --git a/modules/nix/tools.nix b/modules/nix/tools.nix @@ -9,7 +9,7 @@ ## Nix Tools ## config = lib.mkIf config.nix.tools { - user.persist.directories = [ ".cache/manix" ]; + user.homeConfig.home.persist.directories = [ ".cache/manix" ]; nix.settings.system-features = [ "kvm" "big-parallel" diff --git a/modules/shell/bash.nix b/modules/shell/bash.nix @@ -1,42 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - inherit (builtins) any attrValues elem; - enable = any (value: elem "bash" value.shells) (attrValues config.user.settings); -in -{ - ## Bourne Shell Configuration ## - config = lib.mkIf enable { - # Shell Environment - environment.shells = [ pkgs.bashInteractive ]; - user.persist = { - files = [ ".bash_history" ]; - directories = [ ".local/share/bash" ]; - }; - - programs.bash = { - vteIntegration = true; - promptInit = '' - # Options - shopt -s autocd - shopt -s cdspell - shopt -s checkjobs - shopt -s checkwinsize - shopt -s cmdhist - shopt -s extglob - shopt -s globstar - shopt -s histappend - - # Command History - HISTCONTROL=erasedups:ignoredups:ignorespace - HISTFILESIZE=100000 - HISTIGNORE=rm:killall - HISTSIZE=100000 - ''; - }; - }; -} diff --git a/modules/shell/default.nix b/modules/shell/default.nix @@ -16,7 +16,7 @@ let in { ## SHELL Configuration ## - imports = modules.list ./.; + imports = modules.list ./. ++ modules.list ./list; options.shell.utilities = mkEnableOption "Enable Additional Shell Utilities"; @@ -125,8 +125,8 @@ in }; }; - user = { - persist = { + user.homeConfig = { + home.persist = { files = [ ".hstr_favorites" ]; directories = [ ".config/micro" @@ -134,7 +134,7 @@ in ]; }; - homeConfig.programs = { + programs = { btop.enable = true; # Resource Monitor hstr.enable = true; # Command History Browser diff --git a/modules/shell/list/bash.nix b/modules/shell/list/bash.nix @@ -0,0 +1,42 @@ +{ + config, + lib, + pkgs, + ... +}: +let + inherit (builtins) any attrValues elem; + enable = any (value: elem "bash" value.shells) (attrValues config.user.settings); +in +{ + ## Bourne Shell Configuration ## + config = lib.mkIf enable { + # Shell Environment + environment.shells = [ pkgs.bashInteractive ]; + user.homeConfig.home.persist = { + files = [ ".bash_history" ]; + directories = [ ".local/share/bash" ]; + }; + + programs.bash = { + vteIntegration = true; + promptInit = '' + # Options + shopt -s autocd + shopt -s cdspell + shopt -s checkjobs + shopt -s checkwinsize + shopt -s cmdhist + shopt -s extglob + shopt -s globstar + shopt -s histappend + + # Command History + HISTCONTROL=erasedups:ignoredups:ignorespace + HISTFILESIZE=100000 + HISTIGNORE=rm:killall + HISTSIZE=100000 + ''; + }; + }; +} diff --git a/modules/shell/list/zsh.nix b/modules/shell/list/zsh.nix @@ -0,0 +1,58 @@ +{ + config, + lib, + pkgs, + ... +}: +let + inherit (builtins) any attrValues elem; + enable = any (value: elem "zsh" value.shells) (attrValues config.user.settings); +in +{ + ## Z Shell Configuration ## + config = lib.mkIf enable { + # Shell Environment + programs.zsh = { + enable = true; + + # Features + autosuggestions.enable = true; + enableCompletion = false; + syntaxHighlighting.enable = true; + vteIntegration = true; + setOptions = [ + "autocd" + "EXTENDED_HISTORY" + "HIST_EXPIRE_DUPS_FIRST" + ]; + + # Keybindings + promptInit = '' + 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 '^J' backward-kill-line + ''; + + # Plugins + interactiveShellInit = '' + source ${pkgs.zsh-autopair}/share/zsh/zsh-autopair/autopair.zsh + ''; + }; + + system.userActivationScripts.zshrc = "touch .zshrc"; + user.homeConfig.home.persist = { + files = [ ".zsh_history" ]; + directories = [ ".cache/zsh" ]; + }; + }; +} diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix @@ -1,58 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - inherit (builtins) any attrValues elem; - enable = any (value: elem "zsh" value.shells) (attrValues config.user.settings); -in -{ - ## Z Shell Configuration ## - config = lib.mkIf enable { - # Shell Environment - programs.zsh = { - enable = true; - - # Features - autosuggestions.enable = true; - enableCompletion = false; - syntaxHighlighting.enable = true; - vteIntegration = true; - setOptions = [ - "autocd" - "EXTENDED_HISTORY" - "HIST_EXPIRE_DUPS_FIRST" - ]; - - # Keybindings - promptInit = '' - 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 '^J' backward-kill-line - ''; - - # Plugins - interactiveShellInit = '' - source ${pkgs.zsh-autopair}/share/zsh/zsh-autopair/autopair.zsh - ''; - }; - - system.userActivationScripts.zshrc = "touch .zshrc"; - user.persist = { - files = [ ".zsh_history" ]; - directories = [ ".cache/zsh" ]; - }; - }; -} diff --git a/modules/user/default.nix b/modules/user/default.nix @@ -25,7 +25,6 @@ let mkOption mkOptionType optionals - remove types ; @@ -97,7 +96,7 @@ in }; shells = mkOption { description = "List of Additional Supported Shells"; - type = listOf (enum (remove "prompt" (modules.name ../shell))); + type = listOf (enum (modules.name ../shell/list)); default = [ "bash" ]; }; homeConfig = mkOption { diff --git a/users/default.nix b/users/default.nix @@ -107,12 +107,7 @@ in publicShare = "$HOME/Public"; templates = "$HOME/Templates"; videos = "$HOME/Videos"; - - # Custom Directories - extraConfig = { - "XDG_PROJECTS_DIR" = "$HOME/Projects"; - "XDG_SCREENSHOTS_DIR" = "$HOME/Pictures/Screenshots"; - }; + extraConfig."XDG_SCREENSHOTS_DIR" = "$HOME/Pictures/Screenshots"; }; }; }; diff --git a/users/navya.nix b/users/navya.nix @@ -1,12 +1,8 @@ -{ files, ... }: -{ +_: { # Personal Credentials credentials = { fullname = "Navya G"; mail = "gnavya009@gmail.com"; key = "B141E0D9F711DD86DEAE1269D9B023AB01B68EFE"; }; - - # Profile Picture - home.file.".face".source = files.images.profile; } diff --git a/users/v7/default.nix b/users/v7/default.nix @@ -5,6 +5,9 @@ files, ... }: +let + homeDir = config.home.homeDirectory; +in { # Personal Credentials credentials = { @@ -17,21 +20,26 @@ # Home Configuration home = { packages = [ pkgs.home-manager ]; + persist.directories = [ + "TBD" + "Projects" + ]; # Directory Symlinks - file = with files; { + file = { # Profile Picture - ".face".source = images.profile; + ".face".source = ./profile.png; # Online Accounts ".config/goa-1.0/accounts.conf".text = builtins.readFile ./accounts.conf; # Dotfiles - "Projects/dotfiles".source = config.lib.file.mkOutOfStoreSymlink path.system; + "Projects/dotfiles".source = config.lib.file.mkOutOfStoreSymlink files.path.system; # GTK+ Bookmarks ".config/gtk-3.0/bookmarks".text = lib.mkBefore '' - file://${config.home.homeDirectory}/Projects Projects + file://${homeDir}/TBD TBD + file://${homeDir}/Projects Projects ''; }; }; diff --git a/files/images/Profile.png b/users/v7/profile.png Binary files differ.