From 6a386950eb60186b6f531a224190e09705f24b8f Mon Sep 17 00:00:00 2001 From: Shahab Dogar Date: Mon, 10 Feb 2025 22:13:06 +0500 Subject: [PATCH] chore: run nixfmt across repo --- flake.nix | 72 ++++++++++++++++-------------- home-manager/configs/alacritty.nix | 7 ++- home-manager/configs/git.nix | 8 +++- home-manager/configs/ssh.nix | 3 +- home-manager/home.nix | 6 ++- nixos/configuration.nix | 31 ++++++++----- nixos/disko-config.nix | 6 ++- nixos/hardware-configuration.nix | 21 ++++++--- 8 files changed, 96 insertions(+), 58 deletions(-) diff --git a/flake.nix b/flake.nix index d649e16..2dd92d3 100644 --- a/flake.nix +++ b/flake.nix @@ -40,43 +40,47 @@ }; }; - outputs = {nixpkgs, ...} @ inputs: let - system = "x86_64-linux"; - host = "rihla"; - user = "shahab"; - pkgs = nixpkgs.legacyPackages.${system}; - in { - nixosConfigurations = { - "${host}" = nixpkgs.lib.nixosSystem { - inherit system; - modules = [ - inputs.lanzaboote.nixosModules.lanzaboote - inputs.disko.nixosModules.disko - inputs.nixos-hardware.nixosModules.framework-13-7040-amd - inputs.sops-nix.nixosModules.sops - ./nixos/configuration.nix - ./nixos/disko-config.nix - ./nixos/hardware-configuration.nix - ]; - specialArgs = { - inherit inputs; - hostname = host; + outputs = + { nixpkgs, ... }@inputs: + let + system = "x86_64-linux"; + host = "rihla"; + user = "shahab"; + pkgs = nixpkgs.legacyPackages.${system}; + in + { + nixosConfigurations = { + "${host}" = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + inputs.lanzaboote.nixosModules.lanzaboote + inputs.disko.nixosModules.disko + inputs.nixos-hardware.nixosModules.framework-13-7040-amd + inputs.sops-nix.nixosModules.sops + ./nixos/configuration.nix + ./nixos/disko-config.nix + ./nixos/hardware-configuration.nix + ]; + specialArgs = { + inherit inputs; + hostname = host; + }; }; }; - }; - homeConfigurations = { - "${user}" = inputs.home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [./home-manager/home.nix]; + homeConfigurations = { + "${user}" = inputs.home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ ./home-manager/home.nix ]; + }; + }; + + devShell.x86_64-linux = pkgs.mkShell { + buildInputs = with pkgs; [ + nil + nixfmt-rfc-style + lua-language-server + ]; }; }; - - devShell.x86_64-linux = pkgs.mkShell { - buildInputs = with pkgs; [ - nil - lua-language-server - ]; - }; - }; } diff --git a/home-manager/configs/alacritty.nix b/home-manager/configs/alacritty.nix index 6fedf62..3894c3b 100644 --- a/home-manager/configs/alacritty.nix +++ b/home-manager/configs/alacritty.nix @@ -6,7 +6,10 @@ settings = { window = { - padding = { x = 4; y = 8; }; + padding = { + x = 4; + y = 8; + }; decorations = "full"; opacity = 1; startup_mode = "Windowed"; @@ -22,7 +25,7 @@ terminal.shell.program = "zsh"; font = { - size = 14; + size = 14; normal.family = font; bold.family = font; italic.family = font; diff --git a/home-manager/configs/git.nix b/home-manager/configs/git.nix index a6d1103..4707406 100644 --- a/home-manager/configs/git.nix +++ b/home-manager/configs/git.nix @@ -1,4 +1,10 @@ -{ lib, pkgs, userName, userEmail, ... }: +{ + lib, + pkgs, + userName, + userEmail, + ... +}: { programs.git = { diff --git a/home-manager/configs/ssh.nix b/home-manager/configs/ssh.nix index 2e855f9..771cfd5 100644 --- a/home-manager/configs/ssh.nix +++ b/home-manager/configs/ssh.nix @@ -2,7 +2,8 @@ let onePassPath = "~/.1password/agent.sock"; -in { +in +{ programs.ssh = { enable = true; extraConfig = "IdentityAgent ${onePassPath}"; diff --git a/home-manager/home.nix b/home-manager/home.nix index 2d99206..542364f 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -5,13 +5,15 @@ config, pkgs, ... -}: let +}: +let # Be sure to actually install the font first! font = "ComicCodeLigatures"; username = "shahab"; email = "shahab@dogar.dev"; fullName = "Shahab Dogar"; -in { +in +{ # You can import other home-manager modules here imports = [ # Custom import to configure font diff --git a/nixos/configuration.nix b/nixos/configuration.nix index c9ed43c..5042b38 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -8,7 +8,7 @@ pkgs, hostname, ... -}: +}: { # Bootloader. @@ -55,9 +55,12 @@ # Enable flakes nix.settings = { - substituters = ["https://hyprland.cachix.org"]; - trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; - experimental-features = ["nix-command" "flakes"]; + substituters = [ "https://hyprland.cachix.org" ]; + trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; }; # Enable greetd and tuigreet @@ -99,7 +102,7 @@ graphics = { enable = true; - extraPackages = with pkgs; [amdvlk]; + extraPackages = with pkgs; [ amdvlk ]; }; }; @@ -114,7 +117,12 @@ isNormalUser = true; description = "Shahab Dogar"; - extraGroups = ["networkmanager" "wheel" "input" "libvirtd"]; + extraGroups = [ + "networkmanager" + "wheel" + "input" + "libvirtd" + ]; hashedPassword = "$y$j9T$pvjyL7hL5x2VBarGNTnMl1$mLA2UsWTbfp8Hgp/ug5l8224thi..Mo8.p7ME.tDZ.4"; openssh.authorizedKeys = { @@ -165,7 +173,7 @@ enable = true; # Certain features, including CLI integration and system authentication support, # require enabling PolKit integration on some desktop environments (e.g. Plasma). - polkitPolicyOwners = ["shahab"]; + polkitPolicyOwners = [ "shahab" ]; }; programs.dconf.enable = true; @@ -174,7 +182,8 @@ programs.hyprland = { enable = true; package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; - portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + portalPackage = + inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; }; programs.nix-ld = { @@ -195,7 +204,7 @@ containers = { registries = { - search = ["docker.io"]; + search = [ "docker.io" ]; }; }; @@ -206,7 +215,7 @@ ovmf = { enable = true; - packages = with pkgs; [OVMFFull.fd]; + packages = with pkgs; [ OVMFFull.fd ]; }; }; }; @@ -230,7 +239,7 @@ services.openssh.enable = true; # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [22]; + networking.firewall.allowedTCPPorts = [ 22 ]; # networking.firewall.allowedUDPPorts = [ ... ]; # Or disable the firewall altogether. # networking.firewall.enable = false; diff --git a/nixos/disko-config.nix b/nixos/disko-config.nix index 40dc095..6ac525a 100644 --- a/nixos/disko-config.nix +++ b/nixos/disko-config.nix @@ -61,7 +61,11 @@ size = "100%"; content = { type = "btrfs"; - extraArgs = ["-L" "nixos" "-f"]; + extraArgs = [ + "-L" + "nixos" + "-f" + ]; subvolumes = { "@root" = { mountpoint = "/"; diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index f6bac56..38ed226 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -6,17 +6,26 @@ lib, modulesPath, ... -}: { - imports = [(modulesPath + "/installer/scan/not-detected.nix")]; +}: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot = { initrd = { - availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "thunderbolt" "usb_storage" "sd_mod"]; - kernelModules = []; + availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "thunderbolt" + "usb_storage" + "sd_mod" + ]; + kernelModules = [ ]; }; - kernelModules = ["kvm-amd"]; - extraModulePackages = []; + kernelModules = [ "kvm-amd" ]; + extraModulePackages = [ ]; }; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking