dotfiles

My PC Dotfiles & Website
commit 0d1789b93e5c5240f48771bc44cb48a346a554e0
parent 53e40eb5360bddb2fc8f98af363d23ac2cf08ae7
Author: maydayv7 <maydayv7@gmail.com>
Date:   Sun, 22 Oct 2023 12:13:57 +0530

feat: Drop `deploy-rs` Support

Also change `with {...}` statements to `let ... in`

Diffstat:

M.templates/default.nix | 5+++--
MREADME.md | 16+---------------
Mconfiguration.nix | 11+++--------
Mflake.lock | 147++++++++++++++++++++++++++++---------------------------------------------------
Mflake.nix | 3---
Mlib/build.nix | 1-
Mlib/default.nix | 5+++--
Mmodules/apps/default.nix | 5+++--
Mmodules/hardware/default.nix | 5+++--
Mmodules/hardware/security.nix | 7++++---
Mmodules/nix/checks.nix | 8++++----
Mmodules/nix/default.nix | 5+++--
Dmodules/nix/deploy.nix | 18------------------
Mmodules/shell/default.nix | 5+++--
Mscripts/nixos.nix | 6------
Msecrets/default.nix | 5+++--
16 files changed, 84 insertions(+), 168 deletions(-)

diff --git a/.templates/default.nix b/.templates/default.nix @@ -1,5 +1,6 @@ -lib: -with {inherit (lib.filters) filter matchExt;}; { +lib: let + inherit (lib.filters) filter matchExt; +in { ## Configuration Templates ## default = { description = "Simple, Minimal NixOS Configuration"; diff --git a/README.md b/README.md @@ -38,7 +38,6 @@ This [repository](https://github.com/maydayv7/dotfiles) contains the configurati - Auto-Magic using [`flake-utils-plus`](https://github.com/gytis-ivaskevicius/flake-utils-plus) Helper Functions - Automatic `packages` Updates using [`update.sh`](./packages/update.sh) - Install Media and Device Images using [`nixos-generators`](https://github.com/nix-community/nixos-generators) Image Generation Modules -- Automatic [Deployment](./modules/nix/deploy.nix) using the [`deploy-rs`](https://github.com/serokell/deploy-rs) Tool - Advanced Configuration [Checks](./modules/nix/checks.nix) using [`pre-commit-hooks.nix`](https://github.com/cachix/pre-commit-hooks.nix) - Support for `source` Filters with [`nix-filter`](https://github.com/numtide/nix-filter) and [`gitignore.nix`](https://github.com/hercules-ci/gitignore.nix) - Support for Base16 Color Theming using [`stylix`](https://github.com/danth/stylix) @@ -75,10 +74,8 @@ github:maydayv7/dotfiles │ └───x86_64-linux │ ├───Device-gnome: derivation 'nixos-rebuild' │ ├───Device-xfce: derivation 'nixos-rebuild' -│ ├───activate: derivation 'deploy-rs-check-activate' │ ├───commit: derivation 'pre-commit-run' │ └───schema: derivation 'jsonschema-deploy-system' -├───deploy: automatc deployments ├───devShells │ └───x86_64-linux │ ├───cc: development environment 'C' @@ -284,18 +281,6 @@ _In case you are using the `advanced` filesystem scheme, you may need to set the </details> <details> -<summary><b>Automatic Deploy</b></summary> - -The `nixosConfigurations` support automatic deployments using [deploy-rs](https://github.com/serokell/deploy-rs) - -To deploy a Device, simply run the following command: -_Replace_ **_DEVICE_** _with the name of Device to deploy_ - -<pre><code>nix run github:serokell/deploy -- github:maydayv7/dotfiles#<b><i>DEVICE</i></b></code></pre> - -</details> - -<details> <summary><b>Build It Yourself</b></summary> If you really want to get dirty with Nix and decide to invest oodles of your time into building your own configuration, this repository can be used as inspiration. For starters, you can run `nix flake init -t github:maydayv7/dotfiles` in `/etc/nixos` for a basic Flakes-compatible system configuration. If you have any doubts, feel free to open an issue. You can check out the list of links below to resourceful Nix documentation/tutorials/projects that may be helpful in your endeavour @@ -431,6 +416,7 @@ You can navigate to the `README`'s present in the various directories to know mo - Improve `nix-index` - Move out proprietary files - Refactor Secrets +- Drop `deploy-rs` Support ### 23.05 (v12) diff --git a/configuration.nix b/configuration.nix @@ -14,7 +14,6 @@ with inputs; let inherit (lib.util) build map pack; lib = library.lib.extend (final: prev: { - deploy = deploy.lib; filters = ignore.lib // {inherit (filter.lib) filter matchExt;}; hooks = hooks.lib; image = generators.nixosGenerate; @@ -55,14 +54,11 @@ in # Channels channels = { - stable = (build.channel stable [deploy.overlay] ./packages/patches)."${system}"; - unstable = (build.channel unstable [deploy.overlay nur.overlay] [])."${system}"; + stable = (build.channel stable [] ./packages/patches)."${system}"; + unstable = (build.channel unstable [nur.overlay] [])."${system}"; wine = wine.packages."${system}"; gaming = gaming.packages."${system}"; - apps = { - deploy = deploy.defaultPackage."${system}"; - generators = generators.packages."${system}".default; - }; + apps.generators = generators.packages."${system}".default; }; # Custom Packages @@ -97,7 +93,6 @@ in templates = import ./.templates lib; ## Device Configuration ## - deploy = import ./modules/nix/deploy.nix {inherit self lib;}; nixosConfigurations = map.modules ./devices (name: build.device (import name)); diff --git a/flake.lock b/flake.lock @@ -130,26 +130,6 @@ "type": "github" } }, - "deploy": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs", - "utils": "utils" - }, - "locked": { - "lastModified": 1695052866, - "narHash": "sha256-agn7F9Oww4oU6nPiw+YiYI9Xb4vOOE73w8PAoBRP4AA=", - "owner": "serokell", - "repo": "deploy-rs", - "rev": "e3f41832680801d0ee9e2ed33eb63af398b090e9", - "type": "github" - }, - "original": { - "owner": "serokell", - "repo": "deploy-rs", - "type": "github" - } - }, "filter": { "locked": { "lastModified": 1694857738, @@ -168,22 +148,6 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1668681692, - "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "009399224d5e398d03b22badca40a37ac85412a1", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { - "flake": false, - "locked": { "lastModified": 1673956053, "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "owner": "edolstra", @@ -197,7 +161,7 @@ "type": "github" } }, - "flake-compat_3": { + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1673956053, @@ -213,7 +177,7 @@ "type": "github" } }, - "flake-compat_4": { + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1673956053, @@ -284,7 +248,7 @@ "gaming": { "inputs": { "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" }, "locked": { "lastModified": 1695949836, @@ -303,7 +267,7 @@ "generators": { "inputs": { "nixlib": "nixlib", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1696058303, @@ -336,7 +300,9 @@ }, "home": { "inputs": { - "nixpkgs": ["unstable"] + "nixpkgs": [ + "unstable" + ] }, "locked": { "lastModified": 1697688028, @@ -354,11 +320,20 @@ }, "hooks": { "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": ["utils", "flake-utils"], - "gitignore": ["ignore"], - "nixpkgs": ["unstable"], - "nixpkgs-stable": ["stable"] + "flake-compat": "flake-compat", + "flake-utils": [ + "utils", + "flake-utils" + ], + "gitignore": [ + "ignore" + ], + "nixpkgs": [ + "unstable" + ], + "nixpkgs-stable": [ + "stable" + ] }, "locked": { "lastModified": 1695576016, @@ -376,7 +351,9 @@ }, "ignore": { "inputs": { - "nixpkgs": ["stable"] + "nixpkgs": [ + "stable" + ] }, "locked": { "lastModified": 1694102001, @@ -409,7 +386,9 @@ }, "index": { "inputs": { - "nixpkgs": ["stable"] + "nixpkgs": [ + "stable" + ] }, "locked": { "lastModified": 1696131323, @@ -459,11 +438,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1671417167, - "narHash": "sha256-JkHam6WQOwZN1t2C2sbp1TqMv3TVRjzrdoejqfefwrM=", + "lastModified": 1695318763, + "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bb31220cca6d044baa6dc2715b07497a2a7c4bc7", + "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", "type": "github" }, "original": { @@ -509,22 +488,6 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1695318763, - "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { "lastModified": 1693714546, "narHash": "sha256-3EMJZeGSZT6pD1eNwI/6Yc0R4rxklNvJ2SDFcsCnjpM=", "owner": "NixOS", @@ -539,7 +502,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { "lastModified": 1696484316, "narHash": "sha256-LE7F+Wrvo1B8OR3E1bITYAcfBaNKXLHqBrXoZEtqrTQ=", @@ -554,7 +517,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1694760568, "narHash": "sha256-3G07BiXrp2YQKxdcdms22MUx6spc6A++MSePtatCYuI=", @@ -587,8 +550,8 @@ }, "proprietary": { "inputs": { - "nixpkgs": "nixpkgs_4", - "utils": "utils_2" + "nixpkgs": "nixpkgs_3", + "utils": "utils" }, "locked": { "lastModified": 1697710837, @@ -606,7 +569,6 @@ }, "root": { "inputs": { - "deploy": "deploy", "filter": "filter", "gaming": "gaming", "generators": "generators", @@ -623,14 +585,14 @@ "stable": "stable", "stylix": "stylix", "unstable": "unstable", - "utils": "utils_3", + "utils": "utils_2", "windows": "windows", "wine": "wine" } }, "sops": { "inputs": { - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -673,9 +635,13 @@ "base16-kitty": "base16-kitty", "base16-tmux": "base16-tmux", "base16-vim": "base16-vim", - "flake-compat": "flake-compat_3", - "home-manager": ["home"], - "nixpkgs": ["unstable"] + "flake-compat": "flake-compat_2", + "home-manager": [ + "home" + ], + "nixpkgs": [ + "unstable" + ] }, "locked": { "lastModified": 1697720625, @@ -738,21 +704,6 @@ } }, "utils": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "utils_2": { "inputs": { "systems": "systems" }, @@ -770,7 +721,7 @@ "type": "github" } }, - "utils_3": { + "utils_2": { "inputs": { "flake-utils": "flake-utils" }, @@ -790,7 +741,9 @@ }, "windows": { "inputs": { - "nixpkgs": ["stable"] + "nixpkgs": [ + "stable" + ] }, "locked": { "lastModified": 1687787314, @@ -808,8 +761,10 @@ }, "wine": { "inputs": { - "flake-compat": "flake-compat_4", - "nixpkgs": ["unstable"] + "flake-compat": "flake-compat_3", + "nixpkgs": [ + "unstable" + ] }, "locked": { "lastModified": 1695992551, diff --git a/flake.nix b/flake.nix @@ -137,9 +137,6 @@ inputs.gitignore.follows = "ignore"; }; - # Automatic Deployment Tool - deploy.url = "github:serokell/deploy-rs"; - # Windows VM Creator windows = { url = "git+https://git.m-labs.hk/M-Labs/wfvm"; diff --git a/lib/build.nix b/lib/build.nix @@ -26,7 +26,6 @@ in rec { name = "nixos"; description = "Default User"; minimal = true; - recovery = false; shells = null; password = readFile ../modules/user/passwords/default; }; diff --git a/lib/default.nix b/lib/default.nix @@ -2,8 +2,9 @@ self, platforms, lib, -} @ args: -with {inherit (lib) makeExtensible attrValues foldr;}; +} @ args: let + inherit (lib) makeExtensible attrValues foldr; +in (makeExtensible (final: with final; (import ./map.nix args).modules ./. (file: import file args))) diff --git a/modules/apps/default.nix b/modules/apps/default.nix @@ -1,5 +1,6 @@ -{lib, ...}: -with {inherit (lib) mkOption types util;}; { +{lib, ...}: let + inherit (lib) mkOption types util; +in { imports = util.map.module ./.; options.apps.list = mkOption { diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix @@ -1,5 +1,6 @@ -{lib, ...}: -with {inherit (lib) mkOption types util;}; { +{lib, ...}: let + inherit (lib) mkOption types util; +in { imports = util.map.module ./.; options.hardware = with types; { diff --git a/modules/hardware/security.nix b/modules/hardware/security.nix @@ -2,13 +2,14 @@ config, lib, ... -}: -with {inherit (lib) mkEnableOption mkOverride;}; { +}: let + inherit (lib) mkEnableOption mkIf mkOverride; +in { options.hardware.security = mkEnableOption "Enable Additional Security and Hardening Settings"; ## Security Settings ## - config = lib.mkIf config.hardware.security { + config = mkIf config.hardware.security { warnings = [ '' Additional Security Settings are Enabled diff --git a/modules/nix/checks.nix b/modules/nix/checks.nix @@ -2,11 +2,11 @@ self, system, lib, -}: -with {inherit (lib) deploy filters hooks util;}; -# Install Media Checks +}: let + inherit (lib) filters hooks util; +in + # Install Media Checks (util.pack.device self.installMedia "nixos-rebuild") - // (deploy."${system}".deployChecks self.deploy) // { # Pre-Commit Hooks commit = hooks."${system}".run { diff --git a/modules/nix/default.nix b/modules/nix/default.nix @@ -3,8 +3,9 @@ inputs, pkgs, ... -}: -with {inherit (lib.util.map) array;}; { +}: let + inherit (lib.util.map) array; +in { imports = [./index.nix inputs.utils.nixosModules.autoGenFromInputs]; ## Nix Settings ## diff --git a/modules/nix/deploy.nix b/modules/nix/deploy.nix @@ -1,18 +0,0 @@ -{ - self, - lib, -}: -with {inherit (builtins) mapAttrs;}; { - autoRollback = true; - magicRollback = false; - user = "root"; - sshUser = "recovery"; - nodes = - mapAttrs (hostname: config: { - inherit hostname; - profiles.system.path = - lib.deploy."${config.pkgs.system}".activate.nixos - self.nixosConfigurations."${hostname}"; - }) - self.nixosConfigurations; -} diff --git a/modules/shell/default.nix b/modules/shell/default.nix @@ -5,8 +5,9 @@ files, ... }: -with files; -with {inherit (lib) mkEnableOption mkIf mkMerge util;}; { +with files; let + inherit (lib) mkEnableOption mkIf mkMerge util; +in { imports = util.map.module ./.; options.shell.utilities = mkEnableOption "Enable Additional Shell Utilities"; diff --git a/scripts/nixos.nix b/scripts/nixos.nix @@ -46,7 +46,6 @@ with files; let --activate - Activates Current Configuration --boot - Applies Configuration on boot --check - Checks Configuration Build - --deploy [ 'device' ] - Automatically Deploy via SSH --rollback [ 'generation' ] - Reverts to Last [ or Specified ] Build Generation --test - Tests Configuration Build ''; @@ -81,7 +80,6 @@ in [ cachix coreutils - apps.deploy apps.generators git gnupg @@ -128,10 +126,6 @@ in echo "Checking Configuration..." nixos-rebuild dry-activate --flake ${path.system}# ;; - "--deploy") - echo "Deploying Configuration..." - deploy -s ${path.system}#"$3" - ;; "--test") echo "Testing Configuration..." sudo nixos-rebuild test --no-build-nix --show-trace --flake ${path.system}# diff --git a/secrets/default.nix b/secrets/default.nix @@ -4,8 +4,9 @@ pkgs, files, ... -}: -with {inherit (lib) mkForce util;}; { +}: let + inherit (lib) mkForce util; +in { imports = [inputs.sops.nixosModules.sops]; ## Authentication Credentials Management ##