diff --git a/flake.nix b/flake.nix index 97e14ae..0ae60ec 100644 --- a/flake.nix +++ b/flake.nix @@ -78,46 +78,51 @@ }; }; - outputs = { - nixpkgs, - nixpkgs-unstable, - nix-cachyos-kernel, - catppuccin, - catppuccin-palette, - home-manager, - plasma-manager, - niri, - noctalia, - spicetify-nix, - nur, - nixvim, - apple-silicon, - openmw, - catppuccin-discord, - catppuccin-btop, - catppuccin-mpv, - ... - }: let - # All systems we want to support for the generic VM - # to run the vm: - # nixos-rebuild build-vm --flake ~/nix#$(nix eval --raw --impure --expr 'builtins.currentSystem') - supportedSystems = ["x86_64-linux" "aarch64-linux"]; - - # Shared config for all package sets - pkgConfig = { - allowUnfree = true; - }; - - mkNixosSystem = { - hostname, - system, - extraModules ? [], - extraSpecialArgs ? {}, + outputs = + { + nixpkgs, + nixpkgs-unstable, + nix-cachyos-kernel, + catppuccin, + catppuccin-palette, + home-manager, + plasma-manager, + niri, + noctalia, + spicetify-nix, + nur, + nixvim, + apple-silicon, + openmw, + catppuccin-discord, + catppuccin-btop, + catppuccin-mpv, + ... }: - nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = - { + let + # All systems we want to support for the generic VM + # to run the vm: + # nixos-rebuild build-vm --flake ~/nix#$(nix eval --raw --impure --expr 'builtins.currentSystem') + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + ]; + + # Shared config for all package sets + pkgConfig = { + allowUnfree = true; + }; + + mkNixosSystem = + { + hostname, + system, + extraModules ? [ ], + extraSpecialArgs ? { }, + }: + nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { inherit catppuccin system; pkgs-unstable = import nixpkgs-unstable { inherit system; @@ -125,8 +130,7 @@ }; } // extraSpecialArgs; - modules = - [ + modules = [ { nixpkgs = { config = pkgConfig; @@ -170,7 +174,7 @@ # Increase file descriptor limit for builds sandbox = "relaxed"; - extra-sandbox-paths = []; + extra-sandbox-paths = [ ]; build-users-group = "nixbld"; }; @@ -241,65 +245,66 @@ } ] ++ extraModules; - }; - - mkHomeConfig = { - user, - hostname, - system, - }: - home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs { - inherit system; - config = pkgConfig; }; - pkgs-unstable = import nixpkgs-unstable { - inherit system; - config = pkgConfig; - }; - home.username = user; - home.homeDirectory = "/home/${user}"; - modules = [ - ./home - ./home/hosts/${hostname}.nix - catppuccin.homeModules.catppuccin - home-manager.homeModules.home-manager - plasma-manager.homeModules.plasma-manager - niri.homeModules.default - noctalia.homeModules.noctalia - nixvim.homeModules.nixvim - ]; - }; - in { - nixosConfigurations = { - peach = mkNixosSystem { - hostname = "peach"; - system = "aarch64-linux"; - extraModules = [ - apple-silicon.nixosModules.default - {nixpkgs.overlays = [apple-silicon.overlays.apple-silicon-overlay];} - ]; - }; - alien = - mkNixosSystem { - hostname = "alien"; - system = "x86_64-linux"; - extraModules = [ - {nixpkgs.overlays = [nix-cachyos-kernel.overlays.default];} + mkHomeConfig = + { + user, + hostname, + system, + }: + home-manager.lib.homeManagerConfiguration { + pkgs = import nixpkgs { + inherit system; + config = pkgConfig; + }; + pkgs-unstable = import nixpkgs-unstable { + inherit system; + config = pkgConfig; + }; + home.username = user; + home.homeDirectory = "/home/${user}"; + modules = [ + ./home + ./home/hosts/${hostname}.nix + catppuccin.homeModules.catppuccin + home-manager.homeModules.home-manager + plasma-manager.homeModules.plasma-manager + niri.homeModules.default + noctalia.homeModules.noctalia + nixvim.homeModules.nixvim ]; - } - // nixpkgs.lib.genAttrs supportedSystems ( - system: + }; + in + { + nixosConfigurations = { + peach = mkNixosSystem { + hostname = "peach"; + system = "aarch64-linux"; + extraModules = [ + apple-silicon.nixosModules.default + { nixpkgs.overlays = [ apple-silicon.overlays.apple-silicon-overlay ]; } + ]; + }; + + alien = + mkNixosSystem { + hostname = "alien"; + system = "x86_64-linux"; + extraModules = [ + { nixpkgs.overlays = [ nix-cachyos-kernel.overlays.default ]; } + ]; + } + // nixpkgs.lib.genAttrs supportedSystems ( + system: mkNixosSystem { hostname = "vm-generic"; inherit system; } - ); - }; + ); + }; - homeConfigurations = - { + homeConfigurations = { peach = mkHomeConfig { user = "sckova"; hostname = "peach"; @@ -313,11 +318,11 @@ } // nixpkgs.lib.genAttrs supportedSystems ( system: - mkHomeConfig { - user = "sckova"; - hostname = "vm-generic"; - inherit system; - } + mkHomeConfig { + user = "sckova"; + hostname = "vm-generic"; + inherit system; + } ); - }; + }; } diff --git a/hardware/alien/default.nix b/hardware/alien/default.nix index 996d2bb..42146eb 100755 --- a/hardware/alien/default.nix +++ b/hardware/alien/default.nix @@ -7,7 +7,8 @@ pkgs, modulesPath, ... -}: { +}: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; @@ -23,7 +24,7 @@ fileSystems."/" = { device = "/dev/disk/by-uuid/d83ec136-df01-4b9e-a523-6d75726fb904"; fsType = "btrfs"; - options = ["subvol=@"]; + options = [ "subvol=@" ]; }; fileSystems."/nix" = { @@ -46,7 +47,7 @@ }; swapDevices = [ - {device = "/dev/disk/by-uuid/056af100-9382-4cbd-b3d5-90df7da69585";} + { device = "/dev/disk/by-uuid/056af100-9382-4cbd-b3d5-90df7da69585"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/hardware/peach/default.nix b/hardware/peach/default.nix index bd17956..5b49211 100644 --- a/hardware/peach/default.nix +++ b/hardware/peach/default.nix @@ -5,12 +5,13 @@ lib, modulesPath, ... -}: { +}: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["sdhci_pci"]; + boot.initrd.availableKernelModules = [ "sdhci_pci" ]; fileSystems."/" = { device = "/dev/disk/by-label/NixOS"; @@ -26,7 +27,7 @@ ]; }; - swapDevices = []; + swapDevices = [ ]; nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; } diff --git a/hardware/vm-generic/default.nix b/hardware/vm-generic/default.nix index 658f680..2273e45 100644 --- a/hardware/vm-generic/default.nix +++ b/hardware/vm-generic/default.nix @@ -5,10 +5,16 @@ lib, system, ... -}: { - imports = []; +}: +{ + imports = [ ]; - boot.initrd.availableKernelModules = ["ehci_pci" "xhci_pci" "usbhid" "sr_mod"]; + boot.initrd.availableKernelModules = [ + "ehci_pci" + "xhci_pci" + "usbhid" + "sr_mod" + ]; fileSystems."/" = { device = "/dev/disk/by-label/nixos"; @@ -18,11 +24,14 @@ fileSystems."/boot" = { device = "/dev/disk/by-label/boot"; fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; swapDevices = [ - {device = "/dev/disk/by-label/swap";} + { device = "/dev/disk/by-label/swap"; } ]; # Set platform from the system argument passed by the flake @@ -30,7 +39,7 @@ # Enable Parallels tools only on aarch64 hardware.parallels.enable = lib.mkIf (system == "aarch64-linux") true; - nixpkgs.config.allowUnfreePredicate = - lib.mkIf (system == "aarch64-linux") - (pkg: builtins.elem (lib.getName pkg) ["prl-tools"]); + nixpkgs.config.allowUnfreePredicate = lib.mkIf (system == "aarch64-linux") ( + pkg: builtins.elem (lib.getName pkg) [ "prl-tools" ] + ); } diff --git a/home/apps/discord.nix b/home/apps/discord.nix index 58bcf9f..a42a41e 100644 --- a/home/apps/discord.nix +++ b/home/apps/discord.nix @@ -2,10 +2,11 @@ config, pkgs, ... -}: let +}: +let catppuccin-discord = "${pkgs.catppuccin-discord}/share/catppuccin-discord/catppuccin-${config.catppuccin.flavor}-${config.catppuccin.accent}.theme.css"; - mergedThemes = pkgs.runCommand "mergedConfig" {} '' + mergedThemes = pkgs.runCommand "mergedConfig" { } '' mkdir -p $out cp ${catppuccin-discord} $out/catppuccin.css ''; @@ -32,8 +33,9 @@ height = 1071; }; }; -in { - home.packages = with pkgs; [vesktop]; +in +{ + home.packages = with pkgs; [ vesktop ]; home.file.".config/vesktop/settings.json" = { text = builtins.toJSON vesktopSettings; diff --git a/home/apps/librewolf.nix b/home/apps/librewolf.nix index c159216..1e7ede3 100644 --- a/home/apps/librewolf.nix +++ b/home/apps/librewolf.nix @@ -4,50 +4,53 @@ pkgs, config, ... -}: { +}: +{ home.file.".librewolf/default/chrome/" = { source = ./librewolf_css; force = true; recursive = true; }; - home.file.".librewolf/default/chrome/colors.css" = let - color = pkgs.catppuccin.rgb.${config.catppuccin.flavor}; - accent = color.${config.catppuccin.accent}; - in { - text = '' - * { - --accent: ${accent}; - --rosewater: ${color.rosewater}; - --flamingo: ${color.flamingo}; - --pink: ${color.pink}; - --mauve: ${color.mauve}; - --red: ${color.red}; - --maroon: ${color.maroon}; - --peach: ${color.peach}; - --yellow: ${color.yellow}; - --green: ${color.green}; - --teal: ${color.teal}; - --sky: ${color.sky}; - --sapphire: ${color.sapphire}; - --blue: ${color.blue}; - --lavender: ${color.lavender}; - --text: ${color.text}; - --subtext1: ${color.subtext1}; - --subtext0: ${color.subtext0}; - --overlay2: ${color.overlay2}; - --overlay1: ${color.overlay1}; - --overlay0: ${color.overlay0}; - --surface2: ${color.surface2}; - --surface1: ${color.surface1}; - --surface0: ${color.surface0}; - --base: ${color.base}; - --mantle: ${color.mantle}; - --crust: ${color.crust}; - } - ''; - force = true; - }; + home.file.".librewolf/default/chrome/colors.css" = + let + color = pkgs.catppuccin.rgb.${config.catppuccin.flavor}; + accent = color.${config.catppuccin.accent}; + in + { + text = '' + * { + --accent: ${accent}; + --rosewater: ${color.rosewater}; + --flamingo: ${color.flamingo}; + --pink: ${color.pink}; + --mauve: ${color.mauve}; + --red: ${color.red}; + --maroon: ${color.maroon}; + --peach: ${color.peach}; + --yellow: ${color.yellow}; + --green: ${color.green}; + --teal: ${color.teal}; + --sky: ${color.sky}; + --sapphire: ${color.sapphire}; + --blue: ${color.blue}; + --lavender: ${color.lavender}; + --text: ${color.text}; + --subtext1: ${color.subtext1}; + --subtext0: ${color.subtext0}; + --overlay2: ${color.overlay2}; + --overlay1: ${color.overlay1}; + --overlay0: ${color.overlay0}; + --surface2: ${color.surface2}; + --surface1: ${color.surface1}; + --surface0: ${color.surface0}; + --base: ${color.base}; + --mantle: ${color.mantle}; + --crust: ${color.crust}; + } + ''; + force = true; + }; home.file.".local/share/firefoxpwa/profiles/01KEYXH9TC4B54J5CTPNE75JP0/prefs.js" = { text = '' @@ -256,59 +259,61 @@ } ]; }; - search = let - nixIcon = "${pkgs.colloid-icon-theme}/share/icons/Colloid/apps/scalable/nix-snowflake.svg"; - googleIcon = "${pkgs.colloid-icon-theme}/share/icons/Colloid/apps/scalable/google.svg"; - in { - force = true; - default = "google"; - order = [ - "google" - ]; - engines = { - nix-packages = { - name = "Nix Packages"; - urls = [ - { - template = "https://search.nixos.org/packages"; - params = [ - { - name = "type"; - value = "packages"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - } - ]; + search = + let + nixIcon = "${pkgs.colloid-icon-theme}/share/icons/Colloid/apps/scalable/nix-snowflake.svg"; + googleIcon = "${pkgs.colloid-icon-theme}/share/icons/Colloid/apps/scalable/google.svg"; + in + { + force = true; + default = "google"; + order = [ + "google" + ]; + engines = { + nix-packages = { + name = "Nix Packages"; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; - icon = nixIcon; - definedAliases = ["@np"]; - }; + icon = nixIcon; + definedAliases = [ "@np" ]; + }; - nixos-wiki = { - name = "NixOS Wiki"; - urls = [{template = "https://wiki.nixos.org/w/index.php?search={searchTerms}";}]; - icon = nixIcon; - definedAliases = ["@nw"]; - }; + nixos-wiki = { + name = "NixOS Wiki"; + urls = [ { template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ]; + icon = nixIcon; + definedAliases = [ "@nw" ]; + }; - google = { - name = "Google"; - urls = [{template = "https://google.com/search?q={searchTerms}";}]; - icon = googleIcon; - definedAliases = ["@go"]; - }; + google = { + name = "Google"; + urls = [ { template = "https://google.com/search?q={searchTerms}"; } ]; + icon = googleIcon; + definedAliases = [ "@go" ]; + }; - wikipedia = { - name = "Wikipedia"; - urls = [{template = "https://en.wikipedia.org/w/index.php?search={searchTerms}";}]; - definedAliases = ["@wi"]; + wikipedia = { + name = "Wikipedia"; + urls = [ { template = "https://en.wikipedia.org/w/index.php?search={searchTerms}"; } ]; + definedAliases = [ "@wi" ]; + }; }; }; - }; }; }; }; diff --git a/home/apps/mpv.nix b/home/apps/mpv.nix index 4618f06..960d73b 100644 --- a/home/apps/mpv.nix +++ b/home/apps/mpv.nix @@ -2,14 +2,16 @@ config, pkgs, ... -}: let - mergedConfig = pkgs.runCommand "mergedConfig" {} '' +}: +let + mergedConfig = pkgs.runCommand "mergedConfig" { } '' mkdir -p $out ${pkgs.gnused}/bin/sed 's/${pkgs.catppuccin.${config.catppuccin.flavor}.base}/#000000/g' \ ${pkgs.catppuccin-mpv-git}/themes/${config.catppuccin.flavor}/${config.catppuccin.accent}.conf \ > $out/mpv.conf ''; -in { +in +{ home.packages = with pkgs; [ (mpv.override { scripts = with mpvScripts; [ diff --git a/home/apps/vencord.nix b/home/apps/vencord.nix index e456a52..9442180 100644 --- a/home/apps/vencord.nix +++ b/home/apps/vencord.nix @@ -2,9 +2,9 @@ autoUpdate = true; autoUpdateNotification = true; useQuickCss = true; - themeLinks = []; + themeLinks = [ ]; eagerPatches = false; - enabledThemes = ["catppuccin.css"]; + enabledThemes = [ "catppuccin.css" ]; enableReactDevtools = false; frameless = false; transparent = true; @@ -330,8 +330,8 @@ ImageFilename.enabled = false; }; uiElements = { - chatBarButtons = {}; - messagePopoverButtons = {}; + chatBarButtons = { }; + messagePopoverButtons = { }; }; notifications = { timeout = 5000; diff --git a/home/apps/vscode.nix b/home/apps/vscode.nix index c9e777a..3d35311 100644 --- a/home/apps/vscode.nix +++ b/home/apps/vscode.nix @@ -3,10 +3,13 @@ pkgs, lib, ... -}: let - capitalize = str: +}: +let + capitalize = + str: (lib.toUpper (builtins.substring 0 1 str)) + (builtins.substring 1 (builtins.stringLength str) str); -in { +in +{ # home.sessionVariables = { # EDITOR = "code"; # }; diff --git a/home/default.nix b/home/default.nix index 1a8e2e0..8a7964e 100755 --- a/home/default.nix +++ b/home/default.nix @@ -4,7 +4,8 @@ pkgs-unstable, lib, ... -}: { +}: +{ options = { catppuccinUpper = { accent = lib.mkOption { @@ -106,30 +107,32 @@ default = pkgs.noto-fonts-color-emoji; }; }; - cursor = let - attrName = config.catppuccin.flavor + config.catppuccinUpper.accent; - in { - name = lib.mkOption { - type = lib.types.str; - readOnly = true; - default = "catppuccin-${config.catppuccin.flavor}-${config.catppuccin.accent}-cursors"; + cursor = + let + attrName = config.catppuccin.flavor + config.catppuccinUpper.accent; + in + { + name = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "catppuccin-${config.catppuccin.flavor}-${config.catppuccin.accent}-cursors"; + }; + package = lib.mkOption { + type = lib.types.package; + readOnly = true; + default = pkgs.catppuccin-cursors.${attrName}; + }; + size = lib.mkOption { + type = lib.types.int; + readOnly = true; + default = 24; + }; + path = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "${pkgs.catppuccin-cursors.${attrName}}/share/icons"; + }; }; - package = lib.mkOption { - type = lib.types.package; - readOnly = true; - default = pkgs.catppuccin-cursors.${attrName}; - }; - size = lib.mkOption { - type = lib.types.int; - readOnly = true; - default = 24; - }; - path = lib.mkOption { - type = lib.types.str; - readOnly = true; - default = "${pkgs.catppuccin-cursors.${attrName}}/share/icons"; - }; - }; isDark = lib.mkOption { type = lib.types.bool; readOnly = true; @@ -190,8 +193,8 @@ # enableWideVine = true; # }) (catppuccin-kde.override { - flavour = [config.catppuccin.flavor]; - accents = [config.catppuccin.accent]; + flavour = [ config.catppuccin.flavor ]; + accents = [ config.catppuccin.accent ]; }) ]) ++ [ diff --git a/home/games/minecraft.nix b/home/games/minecraft.nix index 4653e75..cfc1ffa 100644 --- a/home/games/minecraft.nix +++ b/home/games/minecraft.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ home.packages = with pkgs; [ (prismlauncher.override { jdks = [ diff --git a/home/games/morrowind.nix b/home/games/morrowind.nix index a7df627..663b43d 100644 --- a/home/games/morrowind.nix +++ b/home/games/morrowind.nix @@ -2,6 +2,7 @@ config, pkgs, ... -}: { - home.packages = with pkgs; [openmw]; +}: +{ + home.packages = with pkgs; [ openmw ]; } diff --git a/home/hosts/alien/default.nix b/home/hosts/alien/default.nix index 310972a..ba9f7c9 100644 --- a/home/hosts/alien/default.nix +++ b/home/hosts/alien/default.nix @@ -4,7 +4,8 @@ pkgs-unstable, spicetify-nix, ... -}: { +}: +{ catppuccin = { accent = "blue"; flavor = "mocha"; @@ -18,28 +19,30 @@ pkgs.daggerfall-unity ]; - programs.spicetify = let - spicePkgs = spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; - in { - enable = true; + programs.spicetify = + let + spicePkgs = spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; + in + { + enable = true; - enabledExtensions = with spicePkgs.extensions; [ - adblock - hidePodcasts - shuffle # shuffle+ (special characters are sanitized out of extension names) - ]; - enabledCustomApps = with spicePkgs.apps; [ - newReleases - ncsVisualizer - ]; - enabledSnippets = with spicePkgs.snippets; [ - rotatingCoverart - pointer - ]; + enabledExtensions = with spicePkgs.extensions; [ + adblock + hidePodcasts + shuffle # shuffle+ (special characters are sanitized out of extension names) + ]; + enabledCustomApps = with spicePkgs.apps; [ + newReleases + ncsVisualizer + ]; + enabledSnippets = with spicePkgs.snippets; [ + rotatingCoverart + pointer + ]; - theme = spicePkgs.themes.catppuccin; - colorScheme = config.catppuccin.flavor; - }; + theme = spicePkgs.themes.catppuccin; + colorScheme = config.catppuccin.flavor; + }; programs.plasma = { panels = [ diff --git a/home/hosts/peach/default.nix b/home/hosts/peach/default.nix index 71560a5..95e0ef3 100644 --- a/home/hosts/peach/default.nix +++ b/home/hosts/peach/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ catppuccin = { accent = "lavender"; flavor = "macchiato"; @@ -34,7 +35,7 @@ shortcuts = { # this is really annoying on apple laptops - org_kde_powerdevil.Sleep = []; + org_kde_powerdevil.Sleep = [ ]; }; panels = [ @@ -50,7 +51,7 @@ activeTaskSource = "activeTask"; }; layout = { - elements = ["windowTitle"]; + elements = [ "windowTitle" ]; horizontalAlignment = "right"; showDisabledElements = "deactivated"; verticalAlignment = "center"; diff --git a/home/hosts/vm-generic/default.nix b/home/hosts/vm-generic/default.nix index d50cbc8..ca5ec38 100644 --- a/home/hosts/vm-generic/default.nix +++ b/home/hosts/vm-generic/default.nix @@ -2,13 +2,14 @@ config, pkgs, ... -}: { +}: +{ catppuccin = { accent = "green"; flavor = "mocha"; }; - home.packages = with pkgs; []; + home.packages = with pkgs; [ ]; programs.plasma = { panels = [ @@ -24,7 +25,7 @@ activeTaskSource = "activeTask"; }; layout = { - elements = ["windowTitle"]; + elements = [ "windowTitle" ]; horizontalAlignment = "right"; showDisabledElements = "deactivated"; verticalAlignment = "center"; diff --git a/home/kde/default.nix b/home/kde/default.nix index 2a0d138..5adabe3 100644 --- a/home/kde/default.nix +++ b/home/kde/default.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ programs.ghostwriter = { enable = true; font = { @@ -52,7 +53,7 @@ value = ""; type = "substring"; }; - window-types = ["normal"]; + window-types = [ "normal" ]; }; apply = { opacityactive = { @@ -72,7 +73,7 @@ value = "openmw"; type = "substring"; }; - window-types = ["normal"]; + window-types = [ "normal" ]; }; apply = { noborder = { @@ -100,7 +101,7 @@ value = "Minecraft*"; type = "substring"; }; - window-types = ["normal"]; + window-types = [ "normal" ]; }; apply = { noborder = { @@ -151,7 +152,7 @@ value = "steamwebhelper"; type = "substring"; }; - window-types = ["normal"]; + window-types = [ "normal" ]; }; apply = { desktopfile = { diff --git a/home/services/default.nix b/home/services/default.nix index 4562f44..e4939d9 100644 --- a/home/services/default.nix +++ b/home/services/default.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ imports = [ ./gtk.nix ./qt.nix @@ -35,10 +36,7 @@ gtk = { enable = true; - colorScheme = - if config.userOptions.isDark - then "dark" - else "light"; + colorScheme = if config.userOptions.isDark then "dark" else "light"; # theme = { # package = pkgs.kdePackages.breeze-gtk; @@ -49,10 +47,7 @@ # }; iconTheme = { - name = - if config.userOptions.isDark - then "Colloid-Dark" - else "Colloid-Light"; + name = if config.userOptions.isDark then "Colloid-Dark" else "Colloid-Light"; package = pkgs.colloid-icon-theme; }; diff --git a/home/services/gtk.nix b/home/services/gtk.nix index 7979844..7ae6a72 100644 --- a/home/services/gtk.nix +++ b/home/services/gtk.nix @@ -3,13 +3,18 @@ pkgs, lib, ... -}: let +}: +let colors = pkgs.catppuccin.hex.${config.catppuccin.flavor}; mkColorSection = name: value: "@define-color ${name} ${value};"; generateCSS = '' - /* Catppuccin ${lib.toUpper (builtins.substring 0 1 config.catppuccin.flavor)}${builtins.substring 1 (-1) config.catppuccin.flavor} ${lib.toUpper (builtins.substring 0 1 config.catppuccin.accent)}${builtins.substring 1 (-1) config.catppuccin.accent} Palette */ + /* Catppuccin ${lib.toUpper (builtins.substring 0 1 config.catppuccin.flavor)}${ + builtins.substring 1 (-1) config.catppuccin.flavor + } ${lib.toUpper (builtins.substring 0 1 config.catppuccin.accent)}${ + builtins.substring 1 (-1) config.catppuccin.accent + } Palette */ /* Base colors */ ${mkColorSection "window_bg_color" colors.base} @@ -116,7 +121,8 @@ ${mkColorSection "accent_bg_color" colors.${config.catppuccin.accent}} @define-color accent_fg_color @window_bg_color; ''; -in { +in +{ home.file = { ".config/gtk-4.0/gtk.css" = { text = generateCSS; diff --git a/home/services/qt.nix b/home/services/qt.nix index b5626a2..ba388a5 100644 --- a/home/services/qt.nix +++ b/home/services/qt.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ qt = { enable = true; @@ -32,84 +33,86 @@ general = "\"${config.userOptions.fontSans.name},${toString config.userOptions.fontSans.size}\""; }; - ColorScheme = let - c = pkgs.catppuccin.bare.${config.catppuccin.flavor}; - accent = c.${config.catppuccin.accent}; - mkColors = roles: builtins.concatStringsSep ", " (map (r: "#ff${r}") roles); - in { - active_colors = mkColors [ - c.text - c.surface0 - c.surface1 - c.surface0 - c.base - c.mantle - c.text - c.text - c.text - c.base - c.mantle - c.crust - accent - c.base - accent - c.mauve - c.mantle - "000000" - c.base - c.text - c.overlay0 - accent - ]; - disabled_colors = mkColors [ - c.overlay0 - c.surface0 - c.surface1 - c.surface0 - c.overlay0 - c.mantle - c.overlay0 - c.text - c.overlay0 - c.surface0 - c.surface0 - c.mantle - c.overlay1 - c.text - "0000ff" - "ff00ff" - c.surface0 - "000000" - c.surface0 - c.base - "80000000" - c.overlay1 - ]; - inactive_colors = mkColors [ - c.text - c.surface0 - c.surface1 - c.surface0 - c.base - c.mantle - c.text - c.text - c.text - c.base - c.mantle - c.crust - accent - c.base - accent - c.mauve - c.mantle - "000000" - c.base - c.text - c.overlay0 - accent - ]; - }; + ColorScheme = + let + c = pkgs.catppuccin.bare.${config.catppuccin.flavor}; + accent = c.${config.catppuccin.accent}; + mkColors = roles: builtins.concatStringsSep ", " (map (r: "#ff${r}") roles); + in + { + active_colors = mkColors [ + c.text + c.surface0 + c.surface1 + c.surface0 + c.base + c.mantle + c.text + c.text + c.text + c.base + c.mantle + c.crust + accent + c.base + accent + c.mauve + c.mantle + "000000" + c.base + c.text + c.overlay0 + accent + ]; + disabled_colors = mkColors [ + c.overlay0 + c.surface0 + c.surface1 + c.surface0 + c.overlay0 + c.mantle + c.overlay0 + c.text + c.overlay0 + c.surface0 + c.surface0 + c.mantle + c.overlay1 + c.text + "0000ff" + "ff00ff" + c.surface0 + "000000" + c.surface0 + c.base + "80000000" + c.overlay1 + ]; + inactive_colors = mkColors [ + c.text + c.surface0 + c.surface1 + c.surface0 + c.base + c.mantle + c.text + c.text + c.text + c.base + c.mantle + c.crust + accent + c.base + accent + c.mauve + c.mantle + "000000" + c.base + c.text + c.overlay0 + accent + ]; + }; }; }; } diff --git a/home/services/systemd.nix b/home/services/systemd.nix index 9000d7e..5dd3a94 100644 --- a/home/services/systemd.nix +++ b/home/services/systemd.nix @@ -3,7 +3,8 @@ pkgs, lib, ... -}: { +}: +{ systemd.user.sessionVariables = { XCURSOR_THEME = config.userOptions.cursor.name; XCURSOR_SIZE = toString config.userOptions.cursor.size; @@ -25,8 +26,8 @@ systemd.user.services.synology-mount = { Unit = { Description = "Mount Synology NAS with Rclone and Home Manager."; - After = ["tailscaled.service"]; - Wants = ["tailscaled.service"]; + After = [ "tailscaled.service" ]; + Wants = [ "tailscaled.service" ]; }; Service = { @@ -61,7 +62,7 @@ }; Install = { - WantedBy = ["default.target"]; + WantedBy = [ "default.target" ]; }; }; diff --git a/home/terminal/btop.nix b/home/terminal/btop.nix index 52f8e03..0f0d406 100644 --- a/home/terminal/btop.nix +++ b/home/terminal/btop.nix @@ -2,15 +2,17 @@ config, pkgs, ... -}: let - mergedConfig = pkgs.runCommand "mergedConfig" {} '' +}: +let + mergedConfig = pkgs.runCommand "mergedConfig" { } '' mkdir -p $out/themes ${pkgs.gnused}/bin/sed 's/blankFlavor/${config.catppuccin.flavor}/g' \ ${./btop.conf} > $out/btop.conf cp ${pkgs.catppuccin-btop-git}/themes/catppuccin_latte.theme $out/themes/ cp ${pkgs.catppuccin-btop-git}/themes/catppuccin_${config.catppuccin.flavor}.theme $out/themes/nixos.theme ''; -in { +in +{ home.file.".config/btop" = { source = mergedConfig; recursive = true; diff --git a/home/terminal/fish.nix b/home/terminal/fish.nix index a8d1944..4f32021 100644 --- a/home/terminal/fish.nix +++ b/home/terminal/fish.nix @@ -3,7 +3,8 @@ pkgs, lib, ... -}: { +}: +{ home.packages = with pkgs; [ kdePackages.qttools eza @@ -44,14 +45,15 @@ programs.man.generateCaches = false; home.file.".config/fish/colors.fish" = { - text = let - flavor = config.catppuccin.flavor; - palette = pkgs.catppuccin.bare.${flavor}; - accent = config.catppuccin.accent; - in + text = + let + flavor = config.catppuccin.flavor; + palette = pkgs.catppuccin.bare.${flavor}; + accent = config.catppuccin.accent; + in lib.concatStringsSep "\n" ( (lib.mapAttrsToList (name: value: "set -g color_${name} ${value}") palette) - ++ ["set -g color_accent ${palette.${accent}}"] + ++ [ "set -g color_accent ${palette.${accent}}" ] ); force = true; }; diff --git a/home/terminal/kitty.nix b/home/terminal/kitty.nix index 4fd13de..6d7fd44 100644 --- a/home/terminal/kitty.nix +++ b/home/terminal/kitty.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: let +}: +let colors = pkgs.catppuccin.hex.${config.catppuccin.flavor}; accent = colors.${config.catppuccin.accent}; @@ -87,7 +88,8 @@ text = kitty-colors; destination = "/kitty-colors.conf"; }; -in { +in +{ home.file.".config/kitty/themes" = { source = kitty-colors-file; recursive = true; @@ -109,7 +111,7 @@ in { }; shellIntegration.enableFishIntegration = true; keybindings = { - "ctrl+k" = ''combine : clear_terminal scroll active : clear_terminal scrollback active''; + "ctrl+k" = "combine : clear_terminal scroll active : clear_terminal scrollback active"; }; settings = { include = "/home/${config.userOptions.username}/.config/kitty/themes/kitty-colors.conf"; diff --git a/home/terminal/neovim.nix b/home/terminal/neovim.nix index 0022906..901b1d4 100644 --- a/home/terminal/neovim.nix +++ b/home/terminal/neovim.nix @@ -2,7 +2,8 @@ pkgs, config, ... -}: { +}: +{ home.sessionVariables = { EDITOR = "nvim"; }; @@ -11,7 +12,7 @@ kdePackages.qtdeclarative prettier prettierd - alejandra + nixfmt stylua black clang-tools @@ -106,18 +107,18 @@ ]; }; sources = [ - {name = "git";} - {name = "nvim_lsp";} - {name = "path";} - {name = "buffer";} - {name = "fish";} - {name = "emoji";} + { name = "git"; } + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } + { name = "fish"; } + { name = "emoji"; } { name = "buffer"; # text within current buffer option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; keywordLength = 3; } - {name = "copilot";} + { name = "copilot"; } { name = "path"; # file system paths keywordLength = 3; @@ -133,16 +134,16 @@ enable = true; settings = { formatters_by_ft = { - lua = ["stylua"]; - python = ["black"]; - nix = ["alejandra"]; - javascript = ["prettier"]; - css = ["prettier"]; - json = ["prettier"]; - jsonc = ["prettier"]; - fish = ["fish_indent"]; - c = ["clang-format"]; - cpp = ["clang-format"]; + lua = [ "stylua" ]; + python = [ "black" ]; + nix = [ "nixfmt" ]; + javascript = [ "prettier" ]; + css = [ "prettier" ]; + json = [ "prettier" ]; + jsonc = [ "prettier" ]; + fish = [ "fish_indent" ]; + c = [ "clang-format" ]; + cpp = [ "clang-format" ]; }; # Default formatting options @@ -185,108 +186,110 @@ nixd.enable = true; }; }; - lualine = let - palette = pkgs.catppuccin.${config.catppuccin.flavor}; - in { - enable = true; - settings = { - options = { - theme = { - normal = { - a = { - fg = palette.base; - bg = palette.mauve; + lualine = + let + palette = pkgs.catppuccin.${config.catppuccin.flavor}; + in + { + enable = true; + settings = { + options = { + theme = { + normal = { + a = { + fg = palette.base; + bg = palette.mauve; + }; + b = { + fg = palette.text; + bg = palette.surface0; + }; + c = { + fg = palette.text; + }; }; - b = { - fg = palette.text; - bg = palette.surface0; + insert = { + a = { + fg = palette.base; + bg = palette.blue; + }; }; - c = { - fg = palette.text; + visual = { + a = { + fg = palette.base; + bg = palette.teal; + }; + }; + replace = { + a = { + fg = palette.base; + bg = palette.red; + }; + }; + inactive = { + a = { + fg = palette.text; + bg = palette.base; + }; + b = { + fg = palette.text; + bg = palette.base; + }; + c = { + fg = palette.text; + }; }; }; - insert = { - a = { - fg = palette.base; - bg = palette.blue; - }; - }; - visual = { - a = { - fg = palette.base; - bg = palette.teal; - }; - }; - replace = { - a = { - fg = palette.base; - bg = palette.red; - }; - }; - inactive = { - a = { - fg = palette.text; - bg = palette.base; - }; - b = { - fg = palette.text; - bg = palette.base; - }; - c = { - fg = palette.text; - }; + component_separators = ""; + section_separators = { + left = ""; + right = ""; }; }; - component_separators = ""; - section_separators = { - left = ""; - right = ""; + + sections = { + lualine_a = [ + { + __unkeyed-1 = "mode"; + separator = { + left = " "; + }; + right_padding = 2; + } + ]; + lualine_b = [ + "filename" + "branch" + ]; + lualine_c = [ "%=" ]; + lualine_x = [ ]; + lualine_y = [ + "filetype" + "progress" + ]; + lualine_z = [ + { + __unkeyed-1 = "location"; + separator = { + right = " "; + }; + left_padding = 2; + } + ]; }; - }; - sections = { - lualine_a = [ - { - __unkeyed-1 = "mode"; - separator = { - left = " "; - }; - right_padding = 2; - } - ]; - lualine_b = [ - "filename" - "branch" - ]; - lualine_c = ["%="]; - lualine_x = []; - lualine_y = [ - "filetype" - "progress" - ]; - lualine_z = [ - { - __unkeyed-1 = "location"; - separator = { - right = " "; - }; - left_padding = 2; - } - ]; + inactive_sections = { + lualine_a = [ "filename" ]; + lualine_b = [ ]; + lualine_c = [ ]; + lualine_x = [ ]; + lualine_y = [ ]; + lualine_z = [ "location" ]; + }; + tabline = { }; + extensions = [ ]; }; - - inactive_sections = { - lualine_a = ["filename"]; - lualine_b = []; - lualine_c = []; - lualine_x = []; - lualine_y = []; - lualine_z = ["location"]; - }; - tabline = {}; - extensions = []; }; - }; }; }; } diff --git a/home/tiling/default.nix b/home/tiling/default.nix index 5a0601c..ae1fc3b 100644 --- a/home/tiling/default.nix +++ b/home/tiling/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ imports = [ ./niri.nix ./noctalia.nix diff --git a/home/tiling/niri.nix b/home/tiling/niri.nix index 1d1d07f..2dc109f 100644 --- a/home/tiling/niri.nix +++ b/home/tiling/niri.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ # https://github.com/sodiboo/niri-flake/blob/main/docs.md programs.niri = { # handle package systemwide @@ -13,7 +14,7 @@ hotkey-overlay.skip-at-startup = true; prefer-no-csd = true; gestures.hot-corners.enable = false; - spawn-at-startup = []; # systemd is based sorry + spawn-at-startup = [ ]; # systemd is based sorry overview = { backdrop-color = pkgs.catppuccin.${config.catppuccin.flavor}.crust; workspace-shadow.enable = false; @@ -88,14 +89,15 @@ theme = config.userOptions.cursor.name; }; layout = { - gaps = 2; + gaps = 4; background-color = pkgs.catppuccin.${config.catppuccin.flavor}.mantle; default-column-width = { proportion = 0.5; }; preset-column-widths = [ - {proportion = 1.0 / 3.0;} - {proportion = 2.0 / 3.0;} + { proportion = 4.0 / 12.0; } + { proportion = 6.0 / 12.0; } + { proportion = 8.0 / 12.0; } ]; border = { enable = true; @@ -137,10 +139,10 @@ } { geometry-corner-radius = { - top-left = 0.0; - top-right = 0.0; - bottom-left = 0.0; - bottom-right = 0.0; + top-left = 16.0; + top-right = 16.0; + bottom-left = 16.0; + bottom-right = 16.0; }; clip-to-geometry = true; } @@ -160,10 +162,10 @@ } ]; binds = { - "Mod+Shift+Slash".action.show-hotkey-overlay = {}; + "Mod+Shift+Slash".action.show-hotkey-overlay = { }; "Mod+T" = { - action.spawn = ["kitty"]; + action.spawn = [ "kitty" ]; hotkey-overlay.title = "Open a Terminal: kitty"; }; "Mod+Space" = { @@ -217,145 +219,187 @@ }; "XF86MonBrightnessUp" = { - action.spawn = ["noctalia-shell" "ipc" "call" "brightness" "increase"]; + action.spawn = [ + "noctalia-shell" + "ipc" + "call" + "brightness" + "increase" + ]; allow-when-locked = true; }; "XF86MonBrightnessDown" = { - action.spawn = ["noctalia-shell" "ipc" "call" "brightness" "decrease"]; + action.spawn = [ + "noctalia-shell" + "ipc" + "call" + "brightness" + "decrease" + ]; allow-when-locked = true; }; "Shift+XF86MonBrightnessUp" = { - action.spawn = ["brightnessctl" "--class=backlight" "set" "+1%"]; + action.spawn = [ + "brightnessctl" + "--class=backlight" + "set" + "+1%" + ]; allow-when-locked = true; }; "Shift+XF86MonBrightnessDown" = { - action.spawn = ["brightnessctl" "--class=backlight" "set" "1%-"]; + action.spawn = [ + "brightnessctl" + "--class=backlight" + "set" + "1%-" + ]; allow-when-locked = true; }; "XF86AudioPrev" = { - action.spawn = ["playerctl" "previous"]; + action.spawn = [ + "playerctl" + "previous" + ]; allow-when-locked = true; }; "XF86AudioPlay" = { - action.spawn = ["playerctl" "play-pause"]; + action.spawn = [ + "playerctl" + "play-pause" + ]; allow-when-locked = true; }; "XF86AudioNext" = { - action.spawn = ["playerctl" "next"]; + action.spawn = [ + "playerctl" + "next" + ]; allow-when-locked = true; }; "XF86Sleep" = { - action.power-off-monitors = {}; + action.power-off-monitors = { }; }; "XF86Search" = { - action.spawn = ["noctalia-shell" "ipc" "call" "launcher" "toggle"]; + action.spawn = [ + "noctalia-shell" + "ipc" + "call" + "launcher" + "toggle" + ]; allow-when-locked = true; }; "XF86LaunchA" = { - action.spawn = ["niri" "msg" "action" "toggle-overview"]; + action.spawn = [ + "niri" + "msg" + "action" + "toggle-overview" + ]; allow-when-locked = true; }; "Mod+O" = { - action.toggle-overview = {}; + action.toggle-overview = { }; repeat = false; }; "Mod+Q" = { - action.close-window = {}; + action.close-window = { }; repeat = false; }; - "Mod+Left".action.focus-column-left = {}; - "Mod+Down".action.focus-window-down = {}; - "Mod+Up".action.focus-window-up = {}; - "Mod+Right".action.focus-column-right = {}; - "Mod+H".action.focus-column-left = {}; - "Mod+J".action.focus-window-down = {}; - "Mod+K".action.focus-window-up = {}; - "Mod+L".action.focus-column-right = {}; + "Mod+Left".action.focus-column-left = { }; + "Mod+Down".action.focus-window-down = { }; + "Mod+Up".action.focus-window-up = { }; + "Mod+Right".action.focus-column-right = { }; + "Mod+H".action.focus-column-left = { }; + "Mod+J".action.focus-window-down = { }; + "Mod+K".action.focus-window-up = { }; + "Mod+L".action.focus-column-right = { }; - "Mod+Ctrl+Left".action.move-column-left = {}; - "Mod+Ctrl+Down".action.move-window-down = {}; - "Mod+Ctrl+Up".action.move-window-up = {}; - "Mod+Ctrl+Right".action.move-column-right = {}; - "Mod+Ctrl+H".action.move-column-left = {}; - "Mod+Ctrl+J".action.move-window-down = {}; - "Mod+Ctrl+K".action.move-window-up = {}; - "Mod+Ctrl+L".action.move-column-right = {}; + "Mod+Ctrl+Left".action.move-column-left = { }; + "Mod+Ctrl+Down".action.move-window-down = { }; + "Mod+Ctrl+Up".action.move-window-up = { }; + "Mod+Ctrl+Right".action.move-column-right = { }; + "Mod+Ctrl+H".action.move-column-left = { }; + "Mod+Ctrl+J".action.move-window-down = { }; + "Mod+Ctrl+K".action.move-window-up = { }; + "Mod+Ctrl+L".action.move-column-right = { }; - "Mod+Home".action.focus-column-first = {}; - "Mod+End".action.focus-column-last = {}; - "Mod+Ctrl+Home".action.move-column-to-first = {}; - "Mod+Ctrl+End".action.move-column-to-last = {}; + "Mod+Home".action.focus-column-first = { }; + "Mod+End".action.focus-column-last = { }; + "Mod+Ctrl+Home".action.move-column-to-first = { }; + "Mod+Ctrl+End".action.move-column-to-last = { }; - "Mod+Shift+Left".action.focus-monitor-left = {}; - "Mod+Shift+Down".action.focus-monitor-down = {}; - "Mod+Shift+Up".action.focus-monitor-up = {}; - "Mod+Shift+Right".action.focus-monitor-right = {}; - "Mod+Shift+H".action.focus-monitor-left = {}; - "Mod+Shift+J".action.focus-monitor-down = {}; - "Mod+Shift+K".action.focus-monitor-up = {}; - "Mod+Shift+L".action.focus-monitor-right = {}; + "Mod+Shift+Left".action.focus-monitor-left = { }; + "Mod+Shift+Down".action.focus-monitor-down = { }; + "Mod+Shift+Up".action.focus-monitor-up = { }; + "Mod+Shift+Right".action.focus-monitor-right = { }; + "Mod+Shift+H".action.focus-monitor-left = { }; + "Mod+Shift+J".action.focus-monitor-down = { }; + "Mod+Shift+K".action.focus-monitor-up = { }; + "Mod+Shift+L".action.focus-monitor-right = { }; - "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = {}; - "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = {}; - "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = {}; - "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = {}; - "Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = {}; - "Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = {}; - "Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = {}; - "Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = {}; + "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = { }; + "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = { }; + "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = { }; + "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = { }; + "Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = { }; + "Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = { }; + "Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = { }; + "Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = { }; - "Mod+Page_Down".action.focus-workspace-down = {}; - "Mod+Page_Up".action.focus-workspace-up = {}; - "Mod+U".action.focus-workspace-down = {}; - "Mod+I".action.focus-workspace-up = {}; - "Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = {}; - "Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = {}; - "Mod+Ctrl+U".action.move-column-to-workspace-down = {}; - "Mod+Ctrl+I".action.move-column-to-workspace-up = {}; + "Mod+Page_Down".action.focus-workspace-down = { }; + "Mod+Page_Up".action.focus-workspace-up = { }; + "Mod+U".action.focus-workspace-down = { }; + "Mod+I".action.focus-workspace-up = { }; + "Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = { }; + "Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = { }; + "Mod+Ctrl+U".action.move-column-to-workspace-down = { }; + "Mod+Ctrl+I".action.move-column-to-workspace-up = { }; - "Mod+Shift+Page_Down".action.move-workspace-down = {}; - "Mod+Shift+Page_Up".action.move-workspace-up = {}; - "Mod+Shift+U".action.move-workspace-down = {}; - "Mod+Shift+I".action.move-workspace-up = {}; + "Mod+Shift+Page_Down".action.move-workspace-down = { }; + "Mod+Shift+Page_Up".action.move-workspace-up = { }; + "Mod+Shift+U".action.move-workspace-down = { }; + "Mod+Shift+I".action.move-workspace-up = { }; "Mod+WheelScrollDown" = { - action.focus-workspace-down = {}; + action.focus-workspace-down = { }; cooldown-ms = 150; }; "Mod+WheelScrollUp" = { - action.focus-workspace-up = {}; + action.focus-workspace-up = { }; cooldown-ms = 150; }; "Mod+Ctrl+WheelScrollDown" = { - action.move-column-to-workspace-down = {}; + action.move-column-to-workspace-down = { }; cooldown-ms = 150; }; "Mod+Ctrl+WheelScrollUp" = { - action.move-column-to-workspace-up = {}; + action.move-column-to-workspace-up = { }; cooldown-ms = 150; }; - "Mod+WheelScrollRight".action.focus-column-right = {}; - "Mod+WheelScrollLeft".action.focus-column-left = {}; - "Mod+Ctrl+WheelScrollRight".action.move-column-right = {}; - "Mod+Ctrl+WheelScrollLeft".action.move-column-left = {}; + "Mod+WheelScrollRight".action.focus-column-right = { }; + "Mod+WheelScrollLeft".action.focus-column-left = { }; + "Mod+Ctrl+WheelScrollRight".action.move-column-right = { }; + "Mod+Ctrl+WheelScrollLeft".action.move-column-left = { }; - "Mod+Shift+WheelScrollDown".action.focus-column-right = {}; - "Mod+Shift+WheelScrollUp".action.focus-column-left = {}; - "Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = {}; - "Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = {}; + "Mod+Shift+WheelScrollDown".action.focus-column-right = { }; + "Mod+Shift+WheelScrollUp".action.focus-column-left = { }; + "Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = { }; + "Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = { }; "Mod+1".action.focus-workspace = 1; "Mod+2".action.focus-workspace = 2; @@ -376,22 +420,22 @@ "Mod+Ctrl+8".action.move-column-to-workspace = 8; "Mod+Ctrl+9".action.move-column-to-workspace = 9; - "Mod+BracketLeft".action.consume-or-expel-window-left = {}; - "Mod+BracketRight".action.consume-or-expel-window-right = {}; + "Mod+BracketLeft".action.consume-or-expel-window-left = { }; + "Mod+BracketRight".action.consume-or-expel-window-right = { }; - "Mod+Comma".action.consume-window-into-column = {}; - "Mod+Period".action.expel-window-from-column = {}; + "Mod+Comma".action.consume-window-into-column = { }; + "Mod+Period".action.expel-window-from-column = { }; - "Mod+R".action.switch-preset-column-width = {}; - "Mod+Shift+R".action.switch-preset-window-height = {}; - "Mod+Ctrl+R".action.reset-window-height = {}; - "Mod+F".action.maximize-column = {}; - "Mod+Shift+F".action.maximize-window-to-edges = {}; - "Mod+Ctrl+Shift+F".action.fullscreen-window = {}; + "Mod+R".action.switch-preset-column-width = { }; + "Mod+Shift+R".action.switch-preset-window-height = { }; + "Mod+Ctrl+R".action.reset-window-height = { }; + "Mod+F".action.maximize-column = { }; + "Mod+Shift+F".action.maximize-window-to-edges = { }; + "Mod+Ctrl+Shift+F".action.fullscreen-window = { }; - "Mod+C".action.center-column = {}; + "Mod+C".action.center-column = { }; - "Mod+Ctrl+C".action.center-visible-columns = {}; + "Mod+Ctrl+C".action.center-visible-columns = { }; "Mod+Minus".action.set-column-width = "-10%"; "Mod+Equal".action.set-column-width = "+10%"; @@ -399,26 +443,26 @@ "Mod+Shift+Minus".action.set-window-height = "-10%"; "Mod+Shift+Equal".action.set-window-height = "+10%"; - "Mod+V".action.toggle-window-floating = {}; - "Mod+Shift+V".action.switch-focus-between-floating-and-tiling = {}; + "Mod+V".action.toggle-window-floating = { }; + "Mod+Shift+V".action.switch-focus-between-floating-and-tiling = { }; - "Mod+W".action.toggle-column-tabbed-display = {}; + "Mod+W".action.toggle-column-tabbed-display = { }; - "Print".action.screenshot = {}; - "Mod+Shift+S".action.screenshot = {}; - "Ctrl+Print".action.screenshot-screen = {}; - "Alt+Print".action.screenshot-window = {}; + "Print".action.screenshot = { }; + "Mod+Shift+S".action.screenshot = { }; + "Ctrl+Print".action.screenshot-screen = { }; + "Alt+Print".action.screenshot-window = { }; "Mod+Escape" = { - action.toggle-keyboard-shortcuts-inhibit = {}; + action.toggle-keyboard-shortcuts-inhibit = { }; allow-inhibiting = false; }; - "Mod+Shift+E".action.quit = {}; - "Ctrl+Alt+Delete".action.quit = {}; + "Mod+Shift+E".action.quit = { }; + "Ctrl+Alt+Delete".action.quit = { }; "Mod+Shift+P" = { - action.power-off-monitors = {}; + action.power-off-monitors = { }; hotkey-overlay.title = "Turn off the display"; }; }; diff --git a/home/tiling/noctalia.nix b/home/tiling/noctalia.nix index e24257c..bcf9167 100644 --- a/home/tiling/noctalia.nix +++ b/home/tiling/noctalia.nix @@ -2,7 +2,8 @@ pkgs, config, ... -}: { +}: +{ programs.noctalia-shell = { enable = true; colors = { @@ -33,7 +34,7 @@ bar = { position = "top"; backgroundOpacity = 1; - monitors = []; + monitors = [ ]; density = "spacious"; showCapsule = true; capsuleOpacity = 1; @@ -198,7 +199,7 @@ enabled = false; overviewEnabled = false; directory = "/home/sckova/.local/share/wallpaper"; - monitorDirectories = []; + monitorDirectories = [ ]; enableMultiMonitorDirectories = false; recursiveSearch = false; setWallpaperOnAllMonitors = true; @@ -217,7 +218,7 @@ enableClipboardHistory = true; enableClipPreview = true; position = "top_left"; - pinnedExecs = []; + pinnedExecs = [ ]; useApp2Unit = false; sortByMostUsed = true; terminalCommand = "kitty -e"; @@ -302,8 +303,8 @@ floatingRatio = 1; size = 1; onlySameOutput = true; - monitors = []; - pinnedApps = []; + monitors = [ ]; + pinnedApps = [ ]; colorizeIcons = false; pinnedStatic = false; inactiveIndicators = false; @@ -346,7 +347,7 @@ }; notifications = { enabled = true; - monitors = []; + monitors = [ ]; location = "top_right"; overlayLayer = true; backgroundOpacity = 1; @@ -372,7 +373,7 @@ 1 2 ]; - monitors = []; + monitors = [ ]; }; audio = { volumeStep = 5; @@ -380,7 +381,7 @@ cavaFrameRate = 30; visualizerType = "linear"; visualizerQuality = "high"; - mprisBlacklist = []; + mprisBlacklist = [ ]; preferredPlayer = ""; externalMixer = "pwvucontrol || pavucontrol"; }; @@ -435,8 +436,8 @@ systemd.user.services.noctalia-shell = { Unit = { - After = ["niri.service"]; - PartOf = ["niri.service"]; + After = [ "niri.service" ]; + PartOf = [ "niri.service" ]; Description = "Noctalia Shell - Wayland desktop shell"; Documentation = "https://docs.noctalia.dev/docs"; }; @@ -454,7 +455,7 @@ }; Install = { - WantedBy = ["niri.service"]; + WantedBy = [ "niri.service" ]; }; }; } diff --git a/home/tiling/wallpaper.nix b/home/tiling/wallpaper.nix index c65d6a2..2655054 100644 --- a/home/tiling/wallpaper.nix +++ b/home/tiling/wallpaper.nix @@ -2,7 +2,8 @@ pkgs, config, ... -}: let +}: +let script = pkgs.writeShellScript "bing-wallpaper" '' set -euo pipefail @@ -62,7 +63,8 @@ echo "Wallpaper downloaded and applied successfully." ''; -in { +in +{ home.packages = with pkgs; [ wpaperd ]; @@ -81,9 +83,9 @@ in { systemd.user.services.wpaperd = { Unit = { Description = "Modern wallpaper daemon for Wayland"; - PartOf = ["niri.service"]; - Requires = ["niri.service"]; - After = ["niri.service"]; + PartOf = [ "niri.service" ]; + Requires = [ "niri.service" ]; + After = [ "niri.service" ]; }; Service = { ExecStart = "${pkgs.wpaperd}/bin/wpaperd"; @@ -128,7 +130,7 @@ in { Persistent = true; }; Install = { - WantedBy = ["timers.target"]; + WantedBy = [ "timers.target" ]; }; }; } diff --git a/packages/overlay.nix b/packages/overlay.nix index 6d48de8..d6357ea 100644 --- a/packages/overlay.nix +++ b/packages/overlay.nix @@ -1,5 +1,5 @@ final: prev: { - spotify-webapp = final.callPackage ./spotify-webapp {}; + spotify-webapp = final.callPackage ./spotify-webapp { }; catppuccin-discord = final.callPackage ./catppuccin-discord { inherit (final) catppuccin-discord-git; diff --git a/packages/spotify-webapp/default.nix b/packages/spotify-webapp/default.nix index 530869c..85304b5 100644 --- a/packages/spotify-webapp/default.nix +++ b/packages/spotify-webapp/default.nix @@ -5,7 +5,8 @@ copyDesktopItems, chromium, writeShellScriptBin, -}: let +}: +let pname = "spotify-webapp"; version = "1.0.0"; @@ -24,48 +25,48 @@ "$@" ''; in - stdenv.mkDerivation { - inherit pname version; +stdenv.mkDerivation { + inherit pname version; - dontUnpack = true; - dontBuild = true; + dontUnpack = true; + dontBuild = true; - nativeBuildInputs = [copyDesktopItems]; + nativeBuildInputs = [ copyDesktopItems ]; - desktopItems = [ - (makeDesktopItem { - name = "spotify-webapp"; - exec = "spotify-webapp %U"; - icon = "spotify"; - desktopName = "Spotify"; - genericName = "Music Streaming"; - comment = "Listen to music on Spotify"; - categories = [ - "Audio" - "Music" - "AudioVideo" - ]; - mimeTypes = ["x-scheme-handler/spotify"]; - startupWMClass = "spotify-webapp"; - startupNotify = true; - }) - ]; + desktopItems = [ + (makeDesktopItem { + name = "spotify-webapp"; + exec = "spotify-webapp %U"; + icon = "spotify"; + desktopName = "Spotify"; + genericName = "Music Streaming"; + comment = "Listen to music on Spotify"; + categories = [ + "Audio" + "Music" + "AudioVideo" + ]; + mimeTypes = [ "x-scheme-handler/spotify" ]; + startupWMClass = "spotify-webapp"; + startupNotify = true; + }) + ]; - installPhase = '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/bin - ln -s ${launchScript}/bin/spotify-webapp $out/bin/spotify-webapp + mkdir -p $out/bin + ln -s ${launchScript}/bin/spotify-webapp $out/bin/spotify-webapp - runHook postInstall - ''; + runHook postInstall + ''; - meta = with lib; { - description = "Spotify web app running in Chromium"; - homepage = "https://open.spotify.com"; - license = licenses.free; - maintainers = []; - platforms = platforms.linux; - mainProgram = "spotify-webapp"; - }; - } + meta = with lib; { + description = "Spotify web app running in Chromium"; + homepage = "https://open.spotify.com"; + license = licenses.free; + maintainers = [ ]; + platforms = platforms.linux; + mainProgram = "spotify-webapp"; + }; +} diff --git a/system/default.nix b/system/default.nix index 36b6f55..167138d 100755 --- a/system/default.nix +++ b/system/default.nix @@ -7,7 +7,8 @@ pkgs, inputs, ... -}: { +}: +{ environment.sessionVariables = { # this makes electron apps work per the wiki NIXOS_OZONE_WL = "1"; diff --git a/system/hosts/alien/default.nix b/system/hosts/alien/default.nix index 2f27f25..69579b1 100644 --- a/system/hosts/alien/default.nix +++ b/system/hosts/alien/default.nix @@ -2,16 +2,17 @@ config, pkgs, ... -}: { +}: +{ environment.systemPackages = with pkgs; [ ddcutil mangohud - (bottles.override {removeWarningPopup = true;}) + (bottles.override { removeWarningPopup = true; }) ]; # enable ddcutil - users.users.sckova.extraGroups = ["i2c"]; - boot.extraModulePackages = [config.boot.kernelPackages.ddcci-driver]; + users.users.sckova.extraGroups = [ "i2c" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ]; boot.kernelModules = [ "i2c-dev" "ddcci_backlight" @@ -92,7 +93,7 @@ # enable hyper-v for guests virtualisation.hypervGuest.enable = true; - boot.blacklistedKernelModules = ["hyperv_fb"]; + boot.blacklistedKernelModules = [ "hyperv_fb" ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" @@ -100,5 +101,5 @@ ]; # i don't even remember what this does or why i added it - systemd.tmpfiles.rules = ["L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware"]; + systemd.tmpfiles.rules = [ "L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware" ]; } diff --git a/system/hosts/peach/default.nix b/system/hosts/peach/default.nix index c3fa403..5fff781 100644 --- a/system/hosts/peach/default.nix +++ b/system/hosts/peach/default.nix @@ -2,8 +2,9 @@ pkgs, config, ... -}: { - boot.kernelParams = ["appledrm.show_notch=1"]; +}: +{ + boot.kernelParams = [ "appledrm.show_notch=1" ]; catppuccin = { accent = "lavender"; @@ -14,7 +15,7 @@ ddcutil ]; - boot.extraModulePackages = [config.boot.kernelPackages.ddcci-driver]; + boot.extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ]; boot.kernelModules = [ "i2c-dev" "ddcci_backlight" diff --git a/system/hosts/vm-generic/default.nix b/system/hosts/vm-generic/default.nix index 314961d..25a4278 100644 --- a/system/hosts/vm-generic/default.nix +++ b/system/hosts/vm-generic/default.nix @@ -1,11 +1,12 @@ -{catppuccin, ...}: { +{ catppuccin, ... }: +{ catppuccin = { accent = "green"; flavor = "mocha"; }; home-manager.users.sckova = { - imports = [catppuccin.homeModules.catppuccin]; + imports = [ catppuccin.homeModules.catppuccin ]; }; services.spice-vdagentd.enable = true; diff --git a/system/shell/fish.nix b/system/shell/fish.nix index ab81676..229692a 100644 --- a/system/shell/fish.nix +++ b/system/shell/fish.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ # This following block taken from the wiki: # https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell programs.bash = { diff --git a/system/tailscale/default.nix b/system/tailscale/default.nix index 3c99319..90e21a8 100644 --- a/system/tailscale/default.nix +++ b/system/tailscale/default.nix @@ -6,7 +6,8 @@ pkgs, lib, ... -}: let +}: +let tailscaleWaitScript = pkgs.writeShellScript "tailscale-wait-for-ip" '' echo "Waiting for tailscale0 to get an IP address..." for i in {1..15}; do @@ -20,7 +21,8 @@ echo "Warning: tailscale0 did not get IP address within 15 seconds" exit 0 ''; -in { +in +{ systemd.services.tailscaled = { serviceConfig = { ExecStartPost = tailscaleWaitScript; diff --git a/system/widevine/default.nix b/system/widevine/default.nix index 23a6898..44ac343 100644 --- a/system/widevine/default.nix +++ b/system/widevine/default.nix @@ -4,13 +4,14 @@ config, lib, ... -}: { +}: +{ nixpkgs.overlays = lib.mkIf (config.nixpkgs.hostPlatform.isLinux) [ (final: prev: { - wrapLibrewolf = browser: opts: let - extraPrefs = - (opts.extraPrefs or "") - + '' + wrapLibrewolf = + browser: opts: + let + extraPrefs = (opts.extraPrefs or "") + '' lockPref("media.gmp-widevinecdm.version", "system-installed"); lockPref("media.gmp-widevinecdm.visible", true); lockPref("media.gmp-widevinecdm.enabled", true); @@ -18,18 +19,16 @@ lockPref("media.eme.enabled", true); lockPref("media.eme.encrypted-media-encryption-scheme.enabled", true); ''; - widevineCdmDir = "${final.widevine-cdm}/share/google/chrome/WidevineCdm"; - widevineOutDir = "$out/gmp-widevinecdm/system-installed"; - in - (prev.wrapLibrewolf browser (opts // {inherit extraPrefs;})).overrideAttrs (previousAttrs: { - buildCommand = - previousAttrs.buildCommand - + '' - mkdir -p "${widevineOutDir}" - ln -s "${widevineCdmDir}/_platform_specific/linux_arm64/libwidevinecdm.so" "${widevineOutDir}/libwidevinecdm.so" - ln -s "${widevineCdmDir}/manifest.json" "${widevineOutDir}/manifest.json" - wrapProgram "$oldExe" --set MOZ_GMP_PATH "${widevineOutDir}" - ''; + widevineCdmDir = "${final.widevine-cdm}/share/google/chrome/WidevineCdm"; + widevineOutDir = "$out/gmp-widevinecdm/system-installed"; + in + (prev.wrapLibrewolf browser (opts // { inherit extraPrefs; })).overrideAttrs (previousAttrs: { + buildCommand = previousAttrs.buildCommand + '' + mkdir -p "${widevineOutDir}" + ln -s "${widevineCdmDir}/_platform_specific/linux_arm64/libwidevinecdm.so" "${widevineOutDir}/libwidevinecdm.so" + ln -s "${widevineCdmDir}/manifest.json" "${widevineOutDir}/manifest.json" + wrapProgram "$oldExe" --set MOZ_GMP_PATH "${widevineOutDir}" + ''; }); }) ];