dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit a6808736ca8b0c03d64dadb6bd424fcf5b2388fb parent 506a4a49037552f9bd20848d1c0ad8ce5623efe8 Author: maydayv7 <maydayv7@gmail.com> Date: Thu, 5 Oct 2023 11:22:23 +0530 fix: Improve `nix-index` Also persist `Games` directory
Diffstat:
| M | README.md | | | 5 | ++--- |
| M | configuration.nix | | | 2 | +- |
| M | flake.lock | | | 21 | +++++++++++++++++++++ |
| M | flake.nix | | | 6 | ++++++ |
| M | modules/apps/wine.nix | | | 1 | + |
| M | modules/nix/index.nix | | | 29 | ++++------------------------- |
| M | modules/shell/bash.nix | | | 6 | ------ |
| M | modules/shell/default.nix | | | 2 | +- |
| M | modules/shell/zsh.nix | | | 6 | ------ |
9 files changed, 36 insertions(+), 42 deletions(-)
diff --git a/README.md b/README.md @@ -94,7 +94,7 @@ github:maydayv7/dotfiles │ └───website: development environment 'Website' ├───files: 'dotfiles' and program configuration ├───formatter -│ └───x86_64-linux: package 'treefmt-0.4.1' +│ └───x86_64-linux: package 'treefmt' ├───installMedia: device install media ├───legacyPackages │ └───x86_64-linux: omitted (use '--legacy' to show) @@ -119,7 +119,6 @@ github:maydayv7/dotfiles │ └───miscellaneous: Nixpkgs overlay ├───packages │ └───x86_64-linux -│ ├───adw-gtk3: package 'adw-gtk3-v4.2' │ ├───dotfiles: package 'Dotfiles-v12.0' │ ├───fonts: package 'fonts-7' │ ├───nixos: package 'nixos' @@ -173,7 +172,7 @@ github:maydayv7/dotfiles - `configuration.nix`: main system configuration file - `flake.nix`: repository version control using `inputs` - `.version`: system state version -- [`.templates`](./templates/README.md): custom Flakes configuration templates +- `.templates`: custom Flakes configuration templates - [`files`](./files/README.md): `dotfiles` and program configuration - [`secrets`](./secrets/README.md): authentication credentials management using [`sops-nix`](https://github.com/Mic92/sops-nix) - `shells`: sand-boxed shells for development purposes diff --git a/configuration.nix b/configuration.nix @@ -55,7 +55,7 @@ in # Channels channels = { - stable = (build.channel stable [] ./packages/patches)."${system}"; + stable = (build.channel stable [deploy.overlay] ./packages/patches)."${system}"; unstable = (build.channel unstable [nur.overlay] [])."${system}"; wine = wine.packages."${system}"; gaming = gaming.packages."${system}"; diff --git a/flake.lock b/flake.lock @@ -256,6 +256,26 @@ "type": "github" } }, + "index": { + "inputs": { + "nixpkgs": [ + "stable" + ] + }, + "locked": { + "lastModified": 1696131323, + "narHash": "sha256-Y47r8Jo+9rs+XUWHcDPZtkQs6wFeZ24L4CQTfVwE+vY=", + "owner": "Mic92", + "repo": "nix-index-database", + "rev": "031d4b22505fdea47bd53bfafad517cd03c26a4f", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-index-database", + "type": "github" + } + }, "library": { "locked": { "lastModified": 1694911725, @@ -412,6 +432,7 @@ "hooks": "hooks", "ignore": "ignore", "impermanence": "impermanence", + "index": "index", "library": "library", "nur": "nur", "sops": "sops", diff --git a/flake.nix b/flake.nix @@ -112,6 +112,12 @@ # System Image Generators generators.url = "github:nix-community/nixos-generators"; + # Nix Index Database + index = { + url = "github:Mic92/nix-index-database"; + inputs.nixpkgs.follows = "stable"; + }; + # Pre-Commit Hooks hooks = { url = "github:cachix/pre-commit-hooks.nix"; diff --git a/modules/apps/wine.nix b/modules/apps/wine.nix @@ -25,6 +25,7 @@ in { # Utilities user.persist.directories = [ + "Games" ".cache/lutris" ".config/lutris" ".config/notepad++" diff --git a/modules/nix/index.nix b/modules/nix/index.nix @@ -2,6 +2,7 @@ config, system, lib, + inputs, pkgs, ... }: { @@ -9,31 +10,9 @@ ## Package Indexer ## config = lib.mkIf config.nix.index { - user = { - persist.directories = [".cache/nix-index"]; - home = { - programs.nix-index.enable = true; - systemd.user = { - timers.nix-index = { - Unit.Description = "Nix Index Update Timer"; - Unit.RefuseManualStart = "no"; - Timer.OnCalendar = "weekly"; - Timer.Persistent = true; - Timer.Unit = "nix-index.service"; - Install.WantedBy = ["timers.target"]; - }; - - services.nix-index = { - Unit.Description = "Nix Index Updater"; - Unit.After = ["network.target"]; - Install.WantedBy = ["default.target"]; - Service.TimeoutSec = 0; - Service.ExecStart = '' - /bin/sh -c "if [ -s ~/.cache/nix-index ]; then ${pkgs.coreutils}/bin/mkdir -p ~/.cache/nix-index; fi && ${pkgs.wget}/bin/wget -q -N https://github.com/Mic92/nix-index-database/releases/latest/download/index-${system} -P ~/.cache/nix-index && ${pkgs.coreutils}/bin/ln -f ~/.cache/nix-index/index-${system} ~/.cache/nix-index/files" - ''; - }; - }; - }; + user.home = { + imports = [inputs.index.hmModules.nix-index]; + programs.nix-index-database.comma.enable = true; }; }; } diff --git a/modules/shell/bash.nix b/modules/shell/bash.nix @@ -62,12 +62,6 @@ in { historyIgnore = ["rm" "pkill"]; historyControl = ["erasedups" "ignoredups" "ignorespace"]; }; - - # Command Not Found Integration - programs.nix-index.enableBashIntegration = true; - - # DirENV Integration - programs.direnv.enableBashIntegration = true; }) settings; }; diff --git a/modules/shell/default.nix b/modules/shell/default.nix @@ -60,7 +60,7 @@ with {inherit (lib) mkEnableOption mkIf mkMerge util;}; { programs = { # DirENV Support direnv = { - enable = true; + enable = true; # Load Shell Variables from '.envrc' nix-direnv.enable = true; }; diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix @@ -88,12 +88,6 @@ in { # Prompt home.file.".p10k.zsh".text = zsh.prompt; - - # Command Not Found Integration - programs.nix-index.enableZshIntegration = true; - - # DirENV Integration - programs.direnv.enableZshIntegration = true; }) settings; };