From 53c956d53e63b3ff652d44826813e93f45cc832c Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Mon, 16 Sep 2024 20:52:24 +0300 Subject: [PATCH] Format nix files with nix-fmt --- common.nix | 120 +++++++++++----------- flake.nix | 55 +++++----- gpg.nix | 36 +++---- home/.config/nvim/mason-lock.json | 23 +---- hosts/Mirkwood/configuration.nix | 4 +- hosts/Mirkwood/hardware-configuration.nix | 12 ++- users/functionalhacker/configuration.nix | 6 +- users/functionalhacker/home.nix | 44 ++++---- users/som/configuration.nix | 6 +- wifi.nix | 6 +- 10 files changed, 149 insertions(+), 163 deletions(-) diff --git a/common.nix b/common.nix index 29bb3487..49e1869d 100644 --- a/common.nix +++ b/common.nix @@ -1,76 +1,76 @@ { pkgs, ... }: { - imports = [ - ./gpg.nix - ./users/functionalhacker/configuration.nix - ./users/som/configuration.nix - ]; + imports = [ + ./gpg.nix + ./users/functionalhacker/configuration.nix + ./users/som/configuration.nix + ]; - system.stateVersion = "24.05"; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + system.stateVersion = "24.05"; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; - time.timeZone = "Europe/Helsinki"; + time.timeZone = "Europe/Helsinki"; - i18n = { - defaultLocale = "en_US.UTF-8"; + i18n = { + defaultLocale = "en_US.UTF-8"; - extraLocaleSettings = { - LC_ADDRESS = "fi_FI.UTF-8"; - LC_IDENTIFICATION = "fi_FI.UTF-8"; - LC_MEASUREMENT = "fi_FI.UTF-8"; - LC_MONETARY = "fi_FI.UTF-8"; - LC_NAME = "fi_FI.UTF-8"; - LC_NUMERIC = "fi_FI.UTF-8"; - LC_PAPER = "fi_FI.UTF-8"; - LC_TELEPHONE = "fi_FI.UTF-8"; - LC_TIME = "fi_FI.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "fi_FI.UTF-8"; + LC_IDENTIFICATION = "fi_FI.UTF-8"; + LC_MEASUREMENT = "fi_FI.UTF-8"; + LC_MONETARY = "fi_FI.UTF-8"; + LC_NAME = "fi_FI.UTF-8"; + LC_NUMERIC = "fi_FI.UTF-8"; + LC_PAPER = "fi_FI.UTF-8"; + LC_TELEPHONE = "fi_FI.UTF-8"; + LC_TIME = "fi_FI.UTF-8"; + }; + }; + + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + }; + + services = { + xserver = { + enable = true; + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + + xkb = { + layout = "us"; + variant = ""; }; - }; + }; - boot = { - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - }; - - services = { - xserver = { - enable = true; - displayManager.gdm.enable = true; - desktopManager.gnome.enable = true; - - xkb = { - layout = "us"; - variant = ""; - }; - }; - - pipewire = { - enable = true; - pulse.enable = true; - }; - }; + pipewire = { + enable = true; + pulse.enable = true; + }; + }; networking.networkmanager.enable = true; - hardware.pulseaudio.enable = false; + hardware.pulseaudio.enable = false; - security.rtkit.enable = true; + security.rtkit.enable = true; - programs.firefox = { - enable = true; - nativeMessagingHosts.packages = [ pkgs.browserpass ]; - }; + programs.firefox = { + enable = true; + nativeMessagingHosts.packages = [ pkgs.browserpass ]; + }; - environment.systemPackages = with pkgs; [ - git - gnumake - home-manager - neovim - telegram-desktop - usbutils - wl-clipboard - ]; + environment.systemPackages = with pkgs; [ + git + gnumake + home-manager + neovim + telegram-desktop + usbutils + wl-clipboard + ]; } diff --git a/flake.nix b/flake.nix index e7095d3f..00bcc8ad 100644 --- a/flake.nix +++ b/flake.nix @@ -1,34 +1,35 @@ { - description = "FunctionalHacker's NixOS config"; + description = "FunctionalHacker's NixOS config"; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; - home-manager = { - url = "github:nix-community/home-manager/release-24.05"; - inputs.nixpkgs.follows = "nixpkgs"; + home-manager = { + url = "github:nix-community/home-manager/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { nixpkgs, home-manager, ... }: + let + lib = nixpkgs.lib; + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in + { + nixosConfigurations.Mirkwood = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./common.nix + ./hosts/Mirkwood/configuration.nix + ]; }; - }; - outputs = { nixpkgs, home-manager, ...}: - let - lib = nixpkgs.lib; - system = "x86_64-linux"; - pkgs = import nixpkgs { inherit system; }; - in { - nixosConfigurations.Mirkwood = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./common.nix - ./hosts/Mirkwood/configuration.nix - ]; - }; - - homeConfigurations = { - functionalhacker = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ ./users/functionalhacker/home.nix ]; - }; - }; + homeConfigurations = { + functionalhacker = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ ./users/functionalhacker/home.nix ]; + }; }; + }; } diff --git a/gpg.nix b/gpg.nix index 17f0d61f..9161c53a 100644 --- a/gpg.nix +++ b/gpg.nix @@ -1,24 +1,24 @@ { pkgs, ... }: { - programs = { - ssh.startAgent = false; - gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - }; + programs = { + ssh.startAgent = false; + gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + }; - services = { - pcscd.enable = true; - udev.packages = [ - pkgs.yubikey-personalization - ]; - }; + services = { + pcscd.enable = true; + udev.packages = [ + pkgs.yubikey-personalization + ]; + }; - environment.shellInit = '' - gpg-connect-agent /bye - export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) - export MARKON_MUUTTUJA="test" - ''; + environment.shellInit = '' + gpg-connect-agent /bye + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + export MARKON_MUUTTUJA="test" + ''; } diff --git a/home/.config/nvim/mason-lock.json b/home/.config/nvim/mason-lock.json index 18047f30..fbda6720 100644 --- a/home/.config/nvim/mason-lock.json +++ b/home/.config/nvim/mason-lock.json @@ -1,21 +1,4 @@ { - "bash-language-server": "5.4.0", - "css-lsp": "4.10.0", - "docker-compose-language-service": "0.2.0", - "dockerfile-language-server": "0.13.0", - "eslint-lsp": "4.10.0", - "google-java-format": "v1.23.0", - "html-lsp": "4.10.0", - "java-debug-adapter": "0.58.0", - "jdtls": "v1.38.0", - "json-lsp": "4.10.0", - "lemminx": "0.27.1", - "lua-language-server": "3.10.5", - "prettier": "3.3.3", - "prettierd": "0.25.3", - "stylua": "v0.20.0", - "taplo": "0.9.3", - "tree-sitter-cli": "v0.22.6", - "typescript-language-server": "4.3.3", - "yaml-language-server": "1.15.0" -} + "nil": "2024-08-06", + "nixpkgs-fmt": "1.3.0" +} \ No newline at end of file diff --git a/hosts/Mirkwood/configuration.nix b/hosts/Mirkwood/configuration.nix index 977a5f66..7fb4fe1d 100644 --- a/hosts/Mirkwood/configuration.nix +++ b/hosts/Mirkwood/configuration.nix @@ -2,8 +2,8 @@ { imports = [ - ./hardware-configuration.nix - ../../wifi.nix + ./hardware-configuration.nix + ../../wifi.nix ]; networking.hostName = "Mirkwood"; diff --git a/hosts/Mirkwood/hardware-configuration.nix b/hosts/Mirkwood/hardware-configuration.nix index 7003d571..3c105ff4 100644 --- a/hosts/Mirkwood/hardware-configuration.nix +++ b/hosts/Mirkwood/hardware-configuration.nix @@ -5,7 +5,8 @@ { imports = - [ (modulesPath + "/installer/scan/not-detected.nix") + [ + (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ]; @@ -14,21 +15,22 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/fcb4b991-0704-45c0-9d31-bd858e1476aa"; + { + device = "/dev/disk/by-uuid/fcb4b991-0704-45c0-9d31-bd858e1476aa"; fsType = "ext4"; }; boot.initrd.luks.devices."luks-2d20d058-3ea8-41cf-90fa-872f46960add".device = "/dev/disk/by-uuid/2d20d058-3ea8-41cf-90fa-872f46960add"; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/8498-FFAF"; + { + device = "/dev/disk/by-uuid/8498-FFAF"; fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ]; }; swapDevices = - [ { device = "/dev/disk/by-uuid/dba8a94b-d7b6-4ac1-a0bb-82d6538ff331"; } - ]; + [{ device = "/dev/disk/by-uuid/dba8a94b-d7b6-4ac1-a0bb-82d6538ff331"; }]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/users/functionalhacker/configuration.nix b/users/functionalhacker/configuration.nix index a750b41f..9a073857 100644 --- a/users/functionalhacker/configuration.nix +++ b/users/functionalhacker/configuration.nix @@ -2,8 +2,8 @@ { users.users.functionalhacker = { - description = "Marko"; - isNormalUser = true; - extraGroups = [ "networkmanager" "wheel" ]; + description = "Marko"; + isNormalUser = true; + extraGroups = [ "networkmanager" "wheel" ]; }; } diff --git a/users/functionalhacker/home.nix b/users/functionalhacker/home.nix index a0d6310c..91a4538c 100644 --- a/users/functionalhacker/home.nix +++ b/users/functionalhacker/home.nix @@ -1,29 +1,29 @@ { config, lib, pkgs, ... }: { - programs.neovim = { - enable = true; - defaultEditor = true; - }; + programs.neovim = { + enable = true; + defaultEditor = true; + }; - home = { - username = "functionalhacker"; - homeDirectory = "/home/functionalhacker"; - stateVersion = "24.05"; + home = { + username = "functionalhacker"; + homeDirectory = "/home/functionalhacker"; + stateVersion = "24.05"; - file.".config/nvim".source = - config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/git/dotfiles/home/.config/nvim"; + file.".config/nvim".source = + config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/git/dotfiles/home/.config/nvim"; - packages = with pkgs; [ - cargo - fzf - gcc - nerdfonts - nodejs - pass - tree-sitter - yarn - zsh - ]; - }; + packages = with pkgs; [ + cargo + fzf + gcc + nerdfonts + nodejs + pass + tree-sitter + yarn + zsh + ]; + }; } diff --git a/users/som/configuration.nix b/users/som/configuration.nix index 5a7a4124..e80688ff 100644 --- a/users/som/configuration.nix +++ b/users/som/configuration.nix @@ -2,8 +2,8 @@ { users.users.som = { - description = "Som"; - isNormalUser = true; - extraGroups = [ "networkmanager" ]; + description = "Som"; + isNormalUser = true; + extraGroups = [ "networkmanager" ]; }; } diff --git a/wifi.nix b/wifi.nix index 4bcd8183..209f0d6b 100644 --- a/wifi.nix +++ b/wifi.nix @@ -1,8 +1,8 @@ -{...}: +{ ... }: { networking = { - networkmanager.wifi.backend = "iwd"; - wireless.iwd.enable = true; + networkmanager.wifi.backend = "iwd"; + wireless.iwd.enable = true; }; }