From c6495f053aa1ceaf70f49d957bb45c3c7232df9b Mon Sep 17 00:00:00 2001 From: vorboyvo Date: Fri, 5 Jan 2024 13:02:09 -0500 Subject: [PATCH] Working basic config for whole system. Missing firefox extensions (through NUR) and some other basic things --- .gitignore | 1 + configuration.nix | 11 ++++++- flake.nix | 4 ++- home.nix | 74 ++++++++++++++++++++++++++++++++++++++++++---- wayland/sway.nix | 26 ++++++++++++---- wayland/waybar.nix | 4 +-- 6 files changed, 105 insertions(+), 15 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..63f1fef --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.lock diff --git a/configuration.nix b/configuration.nix index 33fcd25..76cc397 100644 --- a/configuration.nix +++ b/configuration.nix @@ -19,6 +19,14 @@ # package = pkgs.nixFlakes; # Ask Katie what that does settings.experimental-features = [ "nix-command" "flakes" ]; }; + + # Enable Nix User Repository + # See https://github.com/nix-community/NUR#installation + # nixpkgs.config.packageOverrides = pkgs: { + # nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { + # inherit pkgs; + # }; + # }; networking.hostName = "oyvoLaptop"; # Define your hostname. networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. @@ -31,7 +39,7 @@ console = { font = "Lat2-Terminus16"; keyMap = "us"; - useXkbConfig = true; # use xkb.options in tty. + # useXkbConfig = true; # use xkb.options in tty. }; # Enable Wayland and Sway this way, for now (UPDATE: just using home manager lol) @@ -41,6 +49,7 @@ enable = true; wlr.enable = true; extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + config.common.default = "*"; }; # Enable graphics. diff --git a/flake.nix b/flake.nix index 4a65113..b81ea3a 100644 --- a/flake.nix +++ b/flake.nix @@ -8,6 +8,8 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + + # nur.url = "github:nix-community/NUR"; }; outputs = { self, nixpkgs, home-manager }: let @@ -17,10 +19,10 @@ nixosConfigurations = { oyvoLaptop = nixpkgs.lib.nixosSystem { inherit system; - modules = [ ./configuration.nix home-manager.nixosModules.home-manager + # nur.nixosModules.nur ]; }; }; diff --git a/home.nix b/home.nix index d0c39b9..a969bab 100644 --- a/home.nix +++ b/home.nix @@ -9,7 +9,10 @@ home.packages = with pkgs; [ texliveFull ] ++ # TeX distribution [ kitty ] ++ # Terminal emulator - [ firefox libreoffice ]; # Basic graphical apps + [ firefox vifm pavucontrol ] ++ # Basic graphical apps + [ signal-desktop prismlauncher ] ++ # Personalized selection of graphical apps + [ bemenu j4-dmenu-desktop ] ++ + [ noto-fonts ]; programs.home-manager.enable = true; @@ -23,7 +26,7 @@ programs.swaylock = { enable = true; settings = { - font-size = 12; + font-size = 11; }; }; services.swayidle = { @@ -33,25 +36,86 @@ ]; }; - programs.waybar = import ./wayland/waybar.nix { inherit config lib pkgs; }; + # programs.waybar = import ./wayland/waybar.nix { inherit config lib pkgs; }; fonts.fontconfig.enable = true; programs.kitty = { enable = true; + font = { + name = "NotoMono"; + size = 11; + }; shellIntegration.enableZshIntegration = true; }; programs.neovim = { enable = true; defaultEditor = true; + viAlias = true; + vimAlias = true; }; programs.zathura = { enable = true; }; - - programs.thunderbird = { + + programs.firefox = { enable = true; + profiles = { + default = { + id = 0; + name = "Main Profile"; + isDefault = true; + search = { + force = true; + default = "DuckDuckGo"; + order = [ "DuckDuckGo" "Google" ]; + engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + "NixOS Wiki" = { + urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; + iconUpdateURL = "https://nixos.wiki/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@nw" ]; + }; + "HomeManager Unofficial Options" = { + urls = [{ + template = "https://mipmip.github.io/home-manager-option-search"; + params = [ + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@hm" ]; + }; + "Google".metaData.alias = "@g"; #builtin engines only support specifying one additional alias + }; + }; + # extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + # ublock-origin + # bitwarden + # multi-account-containers + # ]; + settings = { + "browser.search.region" = "CA"; + "browser.search.isUS" = false; + }; + }; + }; }; + + # programs.thunderbird = { + # enable = true; + # }; } diff --git a/wayland/sway.nix b/wayland/sway.nix index da94a6c..117a8b1 100644 --- a/wayland/sway.nix +++ b/wayland/sway.nix @@ -1,18 +1,32 @@ -{ scripts, config, lib, pkgs, ... }: +{ config, lib, pkgs, ... }: { enable = true; config = { terminal = "kitty"; - bars = [{ - command = "${pkgs.lib.getExe pkgs.waybar}"; - position = "bottom"; - }]; modifier = "Mod4"; + fonts = { + names = [ "Noto Sans" ]; + style = "Regular"; + size = 12.0; + }; input = { "type:touchpad" = { natural_scroll = "enabled"; }; }; window = { border = 2; titlebar = true; }; + menu = "j4-dmenu-desktop --dmenu='bemenu -i'"; + focus.followMouse = false; }; -}; + extraConfig = + '' + output 'eDP-1' scale 1.50 + '' + # Fractional scaling to 1.50 + '' + input type:touchpad { + natural_scroll disabled + dwt disabled + click_method clickfinger + } + ''; # Disable fake scroll direction and disabling touchpad while typing, enable multi finger clicking +} diff --git a/wayland/waybar.nix b/wayland/waybar.nix index 74e28a4..d2515eb 100644 --- a/wayland/waybar.nix +++ b/wayland/waybar.nix @@ -1,5 +1,5 @@ -{ scripts, config, lib, pkgs, ... }: +{ config, lib, pkgs, ... }: { enable = true; -}; +}