From b164cad6e2ae586604c16bf76c2171bcab0b9a6b Mon Sep 17 00:00:00 2001 From: Artur Manuel Date: Tue, 26 Nov 2024 13:51:16 +0000 Subject: [PATCH] feat: MIT license and some changes --- LICENSE | 19 +++++++++ computers/python/configs/river/init | 4 +- computers/python/default.nix | 2 +- computers/python/fonts.nix | 23 ++++++----- ...ardware-configuration.nix => hardware.nix} | 0 computers/python/theme.nix | 1 - computers/shared/fonts.nix | 41 +++++++++++++++---- lib/default.nix | 1 + 8 files changed, 70 insertions(+), 21 deletions(-) create mode 100644 LICENSE rename computers/python/{hardware-configuration.nix => hardware.nix} (100%) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a7172da --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2024 Artur Manuel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/computers/python/configs/river/init b/computers/python/configs/river/init index 316e281..a340f10 100755 --- a/computers/python/configs/river/init +++ b/computers/python/configs/river/init @@ -6,8 +6,8 @@ riverctl spawn "swaybg -i ~/.local/share/wallpapers/02.jpg -m fill" riverctl spawn "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" riverctl spawn "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river" -riverctl map normal Super T spawn alacritty -riverctl map normal Super R spawn fuzzel +riverctl map normal Super+Shift Return spawn alacritty +riverctl map normal Super P spawn fuzzel riverctl map normal Super Q close riverctl map normal Super+Shift E exit riverctl map normal Super+Shift C spawn "~/.config/river/init" diff --git a/computers/python/default.nix b/computers/python/default.nix index b9307ad..ee7f983 100644 --- a/computers/python/default.nix +++ b/computers/python/default.nix @@ -1,6 +1,6 @@ {pkgs, ...}: { imports = [ - ./hardware-configuration.nix + ./hardware.nix ./disks.nix ./theme.nix ./apps.nix diff --git a/computers/python/fonts.nix b/computers/python/fonts.nix index e6fc4a2..e9619bf 100644 --- a/computers/python/fonts.nix +++ b/computers/python/fonts.nix @@ -1,17 +1,20 @@ {pkgs, ...}: { alqueva.fonts = { names = { - sansSerif = ["Iosevka Comfy Wide Fixed"]; - monospace = ["Iosevka Comfy Wide Fixed"]; - serif = ["Iosevka Comfy Wide Motion Fixed"]; + sansSerif = ["Source Sans Pro"]; + monospace = ["Source Code Pro"]; + serif = ["Source Serif Pro"]; + emoji = ["OpenMoji Color"]; }; - packages = builtins.attrValues { - inherit - (pkgs.iosevka-comfy) - comfy-wide-fixed - comfy-wide-motion-fixed - ; - nerdfonts = pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}; + packages = { + sansSerif = [pkgs.source-sans-pro]; + monospace = [pkgs.source-code-pro]; + serif = [pkgs.source-serif-pro]; + emoji = [pkgs.openmoji-color]; + extra = [ + pkgs.source-han-sans + (pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) + ]; }; enable = true; }; diff --git a/computers/python/hardware-configuration.nix b/computers/python/hardware.nix similarity index 100% rename from computers/python/hardware-configuration.nix rename to computers/python/hardware.nix diff --git a/computers/python/theme.nix b/computers/python/theme.nix index 1c30a39..cac66e1 100644 --- a/computers/python/theme.nix +++ b/computers/python/theme.nix @@ -1,5 +1,4 @@ { - inputs, pkgs, lib, ... diff --git a/computers/shared/fonts.nix b/computers/shared/fonts.nix index 32c607d..d0bf662 100644 --- a/computers/shared/fonts.nix +++ b/computers/shared/fonts.nix @@ -10,16 +10,43 @@ mkOption { type = types.listOf types.str; inherit default; - description = "Which ${letterform} font packages you want to use."; + description = "The default fonts for ${letterform}."; + }; + mkPackagesOption = default: letterform: + mkOption { + type = types.listOf types.package; + inherit default; + description = "The packages you want to use for your ${letterform} fonts."; }; in { options.alqueva.fonts = { enable = lib.mkEnableOption "" // {description = "Whether you want to use this fonts module.";}; - packages = mkOption { - type = types.listOf types.package; - default = [pkgs.roboto pkgs.roboto-serif pkgs.roboto-mono pkgs.noto-fonts-color-emoji]; - description = "Packages related to fonts to be installed."; - }; + packages = + { + extra = mkOption { + type = types.listOf types.package; + default = []; + description = "Extra font packages you want installed."; + }; + } + // builtins.mapAttrs (_n: v: mkPackagesOption v.default v.letterform) { + sansSerif = { + default = [pkgs.roboto]; + letterform = "sans-serif"; + }; + monospace = { + default = [pkgs.roboto-mono]; + letterform = "monospace"; + }; + serif = { + default = [pkgs.roboto-serif]; + letterform = "serif"; + }; + emoji = { + default = [pkgs.noto-fonts-color-emoji]; + letterform = "emoji"; + }; + }; names = builtins.mapAttrs (_n: v: mkStringsOption v.default v.letterform) { sansSerif = { default = ["Roboto"]; @@ -41,7 +68,7 @@ in { }; config = lib.mkIf cfg.enable { fonts = { - inherit (cfg) packages; + packages = builtins.concatLists (builtins.attrValues cfg.packages); fontconfig = { defaultFonts = { inherit (cfg.names) sansSerif monospace serif emoji; diff --git a/lib/default.nix b/lib/default.nix index 281dba4..1ea2da7 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -25,6 +25,7 @@ dates = "weekly"; }; }; + nixpkgs.config.allowUnfree = true; environment.shellAliases = { rebs = "nixos-rebuild --use-remote-sudo switch --flake .#${host}"; rebt = "nixos-rebuild --use-remote-sudo test --flake .#${host}";