diff --git a/extra_info.nix b/extra_info.nix index 0bf1984..115a43c 100644 --- a/extra_info.nix +++ b/extra_info.nix @@ -1,6 +1,7 @@ -{lib, ...}: +{ lib, ... }: with lib; -with builtins; { +with builtins; +{ options = { extraInfo.email = mkOption { type = types.str; @@ -23,7 +24,7 @@ with builtins; { extraInfo.outputs = mkOption { type = types.attrsOf (types.attrsOf types.str); description = "Description of the outputs"; - default = {}; + default = { }; }; }; } diff --git a/gaming/hm.nix b/gaming/hm.nix index 7128100..6f85c48 100644 --- a/gaming/hm.nix +++ b/gaming/hm.nix @@ -3,7 +3,8 @@ config, lib, ... -}: { +}: +{ home.packages = with pkgs; [ bottles heroic @@ -26,7 +27,7 @@ }; home.activation = { - proton-ge = lib.hm.dag.entryAfter ["writeBoundary"] '' + proton-ge = lib.hm.dag.entryAfter [ "writeBoundary" ] '' target="${config.home.homeDirectory}/.steam/root/compatibilitytools.d/Proton-${lib.getVersion pkgs.proton-ge}" if ! [ -d "$target" ]; then cp -R ${pkgs.proton-ge} "$target" diff --git a/gaming/nixos.nix b/gaming/nixos.nix index 692806e..0d67d44 100644 --- a/gaming/nixos.nix +++ b/gaming/nixos.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ nixpkgs.config = { allowUnfree = true; }; diff --git a/hostconfig/ZeNixComputa/hardware-configuration.nix b/hostconfig/ZeNixComputa/hardware-configuration.nix index c9f039b..ed932b8 100644 --- a/hostconfig/ZeNixComputa/hardware-configuration.nix +++ b/hostconfig/ZeNixComputa/hardware-configuration.nix @@ -7,15 +7,21 @@ pkgs, modulesPath, ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; +}: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = ["dm-snapshot"]; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/618a4ff8-5bbc-4d61-8c0f-0d963ac0931b"; @@ -37,7 +43,5 @@ fsType = "btrfs"; }; - swapDevices = [ - {device = "/dev/disk/by-uuid/3d5336f6-63c8-47ef-91ed-8e605e4fb875";} - ]; + swapDevices = [ { device = "/dev/disk/by-uuid/3d5336f6-63c8-47ef-91ed-8e605e4fb875"; } ]; } diff --git a/hostconfig/ZeNixComputa/hm.nix b/hostconfig/ZeNixComputa/hm.nix index 1c7877b..3a990ca 100644 --- a/hostconfig/ZeNixComputa/hm.nix +++ b/hostconfig/ZeNixComputa/hm.nix @@ -1,11 +1,8 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { home.username = "${config.extraInfo.username}"; home.homeDirectory = "/home/${config.extraInfo.username}"; - home.packages = with pkgs; [cura]; + home.packages = with pkgs; [ cura ]; programs.git = { userName = "traxys"; @@ -13,8 +10,8 @@ }; wm.startup = [ - {command = "${pkgs.wayvnc}/bin/waync 127.0.0.1 5800";} - {command = "${pkgs.ckb-next}/bin/ckb-next -b";} + { command = "${pkgs.wayvnc}/bin/waync 127.0.0.1 5800"; } + { command = "${pkgs.ckb-next}/bin/ckb-next -b"; } ]; wm.workspaces.definitions = { @@ -26,8 +23,8 @@ services.mako.output = "DP-2"; xdg.desktopEntries.teams = { - name = "teams"; - exec = "${pkgs.chromium}/bin/chromium --app=https://teams.microsoft.com"; + name = "teams"; + exec = "${pkgs.chromium}/bin/chromium --app=https://teams.microsoft.com"; }; # This value determines the Home Manager release that your diff --git a/hostconfig/ZeNixComputa/nixos.nix b/hostconfig/ZeNixComputa/nixos.nix index 1c4e886..47f01e8 100644 --- a/hostconfig/ZeNixComputa/nixos.nix +++ b/hostconfig/ZeNixComputa/nixos.nix @@ -1,11 +1,11 @@ +{ pkgs, lib, ... }: { - pkgs, - lib, - ... -}: { boot.initrd = { enable = true; - availableKernelModules = ["amdgpu" "r8169"]; + availableKernelModules = [ + "amdgpu" + "r8169" + ]; # secrets = { # "/etc/secrets/initrd/keyfile" = "/etc/secrets/initrd/keyfile"; @@ -40,8 +40,26 @@ wakeOnLan.enable = true; }; }; - firewall.allowedTCPPorts = [8080 8085 5201 7777 24642 80 443 843 38202 38203]; - firewall.allowedUDPPorts = [24642 80 443 843 38202 38203]; + firewall.allowedTCPPorts = [ + 8080 + 8085 + 5201 + 7777 + 24642 + 80 + 443 + 843 + 38202 + 38203 + ]; + firewall.allowedUDPPorts = [ + 24642 + 80 + 443 + 843 + 38202 + 38203 + ]; }; time.timeZone = "Europe/Paris"; @@ -58,12 +76,11 @@ services.postgresql = { enable = true; - ensureUsers = [ - { - name = "traxys"; - } + ensureUsers = [ { name = "traxys"; } ]; + ensureDatabases = [ + "list" + "regalade" ]; - ensureDatabases = ["list" "regalade"]; }; hardware.cpu.amd.updateMicrocode = true; @@ -73,7 +90,7 @@ keep-derivations = true ''; - boot.binfmt.emulatedSystems = ["aarch64-linux"]; + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/hostconfig/ZeNixLaptop/hardware-configuration.nix b/hostconfig/ZeNixLaptop/hardware-configuration.nix index 0655fba..ec51864 100644 --- a/hostconfig/ZeNixLaptop/hardware-configuration.nix +++ b/hostconfig/ZeNixLaptop/hardware-configuration.nix @@ -7,16 +7,22 @@ pkgs, modulesPath, ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; +}: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; - boot.initrd.kernelModules = ["dm-snapshot"]; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; - boot.kernelParams = ["iomem=relaxed"]; + boot.initrd.availableKernelModules = [ + "ehci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + "sdhci_pci" + ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + boot.kernelParams = [ "iomem=relaxed" ]; fileSystems."/" = { device = "/dev/disk/by-uuid/95baa216-c7f1-418d-be70-cd1d4102c837"; @@ -28,6 +34,5 @@ fsType = "btrfs"; }; - swapDevices = [ - ]; + swapDevices = [ ]; } diff --git a/hostconfig/ZeNixLaptop/hm.nix b/hostconfig/ZeNixLaptop/hm.nix index f0d5bf3..10456f7 100644 --- a/hostconfig/ZeNixLaptop/hm.nix +++ b/hostconfig/ZeNixLaptop/hm.nix @@ -1,4 +1,5 @@ -{config, ...}: { +{ config, ... }: +{ programs.git = { userName = "traxys"; userEmail = config.extraInfo.email; diff --git a/hostconfig/ZeNixLaptop/nixos.nix b/hostconfig/ZeNixLaptop/nixos.nix index 8341ca6..619d6de 100644 --- a/hostconfig/ZeNixLaptop/nixos.nix +++ b/hostconfig/ZeNixLaptop/nixos.nix @@ -1,7 +1,5 @@ { - imports = [ - ./hardware-configuration.nix - ]; + imports = [ ./hardware-configuration.nix ]; boot = { initrd = { diff --git a/hostconfig/minus/hardware-configuration.nix b/hostconfig/minus/hardware-configuration.nix index fa93206..974fc3c 100644 --- a/hostconfig/minus/hardware-configuration.nix +++ b/hostconfig/minus/hardware-configuration.nix @@ -1,31 +1,39 @@ # 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, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "usb_storage" + "usbhid" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/867b63c6-0ce0-4c60-9fea-78e6f2fc2a48"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/867b63c6-0ce0-4c60-9fea-78e6f2fc2a48"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/98AE-2D96"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/98AE-2D96"; + fsType = "vfat"; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/9417523e-0cc5-47f3-920a-ac39038673d4"; } - ]; + swapDevices = [ { device = "/dev/disk/by-uuid/9417523e-0cc5-47f3-920a-ac39038673d4"; } ]; # 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/hostconfig/minus/hm.nix b/hostconfig/minus/hm.nix index af71f89..a27cc42 100644 --- a/hostconfig/minus/hm.nix +++ b/hostconfig/minus/hm.nix @@ -1,8 +1,5 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { home.username = "${config.extraInfo.username}"; home.homeDirectory = "/home/${config.extraInfo.username}"; diff --git a/hostconfig/minus/nixos.nix b/hostconfig/minus/nixos.nix index 5689e46..f9ec84c 100644 --- a/hostconfig/minus/nixos.nix +++ b/hostconfig/minus/nixos.nix @@ -1,15 +1,12 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; networking.hostName = "minus"; networking.networkmanager.enable = true; - networking.firewall.allowedTCPPorts = [1234]; - networking.firewall.allowedUDPPorts = [5353]; + networking.firewall.allowedTCPPorts = [ 1234 ]; + networking.firewall.allowedUDPPorts = [ 5353 ]; networking.interfaces.enp1s0.wakeOnLan.enable = true; time.timeZone = "Europe/Paris"; i18n.defaultLocale = "en_GB.UTF-8"; @@ -44,7 +41,10 @@ users.users."${config.extraInfo.username}" = { isNormalUser = true; description = "Quentin"; - extraGroups = ["networkmanager" "wheel"]; + extraGroups = [ + "networkmanager" + "wheel" + ]; }; services.flatpak.enable = true; @@ -56,14 +56,15 @@ environment.systemPackages = [ pkgs.moonlight-qt pkgs.jstest-gtk - (pkgs.kodi.withPackages (p: - with p; [ + (pkgs.kodi.withPackages ( + p: with p; [ jellyfin youtube inputstream-adaptive steam-launcher netflix - ])) + ] + )) ]; services.xserver.enable = true; diff --git a/hostconfig/thinkpad-nixos/hardware-configuration.nix b/hostconfig/thinkpad-nixos/hardware-configuration.nix index f0003d5..250fb75 100644 --- a/hostconfig/thinkpad-nixos/hardware-configuration.nix +++ b/hostconfig/thinkpad-nixos/hardware-configuration.nix @@ -7,15 +7,20 @@ pkgs, modulesPath, ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; +}: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; - boot.initrd.kernelModules = ["dm-snapshot"]; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "nvme" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/a53e1f39-a9e9-481b-a970-740d0c549181"; @@ -27,9 +32,7 @@ fsType = "vfat"; }; - swapDevices = [ - {device = "/dev/disk/by-uuid/ff3ba4e7-71e0-4723-b2d1-b1ca61f99337";} - ]; + swapDevices = [ { device = "/dev/disk/by-uuid/ff3ba4e7-71e0-4723-b2d1-b1ca61f99337"; } ]; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/hostconfig/thinkpad-nixos/hm.nix b/hostconfig/thinkpad-nixos/hm.nix index 27fa8f4..b4fa140 100644 --- a/hostconfig/thinkpad-nixos/hm.nix +++ b/hostconfig/thinkpad-nixos/hm.nix @@ -3,28 +3,33 @@ config, lib, ... -}: let +}: +let projects = { - btf = ["bxi-test-frameworks" "bxi-frameworks"]; - bxi3 = ["bxi3"]; - libs2 = ["bxi-jenkins-libs2"]; - hps = ["bxi-hps"]; - doc = ["bxi-doc"]; - container = ["bxi-containers"]; - flash-tools = ["bxi-flash-tools"]; - gpumap = ["gpumap"]; - ofi = ["libfabric-bxi-portals"]; - lustre = ["lustre-ptl4lnd"]; - ptlnet = ["ptlnet"]; - openshmem = ["sandia-openshmem"]; - bxi-base = ["bxi-base"]; - bxi2-portals = ["bxi-portals"]; - bxi2-mod = ["bxi-module"]; - bxi2-ptltest = ["bxi-portals-tests"]; - bxicomm = ["bxicomm"]; + btf = [ + "bxi-test-frameworks" + "bxi-frameworks" + ]; + bxi3 = [ "bxi3" ]; + libs2 = [ "bxi-jenkins-libs2" ]; + hps = [ "bxi-hps" ]; + doc = [ "bxi-doc" ]; + container = [ "bxi-containers" ]; + flash-tools = [ "bxi-flash-tools" ]; + gpumap = [ "gpumap" ]; + ofi = [ "libfabric-bxi-portals" ]; + lustre = [ "lustre-ptl4lnd" ]; + ptlnet = [ "ptlnet" ]; + openshmem = [ "sandia-openshmem" ]; + bxi-base = [ "bxi-base" ]; + bxi2-portals = [ "bxi-portals" ]; + bxi2-mod = [ "bxi-module" ]; + bxi2-ptltest = [ "bxi-portals-tests" ]; + bxicomm = [ "bxicomm" ]; }; -in { - imports = [./work.nix]; +in +{ + imports = [ ./work.nix ]; home.packages = with pkgs; [ bear @@ -43,9 +48,7 @@ in { sshfs ]; - wm.startup = [ - {command = "chromium --app=http://teams.microsoft.com";} - ]; + wm.startup = [ { command = "chromium --app=http://teams.microsoft.com"; } ]; wm.workspaces.definitions."".assign = [ "Microsoft Teams" @@ -101,36 +104,34 @@ in { programs.aerc = { enable = true; extraAccounts = { - work-t = let - workCfg = config.accounts.email.accounts.work.aerc; - in { - inherit - (workCfg.extraAccounts) - check-mail-cmd - check-mail-timeout - ; - from = "Quentin Boyer <${config.workAddr}>"; - outgoing = "msmtpq --read-envelope-from --read-recipients"; - default = "_unread"; - postpone = "Drafts"; - source = "notmuch://~/Maildir"; - address-book-cmd = "${pkgs.notmuch-addrlookup}/bin/notmuch-addrlookup --format=aerc %s"; - query-map = let - mkPatchDir = name: "patches/${name}=tag:${name}"; - patchDirs = builtins.concatStringsSep "\n" (builtins.map mkPatchDir ( - builtins.attrNames projects - )); - in "${pkgs.writeText "querymap" '' - inbox=tag:inbox and not tag:spammy - inflight=thread:{tag:inflight} - review=thread:{tag:review} - _unread=thread:{tag:unread} - _todo=thread:{tag:todo} - ext/iommu=tag:iommu + work-t = + let + workCfg = config.accounts.email.accounts.work.aerc; + in + { + inherit (workCfg.extraAccounts) check-mail-cmd check-mail-timeout; + from = "Quentin Boyer <${config.workAddr}>"; + outgoing = "msmtpq --read-envelope-from --read-recipients"; + default = "_unread"; + postpone = "Drafts"; + source = "notmuch://~/Maildir"; + address-book-cmd = "${pkgs.notmuch-addrlookup}/bin/notmuch-addrlookup --format=aerc %s"; + query-map = + let + mkPatchDir = name: "patches/${name}=tag:${name}"; + patchDirs = builtins.concatStringsSep "\n" (builtins.map mkPatchDir (builtins.attrNames projects)); + in + "${pkgs.writeText "querymap" '' + inbox=tag:inbox and not tag:spammy + inflight=thread:{tag:inflight} + review=thread:{tag:review} + _unread=thread:{tag:unread} + _todo=thread:{tag:todo} + ext/iommu=tag:iommu - ${patchDirs} - ''}"; - }; + ${patchDirs} + ''}"; + }; }; extraConfig = { general.unsafe-accounts-conf = true; @@ -280,42 +281,42 @@ in { programs.notmuch = { enable = true; - new.tags = ["new"]; + new.tags = [ "new" ]; hooks = { preNew = "${pkgs.isync}/bin/mbsync --all"; - postNew = let - mkProjectMatch = project: "subject:'/PATCH\\s${project}\\s/'"; - mkProjectMatches = labels: lib.concatStringsSep " or " (builtins.map mkProjectMatch labels); + postNew = + let + mkProjectMatch = project: "subject:'/PATCH\\s${project}\\s/'"; + mkProjectMatches = labels: lib.concatStringsSep " or " (builtins.map mkProjectMatch labels); - mkProject = tag: labels: '' - notmuch tag +${tag} -unread -new -- tag:new and \( ${mkProjectMatches labels} \) and tag:me - notmuch tag +${tag} +unread -new -- tag:new and \( ${mkProjectMatches labels} \) and not tag:me + mkProject = tag: labels: '' + notmuch tag +${tag} -unread -new -- tag:new and \( ${mkProjectMatches labels} \) and tag:me + notmuch tag +${tag} +unread -new -- tag:new and \( ${mkProjectMatches labels} \) and not tag:me + ''; + + projectFilters = builtins.concatStringsSep "\n" (lib.attrsets.mapAttrsToList mkProject projects); + + spammyFilters = [ + "subject:'[confluence] Recommended in Confluence for Boyer, Quentin'" + "subject:'[PCI-SIG]'" + "from:enterprisedb.com" + "from:GIGA@***REMOVED***" + ]; + + spammySearch = lib.concatStringsSep " or " spammyFilters; + in + '' + notmuch tag +work -- tag:new and 'path:work/**' + notmuch tag +iommu -new -- tag:new and to:iommu@lists.linux.dev and subject:'/\[PATCH/' + notmuch tag -unread -- tag:iommu and subject:'/^Re:/' + notmuch tag +inflight -- tag:new and from:${config.workAddr} and subject:'/^\[PATCH/' + notmuch tag +review -- tag:new and not from:${config.workAddr} and subject:'/^\[PATCH/' + notmuch tag -unread +me -- tag:new and from:${config.workAddr} + notmuch tag -unread -new +spammy -- tag:new and \( ${spammySearch} \) + ${projectFilters} + notmuch tag +inbox +unread -new -- tag:new and not tag:me + notmuch tag +inbox -unread -new -- tag:new and tag:me ''; - - projectFilters = - builtins.concatStringsSep "\n" - (lib.attrsets.mapAttrsToList mkProject projects); - - spammyFilters = [ - "subject:'[confluence] Recommended in Confluence for Boyer, Quentin'" - "subject:'[PCI-SIG]'" - "from:enterprisedb.com" - "from:GIGA@***REMOVED***" - ]; - - spammySearch = lib.concatStringsSep " or " spammyFilters; - in '' - notmuch tag +work -- tag:new and 'path:work/**' - notmuch tag +iommu -new -- tag:new and to:iommu@lists.linux.dev and subject:'/\[PATCH/' - notmuch tag -unread -- tag:iommu and subject:'/^Re:/' - notmuch tag +inflight -- tag:new and from:${config.workAddr} and subject:'/^\[PATCH/' - notmuch tag +review -- tag:new and not from:${config.workAddr} and subject:'/^\[PATCH/' - notmuch tag -unread +me -- tag:new and from:${config.workAddr} - notmuch tag -unread -new +spammy -- tag:new and \( ${spammySearch} \) - ${projectFilters} - notmuch tag +inbox +unread -new -- tag:new and not tag:me - notmuch tag +inbox -unread -new -- tag:new and tag:me - ''; }; }; @@ -341,7 +342,10 @@ in { url = "http://localhost:1080/users/${config.workAddr}/calendar/"; type = "caldav"; userName = "${config.workAddr}"; - passwordCommand = ["echo" "foobar"]; + passwordCommand = [ + "echo" + "foobar" + ]; }; khal = { enable = true; @@ -395,7 +399,9 @@ in { }; systemd.user.services.notmuch-new = { - Unit = {Description = "notmuch synchronization";}; + Unit = { + Description = "notmuch synchronization"; + }; Service = { Type = "oneshot"; @@ -404,14 +410,18 @@ in { }; systemd.user.timers.notmuch = { - Unit = {Description = "notmuch synchronization";}; + Unit = { + Description = "notmuch synchronization"; + }; Timer = { OnCalendar = "*:0/5"; Unit = "notmuch-new.service"; }; - Install = {WantedBy = ["default.target"];}; + Install = { + WantedBy = [ "default.target" ]; + }; }; xdg.desktopEntries.teams = { diff --git a/hostconfig/thinkpad-nixos/nixos.nix b/hostconfig/thinkpad-nixos/nixos.nix index 55d2d68..ea09d3a 100644 --- a/hostconfig/thinkpad-nixos/nixos.nix +++ b/hostconfig/thinkpad-nixos/nixos.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ boot.initrd = { luks.devices = { root = { @@ -15,12 +16,15 @@ environment.systemPackages = [ (pkgs.davmail.overrideAttrs (old: { - nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.swt]; + nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.swt ]; })) pkgs.virtiofsd ]; - boot.kernelParams = ["intel_iommu=on" "iommu=pt"]; + boot.kernelParams = [ + "intel_iommu=on" + "iommu=pt" + ]; networking = { hostName = "thinkpad-nixos"; @@ -38,7 +42,7 @@ isSystemUser = true; }; groups.sf-user.gid = 1100; - extraGroups.vboxusers.members = ["traxys"]; + extraGroups.vboxusers.members = [ "traxys" ]; }; nixpkgs.config.allowUnfree = true; @@ -46,7 +50,11 @@ virtualisation.containers = { enable = true; registries = { - search = ["registry.sf.bds.***REMOVED***" "docker.io" "quay.io"]; + search = [ + "registry.sf.bds.***REMOVED***" + "docker.io" + "quay.io" + ]; }; }; @@ -56,7 +64,7 @@ ExecStart = "${pkgs.roaming_proxy}/bin/roaming_proxy --config ${./roaming.toml}"; Restart = "on-failure"; }; - wantedBy = ["default.target"]; + wantedBy = [ "default.target" ]; }; systemd.services.roaming_proxy.enable = true; @@ -65,7 +73,7 @@ # }; services.tailscale.enable = true; - systemd.services.tailscaled.serviceConfig.Environment = ["http_proxy=http://localhost:8100"]; + systemd.services.tailscaled.serviceConfig.Environment = [ "http_proxy=http://localhost:8100" ]; security.sudo.extraConfig = ''Defaults env_keep += "*_proxy *_PROXY"''; networking.proxy = { diff --git a/hostconfig/thinkpad-nixos/work.nix b/hostconfig/thinkpad-nixos/work.nix index b9df2a0..09b9f0d 100644 --- a/hostconfig/thinkpad-nixos/work.nix +++ b/hostconfig/thinkpad-nixos/work.nix @@ -3,11 +3,10 @@ lib, config, ... -}: { +}: +{ options = { - workAddr = lib.mkOption { - type = lib.types.str; - }; + workAddr = lib.mkOption { type = lib.types.str; }; }; config = { @@ -26,7 +25,10 @@ programs.git-series-manager = { enable = true; settings = { - sendmail_args = ["--sendmail-cmd=nwadminSendmail" "--to=dl-bxi-sw-ll-patches@***REMOVED***"]; + sendmail_args = [ + "--sendmail-cmd=nwadminSendmail" + "--to=dl-bxi-sw-ll-patches@***REMOVED***" + ]; repo_url_base = "https://***REMOVED***/scm/bril/"; ci_url = "https://sf.bds.***REMOVED***/jenkins/job/BRIL/job/\${component}/job/\${branch}/\${ci_job}"; editor = "nvim"; diff --git a/minimal/hm.nix b/minimal/hm.nix index 54102e7..753c94e 100644 --- a/minimal/hm.nix +++ b/minimal/hm.nix @@ -2,12 +2,14 @@ inputs, flake, extraInfo, -}: { +}: +{ pkgs, lib, config, ... -}: { +}: +{ options.programs.git.excludes = lib.mkOption { type = lib.types.lines; default = ""; @@ -63,8 +65,7 @@ # Useful for pandoc to latex (texlive.combine { - inherit - (texlive) + inherit (texlive) scheme-medium fncychap wrapfig @@ -153,7 +154,11 @@ enableCompletion = true; oh-my-zsh = { enable = true; - plugins = ["git" "wd" "rust"]; + plugins = [ + "git" + "wd" + "rust" + ]; }; plugins = [ { diff --git a/minimal/nixos.nix b/minimal/nixos.nix index a00a2ce..4a07a4c 100644 --- a/minimal/nixos.nix +++ b/minimal/nixos.nix @@ -1,10 +1,12 @@ -{extraInfo}: { +{ extraInfo }: +{ config, pkgs, lib, ... -}: { - imports = [extraInfo]; +}: +{ + imports = [ extraInfo ]; boot.kernelPackages = lib.mkDefault pkgs.linuxPackages; @@ -14,7 +16,7 @@ isNormalUser = true; home = "/home/${config.extraInfo.username}"; shell = pkgs.zsh; - extraGroups = ["wheel"]; + extraGroups = [ "wheel" ]; }; programs.zsh.enable = true; @@ -25,18 +27,18 @@ keyMap = "dvorak-programmer"; }; - environment.pathsToLink = ["/share/zsh"]; + environment.pathsToLink = [ "/share/zsh" ]; fonts.enableDefaultFonts = true; fonts = { fonts = with pkgs; [ - (nerdfonts.override {fonts = ["Hack"];}) + (nerdfonts.override { fonts = [ "Hack" ]; }) dejavu_fonts ]; fontconfig = { defaultFonts = { - serif = ["DejaVu"]; - sansSerif = ["DejaVu Sans"]; - monospace = ["Hack"]; + serif = [ "DejaVu" ]; + sansSerif = [ "DejaVu Sans" ]; + monospace = [ "Hack" ]; }; }; }; @@ -44,20 +46,22 @@ nixpkgs.overlays = [ (final: super: { nixos-rebuild = super.nixos-rebuild.overrideAttrs (old: { - nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.makeWrapper]; + nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.makeWrapper ]; - src = "${final.runCommand "nixos-rebuild.sh" {} '' - mkdir -p $out + src = "${ + final.runCommand "nixos-rebuild.sh" { } '' + mkdir -p $out - cp ${old.src} nixos-rebuild.sh + cp ${old.src} nixos-rebuild.sh - patch -p5 <${./nom-rebuild.patch} - mv nixos-rebuild.sh $out - ''}/nixos-rebuild.sh"; + patch -p5 <${./nom-rebuild.patch} + mv nixos-rebuild.sh $out + '' + }/nixos-rebuild.sh"; postInstall = '' ${old.postInstall} - wrapProgram $out/bin/nixos-rebuild --prefix PATH ${lib.makeBinPath [pkgs.nix-output-monitor]} + wrapProgram $out/bin/nixos-rebuild --prefix PATH ${lib.makeBinPath [ pkgs.nix-output-monitor ]} ''; }); }) @@ -71,13 +75,13 @@ ''; settings = { - trusted-users = [config.extraInfo.username]; + trusted-users = [ config.extraInfo.username ]; auto-optimise-store = true; - substituters = ["https://nix-gaming.cachix.org"]; - trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="]; + substituters = [ "https://nix-gaming.cachix.org" ]; + trusted-public-keys = [ "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" ]; }; }; - nix.nixPath = ["nixpkgs=${pkgs.path}"]; + nix.nixPath = [ "nixpkgs=${pkgs.path}" ]; nix.gc = { automatic = true; options = "--delete-older-than 7d"; diff --git a/neovim/plugins/lsp-signature.nix b/neovim/plugins/lsp-signature.nix index 4332ab1..2ab240e 100644 --- a/neovim/plugins/lsp-signature.nix +++ b/neovim/plugins/lsp-signature.nix @@ -147,12 +147,12 @@ with lib; setupOptions = { debug = cfg.debug.enable; log_path = cfg.debug.logPath; - verbose = cfg.debug.verbose; + inherit (cfg.debug) verbose; - bind = cfg.bind; + inherit (cfg) bind; doc_lines = cfg.docLines; max_height = cfg.maxHeight; - noice = cfg.noice; + inherit (cfg) noice; floating_window = cfg.floatingWindow.enable; floating_window_above_cur_line = cfg.floatingWindow.aboveCurLine; @@ -168,17 +168,17 @@ with lib; hi_parameter = cfg.hiParameter; handle_opts = { - border = cfg.handlerOpts.border; + inherit (cfg.handlerOpts) border; }; always_trigger = cfg.alwaysTrigger; auto_close_after = cfg.autoCloseAfter; extra_trigger_chars = cfg.extraTriggerChars; - zindex = cfg.zindex; + inherit (cfg) zindex; - padding = cfg.padding; + inherit (cfg) padding; - transparency = cfg.transparency; + inherit (cfg) transparency; shadow_blend = cfg.shadowBlend; shadow_guibg = cfg.shadowGuibg; timer_interval = cfg.timerInterval; diff --git a/personal-cli/hm.nix b/personal-cli/hm.nix index 3c2f229..7c44428 100644 --- a/personal-cli/hm.nix +++ b/personal-cli/hm.nix @@ -1,15 +1,13 @@ -{ - pkgs, - lib, - ... -}: let +{ pkgs, lib, ... }: +let bwPass = pkgs.writeShellScript "bw-pass" '' ${lib.getExe pkgs.bitwarden-cli} get item $@ | ${lib.getExe pkgs.jq} -r .login.password ''; bwUser = pkgs.writeShellScript "bw-user" '' ${lib.getExe pkgs.bitwarden-cli} get item $@ | ${lib.getExe pkgs.jq} -r .login.username ''; -in { +in +{ home.packages = with pkgs; [ bitwarden-cli hbw @@ -47,7 +45,7 @@ in { }; display = { - fuels = ["Diesel"]; + fuels = [ "Diesel" ]; dates = false; }; @@ -66,27 +64,38 @@ in { accounts.calendar = { basePath = ".calendar"; - accounts.personal = let - bwId = "07619222-49eb-4d66-ad8c-ca7c81a9868d"; - in { - primary = true; - primaryCollection = "QC"; - remote = { - type = "caldav"; - url = "https://nextcloud.familleboyer.net/remote.php"; - passwordCommand = ["${bwPass}" bwId]; + accounts.personal = + let + bwId = "07619222-49eb-4d66-ad8c-ca7c81a9868d"; + in + { + primary = true; + primaryCollection = "QC"; + remote = { + type = "caldav"; + url = "https://nextcloud.familleboyer.net/remote.php"; + passwordCommand = [ + "${bwPass}" + bwId + ]; + }; + vdirsyncer = { + enable = true; + collections = [ "from a" ]; + userNameCommand = [ + "${bwUser}" + bwId + ]; + metadata = [ + "color" + "displayname" + ]; + }; + khal = { + type = "discover"; + enable = true; + }; }; - vdirsyncer = { - enable = true; - collections = ["from a"]; - userNameCommand = ["${bwUser}" bwId]; - metadata = ["color" "displayname"]; - }; - khal = { - type = "discover"; - enable = true; - }; - }; }; home.file = { diff --git a/personal-cli/nixos.nix b/personal-cli/nixos.nix index 76c6b63..4b38106 100644 --- a/personal-cli/nixos.nix +++ b/personal-cli/nixos.nix @@ -1,9 +1,9 @@ +{ pkgs, config, ... }: { - pkgs, - config, - ... -}: { - environment.systemPackages = [config.boot.kernelPackages.perf pkgs.virt-manager]; + environment.systemPackages = [ + config.boot.kernelPackages.perf + pkgs.virt-manager + ]; services.privoxy.enable = true; @@ -15,7 +15,7 @@ qemu.swtpm.enable = true; qemu.ovmf = { enable = true; - packages = [pkgs.OVMFFull.fd]; + packages = [ pkgs.OVMFFull.fd ]; }; }; diff --git a/personal-gui/hm.nix b/personal-gui/hm.nix index e9845ff..53d6f43 100644 --- a/personal-gui/hm.nix +++ b/personal-gui/hm.nix @@ -3,18 +3,17 @@ lib, pkgs, ... -}: { - imports = [./wm]; +}: +{ + imports = [ ./wm ]; home.packages = with pkgs; [ # Browsers firefox-wayland - (tor-browser-bundle-bin.override { - useHardenedMalloc = false; - }) + (tor-browser-bundle-bin.override { useHardenedMalloc = false; }) # IM - (discord.override {nss = pkgs.nss;}) + (discord.override { inherit (pkgs) nss; }) element-desktop signal-desktop @@ -50,7 +49,7 @@ BROWSER = "firefox"; GTK_USE_PORTAL = 1; NIXOS_OZONE_WL = 1; - ANDROID_HOME="${config.home.sessionVariables.XDG_DATA_HOME}/android"; + ANDROID_HOME = "${config.home.sessionVariables.XDG_DATA_HOME}/android"; }; programs.zathura.enable = true; diff --git a/personal-gui/wm/default.nix b/personal-gui/wm/default.nix index c575de9..69323e5 100644 --- a/personal-gui/wm/default.nix +++ b/personal-gui/wm/default.nix @@ -3,8 +3,12 @@ lib, pkgs, ... -}: { - imports = [./terminal ./i3like.nix]; +}: +{ + imports = [ + ./terminal + ./i3like.nix + ]; gtk = { enable = true; @@ -29,12 +33,24 @@ normal = "15161e"; bright = "414868"; }; - red = {normal = "f7768e";}; - green = {normal = "9ece6a";}; - yellow = {normal = "e0af68";}; - blue = {normal = "7aa2f7";}; - magenta = {normal = "bb9af7";}; - cyan = {normal = "7dcfff";}; + red = { + normal = "f7768e"; + }; + green = { + normal = "9ece6a"; + }; + yellow = { + normal = "e0af68"; + }; + blue = { + normal = "7aa2f7"; + }; + magenta = { + normal = "bb9af7"; + }; + cyan = { + normal = "7dcfff"; + }; white = { normal = "a9b1d6"; bright = "c0caf5"; @@ -60,133 +76,151 @@ EXA_COLORS = "xx=38;5;8"; }; - wm = let - mod = config.wm.modifier; - in { - enable = true; - kind = "sway"; - modifier = "Mod4"; + wm = + let + mod = config.wm.modifier; + in + { + enable = true; + kind = "sway"; + modifier = "Mod4"; - font = { - name = "Hack Nerd Font"; - style = "Regular"; - size = 14.0; - }; - bar = { font = { - name = "Hack Nerd Font Mono"; + name = "Hack Nerd Font"; style = "Regular"; - size = 11.0; + size = 14.0; }; - }; - - wallpaper = "${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/backgrounds/nixos/nix-wallpaper-simple-dark-gray.png"; - - printScreen = { - enable = true; - keybind = "Print"; - }; - - menu = { - enable = true; - keybind = "${mod}+e"; - }; - - exit = { - enable = true; - keybind = "${mod}+Shift+e"; - }; - - notifications = { - enable = true; - font = "hack nerd font 10"; - defaultTimeout = 7000; - }; - - startup = [ - {command = "signal-desktop";} - {command = "discord";} - {command = "firefox";} - {command = "element-desktop";} - {command = "thunderbird";} - {command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK";} - {command = "hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK";} - { - command = "${pkgs.plasma5Packages.kdeconnect-kde}/libexec/kdeconnectd"; - always = true; - } - ]; - - workspaces = { - moveModifier = "Shift"; - definitions = { - "1:" = {key = "ampersand";}; - "2:" = {key = "bracketleft";}; - "3:" = {key = "braceleft";}; - "4" = {key = "braceright";}; - "5" = {key = "parenleft";}; - "6" = {key = "equal";}; - "7" = {key = "asterisk";}; - "" = { - key = "parenright"; - assign = ["Spotify"]; - }; - "" = { - key = "w"; - assign = [ - "Element" - "Signal" - "Discord" - ]; - }; - "" = { - key = "m"; - assign = ["Thunderbird"]; + bar = { + font = { + name = "Hack Nerd Font Mono"; + style = "Regular"; + size = 11.0; }; }; + + wallpaper = "${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/backgrounds/nixos/nix-wallpaper-simple-dark-gray.png"; + + printScreen = { + enable = true; + keybind = "Print"; + }; + + menu = { + enable = true; + keybind = "${mod}+e"; + }; + + exit = { + enable = true; + keybind = "${mod}+Shift+e"; + }; + + notifications = { + enable = true; + font = "hack nerd font 10"; + defaultTimeout = 7000; + }; + + startup = [ + { command = "signal-desktop"; } + { command = "discord"; } + { command = "firefox"; } + { command = "element-desktop"; } + { command = "thunderbird"; } + { command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK"; } + { + command = "hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"; + } + { + command = "${pkgs.plasma5Packages.kdeconnect-kde}/libexec/kdeconnectd"; + always = true; + } + ]; + + workspaces = { + moveModifier = "Shift"; + definitions = { + "1:" = { + key = "ampersand"; + }; + "2:" = { + key = "bracketleft"; + }; + "3:" = { + key = "braceleft"; + }; + "4" = { + key = "braceright"; + }; + "5" = { + key = "parenleft"; + }; + "6" = { + key = "equal"; + }; + "7" = { + key = "asterisk"; + }; + "" = { + key = "parenright"; + assign = [ "Spotify" ]; + }; + "" = { + key = "w"; + assign = [ + "Element" + "Signal" + "Discord" + ]; + }; + "" = { + key = "m"; + assign = [ "Thunderbird" ]; + }; + }; + }; + + keybindings = { + "${mod}+Shift+l" = "exec ${pkgs.swaylock-fancy}/bin/swaylock-fancy"; + + # Media Keys + "XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ '+10%'"; + "XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ '-10%'"; + "XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify play-pause"; + "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify next"; + "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify previous"; + + # Gromit + "Ctrl+Shift+I" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -a"; + "Ctrl+Shift+D" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -q"; + "Ctrl+Shift+H" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -c"; + + # Change keyboard layout + "${mod}+dollar" = "input type:keyboard xkb_switch_layout next"; # Dvorak + "${mod}+grave" = "input type:keyboard xkb_switch_layout next"; # Qwerty + + # Focus + "${mod}+Left" = "focus left"; + "${mod}+Right" = "focus right"; + "${mod}+Down" = "focus down"; + "${mod}+Up" = "focus up"; + "${mod}+Shift+Left" = "move left"; + "${mod}+Shift+Right" = "move right"; + "${mod}+Shift+Down" = "move down"; + "${mod}+Shift+Up" = "move up"; + + # Layout + "${mod}+u" = "fullscreen toggle"; + "${mod}+comma" = "layout tabbed"; + + # Misc + "${mod}+Shift+semicolon" = "kill"; + "${mod}+Shift+J" = "reload"; + "${mod}+Return" = "exec ${config.terminal.command}"; + "${mod}+p" = "mode resize"; + "${mod}+Shift+P" = "restart"; + "${mod}+Shift+S" = "exec ${config.programs.rofi.package}/bin/rofi -show ssh"; + }; }; - - keybindings = { - "${mod}+Shift+l" = "exec ${pkgs.swaylock-fancy}/bin/swaylock-fancy"; - - # Media Keys - "XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ '+10%'"; - "XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ '-10%'"; - "XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; - "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify play-pause"; - "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify next"; - "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify previous"; - - # Gromit - "Ctrl+Shift+I" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -a"; - "Ctrl+Shift+D" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -q"; - "Ctrl+Shift+H" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -c"; - - # Change keyboard layout - "${mod}+dollar" = "input type:keyboard xkb_switch_layout next"; # Dvorak - "${mod}+grave" = "input type:keyboard xkb_switch_layout next"; # Qwerty - - # Focus - "${mod}+Left" = "focus left"; - "${mod}+Right" = "focus right"; - "${mod}+Down" = "focus down"; - "${mod}+Up" = "focus up"; - "${mod}+Shift+Left" = "move left"; - "${mod}+Shift+Right" = "move right"; - "${mod}+Shift+Down" = "move down"; - "${mod}+Shift+Up" = "move up"; - - # Layout - "${mod}+u" = "fullscreen toggle"; - "${mod}+comma" = "layout tabbed"; - - # Misc - "${mod}+Shift+semicolon" = "kill"; - "${mod}+Shift+J" = "reload"; - "${mod}+Return" = "exec ${config.terminal.command}"; - "${mod}+p" = "mode resize"; - "${mod}+Shift+P" = "restart"; - "${mod}+Shift+S" = "exec ${config.programs.rofi.package}/bin/rofi -show ssh"; - }; - }; } diff --git a/personal-gui/wm/i3.nix b/personal-gui/wm/i3.nix index a487a15..f5e6986 100644 --- a/personal-gui/wm/i3.nix +++ b/personal-gui/wm/i3.nix @@ -5,34 +5,38 @@ ... }: with builtins; -with lib; let +with lib; +let cfg = config.wm; - common = import ./i3like-utils.nix {inherit config;}; + common = import ./i3like-utils.nix { inherit config; }; startupNotifications = - if cfg.notifications.enable - then [ - { - command = "${config.services.dunst.package}/bin/dunst"; - notification = false; - always = true; - } - ] - else []; + if cfg.notifications.enable then + [ + { + command = "${config.services.dunst.package}/bin/dunst"; + notification = false; + always = true; + } + ] + else + [ ]; wallpaperSet = - if cfg.wallpaper != null - then [ - { - command = "${pkgs.feh}/bin/feh --bg-scale ${cfg.wallpaper}"; - always = true; - notification = false; - } - ] - else []; + if cfg.wallpaper != null then + [ + { + command = "${pkgs.feh}/bin/feh --bg-scale ${cfg.wallpaper}"; + always = true; + notification = false; + } + ] + else + [ ]; startup = startupNotifications ++ wallpaperSet ++ cfg.startup; -in { +in +{ config = mkIf (cfg.enable && cfg.kind == "i3") { programs = { i3status-rust = { @@ -70,9 +74,7 @@ in { player = "spotify"; format = "{combo}"; } - { - block = "time"; - } + { block = "time"; } ]; }; }; @@ -83,7 +85,7 @@ in { settings = { global = { timeout = "${toString cfg.notifications.defaultTimeout}ms"; - font = cfg.notifications.font; + inherit (cfg.notifications) font; }; }; }; @@ -97,11 +99,11 @@ in { enable = true; config = { inherit startup; - keybindings = common.keybindings; - workspaceOutputAssign = common.workspaceOutputAssign; - assigns = common.assigns; + inherit (common) keybindings; + inherit (common) workspaceOutputAssign; + inherit (common) assigns; fonts = common.mkFont cfg.font; - modifier = cfg.modifier; + inherit (cfg) modifier; bars = [ { fonts = common.mkFont cfg.bar.font; diff --git a/personal-gui/wm/i3like-utils.nix b/personal-gui/wm/i3like-utils.nix index c6d5670..93d2a67 100644 --- a/personal-gui/wm/i3like-utils.nix +++ b/personal-gui/wm/i3like-utils.nix @@ -1,48 +1,53 @@ -{config}: -with builtins; let +{ config }: +with builtins; +let cfg = config.wm; - addKeyIf = cond: keybinds: newkey: - if cond - then newkey // keybinds - else keybinds; + addKeyIf = + cond: keybinds: newkey: + if cond then newkey // keybinds else keybinds; - keybindSolo = keys: submod: - addKeyIf submod.enable keys { - "${submod.keybind}" = "exec ${submod.command}"; - }; - keydefs = [cfg.printScreen cfg.menu cfg.exit]; + keybindSolo = + keys: submod: addKeyIf submod.enable keys { "${submod.keybind}" = "exec ${submod.command}"; }; + keydefs = [ + cfg.printScreen + cfg.menu + cfg.exit + ]; keybindingsKeydef = foldl' keybindSolo cfg.keybindings keydefs; mod = cfg.modifier; ws_def = cfg.workspaces.definitions; get_ws = ws: getAttr ws ws_def; - workspaceFmt = name: let - key = (get_ws name).key; - in { - "${mod}+${key}" = "workspace ${name}"; - "${mod}+${cfg.workspaces.moveModifier}+${key}" = "move container to workspace ${name}"; - }; + workspaceFmt = + name: + let + inherit ((get_ws name)) key; + in + { + "${mod}+${key}" = "workspace ${name}"; + "${mod}+${cfg.workspaces.moveModifier}+${key}" = "move container to workspace ${name}"; + }; workspaceAssign = name: { workspace = name; - output = (get_ws name).output; + inherit ((get_ws name)) output; }; - classAssign = name: { - "${name}" = map (app: {class = "${app}";}) ((get_ws name).assign); - }; -in { + classAssign = name: { "${name}" = map (app: { class = "${app}"; }) (get_ws name).assign; }; +in +{ mkFont = mod: { - names = [mod.name]; - style = mod.style; - size = mod.size; + names = [ mod.name ]; + inherit (mod) style; + inherit (mod) size; }; keybindings = - (foldl' (x: y: x // y) {} (map workspaceFmt (attrNames ws_def))) - // keybindingsKeydef; + (foldl' (x: y: x // y) { } (map workspaceFmt (attrNames ws_def))) // keybindingsKeydef; - workspaceOutputAssign = map workspaceAssign (filter (ws: (get_ws ws).output != null) (attrNames ws_def)); + workspaceOutputAssign = map workspaceAssign ( + filter (ws: (get_ws ws).output != null) (attrNames ws_def) + ); - assigns = foldl' (x: y: x // y) {} (map classAssign (attrNames ws_def)); + assigns = foldl' (x: y: x // y) { } (map classAssign (attrNames ws_def)); } diff --git a/personal-gui/wm/i3like.nix b/personal-gui/wm/i3like.nix index 12f977d..08642f5 100644 --- a/personal-gui/wm/i3like.nix +++ b/personal-gui/wm/i3like.nix @@ -5,8 +5,12 @@ ... }: with builtins; -with lib; { - imports = [./i3.nix ./sway.nix]; +with lib; +{ + imports = [ + ./i3.nix + ./sway.nix + ]; options = { wm = { @@ -16,7 +20,10 @@ with lib; { description = "Manage window Manager"; }; kind = mkOption { - type = types.enum ["i3" "sway"]; + type = types.enum [ + "i3" + "sway" + ]; default = "sway"; description = "WM to use"; }; @@ -86,7 +93,7 @@ with lib; { command = mkOption { type = types.str; description = "Command to launch the menu"; - default = "${config.programs.rofi.package}/bin/rofi -show drun -show-icons"; + default = "${config.programs.rofi.package}/bin/rofi -show drun -show-icons"; }; }; @@ -123,20 +130,22 @@ with lib; { }; startup = mkOption { - type = types.listOf (types.submodule { - options = { - command = mkOption { - type = types.str; - description = "Command that will be executed on startup."; - }; + type = types.listOf ( + types.submodule { + options = { + command = mkOption { + type = types.str; + description = "Command that will be executed on startup."; + }; - always = mkOption { - type = types.bool; - default = false; - description = "Whether to run command on each ${moduleName} restart."; + always = mkOption { + type = types.bool; + default = false; + description = "Whether to run command on each ${moduleName} restart."; + }; }; - }; - }); + } + ); }; wallpaper = mkOption { @@ -146,26 +155,28 @@ with lib; { workspaces = { definitions = mkOption { - type = types.attrsOf (types.submodule { - options = { - key = mkOption { - type = types.str; - description = "Keybind for the workspace"; + type = types.attrsOf ( + types.submodule { + options = { + key = mkOption { + type = types.str; + description = "Keybind for the workspace"; + }; + output = mkOption { + type = types.nullOr types.str; + description = "Assign workspace to output"; + default = null; + }; + assign = mkOption { + type = types.listOf types.str; + description = "Assign class elements"; + default = [ ]; + }; }; - output = mkOption { - type = types.nullOr types.str; - description = "Assign workspace to output"; - default = null; - }; - assign = mkOption { - type = types.listOf types.str; - description = "Assign class elements"; - default = []; - }; - }; - }); + } + ); description = "Workspace descriptions"; - default = {}; + default = { }; }; moveModifier = mkOption { type = types.str; diff --git a/personal-gui/wm/sway.nix b/personal-gui/wm/sway.nix index dce14c7..0139065 100644 --- a/personal-gui/wm/sway.nix +++ b/personal-gui/wm/sway.nix @@ -5,242 +5,246 @@ ... }: with lib; -with builtins; let +with builtins; +let cfg = config.wm; - common = import ./i3like-utils.nix {inherit config;}; + common = import ./i3like-utils.nix { inherit config; }; startupNotifications = - if cfg.notifications.enable - then [ - { - command = "${pkgs.mako}/bin/mako"; - always = true; - } - ] - else []; + if cfg.notifications.enable then + [ + { + command = "${pkgs.mako}/bin/mako"; + always = true; + } + ] + else + [ ]; startup = startupNotifications ++ cfg.startup; -in { +in +{ options = { - traxys.waybar = with lib.types; let - jsonFormat = pkgs.formats.json {}; + traxys.waybar = + with lib.types; + let + jsonFormat = pkgs.formats.json { }; - modulesListOpt = mkOption { - type = listOf (submodule { - options = { - name = mkOption {type = str;}; - priority = mkOption { - type = types.int; + modulesListOpt = mkOption { + type = listOf (submodule { + options = { + name = mkOption { type = str; }; + priority = mkOption { type = types.int; }; }; - }; - }); - default = []; - apply = opt: - builtins.map (v: v.name) ( - lib.sortOn (v: v.priority) opt - ); - }; - in { - modules-left = modulesListOpt; - modules-center = modulesListOpt; - modules-right = modulesListOpt; + }); + default = [ ]; + apply = opt: builtins.map (v: v.name) (lib.sortOn (v: v.priority) opt); + }; + in + { + modules-left = modulesListOpt; + modules-center = modulesListOpt; + modules-right = modulesListOpt; - modules = let - moduleOpt = { - side ? "right", - enable ? true, - priority, - extraOpts ? {}, - settings, - }: + modules = + let + moduleOpt = + { + side ? "right", + enable ? true, + priority, + extraOpts ? { }, + settings, + }: + { + enable = mkOption { + type = bool; + default = enable; + }; + + side = mkOption { + type = enum [ + "left" + "center" + "right" + ]; + default = side; + }; + priority = mkOption { + type = int; + default = priority; + }; + + settings = mkOption { + inherit (jsonFormat) type; + default = settings; + }; + } + // extraOpts; + + is = ""; + ie = ""; + in { - enable = mkOption { - type = bool; - default = enable; + # Left + + "custom/khal" = moduleOpt { + enable = false; + side = "left"; + priority = 5; + settings = { + format = "{}"; + tooltip = true; + interval = 300; + format-icons = { + default = ""; + }; + exec = "${lib.getExe pkgs.python3} ${./waybar-khal.py}"; + return-type = "json"; + }; }; - side = mkOption { - type = enum ["left" "center" "right"]; - default = side; - }; - priority = mkOption { - type = int; - default = priority; + "network#wifi" = moduleOpt { + side = "left"; + enable = false; + priority = 10; + extraOpts = { + interface = mkOption { type = str; }; + }; + settings = { + inherit (config.traxys.waybar.modules."network#wifi") interface; + format-wifi = "{essid} ({signalStrength}%) "; + format-disconnected = ""; + }; }; - settings = mkOption { - inherit (jsonFormat) type; - default = settings; + "sway/workspaces" = moduleOpt { + side = "left"; + priority = 20; + settings = { + persistent-workspaces = { + "" = [ ]; + "" = [ ]; + "1:" = [ ]; + }; + numeric-first = true; + }; }; - } - // extraOpts; - is = ""; - ie = ""; - in { - /* - Left - */ - - "custom/khal" = moduleOpt { - enable = false; - side = "left"; - priority = 5; - settings = { - format = "{}"; - tooltip = true; - interval = 300; - format-icons = { - default = ""; + "sway/mode" = moduleOpt { + side = "left"; + priority = 30; + settings = { }; }; - exec = "${lib.getExe pkgs.python3} ${./waybar-khal.py}"; - return-type = "json"; - }; - }; + # Center - "network#wifi" = moduleOpt { - side = "left"; - enable = false; - priority = 10; - extraOpts = { - interface = mkOption { - type = str; + "sway/window" = moduleOpt { + side = "center"; + priority = 10; + settings = { + max-length = 50; + }; + }; + + # Right + + "cpu" = moduleOpt { + priority = 10; + settings = { + format = "${is}${ie} {load}"; + }; + }; + + "memory" = moduleOpt { + priority = 20; + settings = { + format = "${is}${ie} {used:.0f}G/{total:.0f}G"; + }; + }; + + "disk#home" = moduleOpt { + priority = 30; + settings = { + path = "/home"; + format = "${is}${ie} {free}"; + }; + }; + + "disk#root" = moduleOpt { + priority = 40; + settings = { + path = "/"; + format = " {percentage_free}%"; + }; + }; + + "battery" = moduleOpt { + enable = false; + priority = 50; + settings = { + format = "{capacity}% ${is}{icon}${ie}"; + format-icons = [ + "" + "" + "" + "" + "" + ]; + }; + }; + + "clock" = moduleOpt { + priority = 60; + settings = { + format-alt = "{:%a, %d. %b %H:%M}"; + }; + }; + + "tray" = moduleOpt { + priority = 70; + settings = { }; + }; + + "pulseaudio" = moduleOpt { + priority = 80; + settings = { }; }; }; - settings = { - inherit (config.traxys.waybar.modules."network#wifi") interface; - format-wifi = "{essid} ({signalStrength}%) "; - format-disconnected = ""; - }; - }; - - "sway/workspaces" = moduleOpt { - side = "left"; - priority = 20; - settings = { - persistent-workspaces = { - "" = []; - "" = []; - "1:" = []; - }; - numeric-first = true; - }; - }; - - "sway/mode" = moduleOpt { - side = "left"; - priority = 30; - settings = {}; - }; - - /* - Center - */ - - "sway/window" = moduleOpt { - side = "center"; - priority = 10; - settings = { - max-length = 50; - }; - }; - - /* - Right - */ - - "cpu" = moduleOpt { - priority = 10; - settings = { - format = "${is}${ie} {load}"; - }; - }; - - "memory" = moduleOpt { - priority = 20; - settings = { - format = "${is}${ie} {used:.0f}G/{total:.0f}G"; - }; - }; - - "disk#home" = moduleOpt { - priority = 30; - settings = { - path = "/home"; - format = "${is}${ie} {free}"; - }; - }; - - "disk#root" = moduleOpt { - priority = 40; - settings = { - path = "/"; - format = " {percentage_free}%"; - }; - }; - - "battery" = moduleOpt { - enable = false; - priority = 50; - settings = { - format = "{capacity}% ${is}{icon}${ie}"; - format-icons = ["" "" "" "" ""]; - }; - }; - - "clock" = moduleOpt { - priority = 60; - settings = { - format-alt = "{:%a, %d. %b %H:%M}"; - }; - }; - - "tray" = moduleOpt { - priority = 70; - settings = {}; - }; - - "pulseaudio" = moduleOpt { - priority = 80; - settings = {}; - }; }; - }; }; - config = let - addKey = key: value: attrs: attrs // {${key} = attrs.${key} // value;}; - modulesList = - lib.foldlAttrs - (acc: name: mod: addKey mod.side {${name} = mod;} acc) - { - center = {}; - left = {}; - right = {}; - } - config.traxys.waybar.modules; - enabledModulesSide = side: lib.filterAttrs (_: v: v.enable) modulesList.${side}; - moduleListSide = side: - lib.mapAttrsToList (name: v: { - inherit name; - inherit (v) priority; - }) (enabledModulesSide side); - in + config = + let + addKey = + key: value: attrs: + attrs // { ${key} = attrs.${key} // value; }; + modulesList = + lib.foldlAttrs + ( + acc: name: mod: + addKey mod.side { ${name} = mod; } acc + ) + { + center = { }; + left = { }; + right = { }; + } + config.traxys.waybar.modules; + enabledModulesSide = side: lib.filterAttrs (_: v: v.enable) modulesList.${side}; + moduleListSide = + side: + lib.mapAttrsToList (name: v: { + inherit name; + inherit (v) priority; + }) (enabledModulesSide side); + in mkIf (cfg.enable && cfg.kind == "sway") { traxys.waybar.modules-left = moduleListSide "left"; traxys.waybar.modules-center = moduleListSide "center"; traxys.waybar.modules-right = moduleListSide "right"; - home.packages = with pkgs; - [ - sway - ] - ++ ( - if cfg.wallpaper != null - then [pkgs.swaybg] - else [] - ); + home.packages = with pkgs; [ sway ] ++ (if cfg.wallpaper != null then [ pkgs.swaybg ] else [ ]); home.sessionVariables = { MOZ_ENABLE_WAYLAND = "1"; @@ -253,9 +257,9 @@ in { services.mako = mkIf cfg.notifications.enable { enable = true; - font = cfg.notifications.font; + inherit (cfg.notifications) font; margin = "20,20,5,5"; - defaultTimeout = cfg.notifications.defaultTimeout; + inherit (cfg.notifications) defaultTimeout; extraConfig = '' [mode=do-not-disturb] invisible=1 @@ -275,10 +279,9 @@ in { inherit (config.traxys.waybar) modules-center; inherit (config.traxys.waybar) modules-right; } - // ( - builtins.mapAttrs (_: v: v.settings) - (lib.filterAttrs (_: v: v.enable) config.traxys.waybar.modules) - ) + // (builtins.mapAttrs (_: v: v.settings) ( + lib.filterAttrs (_: v: v.enable) config.traxys.waybar.modules + )) ) ]; }; @@ -294,32 +297,32 @@ in { ''; config = { inherit startup; - modifier = cfg.modifier; - bars = [ - { - command = "waybar"; - } - ]; - input = let - inputs = config.extraInfo.inputs; - inputsCfg = [ - ( - if inputs.touchpad != null - then { - name = inputs.touchpad; - value = {dwt = "disable";}; + inherit (cfg) modifier; + bars = [ { command = "waybar"; } ]; + input = + let + inherit (config.extraInfo) inputs; + inputsCfg = [ + ( + if inputs.touchpad != null then + { + name = inputs.touchpad; + value = { + dwt = "disable"; + }; + } + else + null + ) + { + name = "type:keyboard"; + value = { + xkb_layout = "us(dvp),us"; + xkb_options = "compose:102"; + }; } - else null - ) - { - name = "type:keyboard"; - value = { - xkb_layout = "us(dvp),us"; - xkb_options = "compose:102"; - }; - } - ]; - in + ]; + in builtins.listToAttrs (builtins.filter (s: s != null) inputsCfg); output = config.extraInfo.outputs; fonts = common.mkFont cfg.font; @@ -336,9 +339,9 @@ in { } ]; }; - keybindings = common.keybindings; - workspaceOutputAssign = common.workspaceOutputAssign; - assigns = common.assigns; + inherit (common) keybindings; + inherit (common) workspaceOutputAssign; + inherit (common) assigns; }; }; }; diff --git a/personal-gui/wm/terminal/default.nix b/personal-gui/wm/terminal/default.nix index 3271605..4651752 100644 --- a/personal-gui/wm/terminal/default.nix +++ b/personal-gui/wm/terminal/default.nix @@ -5,7 +5,8 @@ ... }: with lib; -with builtins; let +with builtins; +let mkColor = mkOption { type = types.nullOr types.str; default = null; @@ -16,8 +17,12 @@ with builtins; let }; cfg = config.terminal; cCfg = cfg.colors; -in { - imports = [./foot.nix ./kitty.nix]; +in +{ + imports = [ + ./foot.nix + ./kitty.nix + ]; options = { terminal = { @@ -27,7 +32,10 @@ in { description = "Manage terminal"; }; kind = mkOption { - type = types.enum ["foot" "kitty"]; + type = types.enum [ + "foot" + "kitty" + ]; default = "foot"; description = "The terminal to be used"; }; diff --git a/personal-gui/wm/terminal/foot.nix b/personal-gui/wm/terminal/foot.nix index fa15708..49a7f3b 100644 --- a/personal-gui/wm/terminal/foot.nix +++ b/personal-gui/wm/terminal/foot.nix @@ -5,55 +5,56 @@ ... }: with lib; -with builtins; let +with builtins; +let cfg = config.terminal; cCfg = cfg.colors; -in { +in +{ config = mkIf (cfg.enable && cfg.kind == "foot") { terminal.command = mkDefault "${pkgs.foot}/bin/foot"; programs.foot = { enable = true; settings = { - colors = let - colorCfg = value: mkIf (value != null) value; - colorCfgNormal = color: colorCfg color.normal; - colorCfgBright = color: - if color.bright != null - then color.bright - else colorCfgNormal color; - in { - background = colorCfg cCfg.background; - foreground = colorCfg cCfg.foreground; + colors = + let + colorCfg = value: mkIf (value != null) value; + colorCfgNormal = color: colorCfg color.normal; + colorCfgBright = color: if color.bright != null then color.bright else colorCfgNormal color; + in + { + background = colorCfg cCfg.background; + foreground = colorCfg cCfg.foreground; - regular0 = colorCfgNormal cCfg.black; - bright0 = colorCfgBright cCfg.black; + regular0 = colorCfgNormal cCfg.black; + bright0 = colorCfgBright cCfg.black; - regular1 = colorCfgNormal cCfg.red; - bright1 = colorCfgBright cCfg.red; + regular1 = colorCfgNormal cCfg.red; + bright1 = colorCfgBright cCfg.red; - regular2 = colorCfgNormal cCfg.green; - bright2 = colorCfgBright cCfg.green; + regular2 = colorCfgNormal cCfg.green; + bright2 = colorCfgBright cCfg.green; - regular3 = colorCfgNormal cCfg.yellow; - bright3 = colorCfgBright cCfg.yellow; + regular3 = colorCfgNormal cCfg.yellow; + bright3 = colorCfgBright cCfg.yellow; - regular4 = colorCfgNormal cCfg.blue; - bright4 = colorCfgBright cCfg.blue; + regular4 = colorCfgNormal cCfg.blue; + bright4 = colorCfgBright cCfg.blue; - regular5 = colorCfgNormal cCfg.magenta; - bright5 = colorCfgBright cCfg.magenta; + regular5 = colorCfgNormal cCfg.magenta; + bright5 = colorCfgBright cCfg.magenta; - regular6 = colorCfgNormal cCfg.cyan; - bright6 = colorCfgBright cCfg.cyan; + regular6 = colorCfgNormal cCfg.cyan; + bright6 = colorCfgBright cCfg.cyan; - regular7 = colorCfgNormal cCfg.white; - bright7 = colorCfgBright cCfg.white; + regular7 = colorCfgNormal cCfg.white; + bright7 = colorCfgBright cCfg.white; - urls = colorCfg cCfg.urls; + urls = colorCfg cCfg.urls; - selection-foreground = colorCfg cCfg.selection.foreground; - selection-background = colorCfg cCfg.selection.background; - }; + selection-foreground = colorCfg cCfg.selection.foreground; + selection-background = colorCfg cCfg.selection.background; + }; main = { font = "${cfg.font.family}:size=${toString cfg.font.size}"; }; diff --git a/personal-gui/wm/terminal/kitty.nix b/personal-gui/wm/terminal/kitty.nix index 29076ea..34ec0fd 100644 --- a/personal-gui/wm/terminal/kitty.nix +++ b/personal-gui/wm/terminal/kitty.nix @@ -5,57 +5,58 @@ ... }: with lib; -with builtins; let +with builtins; +let cfg = config.terminal; cCfg = cfg.colors; -in { +in +{ config = mkIf (cfg.enable && cfg.kind == "kitty") { terminal.command = mkDefault "${pkgs.kitty}/bin/kitty"; programs.kitty = { enable = true; font = { name = cfg.font.family; - size = cfg.font.size; + inherit (cfg.font) size; }; - settings = let - colorCfg = value: mkIf (value != null) "#${value}"; - colorCfgNormal = color: colorCfg color.normal; - colorCfgBright = color: - if color.bright != null - then "#${color.bright}" - else colorCfgNormal color; - in { - confirm_os_window_close = 0; + settings = + let + colorCfg = value: mkIf (value != null) "#${value}"; + colorCfgNormal = color: colorCfg color.normal; + colorCfgBright = color: if color.bright != null then "#${color.bright}" else colorCfgNormal color; + in + { + confirm_os_window_close = 0; - background = colorCfg cCfg.background; - foreground = colorCfg cCfg.foreground; + background = colorCfg cCfg.background; + foreground = colorCfg cCfg.foreground; - color0 = colorCfgNormal cCfg.black; - color8 = colorCfgBright cCfg.black; + color0 = colorCfgNormal cCfg.black; + color8 = colorCfgBright cCfg.black; - color1 = colorCfgNormal cCfg.red; - color9 = colorCfgBright cCfg.red; + color1 = colorCfgNormal cCfg.red; + color9 = colorCfgBright cCfg.red; - color2 = colorCfgNormal cCfg.green; - color10 = colorCfgBright cCfg.green; + color2 = colorCfgNormal cCfg.green; + color10 = colorCfgBright cCfg.green; - color3 = colorCfgNormal cCfg.yellow; - color11 = colorCfgBright cCfg.yellow; + color3 = colorCfgNormal cCfg.yellow; + color11 = colorCfgBright cCfg.yellow; - color4 = colorCfgNormal cCfg.blue; - color12 = colorCfgBright cCfg.blue; + color4 = colorCfgNormal cCfg.blue; + color12 = colorCfgBright cCfg.blue; - color5 = colorCfgNormal cCfg.magenta; - color13 = colorCfgBright cCfg.magenta; + color5 = colorCfgNormal cCfg.magenta; + color13 = colorCfgBright cCfg.magenta; - color6 = colorCfgNormal cCfg.cyan; - color14 = colorCfgBright cCfg.cyan; + color6 = colorCfgNormal cCfg.cyan; + color14 = colorCfgBright cCfg.cyan; - color7 = colorCfgNormal cCfg.white; - color15 = colorCfgBright cCfg.white; + color7 = colorCfgNormal cCfg.white; + color15 = colorCfgBright cCfg.white; - selection_foreground = colorCfg cCfg.selectionForeground; - }; + selection_foreground = colorCfg cCfg.selectionForeground; + }; }; wayland.windowManager.sway.config.terminal = "${config.terminal.command}"; xsession.windowManager.i3.config.terminal = "${config.terminal.command}"; diff --git a/pkgs/bonnie/default.nix b/pkgs/bonnie/default.nix index 365d5e3..f406587 100644 --- a/pkgs/bonnie/default.nix +++ b/pkgs/bonnie/default.nix @@ -24,6 +24,6 @@ rustPlatform.buildRustPackage rec { homepage = "https://github.com/arctic-hen7/bonnie"; changelog = "https://github.com/arctic-hen7/bonnie/blob/${src.rev}/CHANGELOG.md"; license = licenses.mit; - maintainers = with maintainers; []; + maintainers = with maintainers; [ ]; }; } diff --git a/pkgs/flex-launcher.nix b/pkgs/flex-launcher.nix index 0d51143..2fedf9d 100644 --- a/pkgs/flex-launcher.nix +++ b/pkgs/flex-launcher.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { homepage = "https://github.com/complexlogic/flex-launcher"; changelog = "https://github.com/complexlogic/flex-launcher/blob/${src.rev}/CHANGELOG"; license = licenses.unlicense; - maintainers = with maintainers; [traxys]; + maintainers = with maintainers; [ traxys ]; mainProgram = "flex-launcher"; platforms = platforms.all; }; diff --git a/pkgs/frg.nix b/pkgs/frg.nix index 27ae20d..9e51804 100644 --- a/pkgs/frg.nix +++ b/pkgs/frg.nix @@ -11,27 +11,29 @@ stdenv.mkDerivation { dontUnpack = true; - installPhase = let - script = writeText "frg" '' - #!/usr/bin/env bash + installPhase = + let + script = writeText "frg" '' + #!/usr/bin/env bash - # 1. Search for text in files using Ripgrep - # 2. Interactively restart Ripgrep with reload action - # 3. Open the file in Vim - RG_PREFIX="${ripgrep}/bin/rg --column --line-number --no-heading --color=always --smart-case " - INITIAL_QUERY="''${*:-}" - FZF_DEFAULT_COMMAND="$RG_PREFIX $(printf %q "$INITIAL_QUERY")" \ - ${fzf}/bin/fzf --ansi \ - --disabled --query "$INITIAL_QUERY" \ - --bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true" \ - --delimiter : \ - --preview '${bat}/bin/bat --color=always {1} --highlight-line {2}' \ - --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' \ - --bind "enter:become($EDITOR {1} +{2})" + # 1. Search for text in files using Ripgrep + # 2. Interactively restart Ripgrep with reload action + # 3. Open the file in Vim + RG_PREFIX="${ripgrep}/bin/rg --column --line-number --no-heading --color=always --smart-case " + INITIAL_QUERY="''${*:-}" + FZF_DEFAULT_COMMAND="$RG_PREFIX $(printf %q "$INITIAL_QUERY")" \ + ${fzf}/bin/fzf --ansi \ + --disabled --query "$INITIAL_QUERY" \ + --bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true" \ + --delimiter : \ + --preview '${bat}/bin/bat --color=always {1} --highlight-line {2}' \ + --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' \ + --bind "enter:become($EDITOR {1} +{2})" + ''; + in + '' + mkdir -p $out/bin + cp ${script} $out/bin/frg + chmod +x $out/bin/frg ''; - in '' - mkdir -p $out/bin - cp ${script} $out/bin/frg - chmod +x $out/bin/frg - ''; } diff --git a/pkgs/hbw/default.nix b/pkgs/hbw/default.nix index 5f66c72..9a1ab75 100644 --- a/pkgs/hbw/default.nix +++ b/pkgs/hbw/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { src = ./hbw.py; buildInputs = [ - (python3.withPackages (ps: with ps; [pyotp])) + (python3.withPackages (ps: with ps; [ pyotp ])) bitwarden-cli makeWrapper ]; @@ -22,6 +22,6 @@ stdenv.mkDerivation { installPhase = '' mkdir -p $out/bin cp $src $out/bin/hbw - wrapProgram $out/bin/hbw --prefix PATH : ${lib.makeBinPath [bitwarden-cli]} + wrapProgram $out/bin/hbw --prefix PATH : ${lib.makeBinPath [ bitwarden-cli ]} ''; } diff --git a/pkgs/kabalist.nix b/pkgs/kabalist.nix index 3ed1b00..0afb013 100644 --- a/pkgs/kabalist.nix +++ b/pkgs/kabalist.nix @@ -1,8 +1,5 @@ -{ - naersk, - kabalist-src, -}: +{ naersk, kabalist-src }: naersk.buildPackage { - cargoBuildOptions = opts: opts ++ ["--package=kabalist_cli"]; + cargoBuildOptions = opts: opts ++ [ "--package=kabalist_cli" ]; root = kabalist-src; } diff --git a/pkgs/mesonlsp/default.nix b/pkgs/mesonlsp/default.nix index 29a5475..e771ded 100644 --- a/pkgs/mesonlsp/default.nix +++ b/pkgs/mesonlsp/default.nix @@ -14,7 +14,8 @@ libunwind, python3, tomlplusplus, -}: let +}: +let ada = fetchFromGitHub { owner = "ada-url"; repo = "ada"; @@ -59,70 +60,68 @@ hash = "sha256-k883mKwuP35f0WtwX8ybl9uYbvA3y6Vxtv2EJMpZDEs="; }; in - stdenv.mkDerivation rec { - pname = "mesonlsp"; - version = "4.2.2"; +stdenv.mkDerivation rec { + pname = "mesonlsp"; + version = "4.2.2"; - src = fetchFromGitHub { - owner = "JCWasmx86"; - repo = "mesonlsp"; - rev = "refs/tags/v${version}"; - hash = "sha256-pN8MCqrRfVpmM8KWa7HPTghoegplM4bP/HRVJVs05iE="; - }; + src = fetchFromGitHub { + owner = "JCWasmx86"; + repo = "mesonlsp"; + rev = "refs/tags/v${version}"; + hash = "sha256-pN8MCqrRfVpmM8KWa7HPTghoegplM4bP/HRVJVs05iE="; + }; - postUnpack = '' - pushd "$sourceRoot/subprojects" - cp -R --no-preserve=mode,ownership ${tree-sitter} tree-sitter-${tsVersion} - cp -R --no-preserve=mode,ownership ${tree-sitter-meson} tree-sitter-meson - cp -R --no-preserve=mode,ownership ${tree-sitter-ini} tree-sitter-ini - cp -R --no-preserve=mode,ownership ${sha256} sha256 - cp -R --no-preserve=mode,ownership ${ada} ada - cp -R --no-preserve=mode,ownership ${muon} muon - popd - ''; + postUnpack = '' + pushd "$sourceRoot/subprojects" + cp -R --no-preserve=mode,ownership ${tree-sitter} tree-sitter-${tsVersion} + cp -R --no-preserve=mode,ownership ${tree-sitter-meson} tree-sitter-meson + cp -R --no-preserve=mode,ownership ${tree-sitter-ini} tree-sitter-ini + cp -R --no-preserve=mode,ownership ${sha256} sha256 + cp -R --no-preserve=mode,ownership ${ada} ada + cp -R --no-preserve=mode,ownership ${muon} muon + popd + ''; - mesonFlags = ["-Dbenchmarks=false"]; + mesonFlags = [ "-Dbenchmarks=false" ]; - patches = [ - ./build_flags.patch - ]; + patches = [ ./build_flags.patch ]; - postPatch = '' - patchShebangs . - pushd subprojects - cp packagefiles/tree-sitter-${tsVersion}/* tree-sitter-${tsVersion} - cp packagefiles/tree-sitter-meson/* tree-sitter-meson - cp packagefiles/tree-sitter-ini/* tree-sitter-ini - cp packagefiles/sha256/* sha256 - cp packagefiles/ada/* ada - popd - ''; + postPatch = '' + patchShebangs . + pushd subprojects + cp packagefiles/tree-sitter-${tsVersion}/* tree-sitter-${tsVersion} + cp packagefiles/tree-sitter-meson/* tree-sitter-meson + cp packagefiles/tree-sitter-ini/* tree-sitter-ini + cp packagefiles/sha256/* sha256 + cp packagefiles/ada/* ada + popd + ''; - nativeBuildInputs = [ - meson - ninja - python3 - pkg-config - ]; + nativeBuildInputs = [ + meson + ninja + python3 + pkg-config + ]; - buildInputs = [ - tomlplusplus - nlohmann_json - curl - libarchive - libuuid - libpkgconf - libunwind - gtest - ]; + buildInputs = [ + tomlplusplus + nlohmann_json + curl + libarchive + libuuid + libpkgconf + libunwind + gtest + ]; - meta = with lib; { - description = "An unofficial, unendorsed language server for meson written in C"; - homepage = "https://github.com/JCWasmx86/mesonlsp"; - changelog = "https://github.com/JCWasmx86/mesonlsp/blob/${src.rev}/CHANGELOG.md"; - license = licenses.gpl3Only; - maintainers = with maintainers; [traxys]; - mainProgram = "mesonlsp"; - platforms = platforms.all; - }; - } + meta = with lib; { + description = "An unofficial, unendorsed language server for meson written in C"; + homepage = "https://github.com/JCWasmx86/mesonlsp"; + changelog = "https://github.com/JCWasmx86/mesonlsp/blob/${src.rev}/CHANGELOG.md"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ traxys ]; + mainProgram = "mesonlsp"; + platforms = platforms.all; + }; +} diff --git a/pkgs/perseus/default.nix b/pkgs/perseus/default.nix index 42e0848..eaf9bd5 100644 --- a/pkgs/perseus/default.nix +++ b/pkgs/perseus/default.nix @@ -1,12 +1,13 @@ -{ lib -, stdenv -, fetchFromGitHub -, pkg-config -, rustPlatform -, openssl -, zstd -, darwin -, bonnie +{ + lib, + stdenv, + fetchFromGitHub, + pkg-config, + rustPlatform, + openssl, + zstd, + darwin, + bonnie, }: stdenv.mkDerivation rec { @@ -20,9 +21,7 @@ stdenv.mkDerivation rec { hash = "sha256-0jGXoSZeAt+Fo08hGEHiYcookqean6qD7F6mhTGfb2M="; }; - cargoDeps = rustPlatform.importCargoLock { - lockFile = ./Cargo.lock; - }; + cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; }; postPatch = '' ln -s ${./Cargo.lock} Cargo.lock @@ -40,14 +39,16 @@ stdenv.mkDerivation rec { rustPlatform.rust.rustc ]; - buildInputs = [ - openssl - zstd - ] ++ lib.optionals stdenv.isDarwin [ - darwin.apple_sdk.frameworks.CoreFoundation - darwin.apple_sdk.frameworks.CoreServices - darwin.apple_sdk.frameworks.Security - ]; + buildInputs = + [ + openssl + zstd + ] + ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.CoreFoundation + darwin.apple_sdk.frameworks.CoreServices + darwin.apple_sdk.frameworks.Security + ]; checkPhase = '' bonnie test cli diff --git a/pkgs/proton-ge.nix b/pkgs/proton-ge.nix index 8d8b8f5..0dfb831 100644 --- a/pkgs/proton-ge.nix +++ b/pkgs/proton-ge.nix @@ -1,7 +1,4 @@ -{ - stdenv, - fetchFromGitHub, -}: +{ stdenv, fetchFromGitHub }: stdenv.mkDerivation rec { pname = "proton-ge"; version = "9-4"; diff --git a/pkgs/push-to-talk.nix b/pkgs/push-to-talk.nix index 5987f33..1052203 100644 --- a/pkgs/push-to-talk.nix +++ b/pkgs/push-to-talk.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation { hash = "sha256-ZRSgrQHnNdEF2PyaflmI5sUoKCxtZ0mQY/bb/9PH64c="; }; - nativeBuildInputs = [pkg-config]; - buildInputs = [libevdev xdotool xorg.libX11.dev]; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + libevdev + xdotool + xorg.libX11.dev + ]; installPhase = '' runHook preInstall @@ -34,7 +38,7 @@ stdenv.mkDerivation { description = "This fixes the inability to use push to talk in Discord when running Wayland"; homepage = "https://github.com/Rush/wayland-push-to-talk-fix"; license = licenses.mit; - maintainers = with maintainers; [traxys]; + maintainers = with maintainers; [ traxys ]; mainProgram = "wayland-push-to-talk-fix"; platforms = platforms.all; }; diff --git a/pkgs/simulationcraft.nix b/pkgs/simulationcraft.nix index e7445c7..9e646be 100644 --- a/pkgs/simulationcraft.nix +++ b/pkgs/simulationcraft.nix @@ -17,5 +17,5 @@ stdenv.mkDerivation { cmake curl ]; - nativeBuildInputs = [qt5.wrapQtAppsHook]; + nativeBuildInputs = [ qt5.wrapQtAppsHook ]; } diff --git a/pkgs/warcraftlogs.nix b/pkgs/warcraftlogs.nix index 793e4dc..732db59 100644 --- a/pkgs/warcraftlogs.nix +++ b/pkgs/warcraftlogs.nix @@ -12,21 +12,23 @@ appimageTools.wrapType2 rec { hash = "sha256-jShv1FVOzEMThS7dpWCJp1Eu8exETzJ8wTVz1DZ5xE4="; }; - extraInstallCommands = let - appimageContents = appimageTools.extractType2 {inherit pname version src;}; - in '' - install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop - substituteInPlace $out/share/applications/${pname}.desktop --replace-fail 'Exec=AppRun' 'Exec=${pname}-${version}' - install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/0x0/apps/${pname}.png \ - $out/share/icons/hicolor/0x0/apps/${pname}.png - ''; + extraInstallCommands = + let + appimageContents = appimageTools.extractType2 { inherit pname version src; }; + in + '' + install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop + substituteInPlace $out/share/applications/${pname}.desktop --replace-fail 'Exec=AppRun' 'Exec=${pname}-${version}' + install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/0x0/apps/${pname}.png \ + $out/share/icons/hicolor/0x0/apps/${pname}.png + ''; meta = with lib; { homepage = "https://www.warcraftlogs.com/"; description = "Tool to upload world of warcraft combat logs"; #license = licenses.unfree; license = licenses.mit; # workaround because unfree is tedious... - platforms = ["x86_64-linux"]; - maintainers = with maintainers; [traxys]; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ traxys ]; }; } diff --git a/pkgs/wowup.nix b/pkgs/wowup.nix index 18f3398..79c4633 100644 --- a/pkgs/wowup.nix +++ b/pkgs/wowup.nix @@ -12,20 +12,22 @@ appimageTools.wrapType2 rec { sha256 = "sha256-jc9e+0zPJufZaIMhQ8nSFJwKFikuTyDLAxBWaOHf9qI="; }; - extraInstallCommands = let - appimageContents = appimageTools.extractType2 {inherit pname version src;}; - in '' - install -m 444 -D ${appimageContents}/wowup-cf.desktop $out/share/applications/wowup-cf.desktop - substituteInPlace $out/share/applications/wowup-cf.desktop --replace 'Exec=AppRun' 'Exec=${pname}' - install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/wowup-cf.png \ - $out/share/icons/hicolor/512x512/apps/wowup-cf.png - ''; + extraInstallCommands = + let + appimageContents = appimageTools.extractType2 { inherit pname version src; }; + in + '' + install -m 444 -D ${appimageContents}/wowup-cf.desktop $out/share/applications/wowup-cf.desktop + substituteInPlace $out/share/applications/wowup-cf.desktop --replace 'Exec=AppRun' 'Exec=${pname}' + install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/wowup-cf.png \ + $out/share/icons/hicolor/512x512/apps/wowup-cf.png + ''; meta = with lib; { homepage = "https://wowup.io/"; description = "Tool to install world of warcraft addons"; license = licenses.gpl3Plus; - platforms = ["x86_64-linux"]; - maintainers = with maintainers; [traxys]; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ traxys ]; }; } diff --git a/templates/gui/flake.nix b/templates/gui/flake.nix index 39425f7..8c0d7af 100644 --- a/templates/gui/flake.nix +++ b/templates/gui/flake.nix @@ -5,39 +5,48 @@ inputs.naersk.url = "github:nix-community/naersk"; inputs.rust-overlay.url = "github:oxalica/rust-overlay"; - outputs = { - self, - nixpkgs, - flake-utils, - naersk, - rust-overlay, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { - inherit system; - overlays = [(import rust-overlay)]; - }; - rust = pkgs.rust-bin.stable.latest.default; - naersk' = pkgs.callPackage naersk { - cargo = rust; - rustc = rust; - }; - libPath = with pkgs; lib.makeLibraryPath [libxkbcommon wayland]; - in { - devShell = pkgs.mkShell { - nativeBuildInputs = [rust]; - RUST_PATH = "${rust}"; - RUST_DOC_PATH = "${rust}/share/doc/rust/html/std/index.html"; - LD_LIBRARY_PATH = libPath; - }; + outputs = + { + self, + nixpkgs, + flake-utils, + naersk, + rust-overlay, + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ (import rust-overlay) ]; + }; + rust = pkgs.rust-bin.stable.latest.default; + naersk' = pkgs.callPackage naersk { + cargo = rust; + rustc = rust; + }; + libPath = + with pkgs; + lib.makeLibraryPath [ + libxkbcommon + wayland + ]; + in + { + devShell = pkgs.mkShell { + nativeBuildInputs = [ rust ]; + RUST_PATH = "${rust}"; + RUST_DOC_PATH = "${rust}/share/doc/rust/html/std/index.html"; + LD_LIBRARY_PATH = libPath; + }; - defaultPackage = naersk'.buildPackage { - src = ./.; - nativeBuildInputs = [pkgs.makeWrapper]; - postInstall = '' - wrapProgram "$out/bin/todo_change_name" --prefix LD_LIBRARY_PATH : "${libPath}" - ''; - }; - }); + defaultPackage = naersk'.buildPackage { + src = ./.; + nativeBuildInputs = [ pkgs.makeWrapper ]; + postInstall = '' + wrapProgram "$out/bin/todo_change_name" --prefix LD_LIBRARY_PATH : "${libPath}" + ''; + }; + } + ); } - diff --git a/templates/webserver/flake.nix b/templates/webserver/flake.nix index 4c067b9..8176bbe 100644 --- a/templates/webserver/flake.nix +++ b/templates/webserver/flake.nix @@ -5,30 +5,35 @@ inputs.naersk.url = "github:nix-community/naersk"; inputs.rust-overlay.url = "github:oxalica/rust-overlay"; - outputs = { - self, - nixpkgs, - flake-utils, - naersk, - rust-overlay, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { - inherit system; - overlays = [(import rust-overlay)]; - }; - rust = pkgs.rust-bin.stable.latest.default; - naersk' = pkgs.callPackage naersk { - cargo = rust; - rustc = rust; - }; - in { - devShell = pkgs.mkShell { - nativeBuildInputs = [rust]; - RUST_PATH = "${rust}"; - RUST_DOC_PATH = "${rust}/share/doc/rust/html/std/index.html"; - }; + outputs = + { + self, + nixpkgs, + flake-utils, + naersk, + rust-overlay, + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ (import rust-overlay) ]; + }; + rust = pkgs.rust-bin.stable.latest.default; + naersk' = pkgs.callPackage naersk { + cargo = rust; + rustc = rust; + }; + in + { + devShell = pkgs.mkShell { + nativeBuildInputs = [ rust ]; + RUST_PATH = "${rust}"; + RUST_DOC_PATH = "${rust}/share/doc/rust/html/std/index.html"; + }; - packages.default = naersk'.buildPackage ./.; - }); + packages.default = naersk'.buildPackage ./.; + } + ); }