From a6e8a94d8a9730f03059937b784578717cbdef71 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 20 Sep 2023 14:19:13 +0200 Subject: [PATCH] feat: simplified checks --- flake.nix | 13 ++++++++++++- modules/secrets.nix | 21 +++++++++++++++++++++ nix/checks.nix | 18 ------------------ users/common/shells/pager.nix | 12 ++++++------ users/patrick/default.nix | 2 +- 5 files changed, 40 insertions(+), 26 deletions(-) delete mode 100644 nix/checks.nix diff --git a/flake.nix b/flake.nix index 4eb1079..5f711e2 100644 --- a/flake.nix +++ b/flake.nix @@ -81,6 +81,7 @@ agenix-rekey, devshell, nixos-generators, + pre-commit-hooks, ... } @ inputs: let inherit (nixpkgs) lib; @@ -141,7 +142,17 @@ }; apps = agenix-rekey.defineApps self pkgs self.nodes; - checks = import ./nix/checks.nix inputs system; + checks.pre-commit-check = + pre-commit-hooks.lib.${system}.run + { + src = lib.cleanSource ./.; + hooks = { + alejandra.enable = true; + statix.enable = true; + luacheck.enable = true; + stylua.enable = true; + }; + }; devShell = import ./nix/devshell.nix inputs system; formatter = pkgs.alejandra; }); diff --git a/modules/secrets.nix b/modules/secrets.nix index e437e8f..6d2d443 100644 --- a/modules/secrets.nix +++ b/modules/secrets.nix @@ -65,4 +65,25 @@ in { ''; }; }; + config.home-manager.sharedModules = [ + ({ + config, + nixosConfig, + ... + }: { + options = { + userSecretsFile = mkOption { + default = ../users/${config._module.args.name}/secrets.nix.age; + type = types.path; + description = "The global secrets attribute that should be exposed to the user"; + }; + userSecrets = mkOption { + readOnly = true; + default = importEncrypted config.userSecretsFile inputs; + type = types.unspecified; + description = "User secrets"; + }; + }; + }) + ]; } diff --git a/nix/checks.nix b/nix/checks.nix deleted file mode 100644 index 8f512dc..0000000 --- a/nix/checks.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - self, - pre-commit-hooks, - ... -}: system: -with self.pkgs.${system}; { - pre-commit-check = - pre-commit-hooks.lib.${system}.run - { - src = lib.cleanSource ../.; - hooks = { - alejandra.enable = true; - statix.enable = true; - luacheck.enable = true; - stylua.enable = true; - }; - }; -} diff --git a/users/common/shells/pager.nix b/users/common/shells/pager.nix index 0f5dfed..d32300e 100644 --- a/users/common/shells/pager.nix +++ b/users/common/shells/pager.nix @@ -1,13 +1,13 @@ {pkgs, ...}: let initLua = pkgs.writeText "init.lua" '' vim.opt.buftype = "nowrite" - vim.opt.backup=false - vim.opt.modeline=false - vim.opt.shelltemp=false - vim.opt.swapfile=false - vim.opt.undofile=false + vim.opt.backup = false + vim.opt.modeline = false + vim.opt.shelltemp = false + vim.opt.swapfile = false + vim.opt.undofile = false vim.opt.writebackup = false - vim.opt.shada-file = vim.fn.stdpath "state" .. "/shada/man.shada" + vim.opt.shadafile = vim.fn.stdpath "state" .. "/shada/man.shada" vim.opt.virtualedit = "all" vim.opt.splitkeep = "screen" diff --git a/users/patrick/default.nix b/users/patrick/default.nix index a46d44e..446bec6 100644 --- a/users/patrick/default.nix +++ b/users/patrick/default.nix @@ -3,7 +3,7 @@ config, ... }: { - # enable nixos wide wayland config + # enable nixos wide graphical config imports = [ ../../modules/graphical/xserver.nix ../../modules/graphical/steam.nix