diff --git a/flake.lock b/flake.lock index 0f448b8..483424a 100644 --- a/flake.lock +++ b/flake.lock @@ -44,7 +44,9 @@ }, "fenix": { "inputs": { - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "nixpkgs" + ], "rust-analyzer-src": "rust-analyzer-src" }, "locked": { @@ -354,16 +356,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1665449268, - "narHash": "sha256-cw4xrQIAZUyJGj58Dp5VLICI0rscd+uap83afiFzlcA=", - "owner": "nixos", + "lastModified": 1665596265, + "narHash": "sha256-H7Ku1SF+7zDEqw8QOyEDA5blMJQW9MvdfgB+K3KJNLw=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "285e77efe87df64105ec14b204de6636fb0a7a27", + "rev": "9234f5a17e1a7820b5e91ecd4ff0de449e293383", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", + "owner": "NixOS", + "ref": "nixos-22.05", "repo": "nixpkgs", "type": "github" } @@ -400,22 +402,6 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1665596265, - "narHash": "sha256-H7Ku1SF+7zDEqw8QOyEDA5blMJQW9MvdfgB+K3KJNLw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9234f5a17e1a7820b5e91ecd4ff0de449e293383", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.05", - "repo": "nixpkgs", - "type": "github" - } - }, "polymc": { "inputs": { "flake-compat": "flake-compat", @@ -472,7 +458,7 @@ "nix-on-droid": "nix-on-droid", "nixos-generators": "nixos-generators", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "polymc": "polymc", "quilt-server": "quilt-server", diff --git a/flake.nix b/flake.nix index 78203c6..3f85122 100644 --- a/flake.nix +++ b/flake.nix @@ -5,9 +5,24 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixos-hardware.url = "github:NixOS/nixos-hardware"; + home-manager = { + url = "github:nix-community/home-manager/release-22.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-on-droid = { + url = "github:t184256/nix-on-droid"; + inputs = { + nixpkgs.follows = "nixpkgs"; + home-manager.follows = "home-manager"; + }; + }; + darwin = { + url = "github:lnl7/nix-darwin/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; fenix = { url = "github:nix-community/fenix"; - inputs.nixpgks.follows = "nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; }; emacs = { url = "github:nix-community/emacs-overlay"; @@ -21,14 +36,6 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - home-manager = { - url = "github:nix-community/home-manager/release-22.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - darwin = { - url = "github:lnl7/nix-darwin/master"; - inputs.nixpkgs.follows = "nixpkgs"; - }; polymc = { url = "github:PolyMC/PolyMC"; inputs.nixpkgs.follows = "nixpkgs"; @@ -57,73 +64,66 @@ }; }; - nix-on-droid = { - url = "github:t184256/nix-on-droid"; - inputs = { - nixpkgs.follows = "nixpkgs"; - home-manager.follows = "home-manager"; - }; - }; }; - outputs = - { self - , nixpkgs - , nixpkgs-unstable - , nixos-hardware - , fenix - , emacs - , mozilla - , sops-nix - , home-manager - , darwin - , polymc - , java - , quilt-server - , nixos-generators - , wsl - , gamescope - , nix-on-droid - }@inputs: + outputs = { self, nixpkgs, nixpkgs-unstable, nixos-hardware, fenix, emacs + , mozilla, sops-nix, home-manager, darwin, polymc, java, quilt-server + , nixos-generators, wsl, gamescope, nix-on-droid }@inputs: let - makeNixosSystem = { system, hostName, extraModules ? [ ], ourNixpkgs ? nixpkgs }: ourNixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inputs = inputs; - }; - modules = [ - sops-nix.nixosModules.sops - home-manager.nixosModules.home-manager - ./modules/linux/default.nix - ({ pkgs, lib, config, ... }: { - # Configure hostname - networking = { - hostName = hostName; - }; - # Setup sops - # Add default secrets - sops = { - age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; - }; - nixpkgs.config.allowUnfree = true; - nixpkgs.config.allowUnfreePredicate = (pkg: true); - # Home manager configuration - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - extraSpecialArgs = { - inputs = inputs; - nixosConfig = config; + makeNixosSystem = + { system, hostName, extraModules ? [ ], ourNixpkgs ? nixpkgs }: + ourNixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { inputs = inputs; }; + modules = [ + sops-nix.nixosModules.sops + home-manager.nixosModules.home-manager + ./modules/linux/default.nix + ({ pkgs, lib, config, ... }: { + # Configure hostname + networking = { hostName = hostName; }; + # Setup sops + # Add default secrets + sops = { age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; }; + nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfreePredicate = (pkg: true); + # Home manager configuration + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + extraSpecialArgs = { + inputs = inputs; + nixosConfig = config; + }; + sharedModules = [ ./home-manager/linux/default.nix ]; }; - sharedModules = [ - ./home-manager/linux/default.nix - ]; - }; - }) - ] ++ extraModules; - }; - in - rec { + }) + ] ++ extraModules; + }; + makeDarwinSystem = { system, extraModules ? [ ] }: + darwin.lib.darwinSystem { + inherit system; + specialArgs = { inputs = inputs; }; + modules = [ + home-manager.darwinModules.home-manager + ./modules/darwin/default.nix + ({ pkgs, lib, config, ... }: { + nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfreePredicate = (pkg: true); + # Home manager configuration + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + extraSpecialArgs = { + inputs = inputs; + nixosConfig = config; + }; + sharedModules = [ ./home-manager/darwin/default.nix ]; + }; + }) + ] ++ extraModules; + }; + in rec { # Real systems nixosConfigurations = { levitation = makeNixosSystem { @@ -138,27 +138,21 @@ oracles = makeNixosSystem { system = "x86_64-linux"; hostName = "oracles"; - extraModules = [ - ./hardware/oracles.nix - ./machines/oracles/configuration.nix - ]; + extraModules = + [ ./hardware/oracles.nix ./machines/oracles/configuration.nix ]; }; matrix = makeNixosSystem { system = "x86_64-linux"; hostName = "matrix"; - extraModules = [ - ./hardware/matrix.nix - ./machines/matrix/configuration.nix - ]; + extraModules = + [ ./hardware/matrix.nix ./machines/matrix/configuration.nix ]; }; tounge = makeNixosSystem { system = "aarch64-linux"; hostName = "tounge"; - extraModules = [ - ./machines/tounge/configuration.nix - ]; + extraModules = [ ./machines/tounge/configuration.nix ]; }; x86vm = makeNixosSystem { @@ -175,10 +169,15 @@ wsl = makeNixosSystem { system = "x86_64-linux"; hostName = "wsl"; - extraModules = [ - wsl.nixosModules.wsl - ./machines/wsl/configuration.nix - ]; + extraModules = + [ wsl.nixosModules.wsl ./machines/wsl/configuration.nix ]; + }; + }; + # Mac systems + darwinConfigurations = { + "extremophile" = makeDarwinSystem { + system = "x86_64-darwin"; + extraModules = [ ./machines/extremophile/configuration.nix ]; }; }; # Android systems @@ -197,9 +196,7 @@ inputs = inputs; nixosConfig = config; }; - sharedModules = [ - ./home-manager/nix-on-droid/default.nix - ]; + sharedModules = [ ./home-manager/nix-on-droid/default.nix ]; }; }) ]; @@ -210,9 +207,7 @@ # Hyper-V image hyperv = nixos-generators.nixosGenerate { pkgs = nixpkgs.legacyPackages.x86_64-linux; - modules = [ - ./machines/hyperv/configuration.nix - ]; + modules = [ ./machines/hyperv/configuration.nix ]; format = "hyperv"; }; }; diff --git a/hardware/levitation.nix b/hardware/levitation.nix index a33b700..b604245 100644 --- a/hardware/levitation.nix +++ b/hardware/levitation.nix @@ -4,58 +4,51 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = + [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { - device = "/dev/mapper/crypt-pv"; - fsType = "btrfs"; - options = [ "subvol=root" ]; - }; + fileSystems."/" = { + device = "/dev/mapper/crypt-pv"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; - boot.initrd.luks.devices."crypt-pv".device = "/dev/disk/by-uuid/15e9f417-b35a-40fe-a066-595be13cf230"; + boot.initrd.luks.devices."crypt-pv".device = + "/dev/disk/by-uuid/15e9f417-b35a-40fe-a066-595be13cf230"; - fileSystems."/home" = - { - device = "/dev/mapper/crypt-pv"; - fsType = "btrfs"; - options = [ "subvol=home" ]; - }; + fileSystems."/home" = { + device = "/dev/mapper/crypt-pv"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; - fileSystems."/nix" = - { - device = "/dev/mapper/crypt-pv"; - fsType = "btrfs"; - options = [ "subvol=nix" ]; - }; + fileSystems."/nix" = { + device = "/dev/mapper/crypt-pv"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; - fileSystems."/etc" = - { - device = "/dev/mapper/crypt-pv"; - fsType = "btrfs"; - options = [ "subvol=etc" ]; - }; + fileSystems."/etc" = { + device = "/dev/mapper/crypt-pv"; + fsType = "btrfs"; + options = [ "subvol=etc" ]; + }; - fileSystems."/var" = - { - device = "/dev/mapper/crypt-pv"; - fsType = "btrfs"; - options = [ "subvol=var" ]; - }; + fileSystems."/var" = { + device = "/dev/mapper/crypt-pv"; + fsType = "btrfs"; + options = [ "subvol=var" ]; + }; - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/1425-B41E"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1425-B41E"; + fsType = "vfat"; + }; fileSystems."/home/nathan/Music" = { device = "10.0.0.139:/mnt/tank/root/nathan/music"; @@ -70,15 +63,15 @@ fsType = "nfs"; }; - swapDevices = - [{ - device = "/dev/disk/by-partuuid/f9d26ecd-7df5-48ad-bc19-b9ac4e91b0ee"; - randomEncryption = { - cipher = "aes-xts-plain64"; - enable = true; - source = "/dev/random"; - }; - }]; + swapDevices = [{ + device = "/dev/disk/by-partuuid/f9d26ecd-7df5-48ad-bc19-b9ac4e91b0ee"; + randomEncryption = { + cipher = "aes-xts-plain64"; + enable = true; + source = "/dev/random"; + }; + }]; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hardware/matrix.nix b/hardware/matrix.nix index 753679b..c8c1ccf 100644 --- a/hardware/matrix.nix +++ b/hardware/matrix.nix @@ -4,56 +4,48 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ]; + boot.initrd.availableKernelModules = + [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/88f5bc7a-0101-4f10-8863-25def54bab4b"; - fsType = "btrfs"; - options = [ "subvol=root,compress-force=zstd:1" ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/88f5bc7a-0101-4f10-8863-25def54bab4b"; + fsType = "btrfs"; + options = [ "subvol=root,compress-force=zstd:1" ]; + }; - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/61AB-C10E"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/61AB-C10E"; + fsType = "vfat"; + }; - fileSystems."/home" = - { - device = "/dev/disk/by-uuid/88f5bc7a-0101-4f10-8863-25def54bab4b"; - fsType = "btrfs"; - options = [ "subvol=home,compress-force=zstd:1" ]; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/88f5bc7a-0101-4f10-8863-25def54bab4b"; + fsType = "btrfs"; + options = [ "subvol=home,compress-force=zstd:1" ]; + }; - fileSystems."/etc" = - { - device = "/dev/disk/by-uuid/88f5bc7a-0101-4f10-8863-25def54bab4b"; - fsType = "btrfs"; - options = [ "subvol=etc,compress-force=zstd:1" ]; - }; + fileSystems."/etc" = { + device = "/dev/disk/by-uuid/88f5bc7a-0101-4f10-8863-25def54bab4b"; + fsType = "btrfs"; + options = [ "subvol=etc,compress-force=zstd:1" ]; + }; - fileSystems."/var" = - { - device = "/dev/disk/by-uuid/88f5bc7a-0101-4f10-8863-25def54bab4b"; - fsType = "btrfs"; - options = [ "subvol=var,compress-force=zstd:1" ]; - }; + fileSystems."/var" = { + device = "/dev/disk/by-uuid/88f5bc7a-0101-4f10-8863-25def54bab4b"; + fsType = "btrfs"; + options = [ "subvol=var,compress-force=zstd:1" ]; + }; - fileSystems."/nix" = - { - device = "/dev/disk/by-uuid/88f5bc7a-0101-4f10-8863-25def54bab4b"; - fsType = "btrfs"; - options = [ "subvol=nix,compress-force=zstd:6" ]; - }; + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/88f5bc7a-0101-4f10-8863-25def54bab4b"; + fsType = "btrfs"; + options = [ "subvol=nix,compress-force=zstd:6" ]; + }; swapDevices = [{ device = "/dev/disk/by-uuid/09eb9e97-3105-4b60-88f7-ac3a01a2c130"; }]; diff --git a/hardware/oracles.nix b/hardware/oracles.nix index 98c57d4..43cdcd9 100644 --- a/hardware/oracles.nix +++ b/hardware/oracles.nix @@ -4,56 +4,48 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = + [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/26b08694-708a-447d-be16-abc3fc2b0d70"; - fsType = "btrfs"; - options = [ "subvol=root" ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/26b08694-708a-447d-be16-abc3fc2b0d70"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/882E-B495"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/882E-B495"; + fsType = "vfat"; + }; - fileSystems."/var" = - { - device = "/dev/disk/by-uuid/26b08694-708a-447d-be16-abc3fc2b0d70"; - fsType = "btrfs"; - options = [ "subvol=var" ]; - }; + fileSystems."/var" = { + device = "/dev/disk/by-uuid/26b08694-708a-447d-be16-abc3fc2b0d70"; + fsType = "btrfs"; + options = [ "subvol=var" ]; + }; - fileSystems."/etc" = - { - device = "/dev/disk/by-uuid/26b08694-708a-447d-be16-abc3fc2b0d70"; - fsType = "btrfs"; - options = [ "subvol=etc" ]; - }; + fileSystems."/etc" = { + device = "/dev/disk/by-uuid/26b08694-708a-447d-be16-abc3fc2b0d70"; + fsType = "btrfs"; + options = [ "subvol=etc" ]; + }; - fileSystems."/nix" = - { - device = "/dev/disk/by-uuid/26b08694-708a-447d-be16-abc3fc2b0d70"; - fsType = "btrfs"; - options = [ "subvol=nix" ]; - }; + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/26b08694-708a-447d-be16-abc3fc2b0d70"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; - fileSystems."/home" = - { - device = "/dev/disk/by-uuid/26b08694-708a-447d-be16-abc3fc2b0d70"; - fsType = "btrfs"; - options = [ "subvol=home" ]; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/26b08694-708a-447d-be16-abc3fc2b0d70"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; swapDevices = [{ device = "/dev/disk/by-uuid/2c823521-9ab0-44bb-9f40-3963757cf4b5"; }]; diff --git a/hardware/perception.nix b/hardware/perception.nix index 668d1da..8557c46 100644 --- a/hardware/perception.nix +++ b/hardware/perception.nix @@ -4,56 +4,48 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = + [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/49959c20-a0d0-4b9b-b5bc-f7601640d252"; - fsType = "btrfs"; - options = [ "subvol=root" ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/49959c20-a0d0-4b9b-b5bc-f7601640d252"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/68FE-F04C"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/68FE-F04C"; + fsType = "vfat"; + }; - fileSystems."/nix" = - { - device = "/dev/disk/by-uuid/49959c20-a0d0-4b9b-b5bc-f7601640d252"; - fsType = "btrfs"; - options = [ "subvol=nix" ]; - }; + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/49959c20-a0d0-4b9b-b5bc-f7601640d252"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; - fileSystems."/var" = - { - device = "/dev/disk/by-uuid/49959c20-a0d0-4b9b-b5bc-f7601640d252"; - fsType = "btrfs"; - options = [ "subvol=var" ]; - }; + fileSystems."/var" = { + device = "/dev/disk/by-uuid/49959c20-a0d0-4b9b-b5bc-f7601640d252"; + fsType = "btrfs"; + options = [ "subvol=var" ]; + }; - fileSystems."/home" = - { - device = "/dev/disk/by-uuid/49959c20-a0d0-4b9b-b5bc-f7601640d252"; - fsType = "btrfs"; - options = [ "subvol=home" ]; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/49959c20-a0d0-4b9b-b5bc-f7601640d252"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; - fileSystems."/etc" = - { - device = "/dev/disk/by-uuid/49959c20-a0d0-4b9b-b5bc-f7601640d252"; - fsType = "btrfs"; - options = [ "subvol=etc" ]; - }; + fileSystems."/etc" = { + device = "/dev/disk/by-uuid/49959c20-a0d0-4b9b-b5bc-f7601640d252"; + fsType = "btrfs"; + options = [ "subvol=etc" ]; + }; swapDevices = [{ device = "/dev/disk/by-uuid/522c68bd-b23b-487d-80e3-fc41e2be130f"; }]; diff --git a/hardware/shadowchild.nix b/hardware/shadowchild.nix index aab4a00..926c63a 100644 --- a/hardware/shadowchild.nix +++ b/hardware/shadowchild.nix @@ -1,14 +1,19 @@ -{ modulesPath, ... }: -{ +{ modulesPath, ... }: { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; boot.loader.grub = { efiSupport = true; efiInstallAsRemovable = true; device = "nodev"; }; - fileSystems."/boot" = { device = "/dev/disk/by-uuid/94E8-7477"; fsType = "vfat"; }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/94E8-7477"; + fsType = "vfat"; + }; boot.initrd.kernelModules = [ "nvme" ]; - fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; + fileSystems."/" = { + device = "/dev/sda1"; + fsType = "ext4"; + }; swapDevices = [{ device = "/swapfile"; }]; } diff --git a/home-manager/common/programs/core.nix b/home-manager/common/programs/core.nix index 442a5b1..984189c 100644 --- a/home-manager/common/programs/core.nix +++ b/home-manager/common/programs/core.nix @@ -1,6 +1,5 @@ { config, lib, pkgs, inputs, ... }: -with lib; -{ +with lib; { config = mkMerge [ (mkIf config.nathan.programs.util.core { home.packages = with pkgs; [ @@ -104,9 +103,7 @@ with lib; delta.enable = true; lfs.enable = true; extraConfig = { - init = { - defaultBranch = "trunk"; - }; + init = { defaultBranch = "trunk"; }; log = { showSignature = true; abbrevCommit = true; @@ -125,31 +122,19 @@ with lib; default = "simple"; followTags = true; }; - pull = { - rebase = true; - }; - status = { - showUntrackedFiles = "all"; - }; - transfer = { - fsckobjects = true; - }; - color = { - ui = "auto"; - }; + pull = { rebase = true; }; + status = { showUntrackedFiles = "all"; }; + transfer = { fsckobjects = true; }; + color = { ui = "auto"; }; diff = { mnemonicPrefix = true; renames = true; wordRegex = "."; submodule = "log"; }; - credential = { - helper = "cache"; - }; + credential = { helper = "cache"; }; # Disable annoying safe directory nonsense - safe = { - directory = "*"; - }; + safe = { directory = "*"; }; }; }; }) @@ -252,9 +237,7 @@ with lib; commit_hash_length = 6; only_detached = false; }; - package = { - symbol = ""; - }; + package = { symbol = ""; }; time = { disabled = false; format = "[$time]($style)"; @@ -274,13 +257,8 @@ with lib; ######################### ## JSON Utilities ######################### - programs.jq = { - enable = true; - }; - home.packages = with pkgs; [ - jc - fx - ]; + programs.jq = { enable = true; }; + home.packages = with pkgs; [ jc fx ]; }) ]; } diff --git a/home-manager/common/programs/devel.nix b/home-manager/common/programs/devel.nix index ca58238..2640874 100644 --- a/home-manager/common/programs/devel.nix +++ b/home-manager/common/programs/devel.nix @@ -2,15 +2,19 @@ let devel = config.nathan.programs.devel; unstable = inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}"; - inherit (import ../../../modules/lib.nix { inherit lib; inherit pkgs; }) nLib; -in + inherit (import ../../../modules/lib.nix { + inherit lib; + inherit pkgs; + }) + nLib; -with lib; with nLib; { +in with lib; +with nLib; { config = mkMerge [ # Core development utilites (mkIf devel.core { home.packages = with pkgs; - # General packages + # General packages [ # Git addons git-secret @@ -25,14 +29,10 @@ with lib; with nLib; { ]; programs = { - direnv = { - enable = true; - }; + direnv = { enable = true; }; # Neovim # (I'm not abonding emacs I just want the tutor) - neovim = { - enable = true; - }; + neovim = { enable = true; }; }; }) # Rust development @@ -62,26 +62,13 @@ with lib; with nLib; { }) # Python Development (mkIf devel.python { - home.packages = with pkgs; [ - python3Full - nodePackages.pyright - ]; + home.packages = with pkgs; [ python3Full nodePackages.pyright ]; }) # JavaScript/TypeScript Development (mkIf devel.js { - home.packages = with pkgs; [ - nodejs - yarn - nodePackages.typescript - deno - ]; + home.packages = with pkgs; [ nodejs yarn nodePackages.typescript deno ]; }) # Raku Development - (mkIf devel.raku { - home.packages = with pkgs; [ - rakudo - zef - ]; - }) + (mkIf devel.raku { home.packages = with pkgs; [ rakudo zef ]; }) ]; } diff --git a/home-manager/common/programs/emacs.nix b/home-manager/common/programs/emacs.nix index d885278..3aa93c2 100644 --- a/home-manager/common/programs/emacs.nix +++ b/home-manager/common/programs/emacs.nix @@ -1,47 +1,52 @@ { config, lib, pkgs, inputs, ... }: { - config = lib.mkIf config.nathan.programs.emacs.enable { - # Dependencies of my emacs environment - home.packages = with pkgs; [ - # For markdown rendering - python39Packages.grip - # For graph generation - graphviz - sqlite - # For latex editing - texlive.combined.scheme-medium - # For notifications - libnotify - # For flash cards - anki - # For spelling - aspell - aspellDicts.en - aspellDicts.en-science - aspellDicts.en-computers - # For nix - rnix-lsp - manix - nix-doc - # For email - mu - # Desktop file for org-protocol - (makeDesktopItem { - name = "org-protocol"; - exec = "emacsclient %u"; - comment = "Org protocol"; - desktopName = "org-protocol"; - type = "Application"; - mimeTypes = [ "x-scheme-handler/org-protocol" ]; - }) - ]; - programs.emacs = { - enable = true; - package = config.nathan.programs.emacs.package; - extraPackages = epkgs: [ - pkgs.mu + config = lib.mkMerge [ + (lib.mkIf config.nathan.programs.emacs.enable (let + myAspell = pkgs.aspellWithDicts (d: [ d.en d.en-science d.en-computers ]); + in { + # Dependencies of my emacs environment + home.packages = with pkgs; [ + # For markdown rendering + python39Packages.grip + # For graph generation + graphviz + sqlite + # For latex editing + texlive.combined.scheme-medium + # For notifications + libnotify + # For spelling + myAspell + # For nix + rnix-lsp + manix + nix-doc + nixfmt + # For email + mu + # Desktop file for org-protocol + (makeDesktopItem { + name = "org-protocol"; + exec = "emacsclient %u"; + comment = "Org protocol"; + desktopName = "org-protocol"; + type = "Application"; + mimeTypes = [ "x-scheme-handler/org-protocol" ]; + }) ]; - }; - }; + programs.emacs = { + enable = true; + package = config.nathan.programs.emacs.package; + extraPackages = epkgs: [ pkgs.mu ]; + }; + })) + (lib.mkIf (config.nathan.programs.emacs.enable && pkgs.stdenv.isLinux) { + home.packages = with pkgs; + [ + # For flash cards + anki + ]; + }) + ]; } diff --git a/home-manager/darwin/default.nix b/home-manager/darwin/default.nix new file mode 100644 index 0000000..d0b83fa --- /dev/null +++ b/home-manager/darwin/default.nix @@ -0,0 +1,46 @@ +{ config, lib, pkgs, inputs, ... }: +let + inherit (import ../../modules/lib.nix { + inherit lib; + inherit pkgs; + }) + nLib; +in with lib; +with nLib; { + imports = [ + ../options.nix + ../common/programs/core.nix + ../common/programs/devel.nix + ../common/programs/emacs.nix + ./programs/core.nix + ]; + + options = { }; + + config = { + # Link applications in spotlight/launchpad + home.activation = mkIf pkgs.stdenv.isDarwin { + copyApplications = let + apps = pkgs.buildEnv { + name = "home-manager-applications"; + paths = config.home.packages; + pathsToLink = "/Applications"; + }; + in lib.hm.dag.entryAfter [ "writeBoundary" ] '' + baseDir="$HOME/Applications/Home Manager Apps" + if [ -d "$baseDir" ]; then + rm -rf "$baseDir" + fi + mkdir -p "$baseDir" + for appFile in ${apps}/Applications/*; do + target="$baseDir/$(basename "$appFile")" + $DRY_RUN_CMD cp ''${VERBOSE_ARG:+-v} -fHRL "$appFile" "$baseDir" + $DRY_RUN_CMD chmod ''${VERBOSE_ARG:+-v} -R +w "$target" + done + ''; + }; + home.stateVersion = "22.05"; + programs.home-manager.enable = true; + nathan.programs.emacs.package = lib.mkDefault pkgs.emacs28NativeComp; + }; +} diff --git a/home-manager/darwin/programs/core.nix b/home-manager/darwin/programs/core.nix new file mode 100644 index 0000000..b5ea549 --- /dev/null +++ b/home-manager/darwin/programs/core.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, inputs, ... }: +with lib; { + config = mkMerge [ + (mkIf config.nathan.programs.util.fish { + ######################### + ## Fish Configuration + ######################### + programs.fish = { + # Custom configuration + interactiveShellInit = '' + for p in /run/current-system/sw/bin + if not contains $p $fish_user_paths + set -g fish_user_paths $p $fish_user_paths + end + end + for p in /etc/profiles/per-user/nathan/bin + if not contains $p $fish_user_paths + set -g fish_user_paths $p $fish_user_paths + end + end + ''; + }; + }) + ]; +} diff --git a/home-manager/linux/default.nix b/home-manager/linux/default.nix index 085ac04..ef768dc 100644 --- a/home-manager/linux/default.nix +++ b/home-manager/linux/default.nix @@ -1,8 +1,12 @@ { config, lib, pkgs, inputs, ... }: let - inherit (import ../../modules/lib.nix { inherit lib; inherit pkgs; }) nLib; -in -with lib; with nLib; { + inherit (import ../../modules/lib.nix { + inherit lib; + inherit pkgs; + }) + nLib; +in with lib; +with nLib; { imports = [ ../options.nix ./programs/sway.nix @@ -25,13 +29,12 @@ with lib; with nLib; { # Services, these are platform specific so they go here services = { # Synthing, enabled by default on linux desktop - syncthing = mkDefaultOption "Syncthing" (config.nathan.config.isDesktop && pkgs.stdenv.isLinux); + syncthing = mkDefaultOption "Syncthing" + (config.nathan.config.isDesktop && pkgs.stdenv.isLinux); # Email syncing # Disabled by default since this requires manual setup on the machine # TODO: Get this working on darwin - email = { - enable = mkEnableOption "Email"; - }; + email = { enable = mkEnableOption "Email"; }; }; # Linux specific programs programs = { @@ -42,12 +45,11 @@ with lib; with nLib; { gpg = mkEnableOptionT "gpg"; }; devel = { - jvm = mkDefaultOption "JVM Development Utilites" config.nathan.config.isDesktop; + jvm = mkDefaultOption "JVM Development Utilites" + config.nathan.config.isDesktop; }; # Install games - games = { - launcher = mkEnableOption "Game launcher"; - }; + games = { launcher = mkEnableOption "Game launcher"; }; # Swaywm and supoorting application configuration swaywm = { enable = mkDefaultOption "swaywm" config.nathan.config.isDesktop; @@ -55,20 +57,24 @@ with lib; with nLib; { # Communications applications communications = { # Enable by default if we are on a linux desktop - enable = mkDefaultOption "Communication applications" (config.nathan.config.isDesktop && pkgs.stdenv.isLinux); + enable = mkDefaultOption "Communication applications" + (config.nathan.config.isDesktop && pkgs.stdenv.isLinux); }; # Image editing software, on by default on desktop - image-editing = mkDefaultOption "Image Editing Software" config.nathan.config.isDesktop; + image-editing = mkDefaultOption "Image Editing Software" + config.nathan.config.isDesktop; # Media appilcations, on by default on linux desktop media = { - enable = mkDefaultOption "Media Applications" (config.nathan.config.isDesktop && pkgs.stdenv.isLinux); + enable = mkDefaultOption "Media Applications" + (config.nathan.config.isDesktop && pkgs.stdenv.isLinux); mopidyExtraConfig = mkOption { description = "Extra config files for mopidy"; default = [ ]; }; }; # Firefox, enabled by default on linux desktop - firefox = mkDefaultOption "Firefox" (config.nathan.config.isDesktop && pkgs.stdenv.isLinux); + firefox = mkDefaultOption "Firefox" + (config.nathan.config.isDesktop && pkgs.stdenv.isLinux); }; }; }; @@ -80,7 +86,8 @@ with lib; with nLib; { enable = config.nathan.programs.firefox; package = pkgs.firefox-beta-bin; }; - nathan.programs.emacs.package = lib.mkDefault inputs.emacs.packages."${pkgs.system}".emacsPgtkNativeComp; + nathan.programs.emacs.package = + lib.mkDefault inputs.emacs.packages."${pkgs.system}".emacsPgtkNativeComp; # We should be managing xdg stuff xdg = { enable = true; diff --git a/home-manager/linux/programs/communications.nix b/home-manager/linux/programs/communications.nix index f7643b5..e3b65ba 100644 --- a/home-manager/linux/programs/communications.nix +++ b/home-manager/linux/programs/communications.nix @@ -4,32 +4,38 @@ config = lib.mkIf config.nathan.programs.communications.enable { home.packages = with pkgs; let - unstable = import inputs.nixpkgs-unstable { config = { allowUnfree = true; }; inherit system; }; - enableWayland = drv: bin: drv.overrideAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.makeWrapper ]; + unstable = import inputs.nixpkgs-unstable { + config = { allowUnfree = true; }; + inherit system; + }; + enableWayland = drv: bin: + drv.overrideAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) + ++ [ pkgs.makeWrapper ]; postFixup = (old.postFixup or "") + '' wrapProgram $out/bin/${bin} \ --add-flags "--enable-features=UseOzonePlatform" \ --add-flags "--ozone-platform=wayland" ''; - } - ); - discordWayland = pkgs.callPackage ../../../packages/discord/default.nix rec { - pname = "discord-electron"; - binaryName = "Discord"; - desktopName = "Discord (Wayland)"; - version = "0.0.20"; - src = fetchurl { - url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz"; - hash = "sha256-3f7yuxigEF3e8qhCetCHKBtV4XUHsx/iYiaCCXjspYw="; + }); + discordWayland = + pkgs.callPackage ../../../packages/discord/default.nix rec { + pname = "discord-electron"; + binaryName = "Discord"; + desktopName = "Discord (Wayland)"; + version = "0.0.20"; + src = fetchurl { + url = + "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz"; + hash = "sha256-3f7yuxigEF3e8qhCetCHKBtV4XUHsx/iYiaCCXjspYw="; + }; + electron = pkgs.electron_13; }; - electron = pkgs.electron_13; - }; zulipWayland = pkgs.makeDesktopItem { name = "zulip-wayland"; desktopName = "Zulip (Wayland)"; - exec = "${unstable.zulip}/bin/zulip --enable-features=UseOzonePlatform --ozone-platform=wayland"; + exec = + "${unstable.zulip}/bin/zulip --enable-features=UseOzonePlatform --ozone-platform=wayland"; terminal = false; icon = "zulip"; type = "Application"; @@ -38,25 +44,27 @@ fbChromeDesktopItem = pkgs.makeDesktopItem { name = "messenger-chrome"; desktopName = "Messenger (chrome)"; - exec = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform -ozone-platform=wayland \"--app=https://messenger.com\""; + exec = '' + ${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform -ozone-platform=wayland "--app=https://messenger.com"''; terminal = false; }; # Teams teamsItem = pkgs.makeDesktopItem { name = "teams-wayland"; desktopName = "Teams (Wayland)"; - exec = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform -ozone-platform=wayland \"--app=https://teams.microsoft.com\""; + exec = '' + ${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform -ozone-platform=wayland "--app=https://teams.microsoft.com"''; terminal = false; }; # Cinny cinnyItem = pkgs.makeDesktopItem { name = "cinny"; desktopName = "Cinny"; - exec = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform -ozone-platform=wayland \"--app=https://app.cinny.in\""; + exec = '' + ${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform -ozone-platform=wayland "--app=https://app.cinny.in"''; terminal = false; }; - in - [ + in [ # Discord discordWayland betterdiscordctl diff --git a/home-manager/linux/programs/devel.nix b/home-manager/linux/programs/devel.nix index f8588b5..0d4d199 100644 --- a/home-manager/linux/programs/devel.nix +++ b/home-manager/linux/programs/devel.nix @@ -2,15 +2,19 @@ let devel = config.nathan.programs.devel; unstable = inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}"; - inherit (import ../../../modules/lib.nix { inherit lib; inherit pkgs; }) nLib; -in + inherit (import ../../../modules/lib.nix { + inherit lib; + inherit pkgs; + }) + nLib; -with lib; with nLib; { +in with lib; +with nLib; { config = mkMerge [ # Core development utilites (mkIf devel.core { home.packages = with pkgs; - # Linux specific packages + # Linux specific packages [ clang unstable.mold @@ -18,9 +22,10 @@ with lib; with nLib; { }) # Rust development (mkIf devel.rust { - home.packages = with pkgs; [ - unstable.cargo-tarpaulin # Code coverage - ]; + home.packages = with pkgs; + [ + unstable.cargo-tarpaulin # Code coverage + ]; }) # JVM Development (mkIf devel.jvm { diff --git a/home-manager/linux/programs/games.nix b/home-manager/linux/programs/games.nix index 2f8070d..6878670 100644 --- a/home-manager/linux/programs/games.nix +++ b/home-manager/linux/programs/games.nix @@ -5,9 +5,7 @@ with lib; { # eidolon game launcher (mkIf config.nathan.programs.games.launcher { # Install the launcher - home.packages = with pkgs; [ - eidolon - ]; + home.packages = with pkgs; [ eidolon ]; }) ]; } diff --git a/home-manager/linux/programs/gpg.nix b/home-manager/linux/programs/gpg.nix index eb3e59a..8cc25da 100644 --- a/home-manager/linux/programs/gpg.nix +++ b/home-manager/linux/programs/gpg.nix @@ -2,9 +2,7 @@ { config = lib.mkIf config.nathan.programs.util.gpg { - programs.gpg = { - enable = true; - }; + programs.gpg = { enable = true; }; services.gpg-agent = { enable = true; enableSshSupport = true; diff --git a/home-manager/linux/programs/image-editing.nix b/home-manager/linux/programs/image-editing.nix index c8edf0b..de85923 100644 --- a/home-manager/linux/programs/image-editing.nix +++ b/home-manager/linux/programs/image-editing.nix @@ -1,8 +1,6 @@ { config, lib, pkgs, inputs, ... }: -let - unstable = inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}"; -in -{ +let unstable = inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}"; +in { config = lib.mkIf config.nathan.programs.image-editing { home.packages = with pkgs; [ # RawTherapee for raw editing diff --git a/home-manager/linux/programs/media.nix b/home-manager/linux/programs/media.nix index 44fe989..e4afd0e 100644 --- a/home-manager/linux/programs/media.nix +++ b/home-manager/linux/programs/media.nix @@ -1,14 +1,17 @@ { config, lib, pkgs, inputs, ... }: let - unstable = import inputs.nixpkgs-unstable { config = { allowUnfree = true; }; system = pkgs.system; }; + unstable = import inputs.nixpkgs-unstable { + config = { allowUnfree = true; }; + system = pkgs.system; + }; irisDesktopItem = pkgs.makeDesktopItem { name = "iris"; desktopName = "Iris"; - exec = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform -ozone-platform=wayland \"--app=http://localhost:6680/iris/\""; + exec = '' + ${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform -ozone-platform=wayland "--app=http://localhost:6680/iris/"''; terminal = false; }; -in -{ +in { config = lib.mkIf config.nathan.programs.media.enable { # General Packages home.packages = with pkgs; [ @@ -33,18 +36,12 @@ in ]; # extraConfigFiles = config.nathan.programs.media.mopidyExtraConfig; settings = { - file = { - media_dirs = [ - "~/Music" - ]; - }; + file = { media_dirs = [ "~/Music" ]; }; local = { enabled = true; media_dir = "~/Music"; }; - mpd = { - enabled = true; - }; + mpd = { enabled = true; }; }; }; }; diff --git a/home-manager/linux/programs/sway.nix b/home-manager/linux/programs/sway.nix index b054d8d..d598cf1 100644 --- a/home-manager/linux/programs/sway.nix +++ b/home-manager/linux/programs/sway.nix @@ -1,633 +1,606 @@ { config, lib, pkgs, inputs, ... }: -let - nathan = config.nathan; -in -with lib; -{ - config = mkIf nathan.programs.swaywm.enable ( - let - swaylock-command = "${pkgs.swaylock-effects}/bin/swaylock --screenshots --grace 30 --indicator --clock --timestr \"%-I:%M:%S %p\" --datestr \"%A %Y-%M-%d\" --effect-blur 20x3"; - swayimg = pkgs.callPackage ../../../packages/swayimg/default.nix { }; - in - { - home.packages = with pkgs; [ - # Locking and display management - wdisplays - swaylock-effects - swayidle - # Clipboard - wl-clipboard - # Notifications - mako - # Terminal - alacritty - # glib for sound stuff - glib - # Glpaper for the background - (glpaper.overrideAttrs (old: { - src = fetchFromSourcehut { - owner = "~scoopta"; - repo = "glpaper"; - vc = "hg"; - rev = "f89e60b7941fb60f1069ed51af9c5bb4917aab35"; - hash = "sha256-E7FKjt3NL0aAEibfaq+YS2IVvpjNjInA+Rs8SU63/3M="; - }; - })) - # Screenshots - sway-contrib.grimshot - # fuzzel for launcher - fuzzel - # for image viewing - swayimg - ]; - ######################### - ## Sway - ######################### - wayland.windowManager.sway = { - enable = true; - systemdIntegration = true; - wrapperFeatures = { - base = true; - gtk = true; +let nathan = config.nathan; +in with lib; { + config = mkIf nathan.programs.swaywm.enable (let + swaylock-command = '' + ${pkgs.swaylock-effects}/bin/swaylock --screenshots --grace 30 --indicator --clock --timestr "%-I:%M:%S %p" --datestr "%A %Y-%M-%d" --effect-blur 20x3''; + swayimg = pkgs.callPackage ../../../packages/swayimg/default.nix { }; + in { + home.packages = with pkgs; [ + # Locking and display management + wdisplays + swaylock-effects + swayidle + # Clipboard + wl-clipboard + # Notifications + mako + # Terminal + alacritty + # glib for sound stuff + glib + # Glpaper for the background + (glpaper.overrideAttrs (old: { + src = fetchFromSourcehut { + owner = "~scoopta"; + repo = "glpaper"; + vc = "hg"; + rev = "f89e60b7941fb60f1069ed51af9c5bb4917aab35"; + hash = "sha256-E7FKjt3NL0aAEibfaq+YS2IVvpjNjInA+Rs8SU63/3M="; }; - extraSessionCommands = '' - # Make qt theming work - export QT_QPA_PLATFORMTHEME="qt5ct" + })) + # Screenshots + sway-contrib.grimshot + # fuzzel for launcher + fuzzel + # for image viewing + swayimg + ]; + ######################### + ## Sway + ######################### + wayland.windowManager.sway = { + enable = true; + systemdIntegration = true; + wrapperFeatures = { + base = true; + gtk = true; + }; + extraSessionCommands = '' + # Make qt theming work + export QT_QPA_PLATFORMTHEME="qt5ct" + ''; + config = { + # Setup gaps + gaps = { + smartGaps = true; + inner = 9; + }; + # Window configuration + window = { + # Configure borders + border = 2; + # Application specific configuration + commands = [ + # Make pinentry float + { + command = "floating enable"; + criteria = { app_id = "pinentry-qt"; }; + } + # Make swayimg float, this is required to make it work + { + command = "floating enable"; + criteria = { app_id = "^swayimg.*"; }; + } + # Work around for chrome ui bug + { + command = "shortcuts_inhibitor disable"; + criteria = { app_id = "^chrome-.*_-.*$"; }; + } + ]; + }; + # Use windows key as modifier + modifier = "Mod4"; + # Alacritty as default terminal + terminal = "alacritty"; + # Use krunner (from kde) as our launcher + menu = '' + fuzzel -f "Fira Sans" -b "103c48ff" -S "adbcbcff" -s "184956ff" -t "72898fff" -B 5 -r 5 -C "ed8649ff" ''; - config = { - # Setup gaps - gaps = { - smartGaps = true; - inner = 9; - }; - # Window configuration - window = { - # Configure borders - border = 2; - # Application specific configuration - commands = [ - # Make pinentry float - { - command = "floating enable"; - criteria = { - app_id = "pinentry-qt"; - }; - } - # Make swayimg float, this is required to make it work - { - command = "floating enable"; - criteria = { - app_id = "^swayimg.*"; - }; - } - # Work around for chrome ui bug - { - command = "shortcuts_inhibitor disable"; - criteria = { - app_id = "^chrome-.*_-.*$"; - }; - } - ]; - }; - # Use windows key as modifier - modifier = "Mod4"; - # Alacritty as default terminal - terminal = "alacritty"; - # Use krunner (from kde) as our launcher - menu = '' - fuzzel -f "Fira Sans" -b "103c48ff" -S "adbcbcff" -s "184956ff" -t "72898fff" -B 5 -r 5 -C "ed8649ff" - ''; - # Use waybar, but through systemd - bars = [ - # { - # command = "waybar"; - # } - ]; - # Use fira - fonts = { - names = [ "Fira Sans" ]; - size = 10.0; - }; - # Selenize it - colors = { - focused = { - border = "75b938"; - background = "184956"; - text = "adbcbc"; - indicator = "84c747"; - childBorder = "75b938"; - }; - focusedInactive = { - border = "41c7b9"; - background = "#103c48"; - text = "adbcbc"; - indicator = "53d6c7"; - childBorder = "41c7b9"; - }; - unfocused = { - border = "72898f"; - background = "103c48"; - text = "72898f"; - indicator = "adbcbc"; - childBorder = "72898f"; - }; - urgent = { - border = "f275be"; - background = "184956"; - text = "fa5750"; - indicator = "fa5750"; - childBorder = "f275be"; - }; - }; - # Setup keybindings - keybindings = - let - modifer = "Mod4"; - in - lib.mkOptionDefault { - "${modifer}+q" = "kill"; - "${modifer}+z" = "exec ${swaylock-command}"; - ## Sreenshot keybinds - # Copy area to clipboard - "${modifer}+x" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area"; - # Copy window to clipboard - "${modifer}+Ctrl+x" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy window"; - # Clpy entire output to clipboard - "${modifer}+Alt+x" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy output"; - # Make the mute key work - "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; - # Make the volume keys work - "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; - # Play/pause and next song - "XF86AudioPlay" = "exec mpc toggle"; - "XF86AudioNext" = "exec mpc next"; - }; - # Startup applications - startup = [ - # Mako, the notification daemon - { command = "mako"; } - ]; - # Turn on numlock by default - input = { - "*" = { xkb_numlock = "enable"; }; - }; - }; - }; - ######################### - ## Mako (notifications) - ######################### - programs.mako = { - enable = true; - # Selenized color scheme - borderColor = "#f275be"; - backgroundColor = "#184956"; - textColor = "#adbcbc"; - # Border configuration - borderSize = 3; - # Use Fira Code for font - font = "Fira Sans 10"; - # Group by application - groupBy = "app-name"; - # Bottom right corner - anchor = "bottom-right"; - # Maximum visible notifications - maxVisible = 10; - # Sort by time in descending order (newest first) - sort = "-time"; - # Don't time out notifications , I want to have to dismiss them - defaultTimeout = 0; - ignoreTimeout = true; - }; - ######################### - ## Swayidle - ######################### - services.swayidle = { - enable = true; - timeouts = [ - # Lock the screen after 5 minutes of inactivity - { - timeout = 300; - command = builtins.replaceStrings [ "%" ] [ "%%" ] swaylock-command; - } - # Turn off the displays after 10 minutes of inactivity - { - timeout = 600; - command = "swaymsg \"output * dpms off\""; - resumeCommand = "swaymsg \"output * dpms on\""; - } + # Use waybar, but through systemd + bars = [ + # { + # command = "waybar"; + # } ]; - }; - ######################### - ## Waybar - ######################### - programs.waybar = { - enable = true; - package = inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}".waybar; - systemd = { - enable = false; + # Use fira + fonts = { + names = [ "Fira Sans" ]; + size = 10.0; }; - settings = { - mainBar = { - layer = "top"; - position = "bottom"; - height = 27; - modules-left = [ "sway/workspaces" "sway/mode" ]; - modules-center = [ "sway/window" ]; - modules-right = [ "mpd" "clock" "tray" ]; - "sway/workspaces" = { - disable-scroll = true; - }; - "sway/window" = { - icon = true; - }; - "clock" = { - format = "{:%I:%M%p %Y-%m-%d}"; - }; - "window" = { - icon = true; - }; - "tray" = { - spacing = 5; - }; - "mpd" = { - format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})"; - format-disconnected = "Disconnected ❌"; - format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ⏸"; - consume-icons = { - on = "🍴"; - }; - random-icons = { - on = "🔀"; - }; - repeat-icons = { - on = "🔁"; - }; - state-icons = { - paused = "⏸"; - playing = "▶"; - }; - }; + # Selenize it + colors = { + focused = { + border = "75b938"; + background = "184956"; + text = "adbcbc"; + indicator = "84c747"; + childBorder = "75b938"; + }; + focusedInactive = { + border = "41c7b9"; + background = "#103c48"; + text = "adbcbc"; + indicator = "53d6c7"; + childBorder = "41c7b9"; + }; + unfocused = { + border = "72898f"; + background = "103c48"; + text = "72898f"; + indicator = "adbcbc"; + childBorder = "72898f"; + }; + urgent = { + border = "f275be"; + background = "184956"; + text = "fa5750"; + indicator = "fa5750"; + childBorder = "f275be"; }; }; - style = '' - * { - /* `otf-font-awesome` is required to be installed for icons */ - font-family: FontAwesome, Fira; - font-size: 14px; - } - - window#waybar { - background-color: #103c48; - border: 2px solid #2d5b69; - color: #adbcbc; - transition-property: background-color; - transition-duration: .5s; - } - - window#waybar.hidden { - opacity: 0.2; - } - - /* - window#waybar.empty { - background-color: transparent; - } - window#waybar.solo { - background-color: #FFFFFF; - } - */ - - window#waybar.termite { - background-color: #3F3F3F; - } - - window#waybar.chromium { - background-color: #000000; - border: none; - } - - #workspaces button { - padding: 0 5px; - background-color: #184956; - color: #72898f; - /* Use box-shadow instead of border so the text isn't offset */ - box-shadow: inset 0 -3px transparent; - /* Avoid rounded borders under each workspace name */ - border: none; - border-radius: 0; - } - - /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ - #workspaces button:hover { - background: rgba(0, 0, 0, 0.2); - box-shadow: inset 0 -3px #ffffff; - } - - #workspaces button.focused { - background-color: #2d5b69; - color: #adbcbc; - /* box-shadow: inset 0 -3px #ffffff; */ - } - - #workspaces button.urgent { - background-color: #2d5b69; - color: #fa5750; - } - - #mode { - background-color: #64727D; - border-bottom: 3px solid #ffffff; - } - - #clock, - #battery, - #cpu, - #memory, - #disk, - #temperature, - #backlight, - #network, - #pulseaudio, - #custom-media, - #tray, - #mode, - #idle_inhibitor, - #mpd { - padding: 0 10px; - } - - #window, - #workspaces { - margin: 0 4px; - } - - /* If workspaces is the leftmost module, omit left margin */ - .modules-left > widget:first-child > #workspaces { - margin-left: 0; - } - - /* If workspaces is the rightmost module, omit right margin */ - .modules-right > widget:last-child > #workspaces { - margin-right: 0; - } - - #clock { - border: 2px solid #41c7b9; - background-color: #184956; - color: #41c7b9; - } - - #battery { - background-color: #ffffff; - color: #000000; - } - - #battery.charging, #battery.plugged { - color: #ffffff; - background-color: #26A65B; - } - - @keyframes blink { - to { - background-color: #ffffff; - color: #000000; - } - } - - #battery.critical:not(.charging) { - background-color: #f53c3c; - color: #ffffff; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } - - label:focus { - background-color: #000000; - } - - #cpu { - background-color: #2ecc71; - color: #000000; - } - - #memory { - background-color: #9b59b6; - } - - #disk { - background-color: #964B00; - } - - #backlight { - background-color: #90b1b1; - } - - #network { - background-color: #2980b9; - } - - #network.disconnected { - background-color: #f53c3c; - } - - #pulseaudio { - background-color: #f1c40f; - color: #000000; - } - - #pulseaudio.muted { - background-color: #90b1b1; - color: #2a5c45; - } - - #custom-media { - background-color: #66cc99; - color: #2a5c45; - min-width: 100px; - } - - #custom-media.custom-spotify { - background-color: #66cc99; - } - - #custom-media.custom-vlc { - background-color: #ffa000; - } - - #temperature { - background-color: #f0932b; - } - - #temperature.critical { - background-color: #eb4d4b; - } - - #tray { - background-color: #4695f7; - border: 2px solid #58a3ff; - } - - #tray > .passive { - -gtk-icon-effect: dim; - } - - #tray > .needs-attention { - -gtk-icon-effect: highlight; - background-color: #eb4d4b; - } - - #idle_inhibitor { - background-color: #2d3436; - } - - #idle_inhibitor.activated { - background-color: #ecf0f1; - color: #2d3436; - } - - #mpd { - color: #adbcbc; - border: 2px solid #75b938; - background-color: #184956; - - } - - #mpd.disconnected { - color: #dbb32d; - border: 2px solid #dbb32d; - } - - #mpd.stopped { - color: #fa5750; - border: 2px solid #fa5750; - } - - #mpd.paused { - color: #f275be; - border: 2px solid #f275be; - } - - #language { - background: #00b093; - color: #740864; - padding: 0 5px; - margin: 0 5px; - min-width: 16px; - } - - #keyboard-state { - background: #97e1ad; - color: #000000; - padding: 0 0px; - margin: 0 5px; - min-width: 16px; - } - - #keyboard-state > label { - padding: 0 5px; - } - - #keyboard-state > label.locked { - background: rgba(0, 0, 0, 0.2); - } - ''; - }; - # Override the service to run during graphical-session-pre.target - systemd.user.services.waybar = { - Unit = { - Description = - "Highly customizable Wayland bar for Sway and Wlroots based compositors."; - Documentation = "https://github.com/Alexays/Waybar/wiki"; - Before = [ "tray.target" ]; + # Setup keybindings + keybindings = let modifer = "Mod4"; + in lib.mkOptionDefault { + "${modifer}+q" = "kill"; + "${modifer}+z" = "exec ${swaylock-command}"; + ## Sreenshot keybinds + # Copy area to clipboard + "${modifer}+x" = + "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area"; + # Copy window to clipboard + "${modifer}+Ctrl+x" = + "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy window"; + # Clpy entire output to clipboard + "${modifer}+Alt+x" = + "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy output"; + # Make the mute key work + "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; + # Make the volume keys work + "XF86AudioRaiseVolume" = + "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = + "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; + # Play/pause and next song + "XF86AudioPlay" = "exec mpc toggle"; + "XF86AudioNext" = "exec mpc next"; }; - - Service = { - ExecStart = "${config.programs.waybar.package}/bin/waybar"; - ExecReload = "${pkgs.coreutils}/bin/kill -SIGUSR2 $MAINPID"; - ExecstartPost = "${pkgs.coreutils}/bin/sleep 1"; - Restart = "on-failure"; - KillMode = "mixed"; - }; - - Install = { WantedBy = [ "graphical-session-pre.target" ]; }; + # Startup applications + startup = [ + # Mako, the notification daemon + { command = "mako"; } + ]; + # Turn on numlock by default + input = { "*" = { xkb_numlock = "enable"; }; }; }; - ######################### - ## Alacritty - ######################### - programs.alacritty = { - enable = true; - settings = { - env = { - TERM = "xterm-256color"; - ALACRITTY = "1"; - }; - font = { - normal.family = "FiraCode Nerd Font"; - bold.family = "FiraCode Nerd Font"; - italic.family = "FiraCode Nerd Font"; - bold_italic.family = "FiraCode Nerd Font"; - size = 9.0; - }; - colors = { - primary = { - background = "0x103c48"; - foreground = "0xadbcbc"; - }; - normal = { - black = "0x184956"; - red = "0xfa5750"; - green = "0x75b938"; - yellow = "0xdbb32d"; - blue = "0x4695f7"; - magenta = "0xf275be"; - cyan = "0x41c7b9"; - white = "0x72898f"; - }; - bright = { - black = "0x2d5b69"; - red = "0xff665c"; - green = "0x84c747"; - yellow = "0xebc13d"; - blue = "0x58a3ff"; - magenta = "0xff84cd"; - cyan = "0x53d6c7"; - white = "0xcad8d9"; + }; + ######################### + ## Mako (notifications) + ######################### + programs.mako = { + enable = true; + # Selenized color scheme + borderColor = "#f275be"; + backgroundColor = "#184956"; + textColor = "#adbcbc"; + # Border configuration + borderSize = 3; + # Use Fira Code for font + font = "Fira Sans 10"; + # Group by application + groupBy = "app-name"; + # Bottom right corner + anchor = "bottom-right"; + # Maximum visible notifications + maxVisible = 10; + # Sort by time in descending order (newest first) + sort = "-time"; + # Don't time out notifications , I want to have to dismiss them + defaultTimeout = 0; + ignoreTimeout = true; + }; + ######################### + ## Swayidle + ######################### + services.swayidle = { + enable = true; + timeouts = [ + # Lock the screen after 5 minutes of inactivity + { + timeout = 300; + command = builtins.replaceStrings [ "%" ] [ "%%" ] swaylock-command; + } + # Turn off the displays after 10 minutes of inactivity + { + timeout = 600; + command = ''swaymsg "output * dpms off"''; + resumeCommand = ''swaymsg "output * dpms on"''; + } + ]; + }; + ######################### + ## Waybar + ######################### + programs.waybar = { + enable = true; + package = inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}".waybar; + systemd = { enable = false; }; + settings = { + mainBar = { + layer = "top"; + position = "bottom"; + height = 27; + modules-left = [ "sway/workspaces" "sway/mode" ]; + modules-center = [ "sway/window" ]; + modules-right = [ "mpd" "clock" "tray" ]; + "sway/workspaces" = { disable-scroll = true; }; + "sway/window" = { icon = true; }; + "clock" = { format = "{:%I:%M%p %Y-%m-%d}"; }; + "window" = { icon = true; }; + "tray" = { spacing = 5; }; + "mpd" = { + format = + "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})"; + format-disconnected = "Disconnected ❌"; + format-stopped = + "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ⏸"; + consume-icons = { on = "🍴"; }; + random-icons = { on = "🔀"; }; + repeat-icons = { on = "🔁"; }; + state-icons = { + paused = "⏸"; + playing = "▶"; }; }; }; }; - ######################### - ## EasyEffects - ######################### - services.easyeffects.enable = true; - ######################### - ## Create tray target to fix some things - ######################### - systemd.user.targets.tray = { - Unit = { - Description = "Home Manager System Tray"; - Requires = [ "graphical-session-pre.target" "waybar.service" ]; - After = [ "waybar.service" ]; + style = '' + * { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: FontAwesome, Fira; + font-size: 14px; + } + + window#waybar { + background-color: #103c48; + border: 2px solid #2d5b69; + color: #adbcbc; + transition-property: background-color; + transition-duration: .5s; + } + + window#waybar.hidden { + opacity: 0.2; + } + + /* + window#waybar.empty { + background-color: transparent; + } + window#waybar.solo { + background-color: #FFFFFF; + } + */ + + window#waybar.termite { + background-color: #3F3F3F; + } + + window#waybar.chromium { + background-color: #000000; + border: none; + } + + #workspaces button { + padding: 0 5px; + background-color: #184956; + color: #72898f; + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each workspace name */ + border: none; + border-radius: 0; + } + + /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ + #workspaces button:hover { + background: rgba(0, 0, 0, 0.2); + box-shadow: inset 0 -3px #ffffff; + } + + #workspaces button.focused { + background-color: #2d5b69; + color: #adbcbc; + /* box-shadow: inset 0 -3px #ffffff; */ + } + + #workspaces button.urgent { + background-color: #2d5b69; + color: #fa5750; + } + + #mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; + } + + #clock, + #battery, + #cpu, + #memory, + #disk, + #temperature, + #backlight, + #network, + #pulseaudio, + #custom-media, + #tray, + #mode, + #idle_inhibitor, + #mpd { + padding: 0 10px; + } + + #window, + #workspaces { + margin: 0 4px; + } + + /* If workspaces is the leftmost module, omit left margin */ + .modules-left > widget:first-child > #workspaces { + margin-left: 0; + } + + /* If workspaces is the rightmost module, omit right margin */ + .modules-right > widget:last-child > #workspaces { + margin-right: 0; + } + + #clock { + border: 2px solid #41c7b9; + background-color: #184956; + color: #41c7b9; + } + + #battery { + background-color: #ffffff; + color: #000000; + } + + #battery.charging, #battery.plugged { + color: #ffffff; + background-color: #26A65B; + } + + @keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } + } + + #battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + + label:focus { + background-color: #000000; + } + + #cpu { + background-color: #2ecc71; + color: #000000; + } + + #memory { + background-color: #9b59b6; + } + + #disk { + background-color: #964B00; + } + + #backlight { + background-color: #90b1b1; + } + + #network { + background-color: #2980b9; + } + + #network.disconnected { + background-color: #f53c3c; + } + + #pulseaudio { + background-color: #f1c40f; + color: #000000; + } + + #pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; + } + + #custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; + } + + #custom-media.custom-spotify { + background-color: #66cc99; + } + + #custom-media.custom-vlc { + background-color: #ffa000; + } + + #temperature { + background-color: #f0932b; + } + + #temperature.critical { + background-color: #eb4d4b; + } + + #tray { + background-color: #4695f7; + border: 2px solid #58a3ff; + } + + #tray > .passive { + -gtk-icon-effect: dim; + } + + #tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; + } + + #idle_inhibitor { + background-color: #2d3436; + } + + #idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; + } + + #mpd { + color: #adbcbc; + border: 2px solid #75b938; + background-color: #184956; + + } + + #mpd.disconnected { + color: #dbb32d; + border: 2px solid #dbb32d; + } + + #mpd.stopped { + color: #fa5750; + border: 2px solid #fa5750; + } + + #mpd.paused { + color: #f275be; + border: 2px solid #f275be; + } + + #language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; + } + + #keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; + } + + #keyboard-state > label { + padding: 0 5px; + } + + #keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); + } + ''; + }; + # Override the service to run during graphical-session-pre.target + systemd.user.services.waybar = { + Unit = { + Description = + "Highly customizable Wayland bar for Sway and Wlroots based compositors."; + Documentation = "https://github.com/Alexays/Waybar/wiki"; + Before = [ "tray.target" ]; + }; + + Service = { + ExecStart = "${config.programs.waybar.package}/bin/waybar"; + ExecReload = "${pkgs.coreutils}/bin/kill -SIGUSR2 $MAINPID"; + ExecstartPost = "${pkgs.coreutils}/bin/sleep 1"; + Restart = "on-failure"; + KillMode = "mixed"; + }; + + Install = { WantedBy = [ "graphical-session-pre.target" ]; }; + }; + ######################### + ## Alacritty + ######################### + programs.alacritty = { + enable = true; + settings = { + env = { + TERM = "xterm-256color"; + ALACRITTY = "1"; + }; + font = { + normal.family = "FiraCode Nerd Font"; + bold.family = "FiraCode Nerd Font"; + italic.family = "FiraCode Nerd Font"; + bold_italic.family = "FiraCode Nerd Font"; + size = 9.0; + }; + colors = { + primary = { + background = "0x103c48"; + foreground = "0xadbcbc"; + }; + normal = { + black = "0x184956"; + red = "0xfa5750"; + green = "0x75b938"; + yellow = "0xdbb32d"; + blue = "0x4695f7"; + magenta = "0xf275be"; + cyan = "0x41c7b9"; + white = "0x72898f"; + }; + bright = { + black = "0x2d5b69"; + red = "0xff665c"; + green = "0x84c747"; + yellow = "0xebc13d"; + blue = "0x58a3ff"; + magenta = "0xff84cd"; + cyan = "0x53d6c7"; + white = "0xcad8d9"; + }; }; }; - ######################### - ## Default applications - ######################### - xdg.mimeApps.defaultApplications = { - # Make all supported images open in swayimg - "image/jpeg" = [ "swayimg.desktop" ]; - "image/png" = [ "swayimg.desktop" ]; - "image/gif" = [ "swayimg.desktop" ]; - "image/svg+xml" = [ "swayimg.desktop" ]; - "image/webp" = [ "swayimg.desktop" ]; - "image/avif" = [ "swayimg.desktop" ]; - "image/tiff" = [ "swayimg.desktop" ]; - "image/bmp" = [ "swayimg.desktop" ]; + }; + ######################### + ## EasyEffects + ######################### + services.easyeffects.enable = true; + ######################### + ## Create tray target to fix some things + ######################### + systemd.user.targets.tray = { + Unit = { + Description = "Home Manager System Tray"; + Requires = [ "graphical-session-pre.target" "waybar.service" ]; + After = [ "waybar.service" ]; }; - } - ); + }; + ######################### + ## Default applications + ######################### + xdg.mimeApps.defaultApplications = { + # Make all supported images open in swayimg + "image/jpeg" = [ "swayimg.desktop" ]; + "image/png" = [ "swayimg.desktop" ]; + "image/gif" = [ "swayimg.desktop" ]; + "image/svg+xml" = [ "swayimg.desktop" ]; + "image/webp" = [ "swayimg.desktop" ]; + "image/avif" = [ "swayimg.desktop" ]; + "image/tiff" = [ "swayimg.desktop" ]; + "image/bmp" = [ "swayimg.desktop" ]; + }; + }); } diff --git a/home-manager/linux/programs/wine.nix b/home-manager/linux/programs/wine.nix index 359b943..fd4cc4f 100644 --- a/home-manager/linux/programs/wine.nix +++ b/home-manager/linux/programs/wine.nix @@ -2,9 +2,6 @@ { config = lib.mkIf config.nathan.programs.util.wine { - home.packages = with pkgs; [ - proton-caller - wineWowPackages.waylandFull - ]; + home.packages = with pkgs; [ proton-caller wineWowPackages.waylandFull ]; }; } diff --git a/home-manager/linux/services/email.nix b/home-manager/linux/services/email.nix index bdef93b..880d2ff 100644 --- a/home-manager/linux/services/email.nix +++ b/home-manager/linux/services/email.nix @@ -3,11 +3,7 @@ with lib; { config = mkIf config.nathan.services.email.enable { # Packages used for mbsync + mu + protonmail-bridge - home.packages = with pkgs; [ - pass - protonmail-bridge - mu - ]; + home.packages = with pkgs; [ pass protonmail-bridge mu ]; # Configure protonmail as a service systemd.user.services.protonmail-bridge = { Unit = { @@ -29,9 +25,7 @@ with lib; { maildirBasePath = ".mail"; accounts = { "nathan@mccarty.io" = { - maildir = { - path = "nathan@mccarty.io"; - }; + maildir = { path = "nathan@mccarty.io"; }; address = "nathan@mccarty.io"; primary = true; realName = "Nathan McCarty"; @@ -47,7 +41,8 @@ with lib; { port = 1143; tls = { useStartTls = true; - certificatesFile = ../../../certificates/protonmail-${nixosConfig.networking.hostName}.pem; + certificatesFile = + ../../../certificates/protonmail-${nixosConfig.networking.hostName}.pem; }; }; smtp = { @@ -55,7 +50,8 @@ with lib; { port = 1025; tls = { useStartTls = true; - certificatesFile = ../../../certificates/protonmail-${nixosConfig.networking.hostName}.pem; + certificatesFile = + ../../../certificates/protonmail-${nixosConfig.networking.hostName}.pem; }; }; mbsync = { @@ -64,37 +60,27 @@ with lib; { remove = "both"; }; mu.enable = true; - msmtp = { - enable = true; - }; + msmtp = { enable = true; }; }; }; }; ## Enable email applications # Setup mbsync for incoming emails # For fun reasons this requires enabling the program and the service - programs.mbsync = { - enable = true; - }; + programs.mbsync = { enable = true; }; services.mbsync = { enable = true; frequency = "*:0/1"; # Index manually with mu if we don't have emacs setup, but if we have the emacs service setup, # run through emacsclient, as it will have the lock - postExec = - if config.nathan.programs.emacs.service - then - "${../../../scripts/update-mu4e.sh}" - else - "${pkgs.mu}/bin/mu index"; + postExec = if config.nathan.programs.emacs.service then + "${../../../scripts/update-mu4e.sh}" + else + "${pkgs.mu}/bin/mu index"; }; # Setup mu for indexing emails - programs.mu = { - enable = true; - }; + programs.mu = { enable = true; }; # Setup msmtp for outbound emails - programs.msmtp = { - enable = true; - }; + programs.msmtp = { enable = true; }; }; } diff --git a/home-manager/linux/services/syncthing.nix b/home-manager/linux/services/syncthing.nix index 86d1235..9ae76a4 100644 --- a/home-manager/linux/services/syncthing.nix +++ b/home-manager/linux/services/syncthing.nix @@ -1,8 +1,7 @@ { config, lib, pkgs, inputs, ... }: let stray = inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}".syncthingtray; -in -{ +in { config = lib.mkIf config.nathan.services.syncthing { services.syncthing = { enable = true; @@ -13,9 +12,7 @@ in }; # Add a delay to the service so it will start up after the bar systemd.user.services.syncthingtray = { - Service = { - ExecStartPre = "/run/current-system/sw/bin/sleep 5"; - }; + Service = { ExecStartPre = "/run/current-system/sw/bin/sleep 5"; }; }; }; } diff --git a/home-manager/nix-on-droid/default.nix b/home-manager/nix-on-droid/default.nix index 8c4497e..fd47797 100644 --- a/home-manager/nix-on-droid/default.nix +++ b/home-manager/nix-on-droid/default.nix @@ -1,8 +1,12 @@ { config, lib, pkgs, inputs, ... }: let - inherit (import ../../modules/lib.nix { inherit lib; inherit pkgs; }) nLib; -in -with lib; with nLib; { + inherit (import ../../modules/lib.nix { + inherit lib; + inherit pkgs; + }) + nLib; +in with lib; +with nLib; { imports = [ ../options.nix ../common/programs/core.nix diff --git a/home-manager/options.nix b/home-manager/options.nix index 5d15def..d5da492 100644 --- a/home-manager/options.nix +++ b/home-manager/options.nix @@ -1,9 +1,12 @@ { config, lib, pkgs, ... }: let - inherit (import ../modules/lib.nix { inherit lib; inherit pkgs; }) nLib; -in -with lib; with nLib; -{ + inherit (import ../modules/lib.nix { + inherit lib; + inherit pkgs; + }) + nLib; +in with lib; +with nLib; { options = { nathan = { programs = { @@ -17,30 +20,36 @@ with lib; with nLib; # Git configuration, enabled by default git = { enable = mkEnableOptionT "git"; - gpgSign = mkDefaultOption "git signatures" config.nathan.config.isDesktop; + gpgSign = + mkDefaultOption "git signatures" config.nathan.config.isDesktop; }; # Bat configuration, enabled by default bat = mkEnableOptionT "bat"; # JSON Utilities, enabled by default json = mkEnableOptionT "json"; # Productivity application - productivity = mkDefaultOption "Productivity applications" config.nathan.config.isDesktop; + productivity = mkDefaultOption "Productivity applications" + config.nathan.config.isDesktop; }; # Development applications, enabled by default on desktop devel = { - core = mkDefaultOption "Core Development Utilites" config.nathan.config.isDesktop; - rust = mkDefaultOption "Rust Development Utilites" config.nathan.config.isDesktop; - python = mkDefaultOption "Python Development Utilites" config.nathan.config.isDesktop; - js = mkDefaultOption "JavaScript/TypeScript Development Utilites" config.nathan.config.isDesktop; - raku = mkDefaultOption "Raku Development Utilites" config.nathan.config.isDesktop; + core = mkDefaultOption "Core Development Utilites" + config.nathan.config.isDesktop; + rust = mkDefaultOption "Rust Development Utilites" + config.nathan.config.isDesktop; + python = mkDefaultOption "Python Development Utilites" + config.nathan.config.isDesktop; + js = mkDefaultOption "JavaScript/TypeScript Development Utilites" + config.nathan.config.isDesktop; + raku = mkDefaultOption "Raku Development Utilites" + config.nathan.config.isDesktop; }; # Emacs, enabled by default on desktop emacs = { enable = mkDefaultOption "Emacs" config.nathan.config.isDesktop; - service = mkDefaultOption "Emacs Service" config.nathan.config.isDesktop; - package = mkOption { - description = "Emacs package to use"; - }; + service = + mkDefaultOption "Emacs Service" config.nathan.config.isDesktop; + package = mkOption { description = "Emacs package to use"; }; }; }; # General configuration options diff --git a/machines/extremophile/configuration.nix b/machines/extremophile/configuration.nix new file mode 100644 index 0000000..6479c6b --- /dev/null +++ b/machines/extremophile/configuration.nix @@ -0,0 +1,8 @@ +{ config, lib, pkgs, inputs, ... }: + +{ + # Setup system configuration + nathan = { config = { isDesktop = true; }; }; + # Setup home manager + home-manager.users.nathan = import ./home.nix; +} diff --git a/machines/extremophile/home.nix b/machines/extremophile/home.nix new file mode 100644 index 0000000..4e13ad7 --- /dev/null +++ b/machines/extremophile/home.nix @@ -0,0 +1,8 @@ +{ config, lib, pkgs, ... }: + +{ + nathan = { + programs = { util = { git = { gpgSign = false; }; }; }; + config = { isDesktop = true; }; + }; +} diff --git a/machines/hyperv/home.nix b/machines/hyperv/home.nix index 007cde0..003206a 100644 --- a/machines/hyperv/home.nix +++ b/machines/hyperv/home.nix @@ -2,14 +2,8 @@ { nathan = { - services = { - email = { - enable = true; - }; - }; - config = { - isDesktop = true; - }; + services = { email = { enable = true; }; }; + config = { isDesktop = true; }; }; # # Sway outputs diff --git a/machines/levitation/configuration.nix b/machines/levitation/configuration.nix index a0e7bb2..0dcbb6e 100644 --- a/machines/levitation/configuration.nix +++ b/machines/levitation/configuration.nix @@ -18,9 +18,7 @@ }; # Setup system configuration nathan = { - programs = { - games = true; - }; + programs = { games = true; }; services = { borg = { enable = true; @@ -33,9 +31,7 @@ sshKey = config.sops.secrets."borg-ssh-key".path; }; }; - hardware = { - amdPassthrough = true; - }; + hardware = { amdPassthrough = true; }; config = { isDesktop = true; setupGrub = true; @@ -68,30 +64,21 @@ home-manager.users.nathan = import ./home.nix; # TPM setup - security = { - tpm2 = { - enable = true; - }; - }; + security = { tpm2 = { enable = true; }; }; boot = { initrd = { kernelModules = [ "tpm_crb" ]; - systemd = { - enable = true; - }; + systemd = { enable = true; }; }; kernelParams = [ "crypt-pv.luks.options=tpm2-device=auto" ]; }; # Install gamescope - environment.systemPackages = [ - inputs.gamescope.defaultPackage."x86_64-linux" - ]; + environment.systemPackages = + [ inputs.gamescope.defaultPackage."x86_64-linux" ]; nixpkgs.config.packageOverrides = pkgs: { steam = pkgs.steam.override { - extraPkgs = pkgs: [ - inputs.gamescope.defaultPackage."x86_64-linux" - ]; + extraPkgs = pkgs: [ inputs.gamescope.defaultPackage."x86_64-linux" ]; }; }; diff --git a/machines/levitation/home.nix b/machines/levitation/home.nix index 0fb695b..e2b26ea 100644 --- a/machines/levitation/home.nix +++ b/machines/levitation/home.nix @@ -2,21 +2,11 @@ { nathan = { - services = { - email = { - enable = true; - }; - }; - config = { - isDesktop = true; - }; + services = { email = { enable = true; }; }; + config = { isDesktop = true; }; programs = { - util = { - wine = true; - }; - games = { - launcher = true; - }; + util = { wine = true; }; + games = { launcher = true; }; }; }; @@ -43,7 +33,10 @@ # GLPaper { command = "glpaper DP-1 ${../../custom-files/sway/selen.frag} --fork"; } { command = "glpaper DP-3 ${../../custom-files/sway/selen.frag} --fork"; } - { command = "glpaper HDMI-A-1 ${../../custom-files/sway/selen.frag} --fork"; } + { + command = + "glpaper HDMI-A-1 ${../../custom-files/sway/selen.frag} --fork"; + } ]; }; # Mako output configuration diff --git a/machines/matrix/configuration.nix b/machines/matrix/configuration.nix index 0c064a5..e275df1 100644 --- a/machines/matrix/configuration.nix +++ b/machines/matrix/configuration.nix @@ -53,9 +53,7 @@ autoGC = true; }; harden = false; - virtualization = { - docker = true; - }; + virtualization = { docker = true; }; }; }; # Configure bootloader @@ -69,9 +67,7 @@ terminal_input serial; terminal_output serial ''; - boot.kernelParams = [ - "console=ttyS0" - ]; + boot.kernelParams = [ "console=ttyS0" ]; # Configure networking networking = { domain = "community.rs"; @@ -101,9 +97,7 @@ }; # Add www-html for my self - users.users.nathan = { - extraGroups = [ "www-html" ]; - }; + users.users.nathan = { extraGroups = [ "www-html" ]; }; # Configure matrix registration services.matrix-synapse = { @@ -112,8 +106,12 @@ allow_guest_access = false; allow_public_rooms_over_federation = true; experimental_features = { spaces_enabled = true; }; - auto_join_rooms = [ "#space:community.rs" "#rules:community.rs" "#info:community.rs" ]; - turn_uris = [ "turn:turn.community.rs:3478?transport=udp" "turn:turn.community.rs:3478?transport=tcp" ]; + auto_join_rooms = + [ "#space:community.rs" "#rules:community.rs" "#info:community.rs" ]; + turn_uris = [ + "turn:turn.community.rs:3478?transport=udp" + "turn:turn.community.rs:3478?transport=tcp" + ]; turn_user_lifetime = "1h"; }; extraConfigFiles = [ config.sops.secrets."matrix-secrets.yaml".path ]; @@ -151,74 +149,63 @@ }; # Configure the vhost for the domain - services.nginx.virtualHosts = - let - fqdn = - let - join = hostName: domain: hostName + lib.optionalString (domain != null) ".${domain}"; - in - join config.networking.hostName config.networking.domain; - in - { - "${config.networking.domain}" = { - enableACME = true; - forceSSL = true; + services.nginx.virtualHosts = let + fqdn = let + join = hostName: domain: + hostName + lib.optionalString (domain != null) ".${domain}"; + in join config.networking.hostName config.networking.domain; + in { + "${config.networking.domain}" = { + enableACME = true; + forceSSL = true; - locations."= /.well-known/matrix/server".extraConfig = - let - # use 443 instead of the default 8448 port to unite - # the client-server and server-server port for simplicity - server = { "m.server" = "${fqdn}:443"; }; - in - '' - add_header Content-Type application/json; - return 200 '${builtins.toJSON server}'; - ''; - locations."= /.well-known/matrix/client".extraConfig = - let - client = { - "m.homeserver" = { "base_url" = "https://${fqdn}"; }; - "m.identity_server" = { "base_url" = "https://vector.im"; }; - }; - # ACAO required to allow element-web on any URL to request this json file - in - '' - add_header Content-Type application/json; - add_header Access-Control-Allow-Origin *; - return 200 '${builtins.toJSON client}'; - ''; - locations."/".extraConfig = '' - rewrite ^(.*)$ http://www.community.rs$1 redirect; - ''; - }; - # Main domain - "www.community.rs" = { - enableACME = true; - forceSSL = true; - locations."= /.well-known/matrix/server".extraConfig = - let - # use 443 instead of the default 8448 port to unite - # the client-server and server-server port for simplicity - server = { "m.server" = "${fqdn}:443"; }; - in - '' - add_header Content-Type application/json; - return 200 '${builtins.toJSON server}'; - ''; - locations."= /.well-known/matrix/client".extraConfig = - let - client = { - "m.homeserver" = { "base_url" = "https://${fqdn}"; }; - "m.identity_server" = { "base_url" = "https://vector.im"; }; - }; - # ACAO required to allow element-web on any URL to request this json file - in - '' - add_header Content-Type application/json; - add_header Access-Control-Allow-Origin *; - return 200 '${builtins.toJSON client}'; - ''; - root = "/var/www"; - }; + locations."= /.well-known/matrix/server".extraConfig = let + # use 443 instead of the default 8448 port to unite + # the client-server and server-server port for simplicity + server = { "m.server" = "${fqdn}:443"; }; + in '' + add_header Content-Type application/json; + return 200 '${builtins.toJSON server}'; + ''; + locations."= /.well-known/matrix/client".extraConfig = let + client = { + "m.homeserver" = { "base_url" = "https://${fqdn}"; }; + "m.identity_server" = { "base_url" = "https://vector.im"; }; + }; + # ACAO required to allow element-web on any URL to request this json file + in '' + add_header Content-Type application/json; + add_header Access-Control-Allow-Origin *; + return 200 '${builtins.toJSON client}'; + ''; + locations."/".extraConfig = '' + rewrite ^(.*)$ http://www.community.rs$1 redirect; + ''; }; + # Main domain + "www.community.rs" = { + enableACME = true; + forceSSL = true; + locations."= /.well-known/matrix/server".extraConfig = let + # use 443 instead of the default 8448 port to unite + # the client-server and server-server port for simplicity + server = { "m.server" = "${fqdn}:443"; }; + in '' + add_header Content-Type application/json; + return 200 '${builtins.toJSON server}'; + ''; + locations."= /.well-known/matrix/client".extraConfig = let + client = { + "m.homeserver" = { "base_url" = "https://${fqdn}"; }; + "m.identity_server" = { "base_url" = "https://vector.im"; }; + }; + # ACAO required to allow element-web on any URL to request this json file + in '' + add_header Content-Type application/json; + add_header Access-Control-Allow-Origin *; + return 200 '${builtins.toJSON client}'; + ''; + root = "/var/www"; + }; + }; } diff --git a/machines/oracles/configuration.nix b/machines/oracles/configuration.nix index 7912f30..34b5364 100644 --- a/machines/oracles/configuration.nix +++ b/machines/oracles/configuration.nix @@ -63,9 +63,7 @@ autoGC = true; }; harden = false; - virtualization = { - docker = true; - }; + virtualization = { docker = true; }; }; }; # Configure bootloader @@ -92,96 +90,91 @@ home-manager.users.nathan = import ./home.nix; # Setup minecraft container - containers.minecraft = - let - b2AccountID = "00284106ead1ac40000000002"; - b2KeyFile = "${config.sops.secrets."friendpack-backblaze".path}"; - b2Bucket = "ForwardProgressServerBackup"; - in - { - config = { pkgs, lib, ... }@attrs: - let - # OpenJDK 17 - javaPackage = pkgs.jdk; - in - { - imports = [ - inputs.quilt-server.nixosModules.default - ]; - ### - ## Container stuff - ### - # Let nix know this is a container - boot.isContainer = true; - # Set system state version - system.stateVersion = "22.05"; - # Setup networking - networking.useDHCP = false; - # Allow minecraft out - networking.firewall.allowedTCPPorts = [ 25565 ]; + containers.minecraft = let + b2AccountID = "00284106ead1ac40000000002"; + b2KeyFile = "${config.sops.secrets."friendpack-backblaze".path}"; + b2Bucket = "ForwardProgressServerBackup"; + in { + config = { pkgs, lib, ... }@attrs: + let + # OpenJDK 17 + javaPackage = pkgs.jdk; + in { + imports = [ inputs.quilt-server.nixosModules.default ]; + ### + ## Container stuff + ### + # Let nix know this is a container + boot.isContainer = true; + # Set system state version + system.stateVersion = "22.05"; + # Setup networking + networking.useDHCP = false; + # Allow minecraft out + networking.firewall.allowedTCPPorts = [ 25565 ]; - ### - ## User - ### - users = { - mutableUsers = false; - # Enable us to not use a password, this is a container - allowNoPasswordLogin = true; - }; + ### + ## User + ### + users = { + mutableUsers = false; + # Enable us to not use a password, this is a container + allowNoPasswordLogin = true; + }; - ### - ## Configure module - ### - forward-progress = { - services = { - minecraft = { - enable = true; - minecraft-version = "1.18.2"; - quilt-version = "0.17.1-beta.6"; - ram = 6144; - properties = { - motd = "Nathan's Private Modded Minecraft"; - white-list = true; - enforce-whitelist = true; - }; - packwiz-url = "https://pack.forward-progress.net/0.3/pack.toml"; - acceptEula = true; + ### + ## Configure module + ### + forward-progress = { + services = { + minecraft = { + enable = true; + minecraft-version = "1.18.2"; + quilt-version = "0.17.1-beta.6"; + ram = 6144; + properties = { + motd = "Nathan's Private Modded Minecraft"; + white-list = true; + enforce-whitelist = true; }; - backup = { + packwiz-url = "https://pack.forward-progress.net/0.3/pack.toml"; + acceptEula = true; + }; + backup = { + enable = true; + backblaze = { enable = true; - backblaze = { - enable = true; - accountId = b2AccountID; - keyFile = b2KeyFile; - bucket = b2Bucket; - }; + accountId = b2AccountID; + keyFile = b2KeyFile; + bucket = b2Bucket; }; }; }; }; - autoStart = true; - bindMounts = { - "/var/minecraft" = { - hostPath = "/var/minecraft"; - isReadOnly = false; - }; - "/run/secrets/friendpack-backblaze" = { - hostPath = "/run/secrets/friendpack-backblaze"; - }; }; - forwardPorts = [ - { - containerPort = 25565; - hostPort = 25565; - protocol = "tcp"; - } - { - containerPort = 25565; - hostPort = 25565; - protocol = "udp"; - } - ]; + autoStart = true; + bindMounts = { + "/var/minecraft" = { + hostPath = "/var/minecraft"; + isReadOnly = false; + }; + "/run/secrets/friendpack-backblaze" = { + hostPath = "/run/secrets/friendpack-backblaze"; + }; }; + forwardPorts = [ + { + containerPort = 25565; + hostPort = 25565; + protocol = "tcp"; + } + { + containerPort = 25565; + hostPort = 25565; + protocol = "udp"; + } + ]; + }; # Setup vhost for pack website services.nginx.virtualHosts."pack.forward-progress.net" = { @@ -200,56 +193,48 @@ }; # Setup the gitlab runners - services.gitlab-runner = - let - nix-shared = with lib; { - dockerImage = "nixpkgs/nix-flakes"; - dockerVolumes = [ - "/var/sharedstore:/sharedstore" - ]; - dockerDisableCache = true; - dockerPrivileged = true; - }; - in - { - enable = true; - concurrent = 4; - checkInterval = 1; - services = { - # default-asuran = { - # registrationConfigFile = "/var/lib/secret/gitlab-runner/asuran-default"; - # dockerImage = "debian:stable"; - # dockerVolumes = [ - # "/var/run/docker.sock:/var/run/docker.sock" - # ]; - # dockerPrivileged = true; - # tagList = [ "linux-own" ]; - # }; + services.gitlab-runner = let + nix-shared = with lib; { + dockerImage = "nixpkgs/nix-flakes"; + dockerVolumes = [ "/var/sharedstore:/sharedstore" ]; + dockerDisableCache = true; + dockerPrivileged = true; + }; + in { + enable = true; + concurrent = 4; + checkInterval = 1; + services = { + # default-asuran = { + # registrationConfigFile = "/var/lib/secret/gitlab-runner/asuran-default"; + # dockerImage = "debian:stable"; + # dockerVolumes = [ + # "/var/run/docker.sock:/var/run/docker.sock" + # ]; + # dockerPrivileged = true; + # tagList = [ "linux-own" ]; + # }; - nix-asuran = nix-shared // { - registrationConfigFile = config.sops.secrets.nix-asuran.path; - tagList = [ "nix" ]; - requestConcurrency = 8; - limit = 4; - runUntagged = true; - }; + nix-asuran = nix-shared // { + registrationConfigFile = config.sops.secrets.nix-asuran.path; + tagList = [ "nix" ]; + requestConcurrency = 8; + limit = 4; + runUntagged = true; }; }; + }; # Setup searx-ng docker virtualisation.oci-containers.containers."searx-ng" = { image = "searxng/searxng"; autoStart = true; ports = [ "8091:8080" ]; - volumes = [ - "/var/searxng:/etc/searxng" - ]; + volumes = [ "/var/searxng:/etc/searxng" ]; }; services.nginx.virtualHosts."searx-ng.mccarty.io" = { enableACME = true; forceSSL = true; - locations."/" = { - proxyPass = "http://localhost:8091"; - }; + locations."/" = { proxyPass = "http://localhost:8091"; }; }; } diff --git a/machines/tablet/configuration.nix b/machines/tablet/configuration.nix index d09ce79..f7874df 100644 --- a/machines/tablet/configuration.nix +++ b/machines/tablet/configuration.nix @@ -1,10 +1,6 @@ { config, lib, pkgs, ... }: { - nathan = { - config = { - isDesktop = true; - }; - }; + nathan = { config = { isDesktop = true; }; }; home-manager.config = import ./home.nix; } diff --git a/machines/tablet/home.nix b/machines/tablet/home.nix index 574d9bd..2a8662b 100644 --- a/machines/tablet/home.nix +++ b/machines/tablet/home.nix @@ -1,9 +1,5 @@ { config, lib, pkgs, ... }: { - nathan = { - config = { - isDesktop = true; - }; - }; + nathan = { config = { isDesktop = true; }; }; } diff --git a/machines/tounge/configuration.nix b/machines/tounge/configuration.nix index a0183f6..1d38c8b 100644 --- a/machines/tounge/configuration.nix +++ b/machines/tounge/configuration.nix @@ -34,10 +34,7 @@ }; borg = { enable = true; - extraExcludes = [ - "/var/lib/docker" - "/var/log" - ]; + extraExcludes = [ "/var/lib/docker" "/var/log" ]; passwordFile = config.sops.secrets."borg-password".path; sshKey = config.sops.secrets."borg-ssh-key".path; }; @@ -49,9 +46,7 @@ autoGC = true; }; harden = false; - virtualization = { - docker = true; - }; + virtualization = { docker = true; }; }; }; # Configure networking @@ -87,14 +82,9 @@ "3080:80" "30443:443" ]; - volumes = [ - "/var/lib/pihole/:/etc/pihole/" - "/var/lib/dnsmasq.d:/etc/dnsmasq.d/" - ]; - extraOptions = [ - "--cap-add=NET_ADMIN" - "--dns=1.1.1.1" - ]; + volumes = + [ "/var/lib/pihole/:/etc/pihole/" "/var/lib/dnsmasq.d:/etc/dnsmasq.d/" ]; + extraOptions = [ "--cap-add=NET_ADMIN" "--dns=1.1.1.1" ]; }; # Nginx virtual hosts diff --git a/machines/wsl/configuration.nix b/machines/wsl/configuration.nix index 7558a89..e088d18 100644 --- a/machines/wsl/configuration.nix +++ b/machines/wsl/configuration.nix @@ -15,9 +15,7 @@ }; }; # Configure networking - networking = { - domain = "mccarty.io"; - }; + networking = { domain = "mccarty.io"; }; # Setup home manager home-manager.users.nathan = import ./home.nix; # Setup WSL diff --git a/machines/wsl/home.nix b/machines/wsl/home.nix index fac93f4..dca958f 100644 --- a/machines/wsl/home.nix +++ b/machines/wsl/home.nix @@ -9,9 +9,7 @@ }; }; programs = { - util = { - productivity = true; - }; + util = { productivity = true; }; devel = { core = true; rust = true; diff --git a/machines/x86vm/configuration.nix b/machines/x86vm/configuration.nix index a7d4a1a..8bc1585 100644 --- a/machines/x86vm/configuration.nix +++ b/machines/x86vm/configuration.nix @@ -2,9 +2,7 @@ { nathan = { - programs = { - games = true; - }; + programs = { games = true; }; config = { isDesktop = true; nix.autoUpdate = false; @@ -13,7 +11,5 @@ home-manager.users.nathan = import ./home.nix; # Workaround to get sway working in qemu - environment.variables = { - "WLR_RENDERER" = "pixman"; - }; + environment.variables = { "WLR_RENDERER" = "pixman"; }; } diff --git a/machines/x86vm/home.nix b/machines/x86vm/home.nix index acbdcd2..8693a75 100644 --- a/machines/x86vm/home.nix +++ b/machines/x86vm/home.nix @@ -2,11 +2,7 @@ { nathan = { - programs = { - util.git.gpgSign = false; - }; - config = { - isDesktop = true; - }; + programs = { util.git.gpgSign = false; }; + config = { isDesktop = true; }; }; } diff --git a/modules/common/programs/utils.nix b/modules/common/programs/utils.nix index 863f132..33986a2 100644 --- a/modules/common/programs/utils.nix +++ b/modules/common/programs/utils.nix @@ -1,33 +1,26 @@ { config, lib, pkgs, ... }: -let - nathan = config.nathan; -in -with lib; -{ +let nathan = config.nathan; +in with lib; { config = mkMerge [ - (mkIf nathan.programs.utils.core - { - environment.systemPackages = with pkgs; [ - # Basic command line utilities - wget - tmux - nano - unzip - any-nix-shell - htop - # For nslookup - dnsutils - # Mosh for better high-latency ssh - mosh - # PV for viewing pipes - pv - ]; - }) - (mkIf nathan.programs.utils.devel { + (mkIf nathan.programs.utils.core { environment.systemPackages = with pkgs; [ - gcc - binutils + # Basic command line utilities + wget + tmux + nano + unzip + any-nix-shell + htop + # For nslookup + dnsutils + # Mosh for better high-latency ssh + mosh + # PV for viewing pipes + pv ]; }) + (mkIf (nathan.programs.utils.devel && pkgs.stdenv.isLinux) { + environment.systemPackages = with pkgs; [ gcc binutils ]; + }) ]; } diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix new file mode 100644 index 0000000..d1f4815 --- /dev/null +++ b/modules/darwin/default.nix @@ -0,0 +1,90 @@ +{ config, lib, pkgs, ... }: +let + inherit (import ../lib.nix { + inherit lib; + inherit pkgs; + }) + nLib; +in { + imports = + [ ../options.nix ../common/programs/utils.nix ./user.nix ./fonts.nix ]; + + options = with lib; + with nLib; { + nathan = { + config = { + # Install fonts + # On by default if the system is a desktop + fonts = mkDefaultOption "fonts" config.nathan.config.isDesktop; + }; + programs = { + util = { + # Core macos utilities like iterm2 and what not + core = mkDefaultOption "core" true; + }; + # Firefox, enabled by default on linux desktop + firefox = mkDefaultOption "Firefox" config.nathan.config.isDesktop; + syncthing = + mkDefaultOption "syncthing" config.nathan.config.isDesktop; + # Communications applications + communications = { + # Enable by default if we are on a linux desktop + enable = mkDefaultOption "Communication applications" + config.nathan.config.isDesktop; + }; + }; + }; + }; + + config = { + # Link applications in spotlight/launchpad + system.activationScripts.applications.text = pkgs.lib.mkForce ('' + echo "setting up ~/Applications..." >&2 + rm -rf ~/Applications/Nix\ Apps + mkdir -p ~/Applications/Nix\ Apps + for app in $(find ${config.system.build.applications}/Applications -maxdepth 1 -type l); do + src="$(/usr/bin/stat -f%Y "$app")" + cp -r "$src" ~/Applications/Nix\ Apps + done + ''); + # Set system state version + system.stateVersion = 4; + # Enable flakes + # Enable nix flakes + nix.package = pkgs.nixFlakes; + nix.extraOptions = '' + experimental-features = nix-command flakes + ''; + services.nix-daemon.enable = true; + # Replace some macos packages + environment.systemPackages = with pkgs; [ coreutils-full openssh ]; + programs.zsh.enable = true; + programs.fish.enable = true; + # Make nix managed fonts work + fonts.fontDir.enable = true; + # Make nix assume control of homebrew + homebrew = { + enable = true; + onActivation = { + autoUpdate = true; + upgrade = true; + cleanup = "zap"; + }; + casks = lib.mkMerge [ + (lib.mkIf config.nathan.programs.util.core [{ name = "iterm2"; }]) + (lib.mkIf config.nathan.programs.firefox [{ name = "firefox"; }]) + (lib.mkIf config.nathan.programs.communications.enable [ + { name = "discord"; } + { name = "betterdiscord-installer"; } + ]) + ]; + brews = lib.mkMerge [ + (lib.mkIf config.nathan.programs.syncthing [{ + name = "syncthing"; + restart_service = true; + start_service = true; + }]) + ]; + }; + }; +} diff --git a/modules/darwin/fonts.nix b/modules/darwin/fonts.nix new file mode 100644 index 0000000..5f010ff --- /dev/null +++ b/modules/darwin/fonts.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: +let nc = config.nathan.config; +in with lib; { + # Generic desktop configuration + config = mkIf nc.fonts { + fonts.fonts = with pkgs; [ + ## Monospace Fonts + # FiraCode with nerd-fonts patch, as well as fira-code symbols for emacs + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + fira-code-symbols + fira + # Proportional + roboto + liberation_ttf + noto-fonts + ]; + }; +} diff --git a/modules/darwin/user.nix b/modules/darwin/user.nix new file mode 100644 index 0000000..f61d81a --- /dev/null +++ b/modules/darwin/user.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: +let nc = config.nathan.config; +in with lib; { + config = mkMerge [{ + # Configure our user, if enabled + users.users."${nc.user}" = { + # Darwin is special + home = if pkgs.stdenv.isDarwin then + "/Users/${nc.user}" + else + "/home/${nc.user}"; + description = "Nathan McCarty"; + shell = pkgs.fish; + }; + # If we isntall the user, make them trusted + nix.settings.trusted-users = [ "${nc.user}" ]; + # If we setup the user, install the shell as well + environment.systemPackages = [ pkgs.fish ]; + # Configure the timezone + time.timeZone = "America/New_York"; + }]; +} diff --git a/modules/lib.nix b/modules/lib.nix index 8f8a629..aaccab8 100644 --- a/modules/lib.nix +++ b/modules/lib.nix @@ -3,19 +3,21 @@ { nLib = { # mkEnableOption, but defaults to true - mkEnableOptionT = name: lib.mkOption { - default = true; - example = false; - description = "Whether to enable ${name}."; - type = lib.types.bool; - }; + mkEnableOptionT = name: + lib.mkOption { + default = true; + example = false; + description = "Whether to enable ${name}."; + type = lib.types.bool; + }; # mkEnableOption, but with a default - mkDefaultOption = name: default: lib.mkOption { - default = default; - example = false; - description = "Whether to enable ${name}."; - type = lib.types.bool; - }; + mkDefaultOption = name: default: + lib.mkOption { + default = default; + example = false; + description = "Whether to enable ${name}."; + type = lib.types.bool; + }; # Returns an empty list if the current system is not linux ifLinux = value: if pkgs.stdenv.isLinux then value else [ ]; # Appends if the predicate is true diff --git a/modules/linux/default.nix b/modules/linux/default.nix index 0218dd2..c3ffe69 100644 --- a/modules/linux/default.nix +++ b/modules/linux/default.nix @@ -1,8 +1,11 @@ { config, lib, pkgs, ... }: let - inherit (import ../lib.nix { inherit lib; inherit pkgs; }) nLib; -in -{ + inherit (import ../lib.nix { + inherit lib; + inherit pkgs; + }) + nLib; +in { imports = [ ../options.nix ./base.nix @@ -23,163 +26,169 @@ in ./linux/base.nix ]; - options = with lib; with nLib; { - nathan = { - # Control enabling of services - # Services are system specific so they go here - services = { - # Use zramSwap, enabled by default - zramSwap = mkDefaultOption "zram memory compression" config.nathan.config.isDesktop; - # Enable ssh and configure firewall - # On by default - ssh = mkEnableOptionT "ssh"; - # Enable tailscale, on by default on linux - tailscale = { - enable = mkDefaultOption "tailscale" pkgs.stdenv.isLinux; - }; - # Borg backup - # Disabled by default as it requires configuration, but a really good idea to turn on - borg = { - enable = mkEnableOption "borg"; - extraExcludes = mkOption { - default = [ ]; - description = "List of extra paths to exclude"; - }; - extraIncludes = mkOption { - default = [ ]; - description = "List of extra paths to include"; - }; - location = mkOption { - default = "de1955@de1955.rsync.net:computers"; - description = "Location to backup to"; - type = lib.types.str; - }; - passwordFile = mkOption { - description = "Path to the password file"; - type = lib.types.str; - }; - sshKey = mkOption { - description = "Path to the ssh key"; - type = lib.types.str; - }; - startAt = mkOption { - description = "How often to run backups"; - default = "hourly"; - }; - }; - # Nginx - nginx = { - enable = mkEnableOption "nginx"; - acme = mkEnableOption "ACME Integration"; - }; - # Matrix - matrix = { - enable = mkEnableOption "matrix"; - baseDomain = mkOption { - description = "Base domain to use for the matrix services"; - example = "mccarty.io"; - type = lib.types.str; - }; - element = mkDefaultOption "element" config.nathan.services.matrix.enable; - enableRegistration = mkEnableOption "synapse registration"; - }; - }; - # Linux (desktop/server, not android) specific programs - programs = { - # Install games - games = mkEnableOption "games"; - # Install gpg with yubikey support - # Enabled by default if the system is a desktop - gpg = mkDefaultOption "gpg" config.nathan.config.isDesktop; - utils = { - # Enable multi system emulation - # Enabled by default on desktop - binfmt = mkDefaultOption "binfmt" config.nathan.config.isDesktop; - }; - }; - # Control enabling of hardware support - hardware = { - # Logitech hardware support - # On by default if the system is a desktop - logitech = mkDefaultOption "logitech" config.nathan.config.isDesktop; - # AMD Single gpu passthrough - amdPassthrough = mkEnableOption "logitech"; - }; - # Linux specific configuration - config = { - # Wether or not to install the main user - installUser = mkOption { - default = pkgs.stdenv.isLinux; - example = true; - description = "Whether to install the 'nathan' user"; - type = lib.types.bool; - }; - # Should we harden this system? - # On by default - harden = mkEnableOptionT "Apply system hardening"; - # Enable audio subsystem - # On by default if the system is a desktop - audio = mkDefaultOption "audio" config.nathan.config.isDesktop; - # Basic grub configuration - # Off by default - setupGrub = mkEnableOption "Setup grub"; - # Install fonts - # On by default if the system is a desktop - fonts = mkDefaultOption "fonts" config.nathan.config.isDesktop; - # Enable unfree software - # On by default - enableUnfree = mkEnableOptionT "unfree software"; - # Nix configuration - nix = { - # Automatic GC and optimization of the nix store + options = with lib; + with nLib; { + nathan = { + # Control enabling of services + # Services are system specific so they go here + services = { + # Use zramSwap, enabled by default + zramSwap = mkDefaultOption "zram memory compression" + config.nathan.config.isDesktop; + # Enable ssh and configure firewall # On by default - autoGC = mkEnableOptionT "Nix store optimization and auto gc"; - # Automatic updating of the system - # On by default - autoUpdate = mkEnableOptionT "Nix autoupdating"; + ssh = mkEnableOptionT "ssh"; + # Enable tailscale, on by default on linux + tailscale = { + enable = mkDefaultOption "tailscale" pkgs.stdenv.isLinux; + }; + # Borg backup + # Disabled by default as it requires configuration, but a really good idea to turn on + borg = { + enable = mkEnableOption "borg"; + extraExcludes = mkOption { + default = [ ]; + description = "List of extra paths to exclude"; + }; + extraIncludes = mkOption { + default = [ ]; + description = "List of extra paths to include"; + }; + location = mkOption { + default = "de1955@de1955.rsync.net:computers"; + description = "Location to backup to"; + type = lib.types.str; + }; + passwordFile = mkOption { + description = "Path to the password file"; + type = lib.types.str; + }; + sshKey = mkOption { + description = "Path to the ssh key"; + type = lib.types.str; + }; + startAt = mkOption { + description = "How often to run backups"; + default = "hourly"; + }; + }; + # Nginx + nginx = { + enable = mkEnableOption "nginx"; + acme = mkEnableOption "ACME Integration"; + }; + # Matrix + matrix = { + enable = mkEnableOption "matrix"; + baseDomain = mkOption { + description = "Base domain to use for the matrix services"; + example = "mccarty.io"; + type = lib.types.str; + }; + element = + mkDefaultOption "element" config.nathan.services.matrix.enable; + enableRegistration = mkEnableOption "synapse registration"; + }; }; - # Swaywm configuration - # On by default if the system is a desktop - swaywm = { - enable = mkOption { - default = config.nathan.config.isDesktop; + # Linux (desktop/server, not android) specific programs + programs = { + # Install games + games = mkEnableOption "games"; + # Install gpg with yubikey support + # Enabled by default if the system is a desktop + gpg = mkDefaultOption "gpg" config.nathan.config.isDesktop; + utils = { + # Enable multi system emulation + # Enabled by default on desktop + binfmt = mkDefaultOption "binfmt" config.nathan.config.isDesktop; + }; + }; + # Control enabling of hardware support + hardware = { + # Logitech hardware support + # On by default if the system is a desktop + logitech = mkDefaultOption "logitech" config.nathan.config.isDesktop; + # AMD Single gpu passthrough + amdPassthrough = mkEnableOption "logitech"; + }; + # Linux specific configuration + config = { + # Wether or not to install the main user + installUser = mkOption { + default = pkgs.stdenv.isLinux; example = true; - description = "Whether to setup swaywm"; + description = "Whether to install the 'nathan' user"; type = lib.types.bool; }; - }; - # Virtualization configuration - # All on by default if the system is a desktop - virtualization = { - qemu = mkDefaultOption "qemu" config.nathan.config.isDesktop; - docker = mkDefaultOption "docker" config.nathan.config.isDesktop; - lxc = mkDefaultOption "lxc" config.nathan.config.isDesktop; - nixos = mkDefaultOption "nixos containers" config.nathan.config.isDesktop; - }; - # Support for interacting with a dual booted windows system - windows = { - enable = mkEnableOption "Windows Integration"; - mount = { - enable = mkDefaultOption "Mount a bitlockered windows partition" config.nathan.config.windows.enable; - device = mkOption { - description = "Device to mount"; - example = "/dev/sda2"; - type = types.str; + # Should we harden this system? + # On by default + harden = mkEnableOptionT "Apply system hardening"; + # Enable audio subsystem + # On by default if the system is a desktop + audio = mkDefaultOption "audio" config.nathan.config.isDesktop; + # Basic grub configuration + # Off by default + setupGrub = mkEnableOption "Setup grub"; + # Install fonts + # On by default if the system is a desktop + fonts = mkDefaultOption "fonts" config.nathan.config.isDesktop; + # Enable unfree software + # On by default + enableUnfree = mkEnableOptionT "unfree software"; + # Nix configuration + nix = { + # Automatic GC and optimization of the nix store + # On by default + autoGC = mkEnableOptionT "Nix store optimization and auto gc"; + # Automatic updating of the system + # On by default + autoUpdate = mkEnableOptionT "Nix autoupdating"; + }; + # Swaywm configuration + # On by default if the system is a desktop + swaywm = { + enable = mkOption { + default = config.nathan.config.isDesktop; + example = true; + description = "Whether to setup swaywm"; + type = lib.types.bool; }; - mountPoint = mkOption { - description = "Location to mount the device to"; - example = "/dev/sda2"; - type = types.str; - }; - keyFile = mkOption { - description = "File containing the recovery key for the partition"; - type = types.str; + }; + # Virtualization configuration + # All on by default if the system is a desktop + virtualization = { + qemu = mkDefaultOption "qemu" config.nathan.config.isDesktop; + docker = mkDefaultOption "docker" config.nathan.config.isDesktop; + lxc = mkDefaultOption "lxc" config.nathan.config.isDesktop; + nixos = + mkDefaultOption "nixos containers" config.nathan.config.isDesktop; + }; + # Support for interacting with a dual booted windows system + windows = { + enable = mkEnableOption "Windows Integration"; + mount = { + enable = mkDefaultOption "Mount a bitlockered windows partition" + config.nathan.config.windows.enable; + device = mkOption { + description = "Device to mount"; + example = "/dev/sda2"; + type = types.str; + }; + mountPoint = mkOption { + description = "Location to mount the device to"; + example = "/dev/sda2"; + type = types.str; + }; + keyFile = mkOption { + description = + "File containing the recovery key for the partition"; + type = types.str; + }; }; }; }; }; }; - }; config = { # Enable the firewall @@ -187,9 +196,7 @@ in # Enable unfree packages nixpkgs.config.allowUnfree = config.nathan.config.enableUnfree; # Work around for discord jank ugh - nixpkgs.config.permittedInsecurePackages = [ - "electron-13.6.9" - ]; + nixpkgs.config.permittedInsecurePackages = [ "electron-13.6.9" ]; # Set system state version system.stateVersion = "22.05"; diff --git a/modules/linux/desktop.nix b/modules/linux/desktop.nix index f75eda0..2313288 100644 --- a/modules/linux/desktop.nix +++ b/modules/linux/desktop.nix @@ -1,19 +1,14 @@ { config, lib, pkgs, ... }: -let - nc = config.nathan.config; -in -with lib; { +let nc = config.nathan.config; +in with lib; { # Generic desktop configuration config = mkMerge [ - (mkIf nc.isDesktop - { - # Ergodox - environment.systemPackages = with pkgs; [ - wally-cli - ]; - hardware.keyboard.zsa.enable = true; - # Configure grub if configured - }) + (mkIf nc.isDesktop { + # Ergodox + environment.systemPackages = with pkgs; [ wally-cli ]; + hardware.keyboard.zsa.enable = true; + # Configure grub if configured + }) (mkIf nc.setupGrub { # Boot, drivers, and host name # Use grub @@ -57,15 +52,13 @@ with lib; { package = pkgs.bluezFull; }; # Add pulse audio packages, but do not enable them - environment.systemPackages = with pkgs;[ + environment.systemPackages = with pkgs; [ pulseaudio pavucontrol noisetorch ]; # Add noisetorch for microphone noise canceling - programs.noisetorch = { - enable = true; - }; + programs.noisetorch = { enable = true; }; # Configure fonts }) (mkIf nc.fonts { diff --git a/modules/linux/hardware.nix b/modules/linux/hardware.nix index b096481..374325e 100644 --- a/modules/linux/hardware.nix +++ b/modules/linux/hardware.nix @@ -1,9 +1,6 @@ { config, lib, pkgs, ... }: -let - nw = config.nathan.hardware; -in -with lib; -{ +let nw = config.nathan.hardware; +in with lib; { config = mkMerge [ { hardware.logitech.wireless = mkIf nw.logitech { diff --git a/modules/linux/linux/base.nix b/modules/linux/linux/base.nix index f116fb1..6b2ed02 100644 --- a/modules/linux/linux/base.nix +++ b/modules/linux/linux/base.nix @@ -1,20 +1,16 @@ { config, lib, pkgs, inputs, ... }@attrs: -with lib; -{ +with lib; { config = mkMerge [ - (mkIf pkgs.stdenv.isLinux - { - zramSwap = mkIf config.nathan.services.zramSwap - { - enable = true; - algorithm = "lz4"; - memoryPercent = 25; - }; - nix = mkIf config.nathan.config.nix.autoGC { - autoOptimiseStore = true; - }; - }) - (mkIf config.nathan.config.harden (import "${inputs.nixpkgs}/nixos/modules/profiles/hardened.nix" attrs)) + (mkIf pkgs.stdenv.isLinux { + zramSwap = mkIf config.nathan.services.zramSwap { + enable = true; + algorithm = "lz4"; + memoryPercent = 25; + }; + nix = mkIf config.nathan.config.nix.autoGC { autoOptimiseStore = true; }; + }) + (mkIf config.nathan.config.harden + (import "${inputs.nixpkgs}/nixos/modules/profiles/hardened.nix" attrs)) (mkIf config.nathan.config.harden { boot.kernelPackages = pkgs.linuxPackages_5_18_hardened; security = { @@ -22,33 +18,27 @@ with lib; unprivilegedUsernsClone = true; }; }) - (mkIf ((! config.nathan.config.harden) && config.nathan.config.isDesktop) { + (mkIf ((!config.nathan.config.harden) && config.nathan.config.isDesktop) { # Use the zen kernel with muqss turned on - boot.kernelPackages = - let - linuxZenWMuQSS = pkgs.linuxPackagesFor (pkgs.linuxPackages_zen.kernel.override { - structuredExtraConfig = with lib.kernel; { - SCHED_MUQSS = yes; - }; + boot.kernelPackages = let + linuxZenWMuQSS = pkgs.linuxPackagesFor + (pkgs.linuxPackages_zen.kernel.override { + structuredExtraConfig = with lib.kernel; { SCHED_MUQSS = yes; }; ignoreConfigErrors = true; - } - ); - in - linuxZenWMuQSS; + }); + in linuxZenWMuQSS; + }) + (mkIf (config.nathan.config.nix.autoUpdate && pkgs.stdenv.isLinux) { + # Auto update daily at 2 am + system.autoUpgrade = { + enable = true; + allowReboot = true; + # Update from the flake + flake = "git+https://git.sr.ht/~thatonelutenist/system-flake?ref=trunk"; + # Attempt to update daily at 2AM + dates = "2:00"; + }; }) - (mkIf - (config.nathan.config.nix.autoUpdate && pkgs.stdenv.isLinux) - { - # Auto update daily at 2 am - system.autoUpgrade = { - enable = true; - allowReboot = true; - # Update from the flake - flake = "git+https://git.sr.ht/~thatonelutenist/system-flake?ref=trunk"; - # Attempt to update daily at 2AM - dates = "2:00"; - }; - }) # Systemd user service cludge { systemd.user.extraConfig = '' diff --git a/modules/linux/programs/games.nix b/modules/linux/programs/games.nix index 1ef08e8..3278365 100644 --- a/modules/linux/programs/games.nix +++ b/modules/linux/programs/games.nix @@ -1,34 +1,31 @@ { config, lib, pkgs, inputs, ... }: -let - np = config.nathan.programs; -in -with lib; -{ +let np = config.nathan.programs; +in with lib; { config = mkIf np.games { - environment.systemPackages = - let - # https://github.com/Admicos/minecraft-wayland - glfw-patched = pkgs.glfw-wayland.overrideAttrs (attrs: { - patches = attrs.patches ++ [ - ../../../patches/minecraft/0003-Don-t-crash-on-calls-to-focus-or-icon.patch - ../../../patches/minecraft/0004-wayland-fix-broken-opengl-screenshots-on-mutter.patch - ]; - }); - stable-packages = with pkgs; [ - # Dwarf fortress - (dwarf-fortress-packages.dwarf-fortress-full.override { - enableFPS = true; - }) - # PolyMC minecraft stuff - inputs.polymc.packages."${system}".polymc - glfw-patched + environment.systemPackages = let + # https://github.com/Admicos/minecraft-wayland + glfw-patched = pkgs.glfw-wayland.overrideAttrs (attrs: { + patches = attrs.patches ++ [ + ../../../patches/minecraft/0003-Don-t-crash-on-calls-to-focus-or-icon.patch + ../../../patches/minecraft/0004-wayland-fix-broken-opengl-screenshots-on-mutter.patch ]; - unstable-packages = with inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}"; [ + }); + stable-packages = with pkgs; [ + # Dwarf fortress + (dwarf-fortress-packages.dwarf-fortress-full.override { + enableFPS = true; + }) + # PolyMC minecraft stuff + inputs.polymc.packages."${system}".polymc + glfw-patched + ]; + unstable-packages = + with inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}"; + [ # Packwiz for maintaing modpacks packwiz ]; - in - stable-packages ++ unstable-packages; + in stable-packages ++ unstable-packages; # Install steam programs.steam.enable = true; }; diff --git a/modules/linux/programs/gpg.nix b/modules/linux/programs/gpg.nix index a6ae111..ad4fd5e 100644 --- a/modules/linux/programs/gpg.nix +++ b/modules/linux/programs/gpg.nix @@ -2,9 +2,7 @@ let np = config.nathan.programs; nc = config.nathan.config; -in -with lib; -{ +in with lib; { config = mkIf np.gpg { # Enable ykpersonalize to work services.udev.packages = [ pkgs.yubikey-personalization ]; @@ -12,9 +10,6 @@ with lib; services.pcscd.enable = true; # install gnupg and yubikey personalization - environment.systemPackages = with pkgs; [ - gnupg - yubikey-personalization - ]; + environment.systemPackages = with pkgs; [ gnupg yubikey-personalization ]; }; } diff --git a/modules/linux/programs/utils.nix b/modules/linux/programs/utils.nix index 5f68e25..3d40f1a 100644 --- a/modules/linux/programs/utils.nix +++ b/modules/linux/programs/utils.nix @@ -1,12 +1,7 @@ { config, lib, pkgs, ... }: -let - nathan = config.nathan; -in -with lib; -{ - imports = [ - ../../common/programs/utils.nix - ]; +let nathan = config.nathan; +in with lib; { + imports = [ ../../common/programs/utils.nix ]; config = mkMerge [ (mkIf nathan.programs.utils.binfmt { boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; diff --git a/modules/linux/services/borg.nix b/modules/linux/services/borg.nix index e7795d0..9aa32e9 100644 --- a/modules/linux/services/borg.nix +++ b/modules/linux/services/borg.nix @@ -3,17 +3,11 @@ with lib; { config = mkIf config.nathan.services.borg.enable { # Add borg to the system packages - environment.systemPackages = with pkgs; [ - borgbackup - ]; + environment.systemPackages = with pkgs; [ borgbackup ]; services.borgbackup.jobs = { rsyncnet = { - paths = [ - "/home" - "/var" - "/etc" - "/root" - ] ++ config.nathan.services.borg.extraIncludes; + paths = [ "/home" "/var" "/etc" "/root" ] + ++ config.nathan.services.borg.extraIncludes; exclude = [ "*/.cache" "*/.tmp" @@ -25,7 +19,8 @@ with lib; { "/var/dislocker" "/var/cache" ] ++ config.nathan.services.borg.extraExcludes; - repo = "${config.nathan.services.borg.location}/${config.networking.hostName}"; + repo = + "${config.nathan.services.borg.location}/${config.networking.hostName}"; encryption = { mode = "repokey-blake2"; passCommand = "cat ${config.nathan.services.borg.passwordFile}"; diff --git a/modules/linux/services/matrix.nix b/modules/linux/services/matrix.nix index 25bf528..e92523a 100644 --- a/modules/linux/services/matrix.nix +++ b/modules/linux/services/matrix.nix @@ -1,350 +1,345 @@ { config, lib, pkgs, inputs, ... }: -let - nathan = config.nathan; -in -with lib; -{ +let nathan = config.nathan; +in with lib; { config = mkMerge [ - (mkIf nathan.services.matrix.enable - { - # Enable nginx - nathan.services.nginx.enable = true; - services = { - # Setup postgres - postgresql = { - enable = true; - initialScript = pkgs.writeText "synapse-init.sql" '' - CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'matrix-synapse'; - CREATE DATABASE "synapse" WITH OWNER "synapse" - TEMPLATE template0 - LC_COLLATE = "C" - LC_CTYPE = "C"; - ''; - }; - # Setup synapse - matrix-synapse = { - enable = true; - settings = { - enable_registration = nathan.services.matrix.enableRegistration; - server_name = nathan.services.matrix.baseDomain; + (mkIf nathan.services.matrix.enable { + # Enable nginx + nathan.services.nginx.enable = true; + services = { + # Setup postgres + postgresql = { + enable = true; + initialScript = pkgs.writeText "synapse-init.sql" '' + CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'matrix-synapse'; + CREATE DATABASE "synapse" WITH OWNER "synapse" + TEMPLATE template0 + LC_COLLATE = "C" + LC_CTYPE = "C"; + ''; + }; + # Setup synapse + matrix-synapse = { + enable = true; + settings = { + enable_registration = nathan.services.matrix.enableRegistration; + server_name = nathan.services.matrix.baseDomain; - listeners = [ - { - port = 8008; - bind_addresses = [ "::1" ]; - type = "http"; - tls = false; - x_forwarded = true; - resources = [ - { - names = [ "client" "federation" ]; - compress = false; - } - ]; - } - ]; - database.args = { - user = "matrix-synapse"; - database = "synapse"; - }; - }; - }; - # Configure nginx - nginx.virtualHosts = { - "matrix.${nathan.services.matrix.baseDomain}" = { - enableACME = true; - forceSSL = true; - - locations."/".extraConfig = '' - rewrite ^(.*)$ http://${"element." + nathan.services.matrix.baseDomain}$1 redirect; - ''; - - # forward all Matrix API calls to the synapse Matrix homeserver - locations."/_matrix" = { - proxyPass = "http://[::1]:8008"; # without a trailing / - }; - locations."/_synapse" = { - proxyPass = "http://[::1]:8008"; # without a trailing / - }; + listeners = [{ + port = 8008; + bind_addresses = [ "::1" ]; + type = "http"; + tls = false; + x_forwarded = true; + resources = [{ + names = [ "client" "federation" ]; + compress = false; + }]; + }]; + database.args = { + user = "matrix-synapse"; + database = "synapse"; }; }; }; - } - ) - (mkIf nathan.services.matrix.element { - services.nginx.virtualHosts."element.${nathan.services.matrix.baseDomain}" = { - enableACME = true; - forceSSL = true; - root = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.element-web.override { - conf = { - default_server_config."m.homeserver" = { - "base_url" = "https://matrix.${nathan.services.matrix.baseDomain}"; - "server_name" = "matrix.${nathan.services.matrix.baseDomain}"; + # Configure nginx + nginx.virtualHosts = { + "matrix.${nathan.services.matrix.baseDomain}" = { + enableACME = true; + forceSSL = true; + + locations."/".extraConfig = '' + rewrite ^(.*)$ http://${ + "element." + nathan.services.matrix.baseDomain + }$1 redirect; + ''; + + # forward all Matrix API calls to the synapse Matrix homeserver + locations."/_matrix" = { + proxyPass = "http://[::1]:8008"; # without a trailing / + }; + locations."/_synapse" = { + proxyPass = "http://[::1]:8008"; # without a trailing / }; - showLabsSettings = true; - settingDefaults.custom_themes = [ - { - "name" = "Discord Dark"; - "is_dark" = true; - "colors" = { - "accent-color" = "#747ff4"; - "primary-color" = "#00aff4"; - "warning-color" = "#ed4245d9"; - "sidebar-color" = "#202225"; - "roomlist-background-color" = "#2f3136"; - "roomlist-text-color" = "#dcddde"; - "roomlist-text-secondary-color" = "#8e9297"; - "roomlist-highlights-color" = "#4f545c52"; - "roomlist-separator-color" = "#40444b"; - "timeline-background-color" = "#36393f"; - "timeline-text-color" = "#dcddde"; - "timeline-text-secondary-color" = "#b9bbbe"; - "timeline-highlights-color" = "#04040512"; - "reaction-row-button-selected-bg-color" = "#b9bbbe"; - }; - } - { - "name" = "Dracula Flat"; - "is_dark" = true; - "colors" = { - "accent-color" = "#bd93f9"; - "primary-color" = "#bd93f9"; - "warning-color" = "#bd93f9"; - "sidebar-color" = "#1e1f29"; - "roomlist-background-color" = "#1e1f29"; - "roomlist-text-color" = "#eeeeee"; - "roomlist-text-secondary-color" = "#eeeeee"; - "roomlist-highlights-color" = "#00000030"; - "roomlist-separator-color" = "#00000000"; - "timeline-background-color" = "#1e1f29"; - "timeline-text-color" = "#eeeeee"; - "timeline-text-secondary-color" = "#dddddd"; - "timeline-highlights-color" = "#00000030"; - "reaction-row-button-selected-bg-color" = "#b9bbbe"; - }; - } - - { - "name" = "Dracula"; - "is_dark" = true; - "colors" = { - "accent-color" = "#bd93f9"; - "primary-color" = "#bd93f9"; - "warning-color" = "#bd93f9"; - "sidebar-color" = "#1e1f29"; - "roomlist-background-color" = "#1e1f29"; - "roomlist-text-color" = "#eeeeee"; - "roomlist-text-secondary-color" = "#eeeeee"; - "roomlist-highlights-color" = "#00000030"; - "roomlist-separator-color" = "#4d4d4d90"; - "timeline-background-color" = "#282A36"; - "timeline-text-color" = "#eeeeee"; - "timeline-text-secondary-color" = "#dddddd"; - "timeline-highlights-color" = "#00000030"; - "reaction-row-button-selected-bg-color" = "#b9bbbe"; - }; - } - { - "name" = "Geeko dark theme"; - "is_dark" = true; - "colors" = { - "accent-color" = "#73ba25"; - "primary-color" = "#35b9ab"; - "warning-color" = "#bf616a"; - - "sidebar-color" = "#2a2a2a"; - "roomlist-background-color" = "#4a4a4a"; - "roomlist-text-color" = "#fff"; - "roomlist-text-secondary-color" = "#ddd"; - "roomlist-highlights-color" = "#2a2a2a"; - "roomlist-separator-color" = "#3a3a3a"; - - "timeline-background-color" = "#3a3a3a"; - "timeline-text-color" = "#eee"; - "timeline-text-secondary-color" = "#6da741"; - "timeline-highlights-color" = "#bf616a"; - "reaction-row-button-selected-bg-color" = "#bf616a"; - }; - } - { - "name" = "Luxury Dark theme"; - "is_dark" = true; - "colors" = { - "accent-color" = "#D9BC00"; - "primary-color" = "#FFDD00"; - "warning-color" = "#FBC403"; - - "sidebar-color" = "#020F1B"; - "roomlist-background-color" = "#011223"; - "roomlist-highlights-color" = "#1E354A"; - "roomlist-separator-color" = "#05192D"; - "roomlist-text-color" = "#FFEC70"; - "roomlist-text-secondary-color" = "#FFF3A4"; - - "timeline-background-color" = "#05192D"; - "timeline-highlights-color" = "#011223"; - "timeline-text-color" = "#FFF3A4"; - "timeline-text-secondary-color" = "#A79000"; - "reaction-row-button-selected-bg-color" = "#FFEC70"; - }; - } - { - "name" = "Nord dark theme"; - "is_dark" = true; - "colors" = { - "accent-color" = "#a3be8c"; - "primary-color" = "#88c0d0"; - "warning-color" = "#bf616a"; - - "sidebar-color" = "#2e3440"; - "roomlist-background-color" = "#3b4252"; - "roomlist-text-color" = "#ebcb8b"; - "roomlist-text-secondary-color" = "#e5e9f0"; - "roomlist-highlights-color" = "#2e3440"; - "roomlist-separator-color" = "#434c5e"; - - "timeline-background-color" = "#434c5e"; - "timeline-text-color" = "#eceff4"; - "timeline-text-secondary-color" = "#81a1c1"; - "timeline-highlights-color" = "#3b4252"; - "reaction-row-button-selected-bg-color" = "#bf616a"; - }; - } - - { - "name" = "Nord light theme"; - "is_dark" = false; - "colors" = { - "accent-color" = "#a3be8c"; - "primary-color" = "#5e81ac"; - "warning-color" = "#bf616a"; - - "sidebar-color" = "#d8dee9"; - "roomlist-background-color" = "#e5e9f0"; - "roomlist-text-color" = "#d08770"; - "roomlist-text-secondary-color" = "#3b4252"; - "roomlist-highlights-color" = "#eceff4"; - "roomlist-separator-color" = "#eceff4"; - - "timeline-background-color" = "#eceff4"; - "timeline-text-color" = "#2e3440"; - "timeline-text-secondary-color" = "#3b4252"; - "timeline-highlights-color" = "#e5e9f0"; - "reaction-row-button-selected-bg-color" = "#bf616a"; - }; - } - { - "name" = "Selenized black theme"; - "is_dark" = true; - "colors" = { - "accent-color" = "#70b433"; - "primary-color" = "#4695f7"; - "warning-color" = "#ed4a46"; - - "sidebar-color" = "#181818"; - "roomlist-background-color" = "#252525"; - "roomlist-text-color" = "#ffffff"; - "roomlist-text-secondary-color" = "#b9b9b9"; - "roomlist-highlights-color" = "#3b3b3b"; - "roomlist-separator-color" = "#121212"; - - "timeline-background-color" = "#181818"; - "timeline-text-color" = "#FFFFFF"; - "timeline-text-secondary-color" = "#777777"; - "timeline-highlights-color" = "#252525"; - "reaction-row-button-selected-bg-color" = "#4695f7"; - }; - } - - { - "name" = "Selenized dark theme"; - "is_dark" = true; - "colors" = { - "accent-color" = "#41c7b9"; - "primary-color" = "#4695f7"; - "warning-color" = "#fa5750"; - - "sidebar-color" = "#103c48"; - "roomlist-background-color" = "#184956"; - "roomlist-text-color" = "#dbb32d"; - "roomlist-text-secondary-color" = "#FFFFFF"; - "roomlist-highlights-color" = "#2d5b69"; - "roomlist-separator-color" = "#2d5b69"; - - "timeline-background-color" = "#2d5b69"; - "timeline-text-color" = "#FFFFFF"; - "timeline-text-secondary-color" = "#72898f"; - "timeline-highlights-color" = "#184956"; - "reaction-row-button-selected-bg-color" = "#4695f7"; - }; - } - - - { - "name" = "Selenized light theme"; - "is_dark" = false; - "colors" = { - "accent-color" = "#ad8900"; - "primary-color" = "#009c8f"; - "warning-color" = "#d2212d"; - - "sidebar-color" = "#d5cdb6"; - "roomlist-background-color" = "#ece3cc"; - "roomlist-text-color" = "#c25d1e"; - "roomlist-text-secondary-color" = "#000000"; - "roomlist-highlights-color" = "#fbf3db"; - "roomlist-separator-color" = "#fbf3db"; - - "timeline-background-color" = "#fbf3db"; - "timeline-text-color" = "#000000"; - "timeline-text-secondary-color" = "#777777"; - "timeline-highlights-color" = "#ece3cc"; - "reaction-row-button-selected-bg-color" = "#4695f7"; - }; - } - { - "name" = "Solarized Dark"; - "is_dark" = true; - "colors" = { - "accent-color" = "#b58900"; - "primary-color" = "#268bd2"; - "warning-color" = "#dc322f"; - "sidebar-color" = "#002b36"; - "roomlist-background-color" = "#073642"; - "roomlist-text-color" = "#839496"; - "roomlist-text-secondary-color" = "#93a1a1"; - "roomlist-highlights-color" = "#586e75"; - "timeline-background-color" = "#002b36"; - "timeline-text-color" = "#839496"; - "timeline-text-secondary-color" = "#586e75"; - "timeline-highlights-color" = "#073642"; - "reaction-row-button-selected-bg-color" = "#268bd2"; - }; - } - { - "name" = "ThomCat black theme"; - "is_dark" = true; - "colors" = { - "accent-color" = "#cc7b19"; - "primary-color" = "#9F8652"; - "warning-color" = "#f9c003"; - "sidebar-color" = "#000000"; - "roomlist-background-color" = "#191919"; - "roomlist-text-color" = "#cc7b19"; - "roomlist-text-secondary-color" = "#e5e5e5"; - "roomlist-highlights-color" = "#323232"; - "roomlist-separator-color" = "#4c4c4c"; - "timeline-background-color" = "#000000"; - "timeline-text-color" = "#e5e5e5"; - "timeline-text-secondary-color" = "#b2b2b2"; - "timeline-highlights-color" = "#212121"; - "reaction-row-button-selected-bg-color" = "#cc7b19"; - }; - } - ]; }; }; }; }) + (mkIf nathan.services.matrix.element { + services.nginx.virtualHosts."element.${nathan.services.matrix.baseDomain}" = + { + enableACME = true; + forceSSL = true; + root = + inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.element-web.override { + conf = { + default_server_config."m.homeserver" = { + "base_url" = + "https://matrix.${nathan.services.matrix.baseDomain}"; + "server_name" = "matrix.${nathan.services.matrix.baseDomain}"; + }; + showLabsSettings = true; + settingDefaults.custom_themes = [ + { + "name" = "Discord Dark"; + "is_dark" = true; + "colors" = { + "accent-color" = "#747ff4"; + "primary-color" = "#00aff4"; + "warning-color" = "#ed4245d9"; + "sidebar-color" = "#202225"; + "roomlist-background-color" = "#2f3136"; + "roomlist-text-color" = "#dcddde"; + "roomlist-text-secondary-color" = "#8e9297"; + "roomlist-highlights-color" = "#4f545c52"; + "roomlist-separator-color" = "#40444b"; + "timeline-background-color" = "#36393f"; + "timeline-text-color" = "#dcddde"; + "timeline-text-secondary-color" = "#b9bbbe"; + "timeline-highlights-color" = "#04040512"; + "reaction-row-button-selected-bg-color" = "#b9bbbe"; + }; + } + { + "name" = "Dracula Flat"; + "is_dark" = true; + "colors" = { + "accent-color" = "#bd93f9"; + "primary-color" = "#bd93f9"; + "warning-color" = "#bd93f9"; + "sidebar-color" = "#1e1f29"; + "roomlist-background-color" = "#1e1f29"; + "roomlist-text-color" = "#eeeeee"; + "roomlist-text-secondary-color" = "#eeeeee"; + "roomlist-highlights-color" = "#00000030"; + "roomlist-separator-color" = "#00000000"; + "timeline-background-color" = "#1e1f29"; + "timeline-text-color" = "#eeeeee"; + "timeline-text-secondary-color" = "#dddddd"; + "timeline-highlights-color" = "#00000030"; + "reaction-row-button-selected-bg-color" = "#b9bbbe"; + }; + } + + { + "name" = "Dracula"; + "is_dark" = true; + "colors" = { + "accent-color" = "#bd93f9"; + "primary-color" = "#bd93f9"; + "warning-color" = "#bd93f9"; + "sidebar-color" = "#1e1f29"; + "roomlist-background-color" = "#1e1f29"; + "roomlist-text-color" = "#eeeeee"; + "roomlist-text-secondary-color" = "#eeeeee"; + "roomlist-highlights-color" = "#00000030"; + "roomlist-separator-color" = "#4d4d4d90"; + "timeline-background-color" = "#282A36"; + "timeline-text-color" = "#eeeeee"; + "timeline-text-secondary-color" = "#dddddd"; + "timeline-highlights-color" = "#00000030"; + "reaction-row-button-selected-bg-color" = "#b9bbbe"; + }; + } + { + "name" = "Geeko dark theme"; + "is_dark" = true; + "colors" = { + "accent-color" = "#73ba25"; + "primary-color" = "#35b9ab"; + "warning-color" = "#bf616a"; + + "sidebar-color" = "#2a2a2a"; + "roomlist-background-color" = "#4a4a4a"; + "roomlist-text-color" = "#fff"; + "roomlist-text-secondary-color" = "#ddd"; + "roomlist-highlights-color" = "#2a2a2a"; + "roomlist-separator-color" = "#3a3a3a"; + + "timeline-background-color" = "#3a3a3a"; + "timeline-text-color" = "#eee"; + "timeline-text-secondary-color" = "#6da741"; + "timeline-highlights-color" = "#bf616a"; + "reaction-row-button-selected-bg-color" = "#bf616a"; + }; + } + { + "name" = "Luxury Dark theme"; + "is_dark" = true; + "colors" = { + "accent-color" = "#D9BC00"; + "primary-color" = "#FFDD00"; + "warning-color" = "#FBC403"; + + "sidebar-color" = "#020F1B"; + "roomlist-background-color" = "#011223"; + "roomlist-highlights-color" = "#1E354A"; + "roomlist-separator-color" = "#05192D"; + "roomlist-text-color" = "#FFEC70"; + "roomlist-text-secondary-color" = "#FFF3A4"; + + "timeline-background-color" = "#05192D"; + "timeline-highlights-color" = "#011223"; + "timeline-text-color" = "#FFF3A4"; + "timeline-text-secondary-color" = "#A79000"; + "reaction-row-button-selected-bg-color" = "#FFEC70"; + }; + } + { + "name" = "Nord dark theme"; + "is_dark" = true; + "colors" = { + "accent-color" = "#a3be8c"; + "primary-color" = "#88c0d0"; + "warning-color" = "#bf616a"; + + "sidebar-color" = "#2e3440"; + "roomlist-background-color" = "#3b4252"; + "roomlist-text-color" = "#ebcb8b"; + "roomlist-text-secondary-color" = "#e5e9f0"; + "roomlist-highlights-color" = "#2e3440"; + "roomlist-separator-color" = "#434c5e"; + + "timeline-background-color" = "#434c5e"; + "timeline-text-color" = "#eceff4"; + "timeline-text-secondary-color" = "#81a1c1"; + "timeline-highlights-color" = "#3b4252"; + "reaction-row-button-selected-bg-color" = "#bf616a"; + }; + } + + { + "name" = "Nord light theme"; + "is_dark" = false; + "colors" = { + "accent-color" = "#a3be8c"; + "primary-color" = "#5e81ac"; + "warning-color" = "#bf616a"; + + "sidebar-color" = "#d8dee9"; + "roomlist-background-color" = "#e5e9f0"; + "roomlist-text-color" = "#d08770"; + "roomlist-text-secondary-color" = "#3b4252"; + "roomlist-highlights-color" = "#eceff4"; + "roomlist-separator-color" = "#eceff4"; + + "timeline-background-color" = "#eceff4"; + "timeline-text-color" = "#2e3440"; + "timeline-text-secondary-color" = "#3b4252"; + "timeline-highlights-color" = "#e5e9f0"; + "reaction-row-button-selected-bg-color" = "#bf616a"; + }; + } + { + "name" = "Selenized black theme"; + "is_dark" = true; + "colors" = { + "accent-color" = "#70b433"; + "primary-color" = "#4695f7"; + "warning-color" = "#ed4a46"; + + "sidebar-color" = "#181818"; + "roomlist-background-color" = "#252525"; + "roomlist-text-color" = "#ffffff"; + "roomlist-text-secondary-color" = "#b9b9b9"; + "roomlist-highlights-color" = "#3b3b3b"; + "roomlist-separator-color" = "#121212"; + + "timeline-background-color" = "#181818"; + "timeline-text-color" = "#FFFFFF"; + "timeline-text-secondary-color" = "#777777"; + "timeline-highlights-color" = "#252525"; + "reaction-row-button-selected-bg-color" = "#4695f7"; + }; + } + + { + "name" = "Selenized dark theme"; + "is_dark" = true; + "colors" = { + "accent-color" = "#41c7b9"; + "primary-color" = "#4695f7"; + "warning-color" = "#fa5750"; + + "sidebar-color" = "#103c48"; + "roomlist-background-color" = "#184956"; + "roomlist-text-color" = "#dbb32d"; + "roomlist-text-secondary-color" = "#FFFFFF"; + "roomlist-highlights-color" = "#2d5b69"; + "roomlist-separator-color" = "#2d5b69"; + + "timeline-background-color" = "#2d5b69"; + "timeline-text-color" = "#FFFFFF"; + "timeline-text-secondary-color" = "#72898f"; + "timeline-highlights-color" = "#184956"; + "reaction-row-button-selected-bg-color" = "#4695f7"; + }; + } + + { + "name" = "Selenized light theme"; + "is_dark" = false; + "colors" = { + "accent-color" = "#ad8900"; + "primary-color" = "#009c8f"; + "warning-color" = "#d2212d"; + + "sidebar-color" = "#d5cdb6"; + "roomlist-background-color" = "#ece3cc"; + "roomlist-text-color" = "#c25d1e"; + "roomlist-text-secondary-color" = "#000000"; + "roomlist-highlights-color" = "#fbf3db"; + "roomlist-separator-color" = "#fbf3db"; + + "timeline-background-color" = "#fbf3db"; + "timeline-text-color" = "#000000"; + "timeline-text-secondary-color" = "#777777"; + "timeline-highlights-color" = "#ece3cc"; + "reaction-row-button-selected-bg-color" = "#4695f7"; + }; + } + { + "name" = "Solarized Dark"; + "is_dark" = true; + "colors" = { + "accent-color" = "#b58900"; + "primary-color" = "#268bd2"; + "warning-color" = "#dc322f"; + "sidebar-color" = "#002b36"; + "roomlist-background-color" = "#073642"; + "roomlist-text-color" = "#839496"; + "roomlist-text-secondary-color" = "#93a1a1"; + "roomlist-highlights-color" = "#586e75"; + "timeline-background-color" = "#002b36"; + "timeline-text-color" = "#839496"; + "timeline-text-secondary-color" = "#586e75"; + "timeline-highlights-color" = "#073642"; + "reaction-row-button-selected-bg-color" = "#268bd2"; + }; + } + { + "name" = "ThomCat black theme"; + "is_dark" = true; + "colors" = { + "accent-color" = "#cc7b19"; + "primary-color" = "#9F8652"; + "warning-color" = "#f9c003"; + "sidebar-color" = "#000000"; + "roomlist-background-color" = "#191919"; + "roomlist-text-color" = "#cc7b19"; + "roomlist-text-secondary-color" = "#e5e5e5"; + "roomlist-highlights-color" = "#323232"; + "roomlist-separator-color" = "#4c4c4c"; + "timeline-background-color" = "#000000"; + "timeline-text-color" = "#e5e5e5"; + "timeline-text-secondary-color" = "#b2b2b2"; + "timeline-highlights-color" = "#212121"; + "reaction-row-button-selected-bg-color" = "#cc7b19"; + }; + } + ]; + }; + }; + }; + }) ]; } diff --git a/modules/linux/services/nginx.nix b/modules/linux/services/nginx.nix index f3c423d..8529452 100644 --- a/modules/linux/services/nginx.nix +++ b/modules/linux/services/nginx.nix @@ -1,9 +1,6 @@ { config, lib, pkgs, ... }: -let - nathan = config.nathan; -in -with lib; -{ +let nathan = config.nathan; +in with lib; { config = mkMerge [ (mkIf nathan.services.nginx.enable { networking.firewall = { diff --git a/modules/linux/services/ssh.nix b/modules/linux/services/ssh.nix index 2d09dfb..ef9e3d3 100644 --- a/modules/linux/services/ssh.nix +++ b/modules/linux/services/ssh.nix @@ -1,9 +1,6 @@ { config, lib, pkgs, ... }: -let - nathan = config.nathan; -in -with lib; -{ +let nathan = config.nathan; +in with lib; { config = mkIf nathan.services.ssh { networking.firewall = { allowedTCPPorts = [ 22 ]; @@ -15,12 +12,10 @@ with lib; extraConfig = '' StreamLocalBindUnlink yes ''; - listenAddresses = [ - { - addr = "0.0.0.0"; - port = 22; - } - ]; + listenAddresses = [{ + addr = "0.0.0.0"; + port = 22; + }]; permitRootLogin = "no"; passwordAuthentication = false; }; diff --git a/modules/linux/services/tailscale.nix b/modules/linux/services/tailscale.nix index 5c2ff2f..532a3d2 100644 --- a/modules/linux/services/tailscale.nix +++ b/modules/linux/services/tailscale.nix @@ -1,18 +1,11 @@ { config, lib, pkgs, ... }: -let - nathan = config.nathan; -in -with lib; -{ +let nathan = config.nathan; +in with lib; { config = mkIf nathan.services.tailscale.enable { - environment.systemPackages = with pkgs; [ - tailscale - ]; + environment.systemPackages = with pkgs; [ tailscale ]; # Enable the service - services.tailscale = { - enable = true; - }; + services.tailscale = { enable = true; }; # Setup sops sops.secrets."tailscale-auth" = { @@ -42,7 +35,9 @@ with lib; exit 0 fi # otherwise authenticate with tailscale - ${tailscale}/bin/tailscale up -authkey $(cat ${config.sops.secrets."tailscale-auth".path}) + ${tailscale}/bin/tailscale up -authkey $(cat ${ + config.sops.secrets."tailscale-auth".path + }) ''; }; diff --git a/modules/linux/swaywm.nix b/modules/linux/swaywm.nix index 2b982f3..c193a36 100644 --- a/modules/linux/swaywm.nix +++ b/modules/linux/swaywm.nix @@ -1,9 +1,6 @@ { config, lib, pkgs, inputs, ... }: -let - nc = config.nathan.config; -in -with lib; -{ +let nc = config.nathan.config; +in with lib; { config = mkIf nc.swaywm.enable { # Turn on GDM for login services.xserver = { @@ -13,9 +10,7 @@ with lib; sddm = { enable = true; settings = { - Wayland = { - CompositorCommand = "kwin_wayland --no-lockscreen"; - }; + Wayland = { CompositorCommand = "kwin_wayland --no-lockscreen"; }; }; theme = "sugar-dark"; }; @@ -64,9 +59,7 @@ with lib; wrapperFeatures.gtk = true; }; - environment.sessionVariables = { - MOZ_ENABLE_WAYLAND = "1"; - }; + environment.sessionVariables = { MOZ_ENABLE_WAYLAND = "1"; }; # Enable the xdg-portal xdg = { diff --git a/modules/linux/user.nix b/modules/linux/user.nix index a44cf71..a592d22 100644 --- a/modules/linux/user.nix +++ b/modules/linux/user.nix @@ -1,8 +1,6 @@ { config, lib, pkgs, ... }: -let - nc = config.nathan.config; -in -with lib; { +let nc = config.nathan.config; +in with lib; { config = mkMerge [ { users = { @@ -10,18 +8,30 @@ with lib; { mutableUsers = !(nc.installUser && nc.harden); # Configure our user, if enabled users."${nc.user}" = mkMerge [ - (mkIf nc.installUser - { - # Darwin is special - home = if pkgs.stdenv.isDarwin then "/Users/nathan" else "/home/nathan"; - description = "Nathan McCarty"; - shell = pkgs.fish; - # Linux specific configuration next - }) + (mkIf nc.installUser { + # Darwin is special + home = if pkgs.stdenv.isDarwin then + "/Users/${nc.user}" + else + "/home/${nc.user}"; + description = "Nathan McCarty"; + shell = pkgs.fish; + # Linux specific configuration next + }) (mkIf (nc.installUser && pkgs.stdenv.isLinux) { isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" "audio" "docker" "libvirtd" "uinput" "adbusers" "plugdev" ]; - hashedPassword = "$6$ShBAPGwzKZuB7eEv$cbb3erUqtVGFo/Vux9UwT2NkbVG9VGCxJxPiZFYL0DIc3t4GpYxjkM0M7fFnh.6V8MoSKLM/TvOtzdWbYwI58."; + extraGroups = [ + "wheel" + "networkmanager" + "audio" + "docker" + "libvirtd" + "uinput" + "adbusers" + "plugdev" + ]; + hashedPassword = + "$6$ShBAPGwzKZuB7eEv$cbb3erUqtVGFo/Vux9UwT2NkbVG9VGCxJxPiZFYL0DIc3t4GpYxjkM0M7fFnh.6V8MoSKLM/TvOtzdWbYwI58."; openssh.authorizedKeys.keys = [ # yubikey ssh key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILRs6zVljIlQEZ8F+aEBqqbpeFJwCw3JdveZ8TQWfkev cardno:000615938515" @@ -38,15 +48,10 @@ with lib; { # If we install the user, enable sudo security.sudo.enable = mkDefault nc.installUser; # If we isntall the user, make them trusted - nix.settings.trusted-users = - if nc.installUser then [ - "nathan" - ] else [ ]; + nix.settings.trusted-users = if nc.installUser then [ "nathan" ] else [ ]; # If we setup the user, install the shell as well environment.systemPackages = - if nc.installUser then [ - pkgs.fish - ] else [ ]; + if nc.installUser then [ pkgs.fish ] else [ ]; # Configure the timezone time.timeZone = "America/New_York"; } diff --git a/modules/linux/virtualization.nix b/modules/linux/virtualization.nix index c45fd8a..fd84055 100644 --- a/modules/linux/virtualization.nix +++ b/modules/linux/virtualization.nix @@ -1,21 +1,15 @@ { config, lib, pkgs, ... }: -let - nc = config.nathan.config; -in -with lib; -{ +let nc = config.nathan.config; +in with lib; { config = mkMerge [ - (mkIf nc.virtualization.qemu - { - # Enable the kernel modules - boot.kernelModules = [ "kvm-amd" "kvm-intel" ]; - # Enable libvirt - virtualisation.libvirtd.enable = true; - # Install virt-manager - environment.systemPackages = with pkgs; [ - virtmanager - ]; - }) + (mkIf nc.virtualization.qemu { + # Enable the kernel modules + boot.kernelModules = [ "kvm-amd" "kvm-intel" ]; + # Enable libvirt + virtualisation.libvirtd.enable = true; + # Install virt-manager + environment.systemPackages = with pkgs; [ virtmanager ]; + }) (mkIf nc.virtualization.docker { # Enable docker virtualisation.docker = { @@ -31,9 +25,7 @@ with lib; enable = true; recommendedSysctlSettings = true; }; - users.users.${nc.user} = mkIf nc.installUser { - extraGroups = [ "lxd" ]; - }; + users.users.${nc.user} = mkIf nc.installUser { extraGroups = [ "lxd" ]; }; }) (mkIf nc.virtualization.nixos { # Setup networking for nixos containers diff --git a/modules/linux/windows.nix b/modules/linux/windows.nix index 1bed9c4..b50afd0 100644 --- a/modules/linux/windows.nix +++ b/modules/linux/windows.nix @@ -1,30 +1,26 @@ { config, lib, pkgs, ... }: -with lib;{ +with lib; { config = mkIf config.nathan.config.windows.enable { # Enable ntfs support boot.supportedFilesystems = [ "ntfs" ]; # Install dislocker for mounting bitlocker encrypted partitions - environment.systemPackages = with pkgs; [ - dislocker - ]; + environment.systemPackages = with pkgs; [ dislocker ]; systemd.services.mount-windows = - let - mount = config.nathan.config.windows.mount; - in - mkIf mount.enable { + let mount = config.nathan.config.windows.mount; + in mkIf mount.enable { description = "Mount ${mount.device} to ${mount.mountPoint}"; wantedBy = [ "multi-user.target" ]; - path = with pkgs; [ - bash - dislocker - ]; + path = with pkgs; [ bash dislocker ]; serviceConfig = { Type = "forking"; - ExecStart = - "${../../scripts/windows/mount.sh} ${mount.device} ${mount.mountPoint} ${mount.keyFile}"; - ExecStop = "${../../scripts/windows/unmount.sh} ${mount.device} ${mount.mountPoint}"; + ExecStart = "${ + ../../scripts/windows/mount.sh + } ${mount.device} ${mount.mountPoint} ${mount.keyFile}"; + ExecStop = "${ + ../../scripts/windows/unmount.sh + } ${mount.device} ${mount.mountPoint}"; }; }; }; diff --git a/modules/nix-on-droid/default.nix b/modules/nix-on-droid/default.nix index 1737b9f..e440ab2 100644 --- a/modules/nix-on-droid/default.nix +++ b/modules/nix-on-droid/default.nix @@ -1,19 +1,17 @@ { config, lib, pkgs, ... }: let - inherit (import ../lib.nix { inherit lib; inherit pkgs; }) nLib; -in -{ - imports = [ - ../options.nix - ./programs/util.nix - ]; + inherit (import ../lib.nix { + inherit lib; + inherit pkgs; + }) + nLib; +in { + imports = [ ../options.nix ./programs/util.nix ]; options = with lib; with nLib; { }; config = { - environment.packages = with pkgs; [ - nettools - ]; + environment.packages = with pkgs; [ nettools ]; # Set system state version system.stateVersion = "22.05"; diff --git a/modules/nix-on-droid/programs/util.nix b/modules/nix-on-droid/programs/util.nix index d4ad110..a1f29dd 100644 --- a/modules/nix-on-droid/programs/util.nix +++ b/modules/nix-on-droid/programs/util.nix @@ -1,38 +1,31 @@ { config, lib, pkgs, ... }: -let - nathan = config.nathan; -in -with lib; -{ +let nathan = config.nathan; +in with lib; { config = mkMerge [ - (mkIf nathan.programs.utils.core - { - environment.packages = with pkgs; [ - # Basic command line utilities - wget - tmux - nano - unzip - any-nix-shell - htop - which - # For being able to update the flake - gitFull - # For nslookup - dnsutils - # Mosh for better high-latency ssh - mosh - # PV for viewing pipes - pv - # Openssh - openssh - ]; - }) - (mkIf nathan.programs.utils.devel { + (mkIf nathan.programs.utils.core { environment.packages = with pkgs; [ - gcc - binutils + # Basic command line utilities + wget + tmux + nano + unzip + any-nix-shell + htop + which + # For being able to update the flake + gitFull + # For nslookup + dnsutils + # Mosh for better high-latency ssh + mosh + # PV for viewing pipes + pv + # Openssh + openssh ]; }) + (mkIf nathan.programs.utils.devel { + environment.packages = with pkgs; [ gcc binutils ]; + }) ]; } diff --git a/modules/options.nix b/modules/options.nix index 546629d..343a810 100644 --- a/modules/options.nix +++ b/modules/options.nix @@ -1,42 +1,46 @@ { config, lib, pkgs, ... }: let - inherit (import ./lib.nix { inherit lib; inherit pkgs; }) nLib; -in -{ - options = with lib; with nLib; { - nathan = { - # Programs, many of these will be generic - programs = { - # Utility modules - utils = { - # Core utililtes I want on every system - # Enabled by default - core = mkEnableOptionT "utils-core"; - # Development utilities that can't be installed through home manager due to collisions - devel = mkDefaultOption "devel" config.nathan.config.isDesktop; + inherit (import ./lib.nix { + inherit lib; + inherit pkgs; + }) + nLib; +in { + options = with lib; + with nLib; { + nathan = { + # Programs, many of these will be generic + programs = { + # Utility modules + utils = { + # Core utililtes I want on every system + # Enabled by default + core = mkEnableOptionT "utils-core"; + # Development utilities that can't be installed through home manager due to collisions + devel = mkDefaultOption "devel" config.nathan.config.isDesktop; + }; }; - }; - # General system configuration - config = { - # Name of the user to install - user = mkOption { - default = "nathan"; - example = "nathan"; - description = "Username to use for common configuration"; - type = lib.types.str; + # General system configuration + config = { + # Name of the user to install + user = mkOption { + default = "nathan"; + example = "nathan"; + description = "Username to use for common configuration"; + type = lib.types.str; + }; + # Name of the user to install + email = mkOption { + default = "nathan@mccarty.io"; + example = "nathan@mccarty.io"; + description = "Email to use for common configuration"; + type = lib.types.str; + }; + # Is this system a desktop? + # Off by default + isDesktop = mkEnableOption "Desktop specific settings"; }; - # Name of the user to install - email = mkOption { - default = "nathan@mccarty.io"; - example = "nathan@mccarty.io"; - description = "Email to use for common configuration"; - type = lib.types.str; - }; - # Is this system a desktop? - # Off by default - isDesktop = mkEnableOption "Desktop specific settings"; }; }; - }; } diff --git a/packages/blockbench/default.nix b/packages/blockbench/default.nix index a0c183d..76dfe7d 100644 --- a/packages/blockbench/default.nix +++ b/packages/blockbench/default.nix @@ -5,7 +5,8 @@ stdenv.mkDerivation rec { version = "4.2.5"; src = fetchurl { - url = "https://github.com/JannisX11/blockbench/releases/download/v${version}/Blockbench_${version}.AppImage"; + url = + "https://github.com/JannisX11/blockbench/releases/download/v${version}/Blockbench_${version}.AppImage"; sha256 = "ibgWP3i0QGKnL0ZmDusouo2DoDxOkRZQFqIl8SEChbs="; name = "${pname}-${version}.AppImage"; }; diff --git a/packages/discord/default.nix b/packages/discord/default.nix index a1804ec..a5fa702 100644 --- a/packages/discord/default.nix +++ b/packages/discord/default.nix @@ -1,63 +1,14 @@ -{ pname -, version -, src -, binaryName -, desktopName -, autoPatchelfHook -, makeDesktopItem -, lib -, stdenv -, wrapGAppsHook -, alsaLib -, at-spi2-atk -, at-spi2-core -, atk -, cairo -, cups -, dbus -, expat -, fontconfig -, freetype -, gdk-pixbuf -, glib -, gtk3 -, libcxx -, libdrm -, libnotify -, libpulseaudio -, libuuid -, libX11 -, libXScrnSaver -, libXcomposite -, libXcursor -, libXdamage -, libXext -, libXfixes -, libXi -, libXrandr -, libXrender -, libXtst -, libxcb -, libxshmfence -, mesa -, nspr -, nss -, pango -, systemd -, libappindicator-gtk3 -, libdbusmenu -, writeScript -, common-updater-scripts -, electron -, nodePackages -, libgcc -, glibc -}: +{ pname, version, src, binaryName, desktopName, autoPatchelfHook +, makeDesktopItem, lib, stdenv, wrapGAppsHook, alsaLib, at-spi2-atk +, at-spi2-core, atk, cairo, cups, dbus, expat, fontconfig, freetype, gdk-pixbuf +, glib, gtk3, libcxx, libdrm, libnotify, libpulseaudio, libuuid, libX11 +, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext, libXfixes +, libXi, libXrandr, libXrender, libXtst, libxcb, libxshmfence, mesa, nspr, nss +, pango, systemd, libappindicator-gtk3, libdbusmenu, writeScript +, common-updater-scripts, electron, nodePackages, libgcc, glibc }: -let - inherit binaryName; -in -stdenv.mkDerivation rec { +let inherit binaryName; +in stdenv.mkDerivation rec { inherit pname version src; nativeBuildInputs = [ @@ -80,11 +31,7 @@ stdenv.mkDerivation rec { autoPatchelfHook ]; - buildInputs = [ - electron - libgcc - glibc - ]; + buildInputs = [ electron libgcc glibc ]; dontWrapGApps = true; @@ -131,49 +78,47 @@ stdenv.mkDerivation rec { libgcc ]; - installPhase = - let - electron_exec = "${electron}/bin/electron"; - in - '' - mkdir -p $out/{bin,opt/${binaryName},share/pixmaps} - mv * $out/opt/${binaryName} - chmod +x $out/opt/${binaryName}/${binaryName} - ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${pname}.png - mkdir -p $out/share/applications - ls $out/share/applications - sed "s|OUTDIR|$out|" ${desktopItem}/share/applications/${pname}.desktop > $out/share/applications/${pname}.desktop - # Hacks for system electron - asar e $out/opt/${binaryName}/resources/app.asar $out/opt/${binaryName}/resources/app - rm $out/opt/${binaryName}/resources/app.asar - sed -i "s|process.resourcesPath|'$out/opt/${binaryName}/resources'|" $out/opt/${binaryName}/resources/app/app_bootstrap/buildInfo.js - sed -i "s|exeDir,|'$out/share/pixmaps',|" $out/opt/${binaryName}/resources/app/app_bootstrap/autoStart/linux.js - asar p $out/opt/${binaryName}/resources/app $out/opt/${binaryName}/resources/app.asar --unpack-dir '**' + installPhase = let electron_exec = "${electron}/bin/electron"; + in '' + mkdir -p $out/{bin,opt/${binaryName},share/pixmaps} + mv * $out/opt/${binaryName} + chmod +x $out/opt/${binaryName}/${binaryName} + ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${pname}.png + mkdir -p $out/share/applications + ls $out/share/applications + sed "s|OUTDIR|$out|" ${desktopItem}/share/applications/${pname}.desktop > $out/share/applications/${pname}.desktop + # Hacks for system electron + asar e $out/opt/${binaryName}/resources/app.asar $out/opt/${binaryName}/resources/app + rm $out/opt/${binaryName}/resources/app.asar + sed -i "s|process.resourcesPath|'$out/opt/${binaryName}/resources'|" $out/opt/${binaryName}/resources/app/app_bootstrap/buildInfo.js + sed -i "s|exeDir,|'$out/share/pixmaps',|" $out/opt/${binaryName}/resources/app/app_bootstrap/autoStart/linux.js + asar p $out/opt/${binaryName}/resources/app $out/opt/${binaryName}/resources/app.asar --unpack-dir '**' - # executable wrapper - makeWrapper '${electron_exec}' "$out/bin/${binaryName}" \ - --add-flags "--enable-features=UseOzonePlatform --ozone-platform=wayland $out/opt/${binaryName}/resources/app.asar"\ - --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/"\ - --prefix LD_LIBRARY_PATH : ${libPath} - ln -s $out/bin/${binaryName} $out/bin/${lib.strings.toLower binaryName} - ''; + # executable wrapper + makeWrapper '${electron_exec}' "$out/bin/${binaryName}" \ + --add-flags "--enable-features=UseOzonePlatform --ozone-platform=wayland $out/opt/${binaryName}/resources/app.asar"\ + --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/"\ + --prefix LD_LIBRARY_PATH : ${libPath} + ln -s $out/bin/${binaryName} $out/bin/${lib.strings.toLower binaryName} + ''; - desktopItem = - makeDesktopItem { - name = pname; - exec = "${binaryName}"; - icon = pname; - inherit desktopName; - genericName = meta.description; - categories = [ "Network" "InstantMessaging" ]; - mimeTypes = [ "x-scheme-handler/discord" ]; - }; + desktopItem = makeDesktopItem { + name = pname; + exec = "${binaryName}"; + icon = pname; + inherit desktopName; + genericName = meta.description; + categories = [ "Network" "InstantMessaging" ]; + mimeTypes = [ "x-scheme-handler/discord" ]; + }; passthru.updateScript = writeScript "discord-update-script" '' #!/usr/bin/env nix-shell #!nix-shell -i bash -p curl gnugrep common-updater-scripts set -eou pipefail; - url=$(curl -sI "https://discordapp.com/api/download/${builtins.replaceStrings ["discord-" "discord"] ["" "stable"] pname}?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+') + url=$(curl -sI "https://discordapp.com/api/download/${ + builtins.replaceStrings [ "discord-" "discord" ] [ "" "stable" ] pname + }?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+') version=''${url##https://dl*.discordapp.net/apps/linux/} version=''${version%%/*.tar.gz} update-source-version ${pname} "$version" --file=./pkgs/applications/networking/instant-messengers/discord/default.nix diff --git a/packages/swayimg/default.nix b/packages/swayimg/default.nix index 91cc5df..c033d6b 100644 --- a/packages/swayimg/default.nix +++ b/packages/swayimg/default.nix @@ -1,38 +1,15 @@ -{ config -, lib -, pkgs -, stdenv -, fetchurl -, meson -, ninja -, pkg-config -, git -, cmake -, makeDesktopItem -, wayland -, wayland-protocols -, json_c -, libxkbcommon -, fontconfig -, giflib -, libjpeg -, libjxl -, libpng -, librsvg -, libwebp -, libheif -, libtiff -, libexif -, bash-completion -, ... -}: +{ config, lib, pkgs, stdenv, fetchurl, meson, ninja, pkg-config, git, cmake +, makeDesktopItem, wayland, wayland-protocols, json_c, libxkbcommon, fontconfig +, giflib, libjpeg, libjxl, libpng, librsvg, libwebp, libheif, libtiff, libexif +, bash-completion, ... }: stdenv.mkDerivation rec { pname = "swayimg"; version = "1.9"; src = fetchurl { - url = "https://github.com/artemsen/swayimg/archive/refs/tags/v${version}.tar.gz"; + url = + "https://github.com/artemsen/swayimg/archive/refs/tags/v${version}.tar.gz"; sha256 = "sha256-aTojp3VevtsUQnGytnSYChxRogNtq8/5aXw+PGJY8Qg="; name = "${pname}-${version}.tar.gz"; };