diff --git a/flake.nix b/flake.nix index 649f428..7f54956 100644 --- a/flake.nix +++ b/flake.nix @@ -1,84 +1,70 @@ { - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - wrapper-manager = { - url = "github:viperML/wrapper-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - disko = { - url = "github:nix-community/disko"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - sops-nix = { - url = "github:Mic92/sops-nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - nix-index-database = { - url = "github:Mic92/nix-index-database"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - nix-vscode-extensions = { - url = "github:nix-community/nix-vscode-extensions"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { - self, - nixpkgs, - ... - } @ inputs: let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in { - nixosConfigurations = { - north = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit self; - inherit inputs; - }; - modules = [ - ./hosts/north - "${./.}/users/seb/@north.nix" - ]; - }; - inspiron = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit self; - inherit inputs; - }; - modules = [ - ./hosts/inspiron - "${./.}/users/seb/@inspiron.nix" - ]; - }; - }; + wrapper-manager = { + url = "github:viperML/wrapper-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra.overrideAttrs { - passthru.tests.version = {}; - postPatch = '' - substituteInPlace src/alejandra/src/builder.rs \ - --replace '2 * build_ctx.indentation' '4 * build_ctx.indentation' - substituteInPlace src/alejandra/src/rules/string.rs \ - --replace 'format!(" {}", line)' 'format!(" {}", line)' - substituteInPlace src/alejandra_cli/src/cli.rs \ - --replace 'eprint!("{}", random_ad());' "" - rm -r src/alejandra/tests - ''; - }; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - devShells.${system}.default = pkgs.mkShell { - packages = [pkgs.sops]; + sops-nix = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-index-database = { + url = "github:Mic92/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-vscode-extensions = { + url = "github:nix-community/nix-vscode-extensions"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { self, nixpkgs, ... }@inputs: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in + { + nixosConfigurations = { + north = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit self; + inherit inputs; + }; + modules = [ + ./hosts/north + "${./.}/users/seb/@north.nix" + ]; }; + inspiron = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit self; + inherit inputs; + }; + modules = [ + ./hosts/inspiron + "${./.}/users/seb/@inspiron.nix" + ]; + }; + }; + + devShells.${system}.default = pkgs.mkShell { packages = [ pkgs.sops ]; }; + + formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style; }; } diff --git a/hosts/common.nix b/hosts/common.nix index af49abc..e4c56d4 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -1,69 +1,71 @@ -{pkgs, ...}: { - imports = [../modules/system]; +{ pkgs, ... }: +{ + imports = [ ../modules/system ]; - system.stateVersion = "23.11"; + system.stateVersion = "23.11"; - nix.settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; - auto-optimise-store = true; - warn-dirty = false; - trusted-users = [ - "root" - "@wheel" - ]; - }; + nix.settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + auto-optimise-store = true; + warn-dirty = false; + trusted-users = [ + "root" + "@wheel" + ]; + }; - time.timeZone = "Europe/Berlin"; - i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; - }; + time.timeZone = "Europe/Berlin"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; - console.keyMap = "de-latin1-nodeadkeys"; + console.keyMap = "de-latin1-nodeadkeys"; - programs.neovim = { - enable = true; - defaultEditor = true; - viAlias = true; - vimAlias = true; - }; + programs.neovim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + }; - environment.systemPackages = [pkgs.git]; + environment.systemPackages = [ pkgs.git ]; - fonts.packages = [ - pkgs.corefonts - pkgs.roboto - pkgs.open-sans - (pkgs.nerdfonts.override { - fonts = [ - "JetBrainsMono" - "NerdFontsSymbolsOnly" - ]; - }) + fonts.packages = [ + pkgs.corefonts + pkgs.roboto + pkgs.open-sans + (pkgs.nerdfonts.override { + fonts = [ + "JetBrainsMono" + "NerdFontsSymbolsOnly" + ]; + }) + ]; + + nixpkgs.config.allowUnfreePredicate = + pkg: + builtins.elem (pkgs.lib.getName pkg) [ + "steam" + "steam-original" + "steam-run" + "corefonts" + "nvidia-x11" + "nvidia-settings" + "spotify" + "obsidian" ]; - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (pkgs.lib.getName pkg) [ - "steam" - "steam-original" - "steam-run" - "corefonts" - "nvidia-x11" - "nvidia-settings" - "spotify" - "obsidian" - ]; - - users.mutableUsers = false; + users.mutableUsers = false; } diff --git a/hosts/inspiron/default.nix b/hosts/inspiron/default.nix index 5b3e80c..62dbf27 100644 --- a/hosts/inspiron/default.nix +++ b/hosts/inspiron/default.nix @@ -1,40 +1,41 @@ -{pkgs, ...}: { - imports = [ - ../common.nix - ./hardware.nix - ]; +{ pkgs, ... }: +{ + imports = [ + ../common.nix + ./hardware.nix + ]; - networking.hostName = "inspiron"; + networking.hostName = "inspiron"; - environment.sessionVariables.FLAKE = "/home/seb/Projects/nixos/my-config"; + environment.sessionVariables.FLAKE = "/home/seb/Projects/nixos/my-config"; - myConfig = { - boot-loader = { - systemd-boot.enable = true; - silent = true; - }; - - dm.gdm.enable = true; - de.hyprland.enable = true; - - wlan.enable = true; - bluetooth.enable = true; - - sound.enable = true; - vm.qemu.enable = true; - flatpak.enable = true; - vpn.lgs.enable = true; - comma.enable = true; - sops.enable = true; - printing.enable = true; - syncthing.enable = true; - nix-helper = { - enable = true; - auto-gc.enable = true; - }; + myConfig = { + boot-loader = { + systemd-boot.enable = true; + silent = true; }; - boot.kernelPackages = pkgs.linuxPackages_latest; + dm.gdm.enable = true; + de.hyprland.enable = true; - services.auto-cpufreq.enable = true; + wlan.enable = true; + bluetooth.enable = true; + + sound.enable = true; + vm.qemu.enable = true; + flatpak.enable = true; + vpn.lgs.enable = true; + comma.enable = true; + sops.enable = true; + printing.enable = true; + syncthing.enable = true; + nix-helper = { + enable = true; + auto-gc.enable = true; + }; + }; + + boot.kernelPackages = pkgs.linuxPackages_latest; + + services.auto-cpufreq.enable = true; } diff --git a/hosts/inspiron/hardware.nix b/hosts/inspiron/hardware.nix index a6d147d..1ff4ca9 100644 --- a/hosts/inspiron/hardware.nix +++ b/hosts/inspiron/hardware.nix @@ -1,25 +1,26 @@ -{...}: { - fileSystems."/" = { - device = "/dev/disk/by-uuid/92437114-de06-4a78-9ee3-c7d0ffcabf95"; - fsType = "ext4"; - }; +{ ... }: +{ + fileSystems."/" = { + device = "/dev/disk/by-uuid/92437114-de06-4a78-9ee3-c7d0ffcabf95"; + fsType = "ext4"; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/D8B4-1218"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/D8B4-1218"; + fsType = "vfat"; + }; - swapDevices = [{device = "/dev/disk/by-uuid/1eba93d1-4853-4534-8cfd-5c14e29c6ff6";}]; + swapDevices = [ { device = "/dev/disk/by-uuid/1eba93d1-4853-4534-8cfd-5c14e29c6ff6"; } ]; - hardware.enableRedistributableFirmware = true; - boot.initrd.availableKernelModules = [ - "nvme" - "xhci_pci" - "ahci" - "usb_storage" - "sd_mod" - ]; - boot.kernelModules = ["kvm-amd"]; - nixpkgs.hostPlatform = "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = true; + hardware.enableRedistributableFirmware = true; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "sd_mod" + ]; + boot.kernelModules = [ "kvm-amd" ]; + nixpkgs.hostPlatform = "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = true; } diff --git a/hosts/north/default.nix b/hosts/north/default.nix index c74cadf..9ed355e 100644 --- a/hosts/north/default.nix +++ b/hosts/north/default.nix @@ -1,36 +1,37 @@ -{pkgs, ...}: { - imports = [ - ../common.nix - ./hardware.nix - ]; +{ pkgs, ... }: +{ + imports = [ + ../common.nix + ./hardware.nix + ]; - networking.hostName = "north"; + networking.hostName = "north"; - environment.sessionVariables.FLAKE = "/home/seb/Projects/nixos/my-config"; + environment.sessionVariables.FLAKE = "/home/seb/Projects/nixos/my-config"; - myConfig = { - boot-loader = { - systemd-boot.enable = true; - silent = true; - }; - - dm.gdm.enable = true; - de.hyprland.enable = true; - - sound.enable = true; - vm.qemu.enable = true; - vpn.lgs.enable = true; - comma.enable = true; - sops.enable = true; - printing.enable = true; - syncthing.enable = true; - nix-helper = { - enable = true; - auto-gc.enable = true; - }; + myConfig = { + boot-loader = { + systemd-boot.enable = true; + silent = true; }; - boot.kernelPackages = pkgs.linuxPackages_6_8; + dm.gdm.enable = true; + de.hyprland.enable = true; - programs.steam.enable = true; + sound.enable = true; + vm.qemu.enable = true; + vpn.lgs.enable = true; + comma.enable = true; + sops.enable = true; + printing.enable = true; + syncthing.enable = true; + nix-helper = { + enable = true; + auto-gc.enable = true; + }; + }; + + boot.kernelPackages = pkgs.linuxPackages_6_8; + + programs.steam.enable = true; } diff --git a/hosts/north/disko.nix b/hosts/north/disko.nix index 4d37241..54181ab 100644 --- a/hosts/north/disko.nix +++ b/hosts/north/disko.nix @@ -1,28 +1,28 @@ { - disko.devices.disk.main = { - device = "/dev/nvme0n1"; - type = "disk"; - content = { - type = "gpt"; - partitions = { - ESP = { - type = "EF00"; - size = "500M"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - root = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; + disko.devices.disk.main = { + device = "/dev/nvme0n1"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + ESP = { + type = "EF00"; + size = "500M"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; }; + }; } diff --git a/hosts/north/hardware.nix b/hosts/north/hardware.nix index a11f9df..4fa95f4 100644 --- a/hosts/north/hardware.nix +++ b/hosts/north/hardware.nix @@ -1,91 +1,93 @@ { - inputs, - config, - pkgs, - lib, - ... -}: { - imports = [ - inputs.disko.nixosModules.default - ./disko.nix - ]; + inputs, + config, + pkgs, + lib, + ... +}: +{ + imports = [ + inputs.disko.nixosModules.default + ./disko.nix + ]; - hardware.enableRedistributableFirmware = true; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "ahci" - "nvme" - "usb_storage" - "usbhid" - "sd_mod" - ]; - boot.kernelModules = [ - "kvm-amd" - "k10temp" - "nct6775" - ]; - nixpkgs.hostPlatform = "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = true; + hardware.enableRedistributableFirmware = true; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.kernelModules = [ + "kvm-amd" + "k10temp" + "nct6775" + ]; + nixpkgs.hostPlatform = "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = true; - services.xserver.videoDrivers = ["nvidia"]; - hardware.nvidia = { - modesetting.enable = true; - powerManagement.enable = true; - package = let - rcu_patch = pkgs.fetchpatch { - url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch"; - hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg="; - }; - linux_6_8_patch = pkgs.fetchpatch { - url = "https://gist.github.com/joanbm/24f4d4f4ec69f0c37038a6cc9d132b43/raw/bacb9bf3617529d54cb9a57ae8dc9f29b41d4362/nvidia-470xx-fix-linux-6.8.patch"; - hash = "sha256-SPLC2uGdjHSy4h9i3YFjQ6se6OCdWYW6tlC0CtqmP50="; - extraPrefix = "kernel/"; - stripLen = 1; - }; - in - config.boot.kernelPackages.nvidiaPackages.mkDriver { - version = "535.129.03"; - sha256_64bit = "sha256-5tylYmomCMa7KgRs/LfBrzOLnpYafdkKwJu4oSb/AC4="; - sha256_aarch64 = "sha256-i6jZYUV6JBvN+Rt21v4vNstHPIu9sC+2ZQpiLOLoWzM="; - openSha256 = "sha256-/Hxod/LQ4CGZN1B1GRpgE/xgoYlkPpMh+n8L7tmxwjs="; - settingsSha256 = "sha256-QKN/gLGlT+/hAdYKlkIjZTgvubzQTt4/ki5Y+2Zj3pk="; - persistencedSha256 = "sha256-FRMqY5uAJzq3o+YdM2Mdjj8Df6/cuUUAnh52Ne4koME="; + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + package = + let + rcu_patch = pkgs.fetchpatch { + url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch"; + hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg="; + }; + linux_6_8_patch = pkgs.fetchpatch { + url = "https://gist.github.com/joanbm/24f4d4f4ec69f0c37038a6cc9d132b43/raw/bacb9bf3617529d54cb9a57ae8dc9f29b41d4362/nvidia-470xx-fix-linux-6.8.patch"; + hash = "sha256-SPLC2uGdjHSy4h9i3YFjQ6se6OCdWYW6tlC0CtqmP50="; + extraPrefix = "kernel/"; + stripLen = 1; + }; + in + config.boot.kernelPackages.nvidiaPackages.mkDriver { + version = "535.129.03"; + sha256_64bit = "sha256-5tylYmomCMa7KgRs/LfBrzOLnpYafdkKwJu4oSb/AC4="; + sha256_aarch64 = "sha256-i6jZYUV6JBvN+Rt21v4vNstHPIu9sC+2ZQpiLOLoWzM="; + openSha256 = "sha256-/Hxod/LQ4CGZN1B1GRpgE/xgoYlkPpMh+n8L7tmxwjs="; + settingsSha256 = "sha256-QKN/gLGlT+/hAdYKlkIjZTgvubzQTt4/ki5Y+2Zj3pk="; + persistencedSha256 = "sha256-FRMqY5uAJzq3o+YdM2Mdjj8Df6/cuUUAnh52Ne4koME="; - patches = [ - rcu_patch - linux_6_8_patch - ]; - }; - }; + patches = [ + rcu_patch + linux_6_8_patch + ]; + }; + }; - systemd.services.gpu-temp-reader = { - wantedBy = ["multi-user.target"]; - requires = ["fancontrol.service"]; - before = ["fancontrol.service"]; + systemd.services.gpu-temp-reader = { + wantedBy = [ "multi-user.target" ]; + requires = [ "fancontrol.service" ]; + before = [ "fancontrol.service" ]; - script = '' - ${lib.getExe' pkgs.coreutils "touch"} /tmp/nvidia-gpu-temp - while :; do - temp="$(${lib.getExe' config.hardware.nvidia.package "nvidia-smi"} --query-gpu=temperature.gpu --format=csv,noheader,nounits)" - ${lib.getExe' pkgs.coreutils "echo"} "$((temp * 1000))" > /tmp/nvidia-gpu-temp - ${lib.getExe' pkgs.coreutils "sleep"} 2 - done - ''; - }; + script = '' + ${lib.getExe' pkgs.coreutils "touch"} /tmp/nvidia-gpu-temp + while :; do + temp="$(${lib.getExe' config.hardware.nvidia.package "nvidia-smi"} --query-gpu=temperature.gpu --format=csv,noheader,nounits)" + ${lib.getExe' pkgs.coreutils "echo"} "$((temp * 1000))" > /tmp/nvidia-gpu-temp + ${lib.getExe' pkgs.coreutils "sleep"} 2 + done + ''; + }; - hardware.fancontrol = { - enable = true; - config = '' - # pwm1=rear pwm2=cpu pwm3=front+top pwm4=gpu pwm=motherboard? - INTERVAL=2 - DEVPATH=hwmon1=devices/pci0000:00/0000:00:18.3 hwmon2=devices/platform/nct6775.656 - DEVNAME=hwmon1=k10temp hwmon2=nct6798 - FCTEMPS=hwmon2/pwm1=hwmon2/temp1_input hwmon2/pwm2=hwmon1/temp1_input hwmon2/pwm3=hwmon2/temp1_input hwmon2/pwm4=/tmp/nvidia-gpu-temp - FCFANS=hwmon2/pwm1=hwmon2/fan1_input hwmon2/pwm2=hwmon2/fan7_input+hwmon2/fan2_input hwmon2/pwm3=hwmon2/fan3_input hwmon2/pwm4=hwmon2/fan4_input - MINTEMP=hwmon2/pwm1=35 hwmon2/pwm2=45 hwmon2/pwm3=35 hwmon2/pwm4=40 - MAXTEMP=hwmon2/pwm1=100 hwmon2/pwm2=100 hwmon2/pwm3=100 hwmon2/pwm4=100 - MINSTART=hwmon2/pwm1=16 hwmon2/pwm2=16 hwmon2/pwm3=16 hwmon2/pwm4=30 - MINSTOP=hwmon2/pwm1=16 hwmon2/pwm2=16 hwmon2/pwm3=16 hwmon2/pwm4=30 - ''; - }; + hardware.fancontrol = { + enable = true; + config = '' + # pwm1=rear pwm2=cpu pwm3=front+top pwm4=gpu pwm=motherboard? + INTERVAL=2 + DEVPATH=hwmon1=devices/pci0000:00/0000:00:18.3 hwmon2=devices/platform/nct6775.656 + DEVNAME=hwmon1=k10temp hwmon2=nct6798 + FCTEMPS=hwmon2/pwm1=hwmon2/temp1_input hwmon2/pwm2=hwmon1/temp1_input hwmon2/pwm3=hwmon2/temp1_input hwmon2/pwm4=/tmp/nvidia-gpu-temp + FCFANS=hwmon2/pwm1=hwmon2/fan1_input hwmon2/pwm2=hwmon2/fan7_input+hwmon2/fan2_input hwmon2/pwm3=hwmon2/fan3_input hwmon2/pwm4=hwmon2/fan4_input + MINTEMP=hwmon2/pwm1=35 hwmon2/pwm2=45 hwmon2/pwm3=35 hwmon2/pwm4=40 + MAXTEMP=hwmon2/pwm1=100 hwmon2/pwm2=100 hwmon2/pwm3=100 hwmon2/pwm4=100 + MINSTART=hwmon2/pwm1=16 hwmon2/pwm2=16 hwmon2/pwm3=16 hwmon2/pwm4=30 + MINSTOP=hwmon2/pwm1=16 hwmon2/pwm2=16 hwmon2/pwm3=16 hwmon2/pwm4=30 + ''; + }; } diff --git a/modules/home/clipboard.nix b/modules/home/clipboard.nix index f3c6fa8..4d4ea97 100644 --- a/modules/home/clipboard.nix +++ b/modules/home/clipboard.nix @@ -1,19 +1,22 @@ { - config, - pkgs, - lib, - wrappers, - ... -}: { - options.myConfig.clipboard.enable = lib.mkEnableOption ""; + config, + pkgs, + lib, + wrappers, + ... +}: +{ + options.myConfig.clipboard.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.clipboard.enable { - services.cliphist.enable = true; + config = lib.mkIf config.myConfig.clipboard.enable { + services.cliphist.enable = true; - home.packages = [ - (pkgs.writeScriptBin "clipboard" '' - ${lib.getExe pkgs.cliphist} list | ${lib.getExe (wrappers.rofi {inherit (config.myConfig.de) theme;})} -dmenu -display-columns 2 | ${lib.getExe pkgs.cliphist} decode | ${lib.getExe' pkgs.wl-clipboard "wl-copy"} - '') - ]; - }; + home.packages = [ + (pkgs.writeScriptBin "clipboard" '' + ${lib.getExe pkgs.cliphist} list | ${ + lib.getExe (wrappers.rofi { inherit (config.myConfig.de) theme; }) + } -dmenu -display-columns 2 | ${lib.getExe pkgs.cliphist} decode | ${lib.getExe' pkgs.wl-clipboard "wl-copy"} + '') + ]; + }; } diff --git a/modules/home/de/default.nix b/modules/home/de/default.nix index 23797e9..dfe78e0 100644 --- a/modules/home/de/default.nix +++ b/modules/home/de/default.nix @@ -1,8 +1,8 @@ { - imports = [ - ./hyprland - ./theme.nix - ./waybar.nix - ./hypridlelock.nix - ]; + imports = [ + ./hyprland + ./theme.nix + ./waybar.nix + ./hypridlelock.nix + ]; } diff --git a/modules/home/de/hypridlelock.nix b/modules/home/de/hypridlelock.nix index 6baf9ba..6387a80 100644 --- a/modules/home/de/hypridlelock.nix +++ b/modules/home/de/hypridlelock.nix @@ -1,31 +1,34 @@ { - config, - lib, - wrappers, - ... -}: { - options.myConfig.de.hypridlelock.enable = lib.mkEnableOption ""; + config, + lib, + wrappers, + ... +}: +{ + options.myConfig.de.hypridlelock.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.de.hypridlelock.enable { - services.hypridle = { - enable = true; + config = lib.mkIf config.myConfig.de.hypridlelock.enable { + services.hypridle = { + enable = true; - settings = { - general = { - lock_cmd = let - hyprlockExe = "${lib.getExe wrappers.hyprlock}"; - in "pidof ${hyprlockExe} || ${hyprlockExe}"; - before_sleep_cmd = "loginctl lock-session"; - after_sleep_cmd = "hyprctl dispatch dpms on"; - }; - - listener = [ - { - timeout = 600; - on-timeout = "loginctl lock-session"; - } - ]; - }; + settings = { + general = { + lock_cmd = + let + hyprlockExe = "${lib.getExe wrappers.hyprlock}"; + in + "pidof ${hyprlockExe} || ${hyprlockExe}"; + before_sleep_cmd = "loginctl lock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on"; }; + + listener = [ + { + timeout = 600; + on-timeout = "loginctl lock-session"; + } + ]; + }; }; + }; } diff --git a/modules/home/de/hyprland/config.nix b/modules/home/de/hyprland/config.nix index cbe5507..39b9ec7 100644 --- a/modules/home/de/hyprland/config.nix +++ b/modules/home/de/hyprland/config.nix @@ -1,60 +1,61 @@ { - config, - lib, - wrappers, - ... -}: { - config = lib.mkIf config.myConfig.de.hyprland.enable { - wayland.windowManager.hyprland = { - enable = true; + config, + lib, + wrappers, + ... +}: +{ + config = lib.mkIf config.myConfig.de.hyprland.enable { + wayland.windowManager.hyprland = { + enable = true; - settings = { - exec-once = ["${lib.getExe wrappers.hyprpaper}"]; + settings = { + exec-once = [ "${lib.getExe wrappers.hyprpaper}" ]; - input = { - kb_layout = "de"; - kb_variant = "nodeadkeys"; + input = { + kb_layout = "de"; + kb_variant = "nodeadkeys"; - accel_profile = "flat"; - }; - - device = { - name = "dell0b9f:00-27c6:0d43-touchpad"; - accel_profile = "adaptive"; - disable_while_typing = true; - natural_scroll = true; - middle_button_emulation = true; - }; - - general = { - gaps_in = 5; - gaps_out = 10; - border_size = 1; - - layout = "master"; - }; - - master = { - new_is_master = false; - no_gaps_when_only = 1; - mfact = "0.5"; - }; - - decoration = { - rounding = 6; - drop_shadow = false; - }; - - animations.enabled = false; - - misc = { - disable_hyprland_logo = true; - disable_splash_rendering = true; - force_default_wallpaper = 0; - - key_press_enables_dpms = true; - }; - }; + accel_profile = "flat"; }; + + device = { + name = "dell0b9f:00-27c6:0d43-touchpad"; + accel_profile = "adaptive"; + disable_while_typing = true; + natural_scroll = true; + middle_button_emulation = true; + }; + + general = { + gaps_in = 5; + gaps_out = 10; + border_size = 1; + + layout = "master"; + }; + + master = { + new_is_master = false; + no_gaps_when_only = 1; + mfact = "0.5"; + }; + + decoration = { + rounding = 6; + drop_shadow = false; + }; + + animations.enabled = false; + + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + force_default_wallpaper = 0; + + key_press_enables_dpms = true; + }; + }; }; + }; } diff --git a/modules/home/de/hyprland/default.nix b/modules/home/de/hyprland/default.nix index 85dbb90..e22d83a 100644 --- a/modules/home/de/hyprland/default.nix +++ b/modules/home/de/hyprland/default.nix @@ -1,21 +1,16 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: let - cfg = config.myConfig.de; -in { - imports = [ - ./config.nix - ./keybinds.nix - ]; + imports = [ + ./config.nix + ./keybinds.nix + ]; - options.myConfig.de.hyprland.enable = lib.mkEnableOption ""; + options.myConfig.de.hyprland.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.de.hyprland.enable { - myConfig.de = { - hypridlelock.enable = true; - waybar.enable = true; - }; + config = lib.mkIf config.myConfig.de.hyprland.enable { + myConfig.de = { + hypridlelock.enable = true; + waybar.enable = true; }; + }; } diff --git a/modules/home/de/hyprland/keybinds.nix b/modules/home/de/hyprland/keybinds.nix index a522eb6..f771191 100644 --- a/modules/home/de/hyprland/keybinds.nix +++ b/modules/home/de/hyprland/keybinds.nix @@ -1,125 +1,133 @@ { - config, - pkgs, - lib, - ... -}: { - config = lib.mkIf config.myConfig.de.hyprland.enable { - wayland.windowManager.hyprland.extraConfig = '' - # Bindflags: - # r = release - # e = repeat - # l = locked + config, + pkgs, + lib, + ... +}: +{ + config = lib.mkIf config.myConfig.de.hyprland.enable { + wayland.windowManager.hyprland.extraConfig = '' + # Bindflags: + # r = release + # e = repeat + # l = locked - # Essentials - bind = SUPER SHIFT, C, killactive, - bind = SUPER SHIFT, V, togglefloating, - bind = SUPER SHIFT, F, fullscreen, 0 - bind = SUPER, TAB, cyclenext, + # Essentials + bind = SUPER SHIFT, C, killactive, + bind = SUPER SHIFT, V, togglefloating, + bind = SUPER SHIFT, F, fullscreen, 0 + bind = SUPER, TAB, cyclenext, - # Launch programs - bind = SUPER, R, exec, rofi -show drun - bind = SUPER, RETURN, exec, kitty - bind = SUPER, V, exec, clipboard - bind = SUPER, B, exec, brave - bind = SUPER, F, exec, nemo - bind = SUPER, C, exec, codium - + # Launch programs + bind = SUPER, R, exec, rofi -show drun + bind = SUPER, RETURN, exec, kitty + bind = SUPER, V, exec, clipboard + bind = SUPER, B, exec, brave + bind = SUPER, F, exec, nemo + bind = SUPER, C, exec, codium - # Move focus - bind = SUPER, left, movefocus, l - bind = SUPER, right, movefocus, r - bind = SUPER, up, movefocus, u - bind = SUPER, down, movefocus, d - # Move window - bind = SUPER SHIFT, left, movewindow, l - bind = SUPER SHIFT, right, movewindow, r - bind = SUPER SHIFT, up, movewindow, u - bind = SUPER SHIFT, down, movewindow, d - bindm = SUPER, mouse:272, movewindow + # Move focus + bind = SUPER, left, movefocus, l + bind = SUPER, right, movefocus, r + bind = SUPER, up, movefocus, u + bind = SUPER, down, movefocus, d - # Resize window - binde = SUPER CONTROL, left, resizeactive, -100 0 - binde = SUPER CONTROL, right, resizeactive, 100 0 - binde = SUPER CONTROL, up, resizeactive, 0 -100 - binde = SUPER CONTROL, down, resizeactive, 0 100 - bindm = SUPER, mouse:273, resizewindow + # Move window + bind = SUPER SHIFT, left, movewindow, l + bind = SUPER SHIFT, right, movewindow, r + bind = SUPER SHIFT, up, movewindow, u + bind = SUPER SHIFT, down, movewindow, d + bindm = SUPER, mouse:272, movewindow - # Minimize window - bind = SUPER SHIFT, M, togglespecialworkspace, minimize - bind = SUPER SHIFT, M, movetoworkspace, +0 - bind = SUPER SHIFT, M, togglespecialworkspace, minimize - bind = SUPER SHIFT, M, movetoworkspace, special:minimize - bind = SUPER SHIFT, M, togglespecialworkspace, minimize + # Resize window + binde = SUPER CONTROL, left, resizeactive, -100 0 + binde = SUPER CONTROL, right, resizeactive, 100 0 + binde = SUPER CONTROL, up, resizeactive, 0 -100 + binde = SUPER CONTROL, down, resizeactive, 0 100 + bindm = SUPER, mouse:273, resizewindow - # Switch workspace - ${lib.concatMapStringsSep "\n" (n: "bind=SUPER, ${toString n}, workspace, ${toString n}") (lib.range 1 9)} - ${lib.concatMapStringsSep "\n" (n: "bind=SUPER:SHIFT, ${toString n}, movetoworkspacesilent, ${toString n}") (lib.range 1 9)} + # Minimize window + bind = SUPER SHIFT, M, togglespecialworkspace, minimize + bind = SUPER SHIFT, M, movetoworkspace, +0 + bind = SUPER SHIFT, M, togglespecialworkspace, minimize + bind = SUPER SHIFT, M, movetoworkspace, special:minimize + bind = SUPER SHIFT, M, togglespecialworkspace, minimize - # Scroll through workspaces - bind = SUPER, mouse_down, workspace, e-1 - bind = SUPER, mouse_up, workspace, e+1 + # Switch workspace + ${lib.concatMapStringsSep "\n" (n: "bind=SUPER, ${toString n}, workspace, ${toString n}") ( + lib.range 1 9 + )} + ${lib.concatMapStringsSep "\n" ( + n: "bind=SUPER:SHIFT, ${toString n}, movetoworkspacesilent, ${toString n}" + ) (lib.range 1 9)} - # Manage session - bindrl = SUPER CONTROL, Q, exit, - bindrl = SUPER CONTROL, P, exec, poweroff - bindrl = SUPER CONTROL, R, exec, reboot - bindrl = SUPER CONTROL, S, exec, systemctl suspend - bindrl = SUPER CONTROL, L, exec, loginctl lock-session - bindrl = SUPER CONTROL, B, exec, sleep 1 && hyprctl dispatch dpms off - bindl = , switch:on:Lid Switch, exec, systemctl suspend + # Scroll through workspaces + bind = SUPER, mouse_down, workspace, e-1 + bind = SUPER, mouse_up, workspace, e+1 - # Control media - ${let - play-pause = "${lib.getExe pkgs.playerctl} --ignore-player=brave play-pause"; - play-next = "${lib.getExe pkgs.playerctl} --ignore-player=brave next"; - play-previous = "${lib.getExe pkgs.playerctl} --ignore-player=brave previous"; - mute = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; - volume-up = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"; - volume-down = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; - in '' - bindl = , XF86AudioPlay, exec, ${play-pause} - bindel = SHIFT, XF86AudioRaiseVolume, exec, ${play-next} - bindel = SHIFT, XF86AudioLowerVolume, exec, ${play-previous} - bindl = , XF86AudioMute, exec, ${mute} - bindel = , XF86AudioRaiseVolume, exec, ${volume-up} - bindel = , XF86AudioLowerVolume, exec, ${volume-down} + # Manage session + bindrl = SUPER CONTROL, Q, exit, + bindrl = SUPER CONTROL, P, exec, poweroff + bindrl = SUPER CONTROL, R, exec, reboot + bindrl = SUPER CONTROL, S, exec, systemctl suspend + bindrl = SUPER CONTROL, L, exec, loginctl lock-session + bindrl = SUPER CONTROL, B, exec, sleep 1 && hyprctl dispatch dpms off + bindl = , switch:on:Lid Switch, exec, systemctl suspend - bindl = SUPER ALT, RETURN, exec, ${play-pause} - bindel = SUPER ALT, right, exec, ${play-next} - bindel = SUPER ALT, left, exec, ${play-previous} - bindl = SUPER ALT, BACKSPACE, exec, ${mute} - bindel = SUPER ALT, up, exec, ${volume-up} - bindel = SUPER ALT, down, exec, ${volume-down} - ''} + # Control media + ${ + let + play-pause = "${lib.getExe pkgs.playerctl} --ignore-player=brave play-pause"; + play-next = "${lib.getExe pkgs.playerctl} --ignore-player=brave next"; + play-previous = "${lib.getExe pkgs.playerctl} --ignore-player=brave previous"; + mute = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + volume-up = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"; + volume-down = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; + in + '' + bindl = , XF86AudioPlay, exec, ${play-pause} + bindel = SHIFT, XF86AudioRaiseVolume, exec, ${play-next} + bindel = SHIFT, XF86AudioLowerVolume, exec, ${play-previous} + bindl = , XF86AudioMute, exec, ${mute} + bindel = , XF86AudioRaiseVolume, exec, ${volume-up} + bindel = , XF86AudioLowerVolume, exec, ${volume-down} - # Adjust brightness - bindel = , XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -e set +2% - bindel = , XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} -e set 2%- + bindl = SUPER ALT, RETURN, exec, ${play-pause} + bindel = SUPER ALT, right, exec, ${play-next} + bindel = SUPER ALT, left, exec, ${play-previous} + bindl = SUPER ALT, BACKSPACE, exec, ${mute} + bindel = SUPER ALT, up, exec, ${volume-up} + bindel = SUPER ALT, down, exec, ${volume-down} + '' + } - # Screenshot - bind = , Print, exec, ${lib.getExe pkgs.grimblast} --notify --freeze copysave output - bind = SHIFT, Print, exec, ${lib.getExe pkgs.grimblast} --notify --freeze copysave area + # Adjust brightness + bindel = , XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -e set +2% + bindel = , XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} -e set 2%- - # Escape special workspace - bind = SUPER, ESCAPE, togglespecialworkspace, blank - bind = SUPER, ESCAPE, togglespecialworkspace, blank + # Screenshot + bind = , Print, exec, ${lib.getExe pkgs.grimblast} --notify --freeze copysave output + bind = SHIFT, Print, exec, ${lib.getExe pkgs.grimblast} --notify --freeze copysave area - # Music workspace - exec-once = [workspace special:music silent] spotify - workspace = special:music, border:false, gapsout:20, on-created-empty:spotify - bind = SUPER, S, togglespecialworkspace, music + # Escape special workspace + bind = SUPER, ESCAPE, togglespecialworkspace, blank + bind = SUPER, ESCAPE, togglespecialworkspace, blank - # Chat workspace - exec-once = [workspace special:chat silent] webcord - workspace = special:chat, border:false, gapsout:20, on-created-empty:webcord - bind = SUPER, D, togglespecialworkspace, chat + # Music workspace + exec-once = [workspace special:music silent] spotify + workspace = special:music, border:false, gapsout:20, on-created-empty:spotify + bind = SUPER, S, togglespecialworkspace, music - # Flake workspace - workspace = special:flake, border:false, gapsout:40, on-created-empty:kitty --directory $FLAKE --override background_opacity=0.6 - windowrulev2 = noblur, class:(kitty), onworkspace:special:flake - bind = SUPER, Q, togglespecialworkspace, flake - ''; - }; + # Chat workspace + exec-once = [workspace special:chat silent] webcord + workspace = special:chat, border:false, gapsout:20, on-created-empty:webcord + bind = SUPER, D, togglespecialworkspace, chat + + # Flake workspace + workspace = special:flake, border:false, gapsout:40, on-created-empty:kitty --directory $FLAKE --override background_opacity=0.6 + windowrulev2 = noblur, class:(kitty), onworkspace:special:flake + bind = SUPER, Q, togglespecialworkspace, flake + ''; + }; } diff --git a/modules/home/de/theme.nix b/modules/home/de/theme.nix index 4928210..13bd13e 100644 --- a/modules/home/de/theme.nix +++ b/modules/home/de/theme.nix @@ -1,78 +1,80 @@ { - config, - pkgs, - lib, - ... -}: let - cfg = config.myConfig.de; -in { - options.myConfig.de.theme = lib.mkOption {type = lib.types.str;}; + config, + pkgs, + lib, + ... +}: +let + cfg = config.myConfig.de; +in +{ + options.myConfig.de.theme = lib.mkOption { type = lib.types.str; }; - config = lib.mkMerge [ - (lib.mkIf (cfg.theme == "dark") { - dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; + config = lib.mkMerge [ + (lib.mkIf (cfg.theme == "dark") { + dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; - gtk = { - enable = true; + gtk = { + enable = true; - gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - theme.name = "Adwaita-dark"; - theme.package = pkgs.gnome.gnome-themes-extra; + theme.name = "Adwaita-dark"; + theme.package = pkgs.gnome.gnome-themes-extra; - iconTheme.name = "Papirus-Dark"; - iconTheme.package = pkgs.papirus-icon-theme; + iconTheme.name = "Papirus-Dark"; + iconTheme.package = pkgs.papirus-icon-theme; - font.name = "Open Sans"; - font.package = pkgs.open-sans; - }; + font.name = "Open Sans"; + font.package = pkgs.open-sans; + }; - qt = { - enable = true; - platformTheme.name = "adwaita"; - style.name = "adwaita-dark"; - style.package = pkgs.adwaita-qt; - }; + qt = { + enable = true; + platformTheme.name = "adwaita"; + style.name = "adwaita-dark"; + style.package = pkgs.adwaita-qt; + }; - home.pointerCursor = { - name = "Bibata-Original-Classic"; - package = pkgs.bibata-cursors; - size = 24; - gtk.enable = true; - }; - }) + home.pointerCursor = { + name = "Bibata-Original-Classic"; + package = pkgs.bibata-cursors; + size = 24; + gtk.enable = true; + }; + }) - (lib.mkIf (cfg.theme == "light") { - dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-light"; + (lib.mkIf (cfg.theme == "light") { + dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-light"; - gtk = { - enable = true; + gtk = { + enable = true; - gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - theme.name = "Adwaita"; - theme.package = pkgs.gnome.gnome-themes-extra; + theme.name = "Adwaita"; + theme.package = pkgs.gnome.gnome-themes-extra; - iconTheme.name = "Papirus"; - iconTheme.package = pkgs.papirus-icon-theme; + iconTheme.name = "Papirus"; + iconTheme.package = pkgs.papirus-icon-theme; - font.name = "Open Sans"; - font.package = pkgs.open-sans; - }; + font.name = "Open Sans"; + font.package = pkgs.open-sans; + }; - qt = { - enable = true; - platformTheme.name = "adwaita"; - style.name = "adwaita"; - style.package = pkgs.adwaita-qt; - }; + qt = { + enable = true; + platformTheme.name = "adwaita"; + style.name = "adwaita"; + style.package = pkgs.adwaita-qt; + }; - home.pointerCursor = { - name = "Bibata-Original-Ice"; - package = pkgs.bibata-cursors; - size = 24; - gtk.enable = true; - }; - }) - ]; + home.pointerCursor = { + name = "Bibata-Original-Ice"; + package = pkgs.bibata-cursors; + size = 24; + gtk.enable = true; + }; + }) + ]; } diff --git a/modules/home/de/waybar.nix b/modules/home/de/waybar.nix index 82f2d67..d353584 100644 --- a/modules/home/de/waybar.nix +++ b/modules/home/de/waybar.nix @@ -1,18 +1,19 @@ { - config, - lib, - wrappers, - ... -}: { - options.myConfig.de.waybar.enable = lib.mkEnableOption ""; + config, + lib, + wrappers, + ... +}: +{ + options.myConfig.de.waybar.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.de.waybar.enable { - programs.waybar = { - enable = true; - package = wrappers.waybar; - systemd.enable = true; - }; - - systemd.user.services.waybar.Unit.After = ["sound.target"]; + config = lib.mkIf config.myConfig.de.waybar.enable { + programs.waybar = { + enable = true; + package = wrappers.waybar; + systemd.enable = true; }; + + systemd.user.services.waybar.Unit.After = [ "sound.target" ]; + }; } diff --git a/modules/home/default.nix b/modules/home/default.nix index 2c40862..4b4bc96 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,12 +1,12 @@ { - imports = [ - ./de - ./vscode.nix - ./shell - ./ssh-client.nix - ./git.nix - ./equalizer - ./sops.nix - ./clipboard.nix - ]; + imports = [ + ./de + ./vscode.nix + ./shell + ./ssh-client.nix + ./git.nix + ./equalizer + ./sops.nix + ./clipboard.nix + ]; } diff --git a/modules/home/equalizer/default.nix b/modules/home/equalizer/default.nix index b1d0bde..9221e70 100644 --- a/modules/home/equalizer/default.nix +++ b/modules/home/equalizer/default.nix @@ -1,16 +1,13 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { - options.myConfig.equalizer.enable = lib.mkEnableOption ""; + options.myConfig.equalizer.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.equalizer.enable { - services.easyeffects.enable = true; + config = lib.mkIf config.myConfig.equalizer.enable { + services.easyeffects.enable = true; - xdg.configFile."easyeffects/output" = { - source = ./output; - recursive = true; - }; + xdg.configFile."easyeffects/output" = { + source = ./output; + recursive = true; }; + }; } diff --git a/modules/home/git.nix b/modules/home/git.nix index 5e818e4..c0d9dba 100644 --- a/modules/home/git.nix +++ b/modules/home/git.nix @@ -1,20 +1,17 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { - options.myConfig.git.enable = lib.mkEnableOption ""; + options.myConfig.git.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.git.enable { - programs.git = { - enable = true; + config = lib.mkIf config.myConfig.git.enable { + programs.git = { + enable = true; - userName = "SebastianStork"; - userEmail = "sebastian.stork@pm.me"; + userName = "SebastianStork"; + userEmail = "sebastian.stork@pm.me"; - extraConfig.init.defaultBranch = "main"; - }; - - programs.lazygit.enable = true; + extraConfig.init.defaultBranch = "main"; }; + + programs.lazygit.enable = true; + }; } diff --git a/modules/home/shell/default.nix b/modules/home/shell/default.nix index 73d794e..65b4679 100644 --- a/modules/home/shell/default.nix +++ b/modules/home/shell/default.nix @@ -1,22 +1,20 @@ +{ config, lib, ... }: +let + cfg = config.myConfig.shell; +in { - config, - lib, - ... -}: let - cfg = config.myConfig.shell; -in { - imports = [ - ./starship.nix - ./enhancement.nix - ]; + imports = [ + ./starship.nix + ./enhancement.nix + ]; - options.myConfig.shell = { - bash.enable = lib.mkEnableOption ""; - zsh.enable = lib.mkEnableOption ""; - }; + options.myConfig.shell = { + bash.enable = lib.mkEnableOption ""; + zsh.enable = lib.mkEnableOption ""; + }; - config = { - programs.bash.enable = cfg.bash.enable; - programs.zsh.enable = cfg.zsh.enable; - }; + config = { + programs.bash.enable = cfg.bash.enable; + programs.zsh.enable = cfg.zsh.enable; + }; } diff --git a/modules/home/shell/enhancement.nix b/modules/home/shell/enhancement.nix index f595826..2329f30 100644 --- a/modules/home/shell/enhancement.nix +++ b/modules/home/shell/enhancement.nix @@ -1,49 +1,93 @@ { - config, - pkgs, - lib, - ... -}: { - options.myConfig.shell.enhancement.enable = lib.mkEnableOption ""; + config, + pkgs, + lib, + ... +}: +{ + options.myConfig.shell.enhancement.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.shell.enhancement.enable { - programs.fzf.enable = true; + config = lib.mkIf config.myConfig.shell.enhancement.enable { + programs.fzf.enable = true; - programs.zoxide = { - enable = true; - options = ["--cmd cd"]; - }; + programs.zoxide = { + enable = true; + options = [ "--cmd cd" ]; + }; - home.shellAliases = let - lsAliases = let - listCmd = "${lib.getExe pkgs.eza} --header --group --time-style=long-iso --group-directories-first --sort=name --icons=auto --git --git-repos-no-status --binary"; - aliasList = lib.mapCartesianProduct ({ + home.shellAliases = + let + lsAliases = + let + listCmd = "${lib.getExe pkgs.eza} --header --group --time-style=long-iso --group-directories-first --sort=name --icons=auto --git --git-repos-no-status --binary"; + aliasList = + lib.mapCartesianProduct + ( + { a, b, c, - }: - a + b + c) { - a = ["ll" "lt" "l"]; - b = ["" "a"]; - c = ["" "d" "f"]; + }: + a + b + c + ) + { + a = [ + "ll" + "lt" + "l" + ]; + b = [ + "" + "a" + ]; + c = [ + "" + "d" + "f" + ]; }; - convertAliasToCmd = str: "${listCmd} " + (builtins.replaceStrings ["ll" "lt" "l" "a" "d" "f"] ["--long " "--tree " "--oneline --dereference " "--all " "--only-dirs " "--only-files "] str); - aliasAttrs = lib.genAttrs aliasList convertAliasToCmd; - in - aliasAttrs // {ls = "l";}; + convertAliasToCmd = + str: + "${listCmd} " + + (builtins.replaceStrings + [ + "ll" + "lt" + "l" + "a" + "d" + "f" + ] + [ + "--long " + "--tree " + "--oneline --dereference " + "--all " + "--only-dirs " + "--only-files " + ] + str + ); + aliasAttrs = lib.genAttrs aliasList convertAliasToCmd; + in + aliasAttrs // { ls = "l"; }; - catAlias = let - theme = - { - dark = ""; - light = "GitHub"; - } - .${config.myConfig.de.theme}; - in {cat = "${lib.getExe pkgs.bat} --plain --theme=${theme}";}; - in - lib.mkMerge [ - lsAliases - catAlias - ]; - }; + catAlias = + let + theme = + { + dark = ""; + light = "GitHub"; + } + .${config.myConfig.de.theme}; + in + { + cat = "${lib.getExe pkgs.bat} --plain --theme=${theme}"; + }; + in + lib.mkMerge [ + lsAliases + catAlias + ]; + }; } diff --git a/modules/home/shell/starship.nix b/modules/home/shell/starship.nix index 1166692..8a9fe50 100644 --- a/modules/home/shell/starship.nix +++ b/modules/home/shell/starship.nix @@ -1,22 +1,19 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { - options.myConfig.shell.starship.enable = lib.mkEnableOption ""; + options.myConfig.shell.starship.enable = lib.mkEnableOption ""; - config.programs.starship = lib.mkIf config.myConfig.shell.starship.enable { - enable = true; + config.programs.starship = lib.mkIf config.myConfig.shell.starship.enable { + enable = true; - enableBashIntegration = true; - enableZshIntegration = true; + enableBashIntegration = true; + enableZshIntegration = true; - settings = { - directory = { - truncation_length = 0; - truncation_symbol = "…/"; - truncate_to_repo = true; - }; - }; + settings = { + directory = { + truncation_length = 0; + truncation_symbol = "…/"; + truncate_to_repo = true; + }; }; + }; } diff --git a/modules/home/sops.nix b/modules/home/sops.nix index 8d1bf3e..25fc19e 100644 --- a/modules/home/sops.nix +++ b/modules/home/sops.nix @@ -1,18 +1,19 @@ { - self, - inputs, - config, - lib, - ... -}: { - imports = [inputs.sops-nix.homeManagerModules.sops]; + self, + inputs, + config, + lib, + ... +}: +{ + imports = [ inputs.sops-nix.homeManagerModules.sops ]; - options.myConfig.sops.enable = lib.mkEnableOption ""; + options.myConfig.sops.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.sops.enable { - sops = { - age.sshKeyPaths = ["${config.home.homeDirectory}/.ssh/id_ed25519"]; - defaultSopsFile = "${self}/users/${config.home.username}/secrets.yaml"; - }; + config = lib.mkIf config.myConfig.sops.enable { + sops = { + age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; + defaultSopsFile = "${self}/users/${config.home.username}/secrets.yaml"; }; + }; } diff --git a/modules/home/ssh-client.nix b/modules/home/ssh-client.nix index 5e177bf..0f7f4f8 100644 --- a/modules/home/ssh-client.nix +++ b/modules/home/ssh-client.nix @@ -1,17 +1,14 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { - options.myConfig.ssh-client.enable = lib.mkEnableOption ""; + options.myConfig.ssh-client.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.ssh-client.enable { - programs.ssh = { - enable = true; + config = lib.mkIf config.myConfig.ssh-client.enable { + programs.ssh = { + enable = true; - addKeysToAgent = "confirm"; - }; - - services.ssh-agent.enable = true; + addKeysToAgent = "confirm"; }; + + services.ssh-agent.enable = true; + }; } diff --git a/modules/home/vscode.nix b/modules/home/vscode.nix index 450c83e..d363a2f 100644 --- a/modules/home/vscode.nix +++ b/modules/home/vscode.nix @@ -1,59 +1,66 @@ { - inputs, - config, - pkgs, - lib, - ... -}: { - options.myConfig.vscode.enable = lib.mkEnableOption ""; + inputs, + config, + pkgs, + lib, + ... +}: +{ + options.myConfig.vscode.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.vscode.enable { - programs.vscode = { - enable = true; + config = lib.mkIf config.myConfig.vscode.enable { + programs.vscode = { + enable = true; - package = pkgs.vscode-with-extensions.override { - vscode = pkgs.vscodium; - vscodeExtensions = let - open-ext = inputs.nix-vscode-extensions.extensions.${pkgs.system}.open-vsx; - in [ - open-ext.jnoortheen.nix-ide - open-ext.yzhang.markdown-all-in-one + package = pkgs.vscode-with-extensions.override { + vscode = pkgs.vscodium; + vscodeExtensions = + let + open-ext = inputs.nix-vscode-extensions.extensions.${pkgs.system}.open-vsx; + in + [ + open-ext.jnoortheen.nix-ide + open-ext.yzhang.markdown-all-in-one - open-ext.github.github-vscode-theme - open-ext.pkief.material-icon-theme - ]; - }; - }; - - systemd.user.tmpfiles.rules = let - settings = builtins.replaceStrings [","] [",\\n"] (builtins.toJSON { - "workbench.colorTheme" = - { - dark = "GitHub Dark"; - light = "GitHub Light"; - } - .${config.myConfig.de.theme}; - "workbench.iconTheme" = "material-icon-theme"; - "editor.fontFamily" = "JetBrainsMono Nerd Font"; - "explorer.confirmDelete" = false; - "explorer.confirmDragAndDrop" = false; - "extensions.autoCheckUpdates" = false; - "files.autoSave" = "afterDelay"; - "git.autofetch" = true; - "git.confirmSync" = false; - "nix.enableLanguageServer" = true; - "nix.serverPath" = "${lib.getExe pkgs.nil}"; - "update.mode" = "none"; - "git.suggestSmartCommit" = false; - "workbench.sideBar.location" = "right"; - "editor.renderWhitespace" = "none"; - "editor.minimap.enabled" = false; - "window.menuBarVisibility" = "toggle"; - "workbench.editor.decorations.colors" = false; - }); - in [ - "f+ %h/.config/VSCodium/User/settings.json - - - - ${settings}" - "f+ %h/.config/VSCodium/User/settings-default.json - - - - ${settings}" - ]; + open-ext.github.github-vscode-theme + open-ext.pkief.material-icon-theme + ]; + }; }; + + systemd.user.tmpfiles.rules = + let + settings = builtins.replaceStrings [ "," ] [ ",\\n" ] ( + builtins.toJSON { + "workbench.colorTheme" = + { + dark = "GitHub Dark"; + light = "GitHub Light"; + } + .${config.myConfig.de.theme}; + "workbench.iconTheme" = "material-icon-theme"; + "editor.fontFamily" = "JetBrainsMono Nerd Font"; + "explorer.confirmDelete" = false; + "explorer.confirmDragAndDrop" = false; + "extensions.autoCheckUpdates" = false; + "files.autoSave" = "afterDelay"; + "git.autofetch" = true; + "git.confirmSync" = false; + "nix.enableLanguageServer" = true; + "nix.serverPath" = "${lib.getExe pkgs.nil}"; + "update.mode" = "none"; + "git.suggestSmartCommit" = false; + "workbench.sideBar.location" = "right"; + "editor.renderWhitespace" = "none"; + "editor.minimap.enabled" = false; + "window.menuBarVisibility" = "toggle"; + "workbench.editor.decorations.colors" = false; + } + ); + in + [ + "f+ %h/.config/VSCodium/User/settings.json - - - - ${settings}" + "f+ %h/.config/VSCodium/User/settings-default.json - - - - ${settings}" + ]; + }; } diff --git a/modules/system/bluetooth.nix b/modules/system/bluetooth.nix index 144adbc..b6e6f29 100644 --- a/modules/system/bluetooth.nix +++ b/modules/system/bluetooth.nix @@ -1,16 +1,13 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { - options.myConfig.bluetooth.enable = lib.mkEnableOption ""; + options.myConfig.bluetooth.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.bluetooth.enable { - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - services.blueman.enable = true; - hardware.logitech.wireless.enable = true; + config = lib.mkIf config.myConfig.bluetooth.enable { + hardware.bluetooth = { + enable = true; + powerOnBoot = true; }; + services.blueman.enable = true; + hardware.logitech.wireless.enable = true; + }; } diff --git a/modules/system/boot-loader.nix b/modules/system/boot-loader.nix index 209cb78..4dea50b 100644 --- a/modules/system/boot-loader.nix +++ b/modules/system/boot-loader.nix @@ -1,40 +1,37 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { - options.myConfig.boot-loader = { - systemd-boot.enable = lib.mkEnableOption ""; - silent = lib.mkEnableOption ""; - }; + options.myConfig.boot-loader = { + systemd-boot.enable = lib.mkEnableOption ""; + silent = lib.mkEnableOption ""; + }; - config = lib.mkMerge [ - (lib.mkIf config.myConfig.boot-loader.systemd-boot.enable { - boot.tmp.cleanOnBoot = true; - boot.loader = { - systemd-boot = { - enable = true; - editor = false; - configurationLimit = 20; - }; - efi.canTouchEfiVariables = true; - timeout = 3; - }; - systemd.watchdog.rebootTime = "10"; - }) + config = lib.mkMerge [ + (lib.mkIf config.myConfig.boot-loader.systemd-boot.enable { + boot.tmp.cleanOnBoot = true; + boot.loader = { + systemd-boot = { + enable = true; + editor = false; + configurationLimit = 20; + }; + efi.canTouchEfiVariables = true; + timeout = 3; + }; + systemd.watchdog.rebootTime = "10"; + }) - (lib.mkIf config.myConfig.boot-loader.silent { - boot = { - kernelParams = [ - "quiet" - "rd.systemd.show_status=false" - "rd.udev.log_level=3" - "udev.log_priority=3" - ]; - consoleLogLevel = 3; - initrd.verbose = false; - initrd.systemd.enable = true; - }; - }) - ]; + (lib.mkIf config.myConfig.boot-loader.silent { + boot = { + kernelParams = [ + "quiet" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + ]; + consoleLogLevel = 3; + initrd.verbose = false; + initrd.systemd.enable = true; + }; + }) + ]; } diff --git a/modules/system/comma.nix b/modules/system/comma.nix index c7df872..efacf8f 100644 --- a/modules/system/comma.nix +++ b/modules/system/comma.nix @@ -1,18 +1,20 @@ { - inputs, - config, - lib, - ... -}: let - cfg = config.myConfig.comma; -in { - imports = [inputs.nix-index-database.nixosModules.nix-index]; + inputs, + config, + lib, + ... +}: +let + cfg = config.myConfig.comma; +in +{ + imports = [ inputs.nix-index-database.nixosModules.nix-index ]; - options.myConfig.comma.enable = lib.mkEnableOption ""; + options.myConfig.comma.enable = lib.mkEnableOption ""; - config = { - programs.command-not-found.enable = !cfg.enable; - programs.nix-index.enable = cfg.enable; - programs.nix-index-database.comma.enable = cfg.enable; - }; + config = { + programs.command-not-found.enable = !cfg.enable; + programs.nix-index.enable = cfg.enable; + programs.nix-index-database.comma.enable = cfg.enable; + }; } diff --git a/modules/system/de.nix b/modules/system/de.nix index c7ac987..723f93d 100644 --- a/modules/system/de.nix +++ b/modules/system/de.nix @@ -1,24 +1,25 @@ { - config, - pkgs, - lib, - ... -}: { - options.myConfig.de.hyprland.enable = lib.mkEnableOption ""; + config, + pkgs, + lib, + ... +}: +{ + options.myConfig.de.hyprland.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.de.hyprland.enable { - programs.hyprland.enable = true; + config = lib.mkIf config.myConfig.de.hyprland.enable { + programs.hyprland.enable = true; - environment.sessionVariables = { - WLR_NO_HARDWARE_CURSORS = "1"; - NIXOS_OZONE_WL = "1"; - }; - - xdg.portal = { - enable = true; - extraPortals = [pkgs.xdg-desktop-portal-gtk]; - }; - - services.gvfs.enable = true; + environment.sessionVariables = { + WLR_NO_HARDWARE_CURSORS = "1"; + NIXOS_OZONE_WL = "1"; }; + + xdg.portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + + services.gvfs.enable = true; + }; } diff --git a/modules/system/default.nix b/modules/system/default.nix index 05945c5..7be0959 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -1,18 +1,18 @@ { - imports = [ - ./flatpak.nix - ./vm.nix - ./wlan.nix - ./vpn.nix - ./comma.nix - ./sops.nix - ./bluetooth.nix - ./de.nix - ./dm.nix - ./sound.nix - ./boot-loader.nix - ./printing.nix - ./syncthing.nix - ./nix-helper.nix - ]; + imports = [ + ./flatpak.nix + ./vm.nix + ./wlan.nix + ./vpn.nix + ./comma.nix + ./sops.nix + ./bluetooth.nix + ./de.nix + ./dm.nix + ./sound.nix + ./boot-loader.nix + ./printing.nix + ./syncthing.nix + ./nix-helper.nix + ]; } diff --git a/modules/system/dm.nix b/modules/system/dm.nix index 2749d27..2407edc 100644 --- a/modules/system/dm.nix +++ b/modules/system/dm.nix @@ -1,32 +1,36 @@ { - config, - pkgs, - lib, - ... -}: let - cfg = config.myConfig.dm; -in { - options.myConfig.dm = { - gdm.enable = lib.mkEnableOption ""; - tuigreet.enable = lib.mkEnableOption ""; + config, + pkgs, + lib, + ... +}: +let + cfg = config.myConfig.dm; +in +{ + options.myConfig.dm = { + gdm.enable = lib.mkEnableOption ""; + tuigreet.enable = lib.mkEnableOption ""; + }; + + config = { + services.xserver = lib.mkIf cfg.gdm.enable { + enable = true; + displayManager.gdm.enable = true; }; - config = { - services.xserver = lib.mkIf cfg.gdm.enable { - enable = true; - displayManager.gdm.enable = true; - }; - - services.greetd = lib.mkIf cfg.tuigreet.enable { - enable = true; - settings = { - default_session = let - base = config.services.xserver.displayManager.sessionData.desktops; - in { - command = "${lib.getExe pkgs.greetd.tuigreet} --time --asterisks --remember --remember-user-session --sessions ${base}/share/wayland-sessions:${base}/share/xsessions"; - user = "greeter"; - }; - }; - }; + services.greetd = lib.mkIf cfg.tuigreet.enable { + enable = true; + settings = { + default_session = + let + base = config.services.xserver.displayManager.sessionData.desktops; + in + { + command = "${lib.getExe pkgs.greetd.tuigreet} --time --asterisks --remember --remember-user-session --sessions ${base}/share/wayland-sessions:${base}/share/xsessions"; + user = "greeter"; + }; + }; }; + }; } diff --git a/modules/system/flatpak.nix b/modules/system/flatpak.nix index 379993e..b2069fa 100644 --- a/modules/system/flatpak.nix +++ b/modules/system/flatpak.nix @@ -1,23 +1,20 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { - options.myConfig.flatpak.enable = lib.mkEnableOption ""; + options.myConfig.flatpak.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.flatpak.enable { - services.flatpak.enable = true; + config = lib.mkIf config.myConfig.flatpak.enable { + services.flatpak.enable = true; - home-manager.sharedModules = [ - { - xdg = { - enable = true; - systemDirs.data = [ - "/var/lib/flatpak/exports/share" - "/home/seb/.local/share/flatpak/exports/share" - ]; - }; - } - ]; - }; + home-manager.sharedModules = [ + { + xdg = { + enable = true; + systemDirs.data = [ + "/var/lib/flatpak/exports/share" + "/home/seb/.local/share/flatpak/exports/share" + ]; + }; + } + ]; + }; } diff --git a/modules/system/nix-helper.nix b/modules/system/nix-helper.nix index 42932de..63e38be 100644 --- a/modules/system/nix-helper.nix +++ b/modules/system/nix-helper.nix @@ -1,36 +1,36 @@ +{ config, lib, ... }: +let + cfg = config.myConfig.nix-helper; +in { - config, - lib, - ... -}: let - cfg = config.myConfig.nix-helper; -in { - options.myConfig.nix-helper = { - enable = lib.mkEnableOption ""; - auto-gc.enable = lib.mkEnableOption ""; + options.myConfig.nix-helper = { + enable = lib.mkEnableOption ""; + auto-gc.enable = lib.mkEnableOption ""; + }; + + config = lib.mkIf cfg.enable { + programs.nh.enable = true; + + environment.shellAliases = + let + rebuild = "sudo -v && nh os"; + in + { + nrs = "${rebuild} switch"; + nrt = "${rebuild} test"; + nrb = "${rebuild} boot"; + nrrb = "nrb && reboot"; + }; + + programs.direnv = { + enable = true; + silent = true; }; - config = lib.mkIf cfg.enable { - programs.nh.enable = true; - - environment.shellAliases = let - rebuild = "sudo -v && nh os"; - in { - nrs = "${rebuild} switch"; - nrt = "${rebuild} test"; - nrb = "${rebuild} boot"; - nrrb = "nrb && reboot"; - }; - - programs.direnv = { - enable = true; - silent = true; - }; - - programs.nh.clean = lib.mkIf cfg.auto-gc.enable { - enable = true; - dates = "daily"; - extraArgs = "--keep 10 --keep-since 3d"; - }; + programs.nh.clean = lib.mkIf cfg.auto-gc.enable { + enable = true; + dates = "daily"; + extraArgs = "--keep 10 --keep-since 3d"; }; + }; } diff --git a/modules/system/printing.nix b/modules/system/printing.nix index 68bef60..0b56c35 100644 --- a/modules/system/printing.nix +++ b/modules/system/printing.nix @@ -1,16 +1,13 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { - options.myConfig.printing.enable = lib.mkEnableOption ""; + options.myConfig.printing.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.printing.enable { - services.printing.enable = true; - services.avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - }; + config = lib.mkIf config.myConfig.printing.enable { + services.printing.enable = true; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; }; + }; } diff --git a/modules/system/sops.nix b/modules/system/sops.nix index c81587b..2bc3678 100644 --- a/modules/system/sops.nix +++ b/modules/system/sops.nix @@ -1,18 +1,19 @@ { - self, - inputs, - config, - lib, - ... -}: { - imports = [inputs.sops-nix.nixosModules.sops]; + self, + inputs, + config, + lib, + ... +}: +{ + imports = [ inputs.sops-nix.nixosModules.sops ]; - options.myConfig.sops.enable = lib.mkEnableOption ""; + options.myConfig.sops.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.sops.enable { - sops = { - age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; - defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml"; - }; + config = lib.mkIf config.myConfig.sops.enable { + sops = { + age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml"; }; + }; } diff --git a/modules/system/sound.nix b/modules/system/sound.nix index 84b97f2..cae033c 100644 --- a/modules/system/sound.nix +++ b/modules/system/sound.nix @@ -1,19 +1,16 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { - options.myConfig.sound.enable = lib.mkEnableOption ""; + options.myConfig.sound.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.sound.enable { - security.rtkit.enable = true; - hardware.pulseaudio.enable = false; - services.pipewire = { - enable = true; - wireplumber.enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; + config = lib.mkIf config.myConfig.sound.enable { + security.rtkit.enable = true; + hardware.pulseaudio.enable = false; + services.pipewire = { + enable = true; + wireplumber.enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; }; + }; } diff --git a/modules/system/syncthing.nix b/modules/system/syncthing.nix index f34ee23..15f5160 100644 --- a/modules/system/syncthing.nix +++ b/modules/system/syncthing.nix @@ -1,77 +1,76 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { - options.myConfig.syncthing.enable = lib.mkEnableOption ""; + options.myConfig.syncthing.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.syncthing.enable { - services.syncthing = { - enable = true; + config = lib.mkIf config.myConfig.syncthing.enable { + services.syncthing = { + enable = true; - user = "seb"; - group = "users"; - dataDir = "/home/seb"; + user = "seb"; + group = "users"; + dataDir = "/home/seb"; - overrideDevices = true; - overrideFolders = true; + overrideDevices = true; + overrideFolders = true; - settings = { - devices = { - north.id = "ROS2S76-ULQWVFC-7KNQQ6Q-MNIWNKT-2QOPPHY-FFQZNVM-GUJRTHE-NZBM3QY"; - inspiron.id = "GUXHL6J-J2HWYNN-7JZJ5CN-6LPYGJD-H7GYRLQ-ORZ4PJJ-5K4WT7I-MELMIQO"; - }; - - folders = let - allDevices = [ - "north" - "inspiron" - ]; - staggeredVersioning = { - type = "staggered"; - params = { - cleanInterval = "3600"; # 1 hour in seconds - maxAge = "15552000"; # 180 days in seconds - }; - }; - in { - Documents = { - path = "/home/seb/Documents"; - devices = allDevices; - versioning = staggeredVersioning; - ignorePerms = false; - }; - Downloads = { - path = "/home/seb/Downloads"; - devices = allDevices; - versioning = staggeredVersioning; - ignorePerms = false; - }; - Pictures = { - path = "/home/seb/Pictures"; - devices = allDevices; - versioning = staggeredVersioning; - ignorePerms = false; - }; - Music = { - path = "/home/seb/Music"; - devices = allDevices; - versioning = staggeredVersioning; - ignorePerms = false; - }; - Videos = { - path = "/home/seb/Videos"; - devices = allDevices; - versioning = staggeredVersioning; - ignorePerms = false; - }; - Projects = { - path = "/home/seb/Projects"; - devices = allDevices; - ignorePerms = false; - }; - }; - }; + settings = { + devices = { + north.id = "ROS2S76-ULQWVFC-7KNQQ6Q-MNIWNKT-2QOPPHY-FFQZNVM-GUJRTHE-NZBM3QY"; + inspiron.id = "GUXHL6J-J2HWYNN-7JZJ5CN-6LPYGJD-H7GYRLQ-ORZ4PJJ-5K4WT7I-MELMIQO"; }; + + folders = + let + allDevices = [ + "north" + "inspiron" + ]; + staggeredVersioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; # 1 hour in seconds + maxAge = "15552000"; # 180 days in seconds + }; + }; + in + { + Documents = { + path = "/home/seb/Documents"; + devices = allDevices; + versioning = staggeredVersioning; + ignorePerms = false; + }; + Downloads = { + path = "/home/seb/Downloads"; + devices = allDevices; + versioning = staggeredVersioning; + ignorePerms = false; + }; + Pictures = { + path = "/home/seb/Pictures"; + devices = allDevices; + versioning = staggeredVersioning; + ignorePerms = false; + }; + Music = { + path = "/home/seb/Music"; + devices = allDevices; + versioning = staggeredVersioning; + ignorePerms = false; + }; + Videos = { + path = "/home/seb/Videos"; + devices = allDevices; + versioning = staggeredVersioning; + ignorePerms = false; + }; + Projects = { + path = "/home/seb/Projects"; + devices = allDevices; + ignorePerms = false; + }; + }; + }; }; + }; } diff --git a/modules/system/vm.nix b/modules/system/vm.nix index 862916e..ebd8630 100644 --- a/modules/system/vm.nix +++ b/modules/system/vm.nix @@ -1,28 +1,29 @@ { - config, - pkgs, - lib, - ... -}: { - options.myConfig.vm.qemu.enable = lib.mkEnableOption ""; + config, + pkgs, + lib, + ... +}: +{ + options.myConfig.vm.qemu.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.vm.qemu.enable { - virtualisation.libvirtd.enable = true; + config = lib.mkIf config.myConfig.vm.qemu.enable { + virtualisation.libvirtd.enable = true; - programs.virt-manager.enable = true; + programs.virt-manager.enable = true; - environment.systemPackages = [ - pkgs.quickemu - pkgs.quickgui - ]; + environment.systemPackages = [ + pkgs.quickemu + pkgs.quickgui + ]; - home-manager.sharedModules = [ - { - dconf.settings."org/virt-manager/virt-manager/connections" = { - autoconnect = ["qemu:///system"]; - uris = ["qemu:///system"]; - }; - } - ]; - }; + home-manager.sharedModules = [ + { + dconf.settings."org/virt-manager/virt-manager/connections" = { + autoconnect = [ "qemu:///system" ]; + uris = [ "qemu:///system" ]; + }; + } + ]; + }; } diff --git a/modules/system/vpn.nix b/modules/system/vpn.nix index ac8c095..047d3a5 100644 --- a/modules/system/vpn.nix +++ b/modules/system/vpn.nix @@ -1,37 +1,34 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { - options.myConfig.vpn.lgs.enable = lib.mkEnableOption ""; + options.myConfig.vpn.lgs.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.vpn.lgs.enable { - sops.secrets = { - "vpn/lgs/crt" = {}; - "vpn/lgs/key" = {}; - }; - - services.openvpn.servers.lgs = { - autoStart = false; - - config = '' - dev tap - persist-tun - persist-key - data-ciphers AES-128-GCM:AES-256-CBC - data-ciphers-fallback AES-256-CBC - auth SHA1 - tls-client - client - resolv-retry infinite - remote 194.9.190.11 1194 udp4 - nobind - auth-user-pass - ca ${config.sops.secrets."vpn/lgs/crt".path} - tls-auth ${config.sops.secrets."vpn/lgs/key".path} 1 - remote-cert-tls server - explicit-exit-notify - ''; - }; + config = lib.mkIf config.myConfig.vpn.lgs.enable { + sops.secrets = { + "vpn/lgs/crt" = { }; + "vpn/lgs/key" = { }; }; + + services.openvpn.servers.lgs = { + autoStart = false; + + config = '' + dev tap + persist-tun + persist-key + data-ciphers AES-128-GCM:AES-256-CBC + data-ciphers-fallback AES-256-CBC + auth SHA1 + tls-client + client + resolv-retry infinite + remote 194.9.190.11 1194 udp4 + nobind + auth-user-pass + ca ${config.sops.secrets."vpn/lgs/crt".path} + tls-auth ${config.sops.secrets."vpn/lgs/key".path} 1 + remote-cert-tls server + explicit-exit-notify + ''; + }; + }; } diff --git a/modules/system/wlan.nix b/modules/system/wlan.nix index 9b4eeac..07be244 100644 --- a/modules/system/wlan.nix +++ b/modules/system/wlan.nix @@ -1,34 +1,35 @@ { - config, - pkgs, - lib, - ... -}: { - options.myConfig.wlan.enable = lib.mkEnableOption ""; + config, + pkgs, + lib, + ... +}: +{ + options.myConfig.wlan.enable = lib.mkEnableOption ""; - config = lib.mkIf config.myConfig.wlan.enable { - sops.secrets = { - "iwd/WLAN-233151" = {}; - "iwd/Fairphone4" = {}; - "iwd/LGS" = {}; - }; - - networking.wireless.iwd = { - enable = true; - - settings = { - General.EnableNetworkConfiguration = true; - Settings.AutoConnect = true; - Network.NameResolvingService = "resolvconf"; - }; - }; - - systemd.tmpfiles.rules = [ - "C /var/lib/iwd/WLAN-233151.psk 0600 root root - ${config.sops.secrets."iwd/WLAN-233151".path}" - "C /var/lib/iwd/Fairphone4.psk 0600 root root - ${config.sops.secrets."iwd/Fairphone4".path}" - "C /var/lib/iwd/LGS.8021x 0600 root root - ${config.sops.secrets."iwd/LGS".path}" - ]; - - environment.systemPackages = [pkgs.iwgtk]; + config = lib.mkIf config.myConfig.wlan.enable { + sops.secrets = { + "iwd/WLAN-233151" = { }; + "iwd/Fairphone4" = { }; + "iwd/LGS" = { }; }; + + networking.wireless.iwd = { + enable = true; + + settings = { + General.EnableNetworkConfiguration = true; + Settings.AutoConnect = true; + Network.NameResolvingService = "resolvconf"; + }; + }; + + systemd.tmpfiles.rules = [ + "C /var/lib/iwd/WLAN-233151.psk 0600 root root - ${config.sops.secrets."iwd/WLAN-233151".path}" + "C /var/lib/iwd/Fairphone4.psk 0600 root root - ${config.sops.secrets."iwd/Fairphone4".path}" + "C /var/lib/iwd/LGS.8021x 0600 root root - ${config.sops.secrets."iwd/LGS".path}" + ]; + + environment.systemPackages = [ pkgs.iwgtk ]; + }; } diff --git a/users/common.nix b/users/common.nix index 4944461..4d61b46 100644 --- a/users/common.nix +++ b/users/common.nix @@ -1,35 +1,32 @@ +{ self, inputs, ... }: { - self, - inputs, - ... -}: { - imports = [inputs.home-manager.nixosModules.home-manager]; + imports = [ inputs.home-manager.nixosModules.home-manager ]; - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = { - inherit self; - inherit inputs; - }; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { + inherit self; + inherit inputs; }; + }; - home-manager.sharedModules = [ - ../modules/home - ../wrappers + home-manager.sharedModules = [ + ../modules/home + ../wrappers - { - programs.home-manager.enable = true; - home.stateVersion = "23.11"; - systemd.user.startServices = "sd-switch"; + { + programs.home-manager.enable = true; + home.stateVersion = "23.11"; + systemd.user.startServices = "sd-switch"; - xdg = { - enable = true; - userDirs = { - enable = true; - createDirectories = true; - }; - }; - } - ]; + xdg = { + enable = true; + userDirs = { + enable = true; + createDirectories = true; + }; + }; + } + ]; } diff --git a/users/seb/@inspiron.nix b/users/seb/@inspiron.nix index dc2e812..03d95ec 100644 --- a/users/seb/@inspiron.nix +++ b/users/seb/@inspiron.nix @@ -1,25 +1,22 @@ +{ pkgs, lib, ... }: { - pkgs, - lib, - ... -}: { - imports = [./default.nix]; + imports = [ ./default.nix ]; - home-manager.users.seb = { - myConfig.de.theme = "light"; + home-manager.users.seb = { + myConfig.de.theme = "light"; - wayland.windowManager.hyprland.settings.monitor = "eDP-1,1920x1080@60,0x0,1"; + wayland.windowManager.hyprland.settings.monitor = "eDP-1,1920x1080@60,0x0,1"; - services.hypridle.settings.listener = [ - { - timeout = 300; - on-timeout = "${lib.getExe pkgs.brightnessctl} -s && ${lib.getExe pkgs.brightnessctl} -e set 10%"; - on-resume = "${lib.getExe pkgs.brightnessctl} -r"; - } - { - timeout = 1200; - on-timeout = "systemctl suspend"; - } - ]; - }; + services.hypridle.settings.listener = [ + { + timeout = 300; + on-timeout = "${lib.getExe pkgs.brightnessctl} -s && ${lib.getExe pkgs.brightnessctl} -e set 10%"; + on-resume = "${lib.getExe pkgs.brightnessctl} -r"; + } + { + timeout = 1200; + on-timeout = "systemctl suspend"; + } + ]; + }; } diff --git a/users/seb/@north.nix b/users/seb/@north.nix index 3dba1b1..34ba15e 100644 --- a/users/seb/@north.nix +++ b/users/seb/@north.nix @@ -1,21 +1,18 @@ +{ pkgs, lib, ... }: { - pkgs, - lib, - ... -}: { - imports = [./default.nix]; + imports = [ ./default.nix ]; - home-manager.users.seb = { - home.packages = [ - pkgs.obs-studio - pkgs.libsForQt5.kdenlive - pkgs.gimp - ]; + home-manager.users.seb = { + home.packages = [ + pkgs.obs-studio + pkgs.libsForQt5.kdenlive + pkgs.gimp + ]; - myConfig.de.theme = "dark"; + myConfig.de.theme = "dark"; - wayland.windowManager.hyprland.settings.monitor = "DP-2,2560x1440@144,0x0,1"; + wayland.windowManager.hyprland.settings.monitor = "DP-2,2560x1440@144,0x0,1"; - services.hypridle.settings.general.before_sleep_cmd = lib.mkForce ""; - }; + services.hypridle.settings.general.before_sleep_cmd = lib.mkForce ""; + }; } diff --git a/users/seb/default.nix b/users/seb/default.nix index 552d171..c586c6d 100644 --- a/users/seb/default.nix +++ b/users/seb/default.nix @@ -1,19 +1,20 @@ -{config, ...}: { - imports = [../common.nix]; +{ config, ... }: +{ + imports = [ ../common.nix ]; - sops.secrets.seb-password.neededForUsers = true; + sops.secrets.seb-password.neededForUsers = true; - users.users.seb = { - isNormalUser = true; - description = "Sebastian Stork"; - hashedPasswordFile = config.sops.secrets.seb-password.path; - extraGroups = [ - "wheel" - "networkmanager" - "libvirtd" - "video" - ]; - }; + users.users.seb = { + isNormalUser = true; + description = "Sebastian Stork"; + hashedPasswordFile = config.sops.secrets.seb-password.path; + extraGroups = [ + "wheel" + "networkmanager" + "libvirtd" + "video" + ]; + }; - home-manager.users.seb = ./home.nix; + home-manager.users.seb = ./home.nix; } diff --git a/users/seb/home.nix b/users/seb/home.nix index 0056f6f..3dca0fe 100644 --- a/users/seb/home.nix +++ b/users/seb/home.nix @@ -1,48 +1,49 @@ { - config, - pkgs, - osConfig, - wrappers, - ... -}: { - xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; + config, + pkgs, + osConfig, + wrappers, + ... +}: +{ + xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; - myConfig = { - de.hyprland.enable = osConfig.myConfig.de.hyprland.enable; + myConfig = { + de.hyprland.enable = osConfig.myConfig.de.hyprland.enable; - shell = { - bash.enable = true; - starship.enable = true; - enhancement.enable = true; - }; - - ssh-client.enable = true; - git.enable = true; - vscode.enable = true; - equalizer.enable = true; - sops.enable = false; - clipboard.enable = true; + shell = { + bash.enable = true; + starship.enable = true; + enhancement.enable = true; }; - home.packages = [ - pkgs.fastfetch + ssh-client.enable = true; + git.enable = true; + vscode.enable = true; + equalizer.enable = true; + sops.enable = false; + clipboard.enable = true; + }; - pkgs.brave - pkgs.cinnamon.nemo-with-extensions - pkgs.jetbrains.idea-community - pkgs.vlc - pkgs.onlyoffice-bin_latest - pkgs.libreoffice - pkgs.hunspell - pkgs.hunspellDicts.de_DE - pkgs.hunspellDicts.en_US + home.packages = [ + pkgs.fastfetch - wrappers.bottom - wrappers.spotify - wrappers.obsidian - wrappers.marktext - wrappers.webcord - (wrappers.kitty {inherit (config.myConfig.de) theme;}) - (wrappers.rofi {inherit (config.myConfig.de) theme;}) - ]; + pkgs.brave + pkgs.cinnamon.nemo-with-extensions + pkgs.jetbrains.idea-community + pkgs.vlc + pkgs.onlyoffice-bin_latest + pkgs.libreoffice + pkgs.hunspell + pkgs.hunspellDicts.de_DE + pkgs.hunspellDicts.en_US + + wrappers.bottom + wrappers.spotify + wrappers.obsidian + wrappers.marktext + wrappers.webcord + (wrappers.kitty { inherit (config.myConfig.de) theme; }) + (wrappers.rofi { inherit (config.myConfig.de) theme; }) + ]; } diff --git a/wrappers/bottom.nix b/wrappers/bottom.nix index 7603d4f..762f12e 100644 --- a/wrappers/bottom.nix +++ b/wrappers/bottom.nix @@ -1,9 +1,5 @@ -{ - assembleWrapper, - pkgs, - ... -}: +{ assembleWrapper, pkgs, ... }: assembleWrapper { - basePackage = pkgs.bottom; - flags = ["--group"]; + basePackage = pkgs.bottom; + flags = [ "--group" ]; } diff --git a/wrappers/default.nix b/wrappers/default.nix index 9c15548..5c4bbee 100644 --- a/wrappers/default.nix +++ b/wrappers/default.nix @@ -1,21 +1,24 @@ { - inputs, - pkgs, - lib, - ... -}: let - assembleWrapper = wrapperConfig: - (inputs.wrapper-manager.lib { - inherit pkgs; - modules = [{wrappers.wrappedPackage = wrapperConfig;}]; - }) - .config - .wrappers - .wrappedPackage - .wrapped; -in { - _module.args.wrappers = lib.pipe (builtins.readDir ./.) [ - (lib.filterAttrs (name: value: name != "default.nix")) - (lib.concatMapAttrs (name: _: {${lib.removeSuffix ".nix" name} = import ./${name} {inherit assembleWrapper pkgs lib;};})) - ]; + inputs, + pkgs, + lib, + ... +}: +let + assembleWrapper = + wrapperConfig: + (inputs.wrapper-manager.lib { + inherit pkgs; + modules = [ { wrappers.wrappedPackage = wrapperConfig; } ]; + }).config.wrappers.wrappedPackage.wrapped; +in +{ + _module.args.wrappers = lib.pipe (builtins.readDir ./.) [ + (lib.filterAttrs (name: value: name != "default.nix")) + (lib.concatMapAttrs ( + name: _: { + ${lib.removeSuffix ".nix" name} = import ./${name} { inherit assembleWrapper pkgs lib; }; + } + )) + ]; } diff --git a/wrappers/hyprlock.nix b/wrappers/hyprlock.nix index 4030284..db1b4f4 100644 --- a/wrappers/hyprlock.nix +++ b/wrappers/hyprlock.nix @@ -1,25 +1,23 @@ -{ - assembleWrapper, - pkgs, - ... -}: +{ assembleWrapper, pkgs, ... }: assembleWrapper { - basePackage = pkgs.hyprlock; + basePackage = pkgs.hyprlock; - flags = let - hyprlock-config = pkgs.writeText "hyprlock-config" '' - background { - monitor = - path = screenshot - blur_size = 4 - blur_passes = 1 - } - input-field { - monitor = - } - ''; - in [ - "--config" - hyprlock-config + flags = + let + hyprlock-config = pkgs.writeText "hyprlock-config" '' + background { + monitor = + path = screenshot + blur_size = 4 + blur_passes = 1 + } + input-field { + monitor = + } + ''; + in + [ + "--config" + hyprlock-config ]; } diff --git a/wrappers/hyprpaper.nix b/wrappers/hyprpaper.nix index 447a825..0c4b62b 100644 --- a/wrappers/hyprpaper.nix +++ b/wrappers/hyprpaper.nix @@ -1,19 +1,17 @@ -{ - assembleWrapper, - pkgs, - ... -}: +{ assembleWrapper, pkgs, ... }: assembleWrapper { - basePackage = pkgs.hyprpaper; + basePackage = pkgs.hyprpaper; - flags = let - hyprpaper-config = pkgs.writeText "hyprpaper-config" '' - preload = ~/Pictures/.wallpaper - wallpaper = , ~/Pictures/.wallpaper - splash = false - ''; - in [ - "--config" - hyprpaper-config + flags = + let + hyprpaper-config = pkgs.writeText "hyprpaper-config" '' + preload = ~/Pictures/.wallpaper + wallpaper = , ~/Pictures/.wallpaper + splash = false + ''; + in + [ + "--config" + hyprpaper-config ]; } diff --git a/wrappers/kitty.nix b/wrappers/kitty.nix index 85df25f..0e66530 100644 --- a/wrappers/kitty.nix +++ b/wrappers/kitty.nix @@ -1,39 +1,45 @@ { - assembleWrapper, - pkgs, - lib, - ... -}: {theme ? "dark"}: + assembleWrapper, + pkgs, + lib, + ... +}: +{ + theme ? "dark", +}: assembleWrapper { - basePackage = pkgs.kitty; + basePackage = pkgs.kitty; - flags = let - toKittyConfig = lib.generators.toKeyValue { - mkKeyValue = key: value: let - value' = ( - if lib.isBool value - then lib.hm.booleans.yesNo value - else toString value - ); - in "${key} ${value'}"; - }; - kitty-config = pkgs.writeText "kitty-config" (toKittyConfig { - font_family = "JetBrainsMono Nerd Font"; - confirm_os_window_close = 0; - background_opacity = "0.85"; - enable_audio_bell = false; - update_check_interval = 0; - cursor_shape = "beam"; - }); - kitty-theme = pkgs.writeText "kitty-theme" "include ${pkgs.kitty-themes}/share/kitty-themes/themes/${{ - dark = "default.conf"; - light = "GitHub_Light.conf"; + flags = + let + toKittyConfig = lib.generators.toKeyValue { + mkKeyValue = + key: value: + let + value' = (if lib.isBool value then lib.hm.booleans.yesNo value else toString value); + in + "${key} ${value'}"; + }; + kitty-config = pkgs.writeText "kitty-config" (toKittyConfig { + font_family = "JetBrainsMono Nerd Font"; + confirm_os_window_close = 0; + background_opacity = "0.85"; + enable_audio_bell = false; + update_check_interval = 0; + cursor_shape = "beam"; + }); + kitty-theme = pkgs.writeText "kitty-theme" "include ${pkgs.kitty-themes}/share/kitty-themes/themes/${ + { + dark = "default.conf"; + light = "GitHub_Light.conf"; } - .${theme}}"; - in [ - "--config" - kitty-config - "--config" - kitty-theme + .${theme} + }"; + in + [ + "--config" + kitty-config + "--config" + kitty-theme ]; } diff --git a/wrappers/marktext.nix b/wrappers/marktext.nix index 88429dd..874c7df 100644 --- a/wrappers/marktext.nix +++ b/wrappers/marktext.nix @@ -1,9 +1,5 @@ -{ - assembleWrapper, - pkgs, - ... -}: +{ assembleWrapper, pkgs, ... }: assembleWrapper { - basePackage = pkgs.marktext; - flags = ["--disable-gpu"]; + basePackage = pkgs.marktext; + flags = [ "--disable-gpu" ]; } diff --git a/wrappers/obsidian.nix b/wrappers/obsidian.nix index 665ff31..7fe36e0 100644 --- a/wrappers/obsidian.nix +++ b/wrappers/obsidian.nix @@ -1,9 +1,5 @@ -{ - assembleWrapper, - pkgs, - ... -}: +{ assembleWrapper, pkgs, ... }: assembleWrapper { - basePackage = pkgs.obsidian; - flags = ["--disable-gpu"]; + basePackage = pkgs.obsidian; + flags = [ "--disable-gpu" ]; } diff --git a/wrappers/rofi/default.nix b/wrappers/rofi/default.nix index feb3731..55cd0de 100644 --- a/wrappers/rofi/default.nix +++ b/wrappers/rofi/default.nix @@ -1,22 +1,30 @@ { - assembleWrapper, - pkgs, - lib, - ... -}: {theme ? "dark"}: + assembleWrapper, + pkgs, + lib, + ... +}: +{ + theme ? "dark", +}: assembleWrapper { - basePackage = pkgs.rofi-wayland; + basePackage = pkgs.rofi-wayland; - flags = let - color-file = - { - dark = ./dark.rasi; - light = ./light.rasi; - } - .${theme}; - rofi-config = pkgs.concatText "rofi-config" [./config.rasi color-file]; - in [ - "-config" - rofi-config + flags = + let + color-file = + { + dark = ./dark.rasi; + light = ./light.rasi; + } + .${theme}; + rofi-config = pkgs.concatText "rofi-config" [ + ./config.rasi + color-file + ]; + in + [ + "-config" + rofi-config ]; } diff --git a/wrappers/spotify.nix b/wrappers/spotify.nix index ed234a2..bbd4084 100644 --- a/wrappers/spotify.nix +++ b/wrappers/spotify.nix @@ -1,9 +1,5 @@ -{ - assembleWrapper, - pkgs, - ... -}: +{ assembleWrapper, pkgs, ... }: assembleWrapper { - basePackage = pkgs.spotify; - flags = ["--disable-gpu"]; + basePackage = pkgs.spotify; + flags = [ "--disable-gpu" ]; } diff --git a/wrappers/waybar.nix b/wrappers/waybar.nix index af6c322..53410a8 100644 --- a/wrappers/waybar.nix +++ b/wrappers/waybar.nix @@ -1,116 +1,114 @@ -{ - assembleWrapper, - pkgs, - ... -}: +{ assembleWrapper, pkgs, ... }: assembleWrapper { - basePackage = pkgs.waybar; + basePackage = pkgs.waybar; - flags = let - waybar-config = (pkgs.formats.json {}).generate "waybar-config" { - layer = "top"; - position = "bottom"; - spacing = 10; + flags = + let + waybar-config = (pkgs.formats.json { }).generate "waybar-config" { + layer = "top"; + position = "bottom"; + spacing = 10; - modules-left = ["clock"]; - modules-center = ["hyprland/workspaces"]; - modules-right = [ - "tray" - "network" - "wireplumber" - "backlight" - "battery" - ]; + modules-left = [ "clock" ]; + modules-center = [ "hyprland/workspaces" ]; + modules-right = [ + "tray" + "network" + "wireplumber" + "backlight" + "battery" + ]; - "hyprland/workspaces" = { - active-only = false; - all-outputs = true; - }; - - clock = { - format = " {:%H.%M}"; - tooltip-format = "{:%d.%m.%Y}"; - }; - - network = { - interval = 10; - format = ""; - - format-wifi = "{icon}"; - format-icons = [ - "󰤟" - "󰤢" - "󰤥" - "󰤨" - ]; - tooltip-format-wifi = "{essid} 󰇚 {bandwidthDownBits} 󰕒 {bandwidthUpBits}"; - - format-ethernet = "󰌗"; - tooltip-format-ethernet = "󰇚 {bandwidthDownBits} 󰕒 {bandwidthUpBits}"; - - format-disconnected = "󰪎"; - tooltip-format-disconnected = "Disconnected"; - }; - - wireplumber = { - format = "{icon} {volume}%"; - format-muted = "󰝟"; - format-icons = [ - "󰕿" - "󰖀" - "󰕾" - ]; - scroll-step = "5"; - }; - - tray = { - icon-size = 20; - spacing = 6; - }; - - backlight = { - device = "amdgpu_bl1"; - format = "{icon} {percent}%"; - format-icons = [ - "󰃞" - "󰃟" - "󰃠" - ]; - }; - - battery = { - states = { - warning = 15; - critical = 5; - }; - format = "{icon} {capacity}%"; - format-icons = [ - "󰂎" - "󰁺" - "󰁻" - "󰁼" - "󰁽" - "󰁾" - "󰁿" - "󰂀" - "󰂁" - "󰂂" - "󰁹" - ]; - }; + "hyprland/workspaces" = { + active-only = false; + all-outputs = true; }; - waybar-style = pkgs.writeText "waybar-style" '' - * { - border: none; - border-radius: 0px; - font-family: "Open Sans, Symbols Nerd Font Mono"; - font-size: 15px; - } - ''; - in [ - "--config" - waybar-config - "--style" - waybar-style + + clock = { + format = " {:%H.%M}"; + tooltip-format = "{:%d.%m.%Y}"; + }; + + network = { + interval = 10; + format = ""; + + format-wifi = "{icon}"; + format-icons = [ + "󰤟" + "󰤢" + "󰤥" + "󰤨" + ]; + tooltip-format-wifi = "{essid} 󰇚 {bandwidthDownBits} 󰕒 {bandwidthUpBits}"; + + format-ethernet = "󰌗"; + tooltip-format-ethernet = "󰇚 {bandwidthDownBits} 󰕒 {bandwidthUpBits}"; + + format-disconnected = "󰪎"; + tooltip-format-disconnected = "Disconnected"; + }; + + wireplumber = { + format = "{icon} {volume}%"; + format-muted = "󰝟"; + format-icons = [ + "󰕿" + "󰖀" + "󰕾" + ]; + scroll-step = "5"; + }; + + tray = { + icon-size = 20; + spacing = 6; + }; + + backlight = { + device = "amdgpu_bl1"; + format = "{icon} {percent}%"; + format-icons = [ + "󰃞" + "󰃟" + "󰃠" + ]; + }; + + battery = { + states = { + warning = 15; + critical = 5; + }; + format = "{icon} {capacity}%"; + format-icons = [ + "󰂎" + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + }; + }; + waybar-style = pkgs.writeText "waybar-style" '' + * { + border: none; + border-radius: 0px; + font-family: "Open Sans, Symbols Nerd Font Mono"; + font-size: 15px; + } + ''; + in + [ + "--config" + waybar-config + "--style" + waybar-style ]; } diff --git a/wrappers/webcord.nix b/wrappers/webcord.nix index 9a76ef9..b903478 100644 --- a/wrappers/webcord.nix +++ b/wrappers/webcord.nix @@ -1,9 +1,5 @@ -{ - assembleWrapper, - pkgs, - ... -}: +{ assembleWrapper, pkgs, ... }: assembleWrapper { - basePackage = pkgs.webcord; - flags = ["--disable-gpu"]; + basePackage = pkgs.webcord; + flags = [ "--disable-gpu" ]; }