From d90883e404fe1702937246ec82f548288ec6add4 Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Sat, 23 Apr 2022 17:52:45 +0100 Subject: [PATCH] Format code with alejandra --- flake.nix | 100 +++-- hosts/common/default.nix | 13 +- hosts/common/graphical/default.nix | 13 +- hosts/dingbox/configuration.nix | 24 +- hosts/dingbox/hardware-configuration.nix | 40 +- hosts/dingserver/caddy.nix | 25 +- hosts/dingserver/configuration.nix | 25 +- hosts/dingserver/hardware-configuration.nix | 32 +- hosts/dingserver/prometheus.nix | 17 +- hosts/dingserver/synapse.nix | 10 +- hosts/dingserver/syncthing.nix | 6 +- hosts/miniding/configuration.nix | 22 +- hosts/miniding/hardware-configuration.nix | 41 +- hosts/pingbox/configuration.nix | 21 +- hosts/pingbox/hardware-configuration.nix | 40 +- users/daniel/configs/desktop/i3/default.nix | 349 +++++++++--------- .../configs/desktop/i3status-rust/default.nix | 18 +- .../configs/desktop/polybar/default.nix | 28 +- users/daniel/configs/desktop/rofi/default.nix | 4 +- .../configs/system/alacritty/default.nix | 168 +++++---- users/daniel/configs/system/helix/default.nix | 9 +- users/daniel/configs/system/kitty/default.nix | 4 +- .../daniel/configs/system/neovim/default.nix | 55 ++- users/daniel/default.nix | 273 +++++++------- .../daniel/host-specific/dingbox/default.nix | 21 +- .../daniel/host-specific/miniding/default.nix | 33 +- .../daniel/host-specific/pingbox/default.nix | 29 +- 27 files changed, 743 insertions(+), 677 deletions(-) diff --git a/flake.nix b/flake.nix index 4e5875a..6039040 100644 --- a/flake.nix +++ b/flake.nix @@ -1,51 +1,73 @@ { - description = "My System Configs"; + description = "My System Configs"; - inputs = { - nixpkgs.url = "nixpkgs/nixos-unstable"; + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; - i3utils.url = "git+https://git.sr.ht/~dpatterbee/i3utils?ref=main"; - i3utils.inputs.nixpkgs.follows = "nixpkgs"; + i3utils.url = "git+https://git.sr.ht/~dpatterbee/i3utils?ref=main"; + i3utils.inputs.nixpkgs.follows = "nixpkgs"; - home-manager.url = "github:nix-community/home-manager/master"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - }; + home-manager.url = "github:nix-community/home-manager/master"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; - outputs = { nixpkgs, home-manager, i3utils, ... }@inputs: - let - system = "x86_64-linux"; + outputs = { + nixpkgs, + home-manager, + i3utils, + ... + } @ inputs: let + system = "x86_64-linux"; - pkgs = import nixpkgs { - inherit system; - }; + pkgs = import nixpkgs { + inherit system; + }; - lib = nixpkgs.lib; + lib = nixpkgs.lib; - hostSystem = { hostname, headless }: lib.nixosSystem { - inherit system; + hostSystem = { + hostname, + headless, + }: + lib.nixosSystem { + inherit system; - modules = [ - ./hosts/${hostname}/configuration.nix + modules = [ + ./hosts/${hostname}/configuration.nix - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - users = import ./users; - extraSpecialArgs = {inherit hostname; inherit headless;}; - }; - } - ]; + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + users = import ./users; + extraSpecialArgs = { + inherit hostname; + inherit headless; + }; + }; + } + ]; - specialArgs = {inherit inputs;}; - }; - - in { - nixosConfigurations = { - dingbox = hostSystem { hostname = "dingbox"; headless = false; }; - miniding = hostSystem { hostname = "miniding"; headless = false; }; - pingbox = hostSystem { hostname = "pingbox"; headless = false; }; - dingserver = hostSystem { hostname = "dingserver"; headless = true; }; - }; - }; + specialArgs = {inherit inputs;}; + }; + in { + nixosConfigurations = { + dingbox = hostSystem { + hostname = "dingbox"; + headless = false; + }; + miniding = hostSystem { + hostname = "miniding"; + headless = false; + }; + pingbox = hostSystem { + hostname = "pingbox"; + headless = false; + }; + dingserver = hostSystem { + hostname = "dingserver"; + headless = true; + }; + }; + }; } diff --git a/hosts/common/default.nix b/hosts/common/default.nix index ee4acda..db1e50f 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,6 +1,9 @@ -{ config, pkgs, lib, ...}: { - + config, + pkgs, + lib, + ... +}: { # Use the systemd-boot EFI boot loader. boot.kernelPackages = pkgs.linuxPackages_latest; boot.loader.systemd-boot.enable = lib.mkDefault true; @@ -37,7 +40,7 @@ isNormalUser = true; home = "/home/daniel"; initialPassword = "password"; - extraGroups = [ "wheel" "networkmanager" "docker" "video" "syncthing" ]; + extraGroups = ["wheel" "networkmanager" "docker" "video" "syncthing"]; shell = pkgs.zsh; }; @@ -58,7 +61,7 @@ ]; environment.homeBinInPath = true; - + environment.variables = { EDITOR = "hx"; }; @@ -67,7 +70,7 @@ enable = true; ohMyZsh = { enable = true; - plugins = [ "git" "fzf" ]; + plugins = ["git" "fzf"]; theme = "agnoster"; }; }; diff --git a/hosts/common/graphical/default.nix b/hosts/common/graphical/default.nix index 60f54c8..b82e88b 100644 --- a/hosts/common/graphical/default.nix +++ b/hosts/common/graphical/default.nix @@ -1,6 +1,9 @@ -{ config, pkgs, inputs, ...}: - { + config, + pkgs, + inputs, + ... +}: { security.pam.services.gdm.enableGnomeKeyring = true; # Enable the X11 windowing system. hardware.opengl.driSupport32Bit = true; @@ -9,13 +12,12 @@ networking.networkmanager.enable = true; programs.nm-applet.enable = true; - services = { gnome.gnome-keyring.enable = true; pipewire = { - enable = true; - pulse.enable = true; + enable = true; + pulse.enable = true; }; xserver = { @@ -46,4 +48,3 @@ }; }; } - diff --git a/hosts/dingbox/configuration.nix b/hosts/dingbox/configuration.nix index 171a018..e408bc6 100644 --- a/hosts/dingbox/configuration.nix +++ b/hosts/dingbox/configuration.nix @@ -1,27 +1,26 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: - { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ../common - ../common/graphical - ]; + config, + pkgs, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ../common + ../common/graphical + ]; services.xserver = { - dpi = 144; - videoDrivers = [ "nvidia" ]; + videoDrivers = ["nvidia"]; screenSection = '' Option "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On}" Option "AllowIndirectGLXProtocol" "off" Option "TripleBuffer" "on" ''; - }; hardware.nvidia.modesetting.enable = true; @@ -38,4 +37,3 @@ # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "21.05"; # Did you read the comment? } - diff --git a/hosts/dingbox/hardware-configuration.nix b/hosts/dingbox/hardware-configuration.nix index 9c810f3..29b3f73 100644 --- a/hosts/dingbox/hardware-configuration.nix +++ b/hosts/dingbox/hardware-configuration.nix @@ -1,29 +1,33 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/1c0e1988-4420-4485-bf16-ffb8ec854c69"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/1c0e1988-4420-4485-bf16-ffb8ec854c69"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/F5EA-A9CB"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/F5EA-A9CB"; + fsType = "vfat"; + }; - swapDevices = [ ]; + swapDevices = []; # high-resolution display hardware.video.hidpi.enable = lib.mkDefault true; diff --git a/hosts/dingserver/caddy.nix b/hosts/dingserver/caddy.nix index d60f114..3486d40 100644 --- a/hosts/dingserver/caddy.nix +++ b/hosts/dingserver/caddy.nix @@ -1,12 +1,13 @@ -{ pkgs, lib, ... }: - { - networking.firewall.allowedTCPPorts = [ 80 8448 443 ]; + pkgs, + lib, + ... +}: { + networking.firewall.allowedTCPPorts = [80 8448 443]; services.caddy = { enable = true; virtualHosts = { - "matrix.broccoli.town" = { extraConfig = '' reverse_proxy /_matrix/* http://localhost:8008 @@ -37,14 +38,15 @@ X-Content-Type-Options "nosniff" X-Robots-Tag "noindex, noarchive, nofollow" } - root * ${pkgs.element-web.override { - conf = { - default_server_config."m.homeserver" = { - "base_url" = "https://broccoli.town"; - "server_name" = "broccoli.town"; + root * ${ + pkgs.element-web.override { + conf = { + default_server_config."m.homeserver" = { + "base_url" = "https://broccoli.town"; + "server_name" = "broccoli.town"; + }; }; - }; - } + } } file_server ''; @@ -57,7 +59,6 @@ file_server ''; }; - }; }; } diff --git a/hosts/dingserver/configuration.nix b/hosts/dingserver/configuration.nix index 1efa214..a82e76c 100644 --- a/hosts/dingserver/configuration.nix +++ b/hosts/dingserver/configuration.nix @@ -1,14 +1,17 @@ -{ config, pkgs, lib, ... }: - { - imports = - [ # Include the results of the hardware scan. - ../common - ./hardware-configuration.nix - ./caddy.nix - ./synapse.nix - ./syncthing.nix - ]; + config, + pkgs, + lib, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ../common + ./hardware-configuration.nix + ./caddy.nix + ./synapse.nix + ./syncthing.nix + ]; # Force disable the common boot loader boot.loader.systemd-boot.enable = lib.mkForce false; @@ -29,6 +32,4 @@ ]; system.stateVersion = "21.11"; # Did you read the comment? - } - diff --git a/hosts/dingserver/hardware-configuration.nix b/hosts/dingserver/hardware-configuration.nix index 2475921..5ccd401 100644 --- a/hosts/dingserver/hardware-configuration.nix +++ b/hosts/dingserver/hardware-configuration.nix @@ -1,24 +1,28 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = []; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/f91229ad-de6b-49ad-8858-e49fea85e8a1"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/f91229ad-de6b-49ad-8858-e49fea85e8a1"; + fsType = "ext4"; + }; - swapDevices = [ ]; + swapDevices = []; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/dingserver/prometheus.nix b/hosts/dingserver/prometheus.nix index 85e5844..e6e1d83 100644 --- a/hosts/dingserver/prometheus.nix +++ b/hosts/dingserver/prometheus.nix @@ -1,8 +1,11 @@ -{ config, pkgs, lib, ... }: - { + config, + pkgs, + lib, + ... +}: { services.grafana = { - enable = true; + enable = true; }; services.prometheus = { @@ -14,9 +17,11 @@ { job_name = "synapse"; metrics_path = "/_synapse/metrics"; - static_configs = [{ - targets = ["localhost:9000"]; - }]; + static_configs = [ + { + targets = ["localhost:9000"]; + } + ]; } ]; }; diff --git a/hosts/dingserver/synapse.nix b/hosts/dingserver/synapse.nix index 1bcf9e7..739359b 100644 --- a/hosts/dingserver/synapse.nix +++ b/hosts/dingserver/synapse.nix @@ -1,5 +1,9 @@ -{ config, pkgs, lib, ... }: -let +{ + config, + pkgs, + lib, + ... +}: let fqdn = "matrix.broccoli.town"; in { services.matrix-synapse = { @@ -16,7 +20,7 @@ in { x_forwarded = true; resources = [ { - names = [ "client" "federation" ]; + names = ["client" "federation"]; compress = false; } ]; diff --git a/hosts/dingserver/syncthing.nix b/hosts/dingserver/syncthing.nix index 9248072..7ab494d 100644 --- a/hosts/dingserver/syncthing.nix +++ b/hosts/dingserver/syncthing.nix @@ -1,5 +1,9 @@ -{ config, pkgs, lib, ... }: { + config, + pkgs, + lib, + ... +}: { services.syncthing = { enable = true; }; diff --git a/hosts/miniding/configuration.nix b/hosts/miniding/configuration.nix index 2ac7e73..6f3e205 100644 --- a/hosts/miniding/configuration.nix +++ b/hosts/miniding/configuration.nix @@ -1,16 +1,17 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: - { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ../common - ../common/graphical - ]; + config, + pkgs, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ../common + ../common/graphical + ]; networking = { hostName = "miniding"; @@ -21,7 +22,7 @@ services.xserver = { dpi = 144; }; - + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave @@ -30,4 +31,3 @@ # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "21.05"; # Did you read the comment? } - diff --git a/hosts/miniding/hardware-configuration.nix b/hosts/miniding/hardware-configuration.nix index ec19f0a..05164d7 100644 --- a/hosts/miniding/hardware-configuration.nix +++ b/hosts/miniding/hardware-configuration.nix @@ -1,28 +1,31 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/6a362ee7-854b-4a5b-8989-e65af01b9b99"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/6a362ee7-854b-4a5b-8989-e65af01b9b99"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/C103-FFC1"; - fsType = "vfat"; - }; - - swapDevices = [ ]; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/C103-FFC1"; + fsType = "vfat"; + }; + swapDevices = []; } diff --git a/hosts/pingbox/configuration.nix b/hosts/pingbox/configuration.nix index c23531d..d51524a 100644 --- a/hosts/pingbox/configuration.nix +++ b/hosts/pingbox/configuration.nix @@ -1,16 +1,17 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: - { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ../common - ../common/graphical - ]; + config, + pkgs, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ../common + ../common/graphical + ]; powerManagement = { enable = true; @@ -55,6 +56,4 @@ # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "21.05"; # Did you read the comment? - } - diff --git a/hosts/pingbox/hardware-configuration.nix b/hosts/pingbox/hardware-configuration.nix index afb1768..30ac3ce 100644 --- a/hosts/pingbox/hardware-configuration.nix +++ b/hosts/pingbox/hardware-configuration.nix @@ -1,29 +1,33 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/3d0e0831-a08a-4d97-ad5b-d07448346dee"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/3d0e0831-a08a-4d97-ad5b-d07448346dee"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/C4F1-BE4C"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/C4F1-BE4C"; + fsType = "vfat"; + }; - swapDevices = [ ]; + swapDevices = []; # The global useDHCP flag is deprecated, therefore explicitly set to false here. # Per-interface useDHCP will be mandatory in the future, so this generated config diff --git a/users/daniel/configs/desktop/i3/default.nix b/users/daniel/configs/desktop/i3/default.nix index 7f3ec4c..cd31316 100644 --- a/users/daniel/configs/desktop/i3/default.nix +++ b/users/daniel/configs/desktop/i3/default.nix @@ -1,192 +1,205 @@ -{ config, lib, pkgs, ...}: - -let - mod = "Mod4"; +{ + config, + lib, + pkgs, + ... +}: let + mod = "Mod4"; in { + home.file = { + "bin/scripts/goup" = { + source = ./goup; + executable = true; + }; + "bin/scripts/godown" = { + source = ./godown; + executable = true; + }; + }; + xsession = { + enable = true; - home.file = { - "bin/scripts/goup" = { - source = ./goup; - executable = true; - }; - "bin/scripts/godown" = { - source = ./godown; - executable = true; - }; - }; - xsession = { - enable = true; + windowManager.i3 = { + enable = true; + package = pkgs.i3-gaps; + config = { + bars = [ + { + colors = { + background = "#282A36"; + statusline = "#F8F8F2"; + separator = "#44475A"; - windowManager.i3 = { - enable = true; - package = pkgs.i3-gaps; - config = { - bars = [ - { - colors = { - background = "#282A36"; - statusline = "#F8F8F2"; - separator = "#44475A"; + activeWorkspace = { + border = "#282A36"; + background = "#44475A"; + text = "#F8F8F2"; + }; + focusedWorkspace = { + border = "#44475A"; + background = "#44475A"; + text = "#F8F8F2"; + }; + inactiveWorkspace = { + border = "#282A36"; + background = "#282A36"; + text = "#BFBFBF"; + }; + urgentWorkspace = { + border = "#FF5555"; + background = "#FF5555"; + text = "#F8F8F2"; + }; + bindingMode = { + border = "#FF5555"; + background = "#FF5555"; + text = "#F8F8F2"; + }; + }; + fonts = { + size = 11.0; + }; + statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs /home/daniel/.config/i3status-rust/config-main.toml"; + position = "top"; + } + ]; + colors = { + focused = { + border = "#6272A4"; + background = "#6272A4"; + text = "#F8F8F2"; + indicator = "#6272A4"; + childBorder = "#6272A4"; + }; + focusedInactive = { + border = "#44475A"; + background = "#44475A"; + text = "#F8F8F2"; + indicator = "#44475A"; + childBorder = "#44475A"; + }; + unfocused = { + border = "#282A36"; + background = "#282A36"; + text = "#BFBFBF"; + indicator = "#282A36"; + childBorder = "#282A36"; + }; + urgent = { + border = "#44475A"; + background = "#FF5555"; + text = "#F8F8F2"; + indicator = "#FF5555"; + childBorder = "#FF5555"; + }; + placeholder = { + border = "#282A36"; + background = "#282A36"; + text = "#F8F8F2"; + indicator = "#282A36"; + childBorder = "#282A36"; + }; + background = "#F8F8F2"; + }; - activeWorkspace = { - border = "#282A36"; - background = "#44475A"; - text = "#F8F8F2"; - }; - focusedWorkspace = { - border = "#44475A"; - background = "#44475A"; - text = "#F8F8F2"; - }; - inactiveWorkspace = { - border = "#282A36"; - background = "#282A36"; - text = "#BFBFBF"; - }; - urgentWorkspace = { - border = "#FF5555"; - background = "#FF5555"; - text = "#F8F8F2"; - }; - bindingMode = { - border = "#FF5555"; - background = "#FF5555"; - text = "#F8F8F2"; - }; - }; - fonts = { - size = 11.0; - }; - statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs /home/daniel/.config/i3status-rust/config-main.toml"; - position = "top"; - } - ]; - colors = { - focused = { - border = "#6272A4"; - background = "#6272A4"; - text = "#F8F8F2"; - indicator = "#6272A4"; - childBorder = "#6272A4"; - }; - focusedInactive = { - border = "#44475A"; - background = "#44475A"; - text = "#F8F8F2"; - indicator = "#44475A"; - childBorder = "#44475A"; - }; - unfocused = { - border = "#282A36"; - background = "#282A36"; - text = "#BFBFBF"; - indicator = "#282A36"; - childBorder = "#282A36"; - }; - urgent = { - border = "#44475A"; - background = "#FF5555"; - text = "#F8F8F2"; - indicator = "#FF5555"; - childBorder = "#FF5555"; - }; - placeholder = { - border = "#282A36"; - background = "#282A36"; - text = "#F8F8F2"; - indicator = "#282A36"; - childBorder = "#282A36"; - }; - background = "#F8F8F2"; - }; + defaultWorkspace = "workspace number 1"; - defaultWorkspace = "workspace number 1"; + floating = { + modifier = mod; + criteria = [ + {instance = "pavucontrol";} + ]; + }; - floating = { - modifier = mod; - criteria = [ - { instance = "pavucontrol"; } - ]; - }; + focus = { + followMouse = false; + }; - focus = { - followMouse = false; - }; + fonts = { + names = ["pango:monospace 8"]; + style = "monospace"; + size = 8.0; + }; - fonts = { - names = [ "pango:monospace 8" ]; - style = "monospace"; - size = 8.0; - }; + gaps = { + outer = lib.mkDefault 10; + inner = lib.mkDefault 5; + smartBorders = "on"; + }; - gaps = { - outer = lib.mkDefault 10; - inner = lib.mkDefault 5; - smartBorders = "on"; - }; + keybindings = lib.mkOptionDefault { + "${mod}+q" = "kill"; + "${mod}+d" = "exec rofi -show drun"; - keybindings = lib.mkOptionDefault { - "${mod}+q" = "kill"; - "${mod}+d" = "exec rofi -show drun"; + "${mod}+h" = "focus left"; + "${mod}+j" = "focus down"; + "${mod}+k" = "focus up"; + "${mod}+l" = "focus right"; - "${mod}+h" = "focus left"; - "${mod}+j" = "focus down"; - "${mod}+k" = "focus up"; - "${mod}+l" = "focus right"; + "${mod}+Shift+h" = "move left"; + "${mod}+Shift+l" = "move right"; - "${mod}+Shift+h" = "move left"; - "${mod}+Shift+l" = "move right"; + "${mod}+Tab" = "workspace back_and_forth"; - "${mod}+Tab" = "workspace back_and_forth"; + "${mod}+b" = "split h"; + "${mod}+v" = "split v"; + "${mod}+Control+Return" = "exec --no-startup-id i3utils workspace new"; + "${mod}+Control+Shift+Return" = "exec --no-startup-id i3utils workspace new -b"; + "${mod}+Shift+Return" = "exec --no-startup-id i3utils workspace new -n, move next"; - "${mod}+b" = "split h"; - "${mod}+v" = "split v"; - "${mod}+Control+Return" = "exec --no-startup-id i3utils workspace new"; - "${mod}+Control+Shift+Return" = "exec --no-startup-id i3utils workspace new -b"; - "${mod}+Shift+Return" = "exec --no-startup-id i3utils workspace new -n, move next"; + "${mod}+Control+j" = "exec --no-startup-id $HOME/bin/scripts/godown"; + "${mod}+Control+k" = "exec --no-startup-id $HOME/bin/scripts/goup"; + "${mod}+Control+h" = "exec --no-startup-id i3utils workspace new -b"; - "${mod}+Control+j" = "exec --no-startup-id $HOME/bin/scripts/godown"; - "${mod}+Control+k" = "exec --no-startup-id $HOME/bin/scripts/goup"; - "${mod}+Control+h" = "exec --no-startup-id i3utils workspace new -b"; + "${mod}+Shift+k" = "exec --no-startup-id i3utils window move prev"; + "${mod}+Shift+j" = "exec --no-startup-id i3utils window move next"; - "${mod}+Shift+k" = "exec --no-startup-id i3utils window move prev"; - "${mod}+Shift+j" = "exec --no-startup-id i3utils window move next"; + "${mod}+p" = "scratchpad show"; - "${mod}+p" = "scratchpad show"; + "${mod}+Escape" = "exec loginctl lock-session"; - "${mod}+Escape" = "exec loginctl lock-session"; + "XF86MonBrightnessUp" = "exec xbacklight -inc 10"; + "XF86MonBrightnessDown" = "exec xbacklight -dec 10"; + "XF86AudioMute" = "exec pamixer -t"; + "XF86AudioLowerVolume" = "exec pamixer -d 10"; + "XF86AudioRaiseVolume" = "exec pamixer -i 10"; + "XF86AudioPrev" = "exec playerctl previous"; + "XF86AudioPlay" = "exec playerctl play-pause"; + "XF86AudioNext" = "exec playerctl next"; - "XF86MonBrightnessUp" = "exec xbacklight -inc 10"; - "XF86MonBrightnessDown" = "exec xbacklight -dec 10"; - "XF86AudioMute" = "exec pamixer -t"; - "XF86AudioLowerVolume" = "exec pamixer -d 10"; - "XF86AudioRaiseVolume" = "exec pamixer -i 10"; - "XF86AudioPrev" = "exec playerctl previous"; - "XF86AudioPlay" = "exec playerctl play-pause"; - "XF86AudioNext" = "exec playerctl next"; + "Mod1+Shift+4" = "exec flameshot gui -s -p ~/Pictures/screenshots"; + }; - "Mod1+Shift+4" = "exec flameshot gui -s -p ~/Pictures/screenshots"; - }; + modifier = mod; - modifier = mod; + startup = [ + { + command = "$HOME/bin/scripts/flower"; + always = true; + } + { + command = "feh --bg-fill $HOME/wallpapers/wallpaper.jpg"; + always = false; + } + ]; - startup = [ - { command = "$HOME/bin/scripts/flower"; always = true; } - { command = "feh --bg-fill $HOME/wallpapers/wallpaper.jpg"; always = false; } - ]; + terminal = "kitty"; - terminal = "kitty"; - - window = { - border = lib.mkDefault 2; - titlebar = false; - commands = [ - { command = "move position center #2116 46"; criteria = { class = "jetbrains-toolbox"; }; } - { command = "move scratchpad"; criteria = { instance = "spotify"; }; } - ]; - }; - - }; - }; - }; + window = { + border = lib.mkDefault 2; + titlebar = false; + commands = [ + { + command = "move position center #2116 46"; + criteria = {class = "jetbrains-toolbox";}; + } + { + command = "move scratchpad"; + criteria = {instance = "spotify";}; + } + ]; + }; + }; + }; + }; } diff --git a/users/daniel/configs/desktop/i3status-rust/default.nix b/users/daniel/configs/desktop/i3status-rust/default.nix index 44bd709..10891a4 100644 --- a/users/daniel/configs/desktop/i3status-rust/default.nix +++ b/users/daniel/configs/desktop/i3status-rust/default.nix @@ -1,9 +1,11 @@ -{ config, pkgs, ... }: - { - programs.i3status-rust = { - enable = true; - bars = { + config, + pkgs, + ... +}: { + programs.i3status-rust = { + enable = true; + bars = { main = { theme = "dracula"; icons = "awesome"; @@ -37,13 +39,13 @@ { block = "music"; player = "spotify"; - buttons = [ "prev" "play" "next" ]; + buttons = ["prev" "play" "next"]; } { block = "sound"; } ]; }; - }; - }; + }; + }; } diff --git a/users/daniel/configs/desktop/polybar/default.nix b/users/daniel/configs/desktop/polybar/default.nix index b5accb3..d6d9174 100644 --- a/users/daniel/configs/desktop/polybar/default.nix +++ b/users/daniel/configs/desktop/polybar/default.nix @@ -1,20 +1,16 @@ -{pkgs, ...}: +{pkgs, ...}: { + services.polybar = { + enable = true; -{ - services.polybar = { - enable = true; + package = pkgs.polybar.override { + i3Support = true; + pulseSupport = true; + }; - package = pkgs.polybar.override { - i3Support = true; - pulseSupport = true; - }; + script = '' + polybar main & disown + ''; - script = '' - polybar main & disown - ''; - - config = ./config; - - - }; + config = ./config; + }; } diff --git a/users/daniel/configs/desktop/rofi/default.nix b/users/daniel/configs/desktop/rofi/default.nix index 0189675..45a48f7 100644 --- a/users/daniel/configs/desktop/rofi/default.nix +++ b/users/daniel/configs/desktop/rofi/default.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { programs.rofi = { enable = true; theme = ./colour.rasi; diff --git a/users/daniel/configs/system/alacritty/default.nix b/users/daniel/configs/system/alacritty/default.nix index 6d1d85f..028c03a 100644 --- a/users/daniel/configs/system/alacritty/default.nix +++ b/users/daniel/configs/system/alacritty/default.nix @@ -1,88 +1,86 @@ -{ pkgs, ... }: +{pkgs, ...}: { + programs.alacritty = { + enable = false; + settings = { + font = { + normal = { + family = "Iosevka"; + style = "Regular"; + }; + }; -{ - programs.alacritty = { - enable = false; - settings = { - font = { - normal = { - family = "Iosevka"; - style = "Regular"; - }; - }; + cursor = { + style = { + shape = "Underline"; + }; + }; - cursor = { - style= { - shape = "Underline"; - }; - }; - - colors = { - primary = { - background = "0x282a36"; - foreground = "0xf8f8f2"; - }; - cursor = { - text = "CellBackground"; - cursor = "CellForeground"; - }; - vi_mode_cursor = { - text = "CellBackground"; - cursor = "CellForeground"; - }; - search = { - matches = { - foreground = "0x44475a"; - background = "0x50fa7b"; - }; - focused_match = { - foreground = "0x44475a"; - background = "0xffb86c"; - }; - bar = { - background = "0x282a36"; - foreground = "0xf8f8f2"; - }; - }; - line_indicator = { - foreground = "None"; - background = "None"; - }; - selection = { - text = "CellForeground"; - background = "0x44475a"; - }; - normal = { - black = "0x000000"; - red = "0xff5555"; - green = "0x50fa7b"; - yellow = "0xf1fa8c"; - blue = "0xbd93f9"; - magenta = "0xff79c6"; - cyan = "0x8be9fd"; - white = "0xbfbfbf"; - }; - bright = { - black = "0x4d4d4d"; - red = "0xff6e67"; - green = "0x5af78e"; - yellow = "0xf4f99d"; - blue = "0xcaa9fa"; - magenta = "0xff92d0"; - cyan = "0x9aedfe"; - white = "0xe6e6e6"; - }; - dim = { - black = "0x14151b"; - red = "0xff2222"; - green = "0x1ef956"; - yellow = "0xebf85b"; - blue = "0x4d5b86"; - magenta = "0xff46b0"; - cyan = "0x59dffc"; - white = "0xe6e6d1"; - }; - }; - }; - }; + colors = { + primary = { + background = "0x282a36"; + foreground = "0xf8f8f2"; + }; + cursor = { + text = "CellBackground"; + cursor = "CellForeground"; + }; + vi_mode_cursor = { + text = "CellBackground"; + cursor = "CellForeground"; + }; + search = { + matches = { + foreground = "0x44475a"; + background = "0x50fa7b"; + }; + focused_match = { + foreground = "0x44475a"; + background = "0xffb86c"; + }; + bar = { + background = "0x282a36"; + foreground = "0xf8f8f2"; + }; + }; + line_indicator = { + foreground = "None"; + background = "None"; + }; + selection = { + text = "CellForeground"; + background = "0x44475a"; + }; + normal = { + black = "0x000000"; + red = "0xff5555"; + green = "0x50fa7b"; + yellow = "0xf1fa8c"; + blue = "0xbd93f9"; + magenta = "0xff79c6"; + cyan = "0x8be9fd"; + white = "0xbfbfbf"; + }; + bright = { + black = "0x4d4d4d"; + red = "0xff6e67"; + green = "0x5af78e"; + yellow = "0xf4f99d"; + blue = "0xcaa9fa"; + magenta = "0xff92d0"; + cyan = "0x9aedfe"; + white = "0xe6e6e6"; + }; + dim = { + black = "0x14151b"; + red = "0xff2222"; + green = "0x1ef956"; + yellow = "0xebf85b"; + blue = "0x4d5b86"; + magenta = "0xff46b0"; + cyan = "0x59dffc"; + white = "0xe6e6d1"; + }; + }; + }; + }; } diff --git a/users/daniel/configs/system/helix/default.nix b/users/daniel/configs/system/helix/default.nix index 2b88f6d..852913a 100644 --- a/users/daniel/configs/system/helix/default.nix +++ b/users/daniel/configs/system/helix/default.nix @@ -1,7 +1,6 @@ -{...}: -{ +{...}: { home.file.".config/helix" = { - source = ./config; - recursive = true; - }; + source = ./config; + recursive = true; + }; } diff --git a/users/daniel/configs/system/kitty/default.nix b/users/daniel/configs/system/kitty/default.nix index 4e4da8f..d4a6bdc 100644 --- a/users/daniel/configs/system/kitty/default.nix +++ b/users/daniel/configs/system/kitty/default.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { programs.kitty = { enable = true; font = { diff --git a/users/daniel/configs/system/neovim/default.nix b/users/daniel/configs/system/neovim/default.nix index c87c738..8ac33f4 100644 --- a/users/daniel/configs/system/neovim/default.nix +++ b/users/daniel/configs/system/neovim/default.nix @@ -1,31 +1,30 @@ -{ pkgs, ... }: +{pkgs, ...}: { + programs.neovim = { + enable = true; -{ - programs.neovim = { - enable = true; + plugins = with pkgs.vimPlugins; [ + (nvim-treesitter.withPlugins ( + plugins: + with plugins; [ + #tree-sitter-nix + tree-sitter-go + tree-sitter-c + tree-sitter-rust + tree-sitter-vim + tree-sitter-lua + tree-sitter-python + tree-sitter-html + tree-sitter-json + tree-sitter-markdown + tree-sitter-javascript + tree-sitter-typescript + ] + )) + vim-nix - plugins = with pkgs.vimPlugins; [ - (nvim-treesitter.withPlugins ( - plugins: with plugins; [ - #tree-sitter-nix - tree-sitter-go - tree-sitter-c - tree-sitter-rust - tree-sitter-vim - tree-sitter-lua - tree-sitter-python - tree-sitter-html - tree-sitter-json - tree-sitter-markdown - tree-sitter-javascript - tree-sitter-typescript - ] - )) - vim-nix - - nvim-lspconfig - ]; - viAlias = true; - vimAlias = true; - }; + nvim-lspconfig + ]; + viAlias = true; + vimAlias = true; + }; } diff --git a/users/daniel/default.nix b/users/daniel/default.nix index bd1188d..c3e5d21 100644 --- a/users/daniel/default.nix +++ b/users/daniel/default.nix @@ -1,156 +1,157 @@ -{ pkgs, lib, fetchurl, hostname, headless, ... }: -let - cliPackages = with pkgs; [ - aerc - entr - go_1_18 - gomuks - gopls - oh-my-zsh - ( - let - my-python-packages = python-packages: with python-packages; [ - tkinter - requests - ]; - python-with-my-packages = python3.withPackages my-python-packages; - in - python-with-my-packages - ) - ranger - restic - rust-analyzer - starship - ]; - - guiPackages = with pkgs; [ - _1password - _1password-gui - discord - feh - iosevka - jetbrains.goland - mpv - nerdfonts - pamixer - pavucontrol - playerctl - spotify - xclip - ]; -in { - imports = [ + pkgs, + lib, + fetchurl, + hostname, + headless, + ... +}: let + cliPackages = with pkgs; [ + aerc + entr + go_1_18 + gomuks + gopls + oh-my-zsh + ( + let + my-python-packages = python-packages: + with python-packages; [ + tkinter + requests + ]; + python-with-my-packages = python3.withPackages my-python-packages; + in + python-with-my-packages + ) + ranger + restic + rust-analyzer + starship + ]; - ./configs/system + guiPackages = with pkgs; [ + _1password + _1password-gui + discord + feh + iosevka + jetbrains.goland + mpv + nerdfonts + pamixer + pavucontrol + playerctl + spotify + xclip + ]; +in { + imports = + [ + ./configs/system + ] + ++ lib.optionals (!headless) [ + ./configs/desktop + ] + ++ lib.optionals (builtins.pathExists ./host-specific/${hostname}) [ + ./host-specific/${hostname} + ]; - ] ++ lib.optionals (!headless) [ + home = { + username = "daniel"; + homeDirectory = "/home/daniel"; + sessionPath = [ + "$HOME/go/bin" + ]; - ./configs/desktop + file = { + ".icons/default".source = "${pkgs.capitaine-cursors}/share/icons/capitaine-cursors"; - ] ++ lib.optionals (builtins.pathExists ./host-specific/${hostname}) [ + "bin/update" = { + source = ../../scripts/update; + executable = true; + }; - ./host-specific/${hostname} + "bin/supdate" = { + source = ../../scripts/supdate; + executable = true; + }; + }; - ]; + packages = cliPackages ++ lib.optionals (!headless) guiPackages; - home = { - username = "daniel"; - homeDirectory = "/home/daniel"; - sessionPath = [ - "$HOME/go/bin" - ]; + keyboard = { + layout = "gb"; + options = [ + "caps:escape" + ]; + }; - file = { - ".icons/default".source = "${pkgs.capitaine-cursors}/share/icons/capitaine-cursors"; + stateVersion = "21.05"; + }; - "bin/update" = { - source = ../../scripts/update; - executable = true; - }; + programs = { + # Let Home Manager install and manage itself. + home-manager.enable = true; - "bin/supdate" = { - source = ../../scripts/supdate; - executable = true; - }; - }; + fzf = { + enable = true; + enableZshIntegration = true; + }; - packages = cliPackages ++ lib.optionals (!headless) guiPackages; + git = { + enable = true; + package = pkgs.gitFull; + userName = "Daniel Patterson"; + userEmail = "me@danielpatterson.dev"; + extraConfig = { + pull.rebase = true; + init.defaultBranch = "main"; + format.signOff = "yes"; + sendemail = { + smtpUser = "me@danielpatterson.dev"; + smtpServer = "smtp.fastmail.com"; + smtpEncryption = "tls"; + smtpServerPort = 587; + }; + }; + }; - keyboard = { - layout = "gb"; - options = [ - "caps:escape" - ]; - }; + lazygit = { + enable = true; + settings = { + gui = { + showFileTree = false; + }; + }; + }; - stateVersion = "21.05"; - }; + starship.enable = true; - programs = { + vscode.enable = true; - # Let Home Manager install and manage itself. - home-manager.enable = true; + zsh = { + enable = true; + enableAutosuggestions = true; + oh-my-zsh = { + enable = true; + plugins = ["git" "fzf"]; + theme = "agnoster"; + }; + }; + }; - fzf = { - enable = true; - enableZshIntegration = true; - }; + services = { + dunst.enable = true; - git = { - enable = true; - package = pkgs.gitFull; - userName = "Daniel Patterson"; - userEmail = "me@danielpatterson.dev"; - extraConfig = { - pull.rebase = true; - init.defaultBranch = "main"; - format.signOff = "yes"; - sendemail = { - smtpUser = "me@danielpatterson.dev"; - smtpServer = "smtp.fastmail.com"; - smtpEncryption = "tls"; - smtpServerPort = 587; - }; - }; - }; - - lazygit = { - enable = true; - settings = { - gui = { - showFileTree = false; - }; - }; - }; - - starship.enable = true; - - vscode.enable = true; - - zsh = { - enable = true; - enableAutosuggestions = true; - oh-my-zsh = { - enable = true; - plugins = [ "git" "fzf" ]; - theme = "agnoster"; - }; - }; - }; - - services ={ - dunst.enable = true; - - syncthing = { - enable = true; - }; - - screen-locker = { - enable = true; - lockCmd = "${pkgs.i3lock}/bin/i3lock -i /home/daniel/wallpapers/lock.png"; - inactiveInterval = 60; - }; - }; + syncthing = { + enable = true; + }; + screen-locker = { + enable = true; + lockCmd = "${pkgs.i3lock}/bin/i3lock -i /home/daniel/wallpapers/lock.png"; + inactiveInterval = 60; + }; + }; } diff --git a/users/daniel/host-specific/dingbox/default.nix b/users/daniel/host-specific/dingbox/default.nix index 8808819..a03481a 100644 --- a/users/daniel/host-specific/dingbox/default.nix +++ b/users/daniel/host-specific/dingbox/default.nix @@ -1,12 +1,15 @@ -{ config, lib, pkgs, ...}: - { - home.file = { - "wallpapers" = { - source = ./wallpapers; - }; - }; + config, + lib, + pkgs, + ... +}: { + home.file = { + "wallpapers" = { + source = ./wallpapers; + }; + }; - programs.alacritty.settings.font.size = 13; - programs.kitty.font.size = 22; + programs.alacritty.settings.font.size = 13; + programs.kitty.font.size = 22; } diff --git a/users/daniel/host-specific/miniding/default.nix b/users/daniel/host-specific/miniding/default.nix index 5722ef9..8b8a206 100644 --- a/users/daniel/host-specific/miniding/default.nix +++ b/users/daniel/host-specific/miniding/default.nix @@ -1,20 +1,23 @@ -{ config, lib, pkgs, ...}: - { - services.picom = { - enable = true; - vSync = true; - }; + config, + lib, + pkgs, + ... +}: { + services.picom = { + enable = true; + vSync = true; + }; - xsession.windowManager.i3.config.gaps.outer = 6; - xsession.windowManager.i3.config.gaps.inner = 5; + xsession.windowManager.i3.config.gaps.outer = 6; + xsession.windowManager.i3.config.gaps.inner = 5; - home.file = { - wallpapers = { - source = ./wallpapers; - }; - }; + home.file = { + wallpapers = { + source = ./wallpapers; + }; + }; - programs.alacritty.settings.font.size = 10; - programs.kitty.font.size = 19; + programs.alacritty.settings.font.size = 10; + programs.kitty.font.size = 19; } diff --git a/users/daniel/host-specific/pingbox/default.nix b/users/daniel/host-specific/pingbox/default.nix index d97bed2..6f2f006 100644 --- a/users/daniel/host-specific/pingbox/default.nix +++ b/users/daniel/host-specific/pingbox/default.nix @@ -1,18 +1,21 @@ -{ config, lib, pkgs, ...}: - { - home = { - file = { - "wallpapers" = { - source = ./wallpapers; - }; - }; - }; + config, + lib, + pkgs, + ... +}: { + home = { + file = { + "wallpapers" = { + source = ./wallpapers; + }; + }; + }; programs.kitty.font.size = 19; - services.picom = { - enable = true; - vSync = true; - }; + services.picom = { + enable = true; + vSync = true; + }; }