dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 0b9d8cad1817d467054e82ed332427f53a1a4fb0 parent efd897b93763796391797a3d3d52afbb802b77f1 Author: maydayv7 <maydayv7@gmail.com> Date: Tue, 4 Jun 2024 10:13:12 +0530 feat: Make VS Code Configuration mutable Using https://gist.github.com/piousdeer/b29c272eaeba398b864da6abf6cb5daa
Diffstat:
| M | README.md | | | 3 | ++- |
| M | files/flake.nix | | | 14 | ++++++++++++++ |
| M | modules/apps/vscode.nix | | | 11 | ++++++++--- |
| M | modules/user/home.nix | | | 21 | +++++++++++++++++---- |
4 files changed, 41 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md @@ -519,6 +519,7 @@ You can navigate to the `README`s present in the various directories to know mor - [Hyprspace](https://github.com/KZDKM/Hyprspace) - [Hyprexpo](https://github.com/hyprwm/hyprland-plugins/tree/main/hyprexpo) - Add `devcontainer` for Github Codespaces +- Make VS Code Configuration mutable using [this](https://gist.github.com/piousdeer/b29c272eaeba398b864da6abf6cb5daa) module - Reimplement support for specifying Package Channel for configuration build ### v17 @@ -762,7 +763,7 @@ You can navigate to the `README`s present in the various directories to know mor - [Wine](./packages/wine) Applications have to be manually updated #### To Fix -- VS Code theme doesn't apply + - GNOME Extensions aren't updated - New [Picom](https://github.com/yshui/picomx) animations feature isn't implemented diff --git a/files/flake.nix b/files/flake.nix @@ -102,6 +102,20 @@ # Pictures images.profile = ./images/Profile.png; + # Configuration Mutability + mutability = rec { + src = "https://gist.githubusercontent.com/piousdeer/b29c272eaeba398b864da6abf6cb5daa/raw/41e569ba110eb6ebbb463a6b1f5d9fe4f9e82375"; + module = { + url = src + "/mutability.nix"; + sha256 = "4b5ca670c1ac865927e98ac5bf5c131eca46cc20abf0bd0612db955bfc979de8"; + }; + + vscode = { + url = src + "/vscode.nix"; + sha256 = "fed877fa1eefd94bc4806641cea87138df78a47af89c7818ac5e76ebacbd025f"; + }; + }; + # Pantheon Desktop pantheon = { dconf = ./pantheon/dconf.nix; diff --git a/modules/apps/vscode.nix b/modules/apps/vscode.nix @@ -18,10 +18,15 @@ in { user = { persist.directories = [".config/Code" ".vscode"]; homeConfig = { - xdg.mimeApps.defaultApplications = util.build.mime files.xdg.mime { - text = ["code.desktop"]; - }; + # Mutable Configuration File + imports = [ + ({config, ...}: (import (builtins.fetchurl { + inherit (files.mutability.vscode) url sha256; + }) {inherit config lib pkgs;})) + ]; + # Environment + xdg.mimeApps.defaultApplications = util.build.mime files.xdg.mime {text = ["code.desktop"];}; programs.vscode = { enable = true; package = pkgs.vscode; diff --git a/modules/user/home.nix b/modules/user/home.nix @@ -1,4 +1,9 @@ -{config, ...}: { +{ + config, + lib, + files, + ... +}: { ## User Home Configuration ## config = { # Environment Settings @@ -10,7 +15,16 @@ }; user.homeConfig = { - imports = [../../users]; + imports = [ + ../../users + + # Mutable Configuration Files + ({config, ...}: (import (builtins.fetchurl { + inherit (files.mutability.module) url sha256; + }) {inherit config lib;})) + ]; + + # SystemD User Services systemd.user = { enable = true; startServices = true; @@ -21,8 +35,7 @@ inherit (config.system) stateVersion; file = { ".config/nixpkgs/config.nix".source = ../nix/config.nix; - ".config/nix/nix.conf".source = - config.environment.etc."nix/nix.conf".source; + ".config/nix/nix.conf".source = config.environment.etc."nix/nix.conf".source; }; }; };