From 7e4b442fd9af7f6bf247f80324432f23e6275cfd Mon Sep 17 00:00:00 2001 From: kat witch Date: Mon, 8 Feb 2021 22:03:38 +0000 Subject: [PATCH] Ran nixfmt. --- config/hosts/boline/configuration.nix | 8 +- .../hosts/boline/hardware-configuration.nix | 20 ++-- config/hosts/boline/wireguard.nix | 24 ++-- config/hosts/samhain/configuration.nix | 8 +- config/hosts/yule/configuration.nix | 9 +- config/hosts/yule/hardware-configuration.nix | 42 ++++--- config/profiles/common/default.nix | 2 +- config/profiles/desktop/default.nix | 7 +- config/profiles/sway/default.nix | 26 ++--- config/profiles/sway/waybar.css.nix | 104 +++++++++--------- config/users/kat/default.nix | 6 +- config/users/kat/emacs.nix | 5 +- lib/colorhelpers.nix | 38 ++++--- pkgs/default.nix | 8 +- 14 files changed, 148 insertions(+), 159 deletions(-) diff --git a/config/hosts/boline/configuration.nix b/config/hosts/boline/configuration.nix index 2ab8b74d..aa6aa8ce 100644 --- a/config/hosts/boline/configuration.nix +++ b/config/hosts/boline/configuration.nix @@ -8,7 +8,7 @@ #meta.deploy.profiles = []; meta.deploy.ssh.host = "boline.kittywit.ch"; - + boot.loader.grub.enable = true; boot.loader.grub.version = 2; boot.loader.grub.device = "/dev/vda"; @@ -17,9 +17,9 @@ networking.hostName = "boline"; networking.useDHCP = false; - networking.interfaces.ens3.ipv4.addresses = [ { - address = "104.244.73.10"; - prefixLength = 24; + networking.interfaces.ens3.ipv4.addresses = [{ + address = "104.244.73.10"; + prefixLength = 24; }]; networking.defaultGateway = "104.244.73.1"; networking.nameservers = [ "1.1.1.1" ]; diff --git a/config/hosts/boline/hardware-configuration.nix b/config/hosts/boline/hardware-configuration.nix index 7d775527..e03a01a5 100644 --- a/config/hosts/boline/hardware-configuration.nix +++ b/config/hosts/boline/hardware-configuration.nix @@ -1,22 +1,20 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.availableKernelModules = + [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/e0a9f76a-5eed-4dd3-a5a6-a93006f7d526"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/e0a9f76a-5eed-4dd3-a5a6-a93006f7d526"; + fsType = "ext4"; + }; swapDevices = - [ { device = "/dev/disk/by-uuid/cf122d6d-eca9-44f5-b655-85aaf5b2e6af"; } - ]; + [{ device = "/dev/disk/by-uuid/cf122d6d-eca9-44f5-b655-85aaf5b2e6af"; }]; -} \ No newline at end of file +} diff --git a/config/hosts/boline/wireguard.nix b/config/hosts/boline/wireguard.nix index 4f2cd32b..419f5758 100644 --- a/config/hosts/boline/wireguard.nix +++ b/config/hosts/boline/wireguard.nix @@ -1,15 +1,13 @@ { config, pkgs, ... }: { - networking.nat.enable = true; - networking.nat.externalInterface = "ens3"; - networking.nat.internalInterfaces = [ "wg0" ]; + networking.nat.enable = true; + networking.nat.externalInterface = "ens3"; + networking.nat.internalInterfaces = [ "wg0" ]; - networking.firewall = { - allowedUDPPorts = [ 51820 ]; - }; + networking.firewall = { allowedUDPPorts = [ 51820 ]; }; - networking.wireguard.interfaces = { + networking.wireguard.interfaces = { wg0 = { ips = [ "10.100.0.1/24" ]; @@ -24,12 +22,10 @@ privateKeyFile = "/var/secrets/wireguard-private"; - peers = [ - { - publicKey = "{client public key}"; - allowedIPs = [ "10.100.0.2/32" ]; - } - ]; + peers = [{ + publicKey = "{client public key}"; + allowedIPs = [ "10.100.0.2/32" ]; + }]; }; }; -} \ No newline at end of file +} diff --git a/config/hosts/samhain/configuration.nix b/config/hosts/samhain/configuration.nix index 0760f3f4..f2eaaa56 100644 --- a/config/hosts/samhain/configuration.nix +++ b/config/hosts/samhain/configuration.nix @@ -9,9 +9,10 @@ ./services/torrenting.nix ]; - meta.deploy.profiles = [ "desktop" "development" "sway" "gaming" "network" "yubikey" ]; + meta.deploy.profiles = + [ "desktop" "development" "sway" "gaming" "network" "yubikey" ]; meta.deploy.ssh.host = "192.168.1.135"; - + # libvirtd is used for our virtual machine virtualisation.libvirtd = { enable = true; @@ -22,7 +23,8 @@ }; # required for guest reboots with the 580 - boot.extraModulePackages = [ (pkgs.linuxPackagesFor config.boot.kernelPackages.kernel).vendor-reset ]; + boot.extraModulePackages = + [ (pkgs.linuxPackagesFor config.boot.kernelPackages.kernel).vendor-reset ]; # required groups for various intentions users.users.kat.extraGroups = [ "libvirtd" "input" "qemu-libvirtd" ]; diff --git a/config/hosts/yule/configuration.nix b/config/hosts/yule/configuration.nix index 6b1ca89e..78fd9af2 100644 --- a/config/hosts/yule/configuration.nix +++ b/config/hosts/yule/configuration.nix @@ -1,13 +1,12 @@ { config, pkgs, ... }: { - imports = [ - ./hardware-configuration.nix - ]; + imports = [ ./hardware-configuration.nix ]; - meta.deploy.profiles = [ "desktop" "development" "sway" "gaming" "network" "yubikey" ]; + meta.deploy.profiles = + [ "desktop" "development" "sway" "gaming" "network" "yubikey" ]; meta.deploy.ssh.host = "192.168.1.92"; - + boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.supportedFilesystems = [ "zfs" ]; diff --git a/config/hosts/yule/hardware-configuration.nix b/config/hosts/yule/hardware-configuration.nix index c479281e..fbe198b8 100644 --- a/config/hosts/yule/hardware-configuration.nix +++ b/config/hosts/yule/hardware-configuration.nix @@ -4,37 +4,35 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = + [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "rpool/safe/root"; - fsType = "zfs"; - }; + fileSystems."/" = { + device = "rpool/safe/root"; + fsType = "zfs"; + }; - fileSystems."/home" = - { device = "rpool/safe/home"; - fsType = "zfs"; - }; + fileSystems."/home" = { + device = "rpool/safe/home"; + fsType = "zfs"; + }; - fileSystems."/nix" = - { device = "rpool/local/nix"; - fsType = "zfs"; - }; + fileSystems."/nix" = { + device = "rpool/local/nix"; + fsType = "zfs"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/D680-ED0E"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/D680-ED0E"; + fsType = "vfat"; + }; swapDevices = - [ { device = "/dev/disk/by-uuid/87ff4f68-cc00-494e-8eba-050469c3bf03"; } - ]; + [{ device = "/dev/disk/by-uuid/87ff4f68-cc00-494e-8eba-050469c3bf03"; }]; } diff --git a/config/profiles/common/default.nix b/config/profiles/common/default.nix index 7fa5e923..ea90a87d 100644 --- a/config/profiles/common/default.nix +++ b/config/profiles/common/default.nix @@ -29,7 +29,7 @@ in { EDITOR = "emacs"; TERMINFO_DIRS = "${pkgs.kitty.terminfo.outPath}/share/terminfo"; }; - + services.openssh.enable = true; services.openssh.ports = lib.mkDefault [ 62954 ]; services.openssh.passwordAuthentication = false; diff --git a/config/profiles/desktop/default.nix b/config/profiles/desktop/default.nix index dcd1d5fc..36216594 100644 --- a/config/profiles/desktop/default.nix +++ b/config/profiles/desktop/default.nix @@ -6,7 +6,10 @@ let in { config = lib.mkIf (lib.elem "desktop" config.meta.deploy.profiles) { - nixpkgs.config = { mumble.speechdSupport = true; pulseaudio = true;}; + nixpkgs.config = { + mumble.speechdSupport = true; + pulseaudio = true; + }; environment.systemPackages = [ pkgs.redshift ]; @@ -52,7 +55,7 @@ in { programs.fish = { interactiveShellInit = "set -g fish_greeting ''"; }; programs.firefox = { enable = true; }; - + services.kdeconnect = { enable = true; indicator = true; diff --git a/config/profiles/sway/default.nix b/config/profiles/sway/default.nix index 3ef56c15..8c1266d7 100644 --- a/config/profiles/sway/default.nix +++ b/config/profiles/sway/default.nix @@ -1,6 +1,7 @@ { config, pkgs, lib, ... }: -let colors = import ./colors.nix; in { +let colors = import ./colors.nix; +in { config = lib.mkIf (lib.elem "sway" config.meta.deploy.profiles) { fonts.fonts = with pkgs; [ font-awesome @@ -253,10 +254,13 @@ let colors = import ./colors.nix; in { programs.waybar = { enable = true; - style = import ./waybar.css.nix { inherit colors; hextorgba = pkgs.colorhelpers.hextorgba; }; + style = import ./waybar.css.nix { + inherit colors; + hextorgba = pkgs.colorhelpers.hextorgba; + }; settings = [{ modules-left = [ "sway/workspaces" "sway/mode" "sway/window" ]; - modules-center = [ "clock" ]; + modules-center = [ "clock" ]; modules-right = [ "pulseaudio" "network" @@ -268,18 +272,10 @@ let colors = import ./colors.nix; in { ]; modules = { - cpu = { - format = " {usage}%"; - }; - memory = { - format = " {percentage}%"; - }; - battery = { - format = " {capacity}%"; - }; - temperature = { - format = "﨎 {temperatureC}°C"; - }; + cpu = { format = " {usage}%"; }; + memory = { format = " {percentage}%"; }; + battery = { format = " {capacity}%"; }; + temperature = { format = "﨎 {temperatureC}°C"; }; pulseaudio = { format = " {volume}%"; on-click = "pavucontrol"; diff --git a/config/profiles/sway/waybar.css.nix b/config/profiles/sway/waybar.css.nix index 2421e7a0..5e764668 100644 --- a/config/profiles/sway/waybar.css.nix +++ b/config/profiles/sway/waybar.css.nix @@ -1,65 +1,65 @@ { hextorgba, colors }: '' - * { - border: none; - border-radius: 0; - font-family: "Hack Nerd Font"; - font-size: 12px; - min-height: 14px -} + * { + border: none; + border-radius: 0; + font-family: "Hack Nerd Font"; + font-size: 12px; + min-height: 14px + } -#clock, #memory, #cpu, #temperature, #pulseaudio, #network, #mpd { - margin-left: 8px; - margin-right: 8px; - padding-left: 8px; - padding-right: 8px; - transition: none; - border-bottom: 2px solid ${colors.base16.color7}; - color: ${colors.base16.color7} -} + #clock, #memory, #cpu, #temperature, #pulseaudio, #network, #mpd { + margin-left: 8px; + margin-right: 8px; + padding-left: 8px; + padding-right: 8px; + transition: none; + border-bottom: 2px solid ${colors.base16.color7}; + color: ${colors.base16.color7} + } -window#waybar { background: ${hextorgba colors.base16.color0} } + window#waybar { background: ${hextorgba colors.base16.color0} } -#window { - color: ${colors.base16.color7}; - padding-left: 16px; - padding-right: 16px -} + #window { + color: ${colors.base16.color7}; + padding-left: 16px; + padding-right: 16px + } -#workspaces { padding: 0px 4px 0px 4px } + #workspaces { padding: 0px 4px 0px 4px } -#workspaces button { - color: ${colors.base16.color7}; - background: ${hextorgba colors.base16.color11}; - font-size: 16px; - margin: 0px 4px 0px 4px; - border-bottom: 2px solid transparent; - border-left: 1px solid ${colors.base16.color7}; - border-right: 1px solid ${colors.base16.color7} -} + #workspaces button { + color: ${colors.base16.color7}; + background: ${hextorgba colors.base16.color11}; + font-size: 16px; + margin: 0px 4px 0px 4px; + border-bottom: 2px solid transparent; + border-left: 1px solid ${colors.base16.color7}; + border-right: 1px solid ${colors.base16.color7} + } -#workspaces button:last-child { margin-right: 0px } + #workspaces button:last-child { margin-right: 0px } -#workspaces button.focused { - color: ${colors.base16.color1}; - border-bottom-color: ${colors.base16.color1} -} + #workspaces button.focused { + color: ${colors.base16.color1}; + border-bottom-color: ${colors.base16.color1} + } -#workspaces button:hover { - transition: none; - box-shadow: inherit; - text-shadow: inherit; - color: ${colors.base16.color3}; - border-bottom-color: ${colors.base16.color3} -} + #workspaces button:hover { + transition: none; + box-shadow: inherit; + text-shadow: inherit; + color: ${colors.base16.color3}; + border-bottom-color: ${colors.base16.color3} + } -#mpd { border-color: #5af78e } -#mpd.disconnected, #mpd.stopped { border-color: #282a36 } -#network { border-color: ${colors.base16.color3} } -#pulseaudio { border-color: ${colors.base16.color2} } -#temperature { border-color: ${colors.base16.color4} } -#cpu { border-color: ${colors.base16.color5} } -#memory { border-color: ${colors.base16.color17} } -#clock { border-color: ${colors.base16.color7} } + #mpd { border-color: #5af78e } + #mpd.disconnected, #mpd.stopped { border-color: #282a36 } + #network { border-color: ${colors.base16.color3} } + #pulseaudio { border-color: ${colors.base16.color2} } + #temperature { border-color: ${colors.base16.color4} } + #cpu { border-color: ${colors.base16.color5} } + #memory { border-color: ${colors.base16.color17} } + #clock { border-color: ${colors.base16.color7} } '' diff --git a/config/users/kat/default.nix b/config/users/kat/default.nix index 50c2542a..6361da5d 100644 --- a/config/users/kat/default.nix +++ b/config/users/kat/default.nix @@ -1,10 +1,8 @@ { config, pkgs, ... }: { - imports = [ - ./emacs.nix - ]; - + imports = [ ./emacs.nix ]; + users.users.kat = { uid = 1000; isNormalUser = true; diff --git a/config/users/kat/emacs.nix b/config/users/kat/emacs.nix index 29c03b1f..619bb7a6 100644 --- a/config/users/kat/emacs.nix +++ b/config/users/kat/emacs.nix @@ -4,9 +4,8 @@ let emacs = pkgs.callPackage sources.nix-doom-emacs { doomPrivateDir = "${./doom.d}"; emacsPackagesOverlay = self: super: { - magit-delta = super.magit-delta.overrideAttrs (esuper: { - buildInputs = esuper.buildInputs ++ [ pkgs.git ]; - }); + magit-delta = super.magit-delta.overrideAttrs + (esuper: { buildInputs = esuper.buildInputs ++ [ pkgs.git ]; }); }; }; in { diff --git a/lib/colorhelpers.nix b/lib/colorhelpers.nix index 62b59b48..7a98a3b7 100644 --- a/lib/colorhelpers.nix +++ b/lib/colorhelpers.nix @@ -1,19 +1,21 @@ -{ lib }: -rec { - hexChars = [ "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "e" "f" ]; - hexCharToInt = char: let - pairs = lib.imap0 (lib.flip lib.nameValuePair) hexChars; - idx = builtins.listToAttrs pairs; - in idx.${lib.toLower char}; +{ lib }: rec { + hexChars = + [ "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "e" "f" ]; + hexCharToInt = char: + let + pairs = lib.imap0 (lib.flip lib.nameValuePair) hexChars; + idx = builtins.listToAttrs pairs; + in idx.${lib.toLower char}; hexToInt = str: - lib.foldl (value: chr: value * 16 + hexCharToInt chr) 0 (lib.stringToCharacters str); - hextorgba = hex: ( - let r_hex = lib.substring 1 2 hex; - g_hex = lib.substring 3 2 hex; - b_hex = lib.substring 5 2 hex; - r_dec = hexToInt r_hex; - g_dec = hexToInt g_hex; - b_dec = hexToInt b_hex; - in "rgba(${toString r_dec}, ${toString g_dec}, ${toString b_dec}, 0.75)" - ); -} \ No newline at end of file + lib.foldl (value: chr: value * 16 + hexCharToInt chr) 0 + (lib.stringToCharacters str); + hextorgba = hex: + (let + r_hex = lib.substring 1 2 hex; + g_hex = lib.substring 3 2 hex; + b_hex = lib.substring 5 2 hex; + r_dec = hexToInt r_hex; + g_dec = hexToInt g_hex; + b_dec = hexToInt b_hex; + in "rgba(${toString r_dec}, ${toString g_dec}, ${toString b_dec}, 0.75)"); +} diff --git a/pkgs/default.nix b/pkgs/default.nix index e33c89f6..90bbf3f4 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -10,10 +10,8 @@ let dino = callPackage "${sources.qyliss-nixlib}/overlays/patches/dino" { inherit (pkgs) dino; }; - - discord = pkgs.discord.override { - nss = pkgs.nss_latest; - }; + + discord = pkgs.discord.override { nss = pkgs.nss_latest; }; linuxPackagesFor = kernel: (pkgs.linuxPackagesFor kernel).extend (_: ksuper: { @@ -22,7 +20,7 @@ let }); colorhelpers = import ../lib/colorhelpers.nix { inherit (pkgs) lib; }; - + inherit callPackage; appendOverlays = overlays: (pkgs.appendOverlays overlays) // newpkgs; };