dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 5330036cf32a37d336b50cc4e4e0dac7282aca0d parent 212508920035b71124cd9aacc93bbafc2fcadbd4 Author: maydayv7 <maydayv7@gmail.com> Date: Tue, 24 Oct 2023 11:51:07 +0530 fix: Remove `lib.types`
Diffstat:
| M | README.md | | | 3 | +-- |
| M | configuration.nix | | | 9 | +++++---- |
| M | lib/README.md | | | 4 | ---- |
| D | lib/types.nix | | | 10 | ---------- |
| M | modules/user/default.nix | | | 12 | ++++++++++-- |
| M | scripts/README.md | | | 2 | +- |
| M | scripts/nixos.nix | | | 5 | ++--- |
7 files changed, 19 insertions(+), 26 deletions(-)
diff --git a/README.md b/README.md @@ -151,8 +151,7 @@ github:maydayv7/dotfiles ├── lib │ ├── build.nix │ ├── map.nix -│ ├── pack.nix -│ └── types.nix +│ └── pack.nix └── modules ├── apps ├── base diff --git a/configuration.nix b/configuration.nix @@ -5,7 +5,6 @@ # System Libraries inherit (self) files; - inherit (builtins) head readFile; inherit (lib.util) build map pack; lib = with inputs; nixpkgs.lib.extend (final: prev: @@ -14,6 +13,8 @@ hooks = hooks.lib; image = generators.nixosGenerate; wine = wine.lib; + } + // { util = import ./lib { inherit self systems; lib = final; @@ -48,12 +49,12 @@ in ## Package Configuration ## legacyPackages = self.channels."${system}".nixpkgs; - # Channels + # Package Channels channels = with inputs; { nixpkgs = (build.channel nixpkgs [nur.overlay])."${system}"; wine = wine.packages."${system}"; gaming = gaming.packages."${system}"; - apps.generators = generators.packages."${system}".default; + generators = generators.packages."${system}".default; }; # Custom Packages @@ -67,7 +68,7 @@ in // inputs.proprietary.packages."${system}"; }) // (let - defaultPkgs = self.legacyPackages."${head systems}"; + defaultPkgs = self.legacyPackages."${builtins.head systems}"; in { # Overrides overlays = map.modules ./packages/overlays import; diff --git a/lib/README.md b/lib/README.md @@ -30,7 +30,3 @@ The `lib` directory contains custom-made pure Flakes-compatible utility function - `device`: Pack desired system derivations into individual packages - `user`: Pack `self.homeConfigurations` derivations into individual packages - -- [`types`](./types.nix): Custom Module Option Types for advanced configuration - - - - `mergedAttrs`: Type specifier for merged `attrsets` diff --git a/lib/types.nix b/lib/types.nix @@ -1,10 +0,0 @@ -{lib, ...}: let - inherit (lib) mkOptionType getValues; -in rec { - ## Module Option Types ## - # Merged Attribute Sets - mergedAttrs = mkOptionType { - name = "mergedAttrs"; - merge = _: getValues; - }; -} diff --git a/modules/user/default.nix b/modules/user/default.nix @@ -12,13 +12,21 @@ filterAttrs findFirst findSingle + getValues mkIf mkEnableOption mkOption + mkOptionType optionals types util ; + + # Merged Sets Type + mergedAttrs = mkOptionType { + name = "mergedAttrs"; + merge = _: getValues; + }; in { imports = util.map.module ./. ++ [inputs.home.nixosModules.home-manager]; @@ -37,7 +45,7 @@ in { user = { home = mkOption { description = "User Home Configuration"; - type = util.types.mergedAttrs; + type = mergedAttrs; default = {}; }; @@ -71,7 +79,7 @@ in { }; homeConfig = mkOption { description = "User Specific Home Configuration"; - type = util.types.mergedAttrs; + type = mergedAttrs; default = {}; }; }; diff --git a/scripts/README.md b/scripts/README.md @@ -13,7 +13,7 @@ $ nixos # Usage # apply [ --'option' ] - Applies Device and User Configuration cache 'command' - Pushes Binary Cache Output to Cachix - check [ --trace | --fast ] - Checks System Configuration [ Displays Error to Trace ] + check [ --trace ] - Checks System Configuration [ Displays Error to Trace ] clean [ --all ] - Garbage Collects and Optimises Nix Store explore - Opens Interactive Shell to explore Syntax and Configuration install - Installs NixOS onto System diff --git a/scripts/nixos.nix b/scripts/nixos.nix @@ -26,7 +26,7 @@ with files; let # Usage # apply [ --'option' ] - Applies Device and User Configuration cache 'command' - Pushes Binary Cache Output to Cachix - check [ --trace | --fast ] - Checks System Configuration [ Displays Error to Trace ] + check [ --trace ] - Checks System Configuration [ Displays Error to Trace ] clean [ --all ] - Garbage Collects and Optimises Nix Store explore - Opens Interactive Shell to explore Syntax and Configuration install - Installs NixOS onto System @@ -80,7 +80,7 @@ in [ cachix coreutils - apps.generators + generators git gnupg gnused @@ -166,7 +166,6 @@ in case $2 in "") nix flake check ${path.system} --keep-going;; "--trace") nix flake check ${path.system} --keep-going --show-trace;; - "--fast") nix build -L --no-link ${path.system}#checks.${system}.activate;; *) nix flake check "$2" --keep-going;; esac ;;