From b2a8645da1dc899df2b23bf6f173107580d1db32 Mon Sep 17 00:00:00 2001 From: Emile Clark-Boman Date: Wed, 30 Oct 2024 23:25:57 +1000 Subject: [PATCH] added wofi, spicetify, and fonts --- flake.lock | 40 +++++- flake.nix | 12 +- homes/me/default.nix | 259 ++++++++++++++++++++++++++++++++++++-- homes/me/wofi.nix | 192 ++++++++++++++++++++++++++++ hosts/myputer/default.nix | 26 +++- 5 files changed, 509 insertions(+), 20 deletions(-) create mode 100644 homes/me/wofi.nix diff --git a/flake.lock b/flake.lock index c2e5529..da8b556 100644 --- a/flake.lock +++ b/flake.lock @@ -49,6 +49,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -327,7 +343,29 @@ "inputs": { "home-manager": "home-manager", "hyprland": "hyprland", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "spicetify-nix": "spicetify-nix" + } + }, + "spicetify-nix": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730261837, + "narHash": "sha256-syeN2dLFxJ9bhsG1YnwWpwMgCttBY1S60KUrqLIrmMo=", + "owner": "Gerg-L", + "repo": "spicetify-nix", + "rev": "1c482c8baffd494119b7f61735d35c62a0a22244", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "spicetify-nix", + "type": "github" } }, "systems": { diff --git a/flake.nix b/flake.nix index a33d49a..18ad9ae 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + spicetify-nix = { + url = "github:Gerg-L/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # is this necessary? (aren't I enabling it in `configuration.nix` anyways?) hyprland.url = "github:hyprwm/Hyprland"; }; @@ -26,10 +31,7 @@ pkgs = import nixpkgs { inherit system; - - config = { - allowUnfree = false; - }; + config.allowUnfree = true; }; # this is just something I'm experimenting with @@ -41,7 +43,7 @@ myputer = nixpkgs.lib.nixosSystem { # nix passes these to every single module above specialArgs = { - inherit inputs; + inherit inputs pkgs; }; modules = [ diff --git a/homes/me/default.nix b/homes/me/default.nix index e2c5c58..b943e09 100644 --- a/homes/me/default.nix +++ b/homes/me/default.nix @@ -8,14 +8,32 @@ }: { - #imports = [ - # ./nvim.nix - #]; - nixpkgs = { - config.allowUnfree = false; + config.allowUnfree = true; }; + imports = [ + # inputs.spicetify-nix.homeManagerModules.default + #./wofi.nix + ]; + + /* + programs.spicetify = + let + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; + in + { + enable = true; + enabledExtensions = with spicePkgs.extensions; [ + adblock + hidePodcasts + shuffle # shuffle+ (special characters are sanitized out of extension names) + ]; + theme = spicePkgs.themes.catppuccin; + colorScheme = "mocha"; + }; + */ + home = { username = "me"; homeDirectory = "/home/me"; @@ -25,6 +43,33 @@ # these are both required for home-manager to work home-manager.enable = true; git.enable = true; + + # like `/bin/cat` but with syntax highlighting + # TODO: change the pager (maybe use Github:sachaos/viddy instead) + bat = { + enable = true; + config = { + pager = "less -FR"; + theme = "Dracula"; + }; + }; + + /* + spicetify = + let + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; + in + { + enable = true; + enabledExtensions = with spicePkgs.extensions; [ + adblock + hidePodcasts + #shuffle + ]; + theme = spicePkgs.themes.catppuccin; + colorScheme = "mocha"; + }; + */ # The terminal I use # TODO: this is dependent on nvim being installed @@ -38,30 +83,39 @@ use-fork = true; # fork (dont spawn) Rio + padding-x = 10; + padding-y = [ 15 10 ]; # top, left + + # lines = (accumulated scroll * multiplier / divider) + scroll = { + multiplier = 1.0; + divider = 1.0; + }; + fonts = { - size = 18; - features = []; + size = 15; + features = []; regular = { - family = "IosevkaTerm Nerd Font"; + family = "FiraCode Nerd Font"; # "IosevkaTerm Nerd Font" style = "Normal"; weight = 400; }; bold = { - family = "IosevkaTerm Nerd Font"; + family = "FiraCode Nerd Font"; style = "Normal"; weight = 800; }; italic = { - family = "IosevkaTerm Nerd Font"; + family = "FiraCode Nerd Font"; style = "Italic"; weight = 400; }; bold-italic = { - family = "IosevkaTerm Nerd Font"; + family = "FiraCode Nerd Font"; style = "Italic"; weight = 800; }; @@ -72,8 +126,189 @@ program = "nvim"; args = []; }; + + renderer = { + performance = "High"; + backend = "Automatic"; # Vulkan + }; }; }; + + wofi = { + enable = true; + settings = { + location = "center"; + allow_markup = true; + width = 250; + }; + style = '' + @define-color rosewater #f2d5cf; + @define-color rosewater-rgb rgb(242, 213, 207); + @define-color flamingo #eebebe; + @define-color flamingo-rgb rgb(238, 190, 190); + @define-color pink #f4b8e4; + @define-color pink-rgb rgb(244, 184, 228); + @define-color mauve #ca9ee6; + @define-color mauve-rgb rgb(202, 158, 230); + @define-color red #e78284; + @define-color red-rgb rgb(231, 130, 132); + @define-color maroon #ea999c; + @define-color maroon-rgb rgb(234, 153, 156); + @define-color peach #ef9f76; + @define-color peach-rgb rgb(239, 159, 118); + @define-color yellow #e5c890; + @define-color yellow-rgb rgb(229, 200, 144); + @define-color green #a6d189; + @define-color green-rgb rgb(166, 209, 137); + @define-color teal #81c8be; + @define-color teal-rgb rgb(129, 200, 190); + @define-color sky #99d1db; + @define-color sky-rgb rgb(153, 209, 219); + @define-color sapphire #85c1dc; + @define-color sapphire-rgb rgb(133, 193, 220); + @define-color blue #8caaee; + @define-color blue-rgb rgb(140, 170, 238); + @define-color lavender #babbf1; + @define-color lavender-rgb rgb(186, 187, 241); + @define-color text #c6d0f5; + @define-color text-rgb rgb(198, 208, 245); + @define-color subtext1 #b5bfe2; + @define-color subtext1-rgb rgb(181, 191, 226); + @define-color subtext0 #a5adce; + @define-color subtext0-rgb rgb(165, 173, 206); + @define-color overlay2 #949cbb; + @define-color overlay2-rgb rgb(148, 156, 187); + @define-color overlay1 #838ba7; + @define-color overlay1-rgb rgb(131, 139, 167); + @define-color overlay0 #737994; + @define-color overlay0-rgb rgb(115, 121, 148); + @define-color surface2 #626880; + @define-color surface2-rgb rgb(98, 104, 128); + @define-color surface1 #51576d; + @define-color surface1-rgb rgb(81, 87, 109); + @define-color surface0 #414559; + @define-color surface0-rgb rgb(65, 69, 89); + @define-color base #303446; + @define-color base-rgb rgb(48, 52, 70); + @define-color mantle #292c3c; + @define-color mantle-rgb rgb(41, 44, 60); + @define-color crust #232634; + @define-color crust-rgb rgb(35, 38, 52); + + * { + font-family: 'FiraCode Nerd Font'; + font-size: 16px; + } + + /* Window */ + window { + margin: 0px; + padding: 10px; + border: 0.16em solid @teal; + border-radius: 0.5em; + background-color: @base; + animation: slideIn 0.25s ease-in-out both; + } + + /* Slide In */ + @keyframes slideIn { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } + } + + /* Inner Box */ + #inner-box { + margin: 5px; + padding: 10px; + border: none; + background-color: @base; + /*animation: fadeIn 0.5s ease-in-out both;*/ + } + + /* Fade In */ + @keyframes fadeIn { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } + } + + /* Outer Box */ + #outer-box { + margin: 5px; + padding: 10px; + border: none; + background-color: @base; + } + + /* Scroll */ + #scroll { + margin: 0px; + padding: 10px; + border: none; + background-color: @base; + } + + /* Input */ + #input { + margin: 5px 20px; + padding: 10px; + border: none; + border-radius: 0.25em; + color: @text; + background-color: @base; + animation: fadeIn 0.25s ease-in-out both; + } + + #input image { + border: none; + color: @red; + } + + #input * { + outline: 4px solid @red!important; + } + + /* Text */ + #text { + margin: 5px; + border: none; + color: @text; + animation: fadeIn 0.5s ease-in-out both; + } + + #entry { + background-color: @base; + } + + #entry arrow { + border: none; + color: @teal; + } + + /* Selected Entry */ + #entry:selected { + border: 0.10em solid @teal; + border-radius: 0.25em; + } + + #entry:selected #text { + color: @teal; + } + + #entry:drop(active) { + background-color: @lavender!important; + } + ''; + }; }; # Nicely reload system units when changing configs @@ -81,7 +316,6 @@ home.stateVersion = "24.05"; # don't change this - /* services = { # Change monitor positions # TODO: find a way to make this modular (ie put something different for my laptop) @@ -119,5 +353,4 @@ ]; }; }; - */ } diff --git a/homes/me/wofi.nix b/homes/me/wofi.nix new file mode 100644 index 0000000..8613519 --- /dev/null +++ b/homes/me/wofi.nix @@ -0,0 +1,192 @@ +{ + lib, + config, + pkgs, + ... +}: + +{ + options = { + #enable = lib.mkEnableOption "Enable wofi and my configuration"; + }; + + config = { + programs = { + wofi = { + enable = true; + settings = { + location = "center"; + allow_markup = true; + width = 250; + }; + style = '' + @define-color rosewater #f2d5cf; + @define-color rosewater-rgb rgb(242, 213, 207); + @define-color flamingo #eebebe; + @define-color flamingo-rgb rgb(238, 190, 190); + @define-color pink #f4b8e4; + @define-color pink-rgb rgb(244, 184, 228); + @define-color mauve #ca9ee6; + @define-color mauve-rgb rgb(202, 158, 230); + @define-color red #e78284; + @define-color red-rgb rgb(231, 130, 132); + @define-color maroon #ea999c; + @define-color maroon-rgb rgb(234, 153, 156); + @define-color peach #ef9f76; + @define-color peach-rgb rgb(239, 159, 118); + @define-color yellow #e5c890; + @define-color yellow-rgb rgb(229, 200, 144); + @define-color green #a6d189; + @define-color green-rgb rgb(166, 209, 137); + @define-color teal #81c8be; + @define-color teal-rgb rgb(129, 200, 190); + @define-color sky #99d1db; + @define-color sky-rgb rgb(153, 209, 219); + @define-color sapphire #85c1dc; + @define-color sapphire-rgb rgb(133, 193, 220); + @define-color blue #8caaee; + @define-color blue-rgb rgb(140, 170, 238); + @define-color lavender #babbf1; + @define-color lavender-rgb rgb(186, 187, 241); + @define-color text #c6d0f5; + @define-color text-rgb rgb(198, 208, 245); + @define-color subtext1 #b5bfe2; + @define-color subtext1-rgb rgb(181, 191, 226); + @define-color subtext0 #a5adce; + @define-color subtext0-rgb rgb(165, 173, 206); + @define-color overlay2 #949cbb; + @define-color overlay2-rgb rgb(148, 156, 187); + @define-color overlay1 #838ba7; + @define-color overlay1-rgb rgb(131, 139, 167); + @define-color overlay0 #737994; + @define-color overlay0-rgb rgb(115, 121, 148); + @define-color surface2 #626880; + @define-color surface2-rgb rgb(98, 104, 128); + @define-color surface1 #51576d; + @define-color surface1-rgb rgb(81, 87, 109); + @define-color surface0 #414559; + @define-color surface0-rgb rgb(65, 69, 89); + @define-color base #303446; + @define-color base-rgb rgb(48, 52, 70); + @define-color mantle #292c3c; + @define-color mantle-rgb rgb(41, 44, 60); + @define-color crust #232634; + @define-color crust-rgb rgb(35, 38, 52); + + * { + font-family: 'FiraCode Nerd Font', monospace; + font-size: 16px; + } + + /* Window */ + window { + margin: 0px; + padding: 10px; + border: 0.16em solid @teal; + border-radius: 0.5em; + background-color: @base; + animation: slideIn 0.25s ease-in-out both; + } + + /* Slide In */ + @keyframes slideIn { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } + } + + /* Inner Box */ + #inner-box { + margin: 5px; + padding: 10px; + border: none; + background-color: @base; + /*animation: fadeIn 0.5s ease-in-out both;*/ + } + + /* Fade In */ + @keyframes fadeIn { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } + } + + /* Outer Box */ + #outer-box { + margin: 5px; + padding: 10px; + border: none; + background-color: @base; + } + + /* Scroll */ + #scroll { + margin: 0px; + padding: 10px; + border: none; + background-color: @base; + } + + /* Input */ + #input { + margin: 5px 20px; + padding: 10px; + border: none; + border-radius: 0.25em; + color: @text; + background-color: @base; + animation: fadeIn 0.25s ease-in-out both; + } + + #input image { + border: none; + color: @red; + } + + #input * { + outline: 4px solid @red!important; + } + + /* Text */ + #text { + margin: 5px; + border: none; + color: @text; + animation: fadeIn 0.5s ease-in-out both; + } + + #entry { + background-color: @base; + } + + #entry arrow { + border: none; + color: @teal; + } + + /* Selected Entry */ + #entry:selected { + border: 0.10em solid @teal; + border-radius: 0.25em; + } + + #entry:selected #text { + color: @teal; + } + + #entry:drop(active) { + background-color: @lavender!important; + } + '' + }; + }; + }; +} diff --git a/hosts/myputer/default.nix b/hosts/myputer/default.nix index 18437f3..1e3d8fa 100644 --- a/hosts/myputer/default.nix +++ b/hosts/myputer/default.nix @@ -14,8 +14,26 @@ in imports = [ ./hardware-configuration.nix (import "${home-manager}/nixos") + inputs.spicetify-nix.nixosModules.default ]; + programs.spicetify = + let + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; + in + { + enable = true; + enabledExtensions = with spicePkgs.extensions; [ + adblock + hidePodcasts + shuffle # shuffle+ (special characters are sanitized out of extension names) + ]; + #theme = spicePkgs.themes.catppuccin; + #colorScheme = "mocha"; + }; + + + # Use the systemd-boot EFI boot loader. # TODO: use GRUB2 instead boot.loader.systemd-boot.enable = true; @@ -162,7 +180,13 @@ in fonts = { enableDefaultPackages = true; # no clue what this line does tbh packages = with pkgs; [ - (nerdfonts.override { fonts = [ "Cousine" "Iosevka" "IosevkaTerm" ]; }) + (nerdfonts.override { fonts = [ "Cousine" # its already i guess + "Iosevka" # nah nah + "IosevkaTerm" # big nah + "CascadiaCode" # potential + "FiraCode" # potential + "Hasklig" + "Hack"]; }) # texlive maintains a noto-emoji flake texlivePackages.noto-emoji