From 9743295319ab054c7c90f93321b2f8f830a2405a Mon Sep 17 00:00:00 2001 From: "Reid \"reidlab" Date: Tue, 2 Apr 2024 23:11:47 -0700 Subject: [PATCH] fully tabs2space --- default.nix | 14 +++++----- lib/default.nix | 4 +-- modules/desktop/dunst.nix | 10 +++---- modules/desktop/hyprpaper.nix | 26 +++++++++--------- modules/dev/default.nix | 2 +- modules/security.nix | 32 +++++++++++----------- modules/software/editors/vscode.nix | 1 + modules/user.nix | 42 ++++++++++++++--------------- modules/xdg.nix | 26 +++++++++--------- 9 files changed, 79 insertions(+), 78 deletions(-) diff --git a/default.nix b/default.nix index 6be4f64..6dd3399 100755 --- a/default.nix +++ b/default.nix @@ -15,9 +15,9 @@ in { ++ (mapModulesRec' (toString ./modules) import); hm.imports = [ - inputs.hyprlock.homeManagerModules.hyprlock - inputs.hypridle.homeManagerModules.hypridle - inputs.hyprland.homeManagerModules.default + inputs.hyprlock.homeManagerModules.hyprlock + inputs.hypridle.homeManagerModules.hypridle + inputs.hyprland.homeManagerModules.default ]; environment.variables = { @@ -32,7 +32,7 @@ in { nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; registry.nixpkgs.flake = inputs.nixpkgs; - settings = { + settings = { experimental-features = [ "nix-command" "flakes" ]; auto-optimise-store = true; keep-outputs = true; @@ -43,11 +43,11 @@ in { "https://hyprland.cachix.org" ]; trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; - }; + }; }; system.stateVersion = mkDefault "23.11"; diff --git a/lib/default.nix b/lib/default.nix index 1bb3d04..dfd2478 100755 --- a/lib/default.nix +++ b/lib/default.nix @@ -9,8 +9,8 @@ modules = import ./modules.nix { inherit lib; self.attrs = import ./attrs.nix { - inherit lib; - self = {}; + inherit lib; + self = {}; }; }; mylib = diff --git a/modules/desktop/dunst.nix b/modules/desktop/dunst.nix index c0a41bd..d5d56c1 100644 --- a/modules/desktop/dunst.nix +++ b/modules/desktop/dunst.nix @@ -5,13 +5,13 @@ let cfg = config.modules.desktop.dunst; in { options.modules.desktop.dunst = { - enable = mkEnableOption "Enable dunst, a lightweight replacement for the notification daemons provided by most desktop environments"; + enable = mkEnableOption "Enable dunst, a lightweight replacement for the notification daemons provided by most desktop environments"; }; config = mkIf cfg.enable { - hm.services.dunst = { - enable = true; - configFile = ../../config/dunst.conf; - }; + hm.services.dunst = { + enable = true; + configFile = ../../config/dunst.conf; + }; }; } diff --git a/modules/desktop/hyprpaper.nix b/modules/desktop/hyprpaper.nix index acb7d29..4c79d38 100644 --- a/modules/desktop/hyprpaper.nix +++ b/modules/desktop/hyprpaper.nix @@ -5,24 +5,24 @@ let cfg = config.modules.desktop.hyprpaper; in { options.modules.desktop.hyprpaper = { - enable = mkEnableOption "Enable hyprpaper, a wayland wallpaper utility"; - package = mkOption { - type = types.package; - default = inputs.hyprpaper.packages.${system}.hyprpaper; - example = "pkgs.hyperpaper"; - }; + enable = mkEnableOption "Enable hyprpaper, a wayland wallpaper utility"; + package = mkOption { + type = types.package; + default = inputs.hyprpaper.packages.${system}.hyprpaper; + example = "pkgs.hyperpaper"; + }; }; config = mkIf cfg.enable { - hm.wayland.windowManager.hyprland.settings.exec-once = [ "${lib.getExe cfg.package}" ]; - hm.xdg.configFile."hypr/hyprpaper.conf" = let - img = ../../assets/wallpaper.png; - in { - text = '' + hm.wayland.windowManager.hyprland.settings.exec-once = [ "${lib.getExe cfg.package}" ]; + hm.xdg.configFile."hypr/hyprpaper.conf" = let + img = ../../assets/wallpaper.png; + in { + text = '' preload = ${img} wallpaper = ,${img} splash = false - ''; - }; + ''; + }; }; } diff --git a/modules/dev/default.nix b/modules/dev/default.nix index d7ba809..04822b6 100644 --- a/modules/dev/default.nix +++ b/modules/dev/default.nix @@ -9,7 +9,7 @@ in { }; config = mkIf cfg.enable { - programs.direnv ={ + programs.direnv = { enable = true; silent = true; nix-direnv.enable = true; diff --git a/modules/security.nix b/modules/security.nix index 14162ad..204c96f 100755 --- a/modules/security.nix +++ b/modules/security.nix @@ -9,13 +9,13 @@ in { }; config = mkIf cfg.enable { - boot = { - tmp.useTmpfs = lib.mkDefault true; - tmp.cleanOnBoot = lib.mkDefault (!config.boot.tmp.useTmpfs); - - kernel.sysctl = { - # magic sysrq key, allows low-level commands through keyboard input - "kernel.sysrq" = 0; + boot = { + tmp.useTmpfs = lib.mkDefault true; + tmp.cleanOnBoot = lib.mkDefault (!config.boot.tmp.useTmpfs); + + kernel.sysctl = { + # magic sysrq key, allows low-level commands through keyboard input + "kernel.sysrq" = 0; ## TCP hardening # prevent bogus ICMP errors from filling up logs @@ -50,21 +50,21 @@ in { security = { # prevents replacing the kernel without a reboot - protectKernelImage = true; - # rtkit allows unprivileged processes to use realtime scheduling + protectKernelImage = true; + # rtkit allows unprivileged processes to use realtime scheduling # polkit allows unprivileged processes to speak to privileged processes (ex. nmtui, reboot) - rtkit.enable = true; + rtkit.enable = true; polkit.enable = true; }; # personal computer? no firewall ty :3 networking.firewall.enable = false; } // (mkIf cfg.useDoas { - security.sudo.enable = false; - security.doas.enable = true; - security.doas.extraRules = [ - { users = [ config.user.name ]; noPass = true; persist = false; keepEnv = true; } - ]; - environment.systemPackages = with pkgs; [ doas-sudo-shim ]; + security.sudo.enable = false; + security.doas.enable = true; + security.doas.extraRules = [ + { users = [ config.user.name ]; noPass = true; persist = false; keepEnv = true; } + ]; + environment.systemPackages = with pkgs; [ doas-sudo-shim ]; }); } diff --git a/modules/software/editors/vscode.nix b/modules/software/editors/vscode.nix index 339bdd9..d3ca07d 100644 --- a/modules/software/editors/vscode.nix +++ b/modules/software/editors/vscode.nix @@ -42,6 +42,7 @@ in { "security.workspace.trust.untrustedFiles" = "open"; + "explorer.compactFolders" = false; "explorer.confirmDelete" = false; "explorer.confirmDragAndDrop" = true; diff --git a/modules/user.nix b/modules/user.nix index 005ba92..970ac2d 100644 --- a/modules/user.nix +++ b/modules/user.nix @@ -8,30 +8,30 @@ with lib.my; }; config = { - user = rec { - name = "reidlab"; - description = "reid"; - extraGroups = ["wheel" "input" "audio" "video" "storage"]; - isNormalUser = true; - home = "/home/${name}"; - group = name; - uid = 1000; - }; - users.groups.${config.user.group} = {}; + user = rec { + name = "reidlab"; + description = "reid"; + extraGroups = ["wheel" "input" "audio" "video" "storage"]; + isNormalUser = true; + home = "/home/${name}"; + group = name; + uid = 1000; + }; + users.groups.${config.user.group} = {}; - users.users.${config.user.name} = mkAliasDefinitions options.user; + users.users.${config.user.name} = mkAliasDefinitions options.user; - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; - hm.home.username = config.user.name; - hm.home.homeDirectory = lib.mkForce config.user.home; + hm.home.username = config.user.name; + hm.home.homeDirectory = lib.mkForce config.user.home; - nix.settings = let - users = ["root" config.user.name]; - in { - trusted-users = users; - allowed-users = users; - }; + nix.settings = let + users = ["root" config.user.name]; + in { + trusted-users = users; + allowed-users = users; + }; }; } diff --git a/modules/xdg.nix b/modules/xdg.nix index 7ce9551..10f9786 100644 --- a/modules/xdg.nix +++ b/modules/xdg.nix @@ -1,19 +1,19 @@ { ... }: { config = { - hm.xdg.enable = true; - hm.xdg.userDirs = { - enable = true; - createDirectories = true; + hm.xdg.enable = true; + hm.xdg.userDirs = { + enable = true; + createDirectories = true; - desktop = "$HOME/desktop"; - documents = "$HOME/documents"; - download = "$HOME/downloads"; - music = "$HOME/music"; - pictures = "$HOME/pictures"; - publicShare = "$HOME/public"; - templates = "$HOME/templates"; - videos = "$HOME/videos"; - }; + desktop = "$HOME/desktop"; + documents = "$HOME/documents"; + download = "$HOME/downloads"; + music = "$HOME/music"; + pictures = "$HOME/pictures"; + publicShare = "$HOME/public"; + templates = "$HOME/templates"; + videos = "$HOME/videos"; + }; }; }