From d97a20f739998eb8932975d8ed7c514980bb31d4 Mon Sep 17 00:00:00 2001 From: Ivan Bushchik Date: Sat, 6 Jan 2024 18:46:56 +0300 Subject: [PATCH] global: enable NUR + common/dotfiles: rise Firefox Signed-off-by: Ivan Bushchik --- common/base.nix | 4 +- common/dotfiles.nix | 93 ++++++++++++++++++++++++++++++++++++++++++--- flake.nix | 28 +++++++++++--- 3 files changed, 114 insertions(+), 11 deletions(-) diff --git a/common/base.nix b/common/base.nix index 720bff5..b0c203d 100644 --- a/common/base.nix +++ b/common/base.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, nur, ... }: let my = import ../.; @@ -20,6 +20,8 @@ in { }; }; + nixpkgs.overlays = [ nur.overlay ]; + documentation = { doc.enable = false; info.enable = false; diff --git a/common/dotfiles.nix b/common/dotfiles.nix index 56e8153..01a4003 100644 --- a/common/dotfiles.nix +++ b/common/dotfiles.nix @@ -19,9 +19,10 @@ in { options.my.users.ivabus.dotfiles.enable = lib.mkEnableOption "Enable automatic dotfiles installation"; config.my.users.ivabus.dotfiles.enable = lib.mkDefault true; - config.home-manager = lib.mkIf - (config.my.users.ivabus.enable && config.my.users.ivabus.dotfiles.enable) ({ - users.ivabus = { + config.home-manager.users.ivabus = lib.mkIf + (config.my.users.ivabus.enable && config.my.users.ivabus.dotfiles.enable) + (lib.mkMerge [ + { home.file = { ".config" = { source = "${dotfiles}/configs"; @@ -35,6 +36,88 @@ in { ".profile" = { source = "${dotfiles}/configs/.profile"; }; ".zshrc" = { source = "${dotfiles}/configs/.zshrc"; }; }; - }; - }); + } + (lib.mkIf config.my.roles.graphical.enable { + # NixOS only things + programs.firefox = { + enable = true; + profiles.default = { + id = 0; + name = "default"; + isDefault = true; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + stylus + ]; + search = { + force = true; + 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}"; + }]; + icon = + "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@nw" ]; + }; + }; + }; + userChrome = '' + .titlebar-buttonbox-container, .titlebar-spacer, #alltabs-button { + display:none; + }''; + bookmarks = [ + { + name = "NixOS Search"; + url = "https://search.nixos.org"; + } + { + name = "GitHub"; + url = "https://github.com"; + } + { + name = "YouTube"; + url = "https://youtube.com"; + } + { + name = "VK"; + url = "https://vk.com"; + } + { + name = "Mastodon"; + url = "https://social.treehouse.systems"; + } + # I go to school, you know? + { + name = "ЭД"; + url = "https://dnevnik2.petersburgedu.ru"; + } + ]; + settings = { + "intl.accept_languages" = [ "ru-RU" "ru" "en-US" "en" ]; + "font.language.group" = "x-cyrillic"; + }; + }; + }; + }) + ]); } diff --git a/flake.nix b/flake.nix index b4b30bd..29d518d 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,8 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nur.url = "github:nix-community/NUR"; + home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; @@ -12,23 +14,33 @@ apple-silicon-support.url = "github:tpwrules/nixos-apple-silicon"; + nixos-hardware.url = "github:nixos/nixos-hardware"; + rust-overlay.url = "github:oxalica/rust-overlay"; }; - outputs = { self, nixpkgs, home-manager, rust-overlay, apple-silicon-support - , ... }@inputs: { + outputs = { self, nixpkgs, home-manager, rust-overlay, nixos-hardware + , apple-silicon-support, nur, ... }@inputs: { # Stella = Unchartevice 6540 (Ryzen 3 3250U, 16GB RAM) nixosConfigurations."stella" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = inputs; - modules = [ home-manager.nixosModules.home-manager ./machines/stella ]; + modules = [ + nur.nixosModules.nur + home-manager.nixosModules.home-manager + ./machines/stella + ]; }; # Vetus = iMac 27" 2017, i5, 64 GB RAM nixosConfigurations."vetus" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = inputs; - modules = [ home-manager.nixosModules.home-manager ./machines/vetus ]; + modules = [ + nur.nixosModules.nur + home-manager.nixosModules.home-manager + ./machines/vetus + ]; }; # Celerrime = MacBook Air M2 @@ -36,6 +48,7 @@ system = "aarch64-linux"; specialArgs = inputs; modules = [ + nur.nixosModules.nur home-manager.nixosModules.home-manager apple-silicon-support.nixosModules.apple-silicon-support ./machines/celerrime @@ -46,7 +59,11 @@ nixosConfigurations."cursor" = nixpkgs.lib.nixosSystem { system = "aarch64-linux"; specialArgs = inputs; - modules = [ home-manager.nixosModules.home-manager ./machines/cursor ]; + modules = [ + nur.nixosModules.nur + home-manager.nixosModules.home-manager + ./machines/cursor + ]; }; # Raspberry Pi 4B 2GB RAM @@ -55,6 +72,7 @@ specialArgs = inputs; modules = [ "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" + nur.nixosModules.nur home-manager.nixosModules.home-manager ./machines/rubusidaeus ];