dotfiles

My PC Dotfiles & Website
commit 237756c5f25dd38f563dd3e41f78a750bb41723b
parent b6ce0e540d44fd4f90713584f03a5605ef7020f5
Author: maydayv7 <maydayv7@gmail.com>
Date:   Thu,  7 Dec 2023 21:01:24 +0530

fix: Miscellaneous Fixes

Diffstat:

15 files changed, 43 insertions(+), 36 deletions(-)

diff --git a/checks/flake.nix b/checks/flake.nix @@ -1,8 +1,16 @@ -{inputs, ...}: { +{ + config, + inputs, + ... +}: { ## Configuration Checks ## imports = [inputs.formatter.flakeModule]; - perSystem = {pkgs, ...}: { + perSystem = { + system, + pkgs, + ... + }: { ## Code Formatter treefmt.config = rec { package = pkgs.treefmt; @@ -26,5 +34,8 @@ }; }; }; + + # Formatting Shell + devShells.format = config.allSystems."${system}".treefmt.build.devShell; }; } diff --git a/devices/Vortex/secrets/default.nix b/devices/Vortex/secrets/default.nix @@ -1,4 +1,4 @@ {util, ...}: { ## System Secrets ## - config.sops.secrets = util.map.secrets ./. false; + config.sops.secrets = util.map.secrets {directory = ./.;}; } diff --git a/devices/flake.nix b/devices/flake.nix @@ -31,7 +31,6 @@ in { gui.desktop = config.gui.desktop + "-minimal"; # Default User - imports = [{user.home = lib.mkForce {};}]; user = { name = "nixos"; description = "Default User"; @@ -39,6 +38,14 @@ in { shells = null; password = readFile ../modules/user/passwords/default; }; + + # Disabled Modules + imports = [ + { + user.home = lib.mkForce {}; + sops.secrets = lib.mkForce {}; + } + ]; }); region = { diff --git a/lib/map.nix b/lib/map.nix @@ -110,7 +110,10 @@ in rec { else patch; # 'sops' Encrypted Secrets - secrets = directory: neededForUsers: + secrets = { + directory, + neededForUsers ? false, + }: filter checkName (name: type: if type == "regular" && hasSuffix ".secret" name then diff --git a/modules/user/security.nix b/modules/user/security.nix @@ -18,7 +18,11 @@ in { sops.secrets = if enable then (mkForce {}) - else util.map.secrets ./passwords true; + else + util.map.secrets { + directory = ./passwords; + neededForUsers = true; + }; users = { users = diff --git a/scripts/nixos.nix b/scripts/nixos.nix @@ -227,6 +227,7 @@ in DIR=${path.system} fi git clone --recurse-submodules ${path.repo} "$DIR" + pushd "$DIR" &> /dev/null; git config core.fileMode false; popd &> /dev/null nixos apply --activate ;; "") diff --git a/secrets/default.nix b/secrets/default.nix @@ -17,7 +17,7 @@ sops = { # Encrypted Secrets - secrets = util.map.secrets ./. false; + secrets = util.map.secrets {directory = ./.;}; # GPG Key Import gnupg = { diff --git a/devices/Vortex/secrets/github-token.secret b/secrets/github-token.secret diff --git a/devices/Vortex/secrets/gitlab-token.secret b/secrets/gitlab-token.secret diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml @@ -6,12 +6,12 @@ creation_rules: key_groups: - pgp: - *v7 - - path_regex: devices/Vortex/secrets/.*$ + - path_regex: modules/user/passwords/.*$ key_groups: - pgp: - *v7 - - path_regex: modules/user/passwords/.*$ + - *navya + - path_regex: devices/Vortex/secrets/.*$ key_groups: - pgp: - *v7 - - *navya diff --git a/shells/default.nix b/shells/default.nix @@ -1,4 +1,4 @@ -{pkgs ? import ../., ...}: +{pkgs ? import ../packages, ...}: with pkgs; mkShell { name = "devShell"; diff --git a/shells/flake.nix b/shells/flake.nix @@ -1,20 +1,8 @@ -{ - config, - util, - ... -}: { +{util, ...}: { ## Developer Shells ## - perSystem = { - system, - pkgs, - ... - }: { + perSystem = {pkgs, ...}: { devShells = util.map.modules ./. (file: pkgs.mkShell (import file pkgs)) - // { - default = import ./. {inherit pkgs;}; - website = import ../site/shell.nix {inherit pkgs;}; - format = config.allSystems."${system}".treefmt.build.devShell; - }; + // {default = import ./. {inherit pkgs;};}; }; } diff --git a/shells/go.nix b/shells/go.nix @@ -1,5 +0,0 @@ -pkgs: { - name = "Go"; - shellHook = ''echo "## Go Development Shell ##"''; - packages = with pkgs; [go delve go-outline godef golint gopls gotools]; -} diff --git a/shells/lisp.nix b/shells/lisp.nix @@ -1,5 +0,0 @@ -pkgs: { - name = "Lisp"; - shellHook = ''echo "## Lisp Development Shell ##"''; - packages = with pkgs; [sbcl lispPackages.quicklisp]; -} diff --git a/site/flake.nix b/site/flake.nix @@ -4,6 +4,9 @@ _: { # Package packages.website = pkgs.callPackage ./. {inherit pkgs;}; + # Development Shell + devShells.website = import ./shell.nix {inherit pkgs;}; + # Formatting Errors treefmt.config.programs.prettier.excludes = [ "site/templates/macros/edit.html"