From c81dc44422ce1b564a669133188fd4dd32ec84de Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sun, 25 Feb 2024 19:51:42 +0300 Subject: [PATCH] Nix : Use different way to include applefont. --- .../{apple_font => applefont}/flake.nix | 11 +++------- .config/linux/system/flake.nix | 21 ++++++++++++++----- .config/linux/system/module/common/Font.nix | 4 ++-- 3 files changed, 21 insertions(+), 15 deletions(-) rename .config/linux/system/derivation/{apple_font => applefont}/flake.nix (90%) diff --git a/.config/linux/system/derivation/apple_font/flake.nix b/.config/linux/system/derivation/applefont/flake.nix similarity index 90% rename from .config/linux/system/derivation/apple_font/flake.nix rename to .config/linux/system/derivation/applefont/flake.nix index 3b3eccf..89c8fdd 100644 --- a/.config/linux/system/derivation/apple_font/flake.nix +++ b/.config/linux/system/derivation/applefont/flake.nix @@ -1,15 +1,10 @@ { description = "Apple fonts."; - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - }; - - outputs = { self, nixpkgs } @inputs: + outputs = { nixpkgs, system } @inputs: let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - lib = nixpkgs.lib; + pkgs = nixpkgs.legacyPackages.${system}; + lib = nixpkgs.lib; in { packages.${system}.default = pkgs.stdenv.mkDerivation rec { pname = "applefonts"; diff --git a/.config/linux/system/flake.nix b/.config/linux/system/flake.nix index ab78ec1..6e2c570 100644 --- a/.config/linux/system/flake.nix +++ b/.config/linux/system/flake.nix @@ -6,7 +6,6 @@ url = "git+https://git.voronind.com/voronind/linux.git"; flake = false; }; - applefonts.url = "git+file:.?dir=./.config/linux/system/derivation/apple_font"; # Nvim plugins. nvimAlign = { @@ -87,7 +86,7 @@ }; }; - outputs = { self, nixpkgs, dotfiles, applefonts, ... } @inputs: rec { + outputs = { self, nixpkgs, dotfiles, ... } @inputs: rec { # Constant values. nixosModules.const = { hashedPassword = "$y$j9T$oqCB16i5E2t1t/HAWaFd5.$tTaHtAcifXaDVpTcRv.yH2/eWKxKE9xM8KcqXHfHrD7"; # Use `mkpasswd`. @@ -121,6 +120,14 @@ ./module/common/Wallpaper.nix ]; + # Apple fonts flake. + # applefont-flake = import ./derivation/applefont/flake.nix; + # applefont-outputs = applefont-flake.outputs { + # inherit nixpkgs; + # inherit system; + # }; + # applefont = applefont-outputs.packages.system.default; + # Function to create a host. mkHost = { system, hostname, modules }: nixpkgs.lib.nixosSystem { inherit system; @@ -132,9 +139,13 @@ inputs.self.nixosModules.common ] ++ modules; - specialArgs.const = self.nixosModules.const; - specialArgs.flake = self; - specialArgs.inputs = inputs; + specialArgs.const = self.nixosModules.const; + specialArgs.flake = self; + specialArgs.inputs = inputs; + specialArgs.applefont = ((import ./derivation/applefont/flake.nix).outputs { + inherit nixpkgs; + inherit system; + }).packages.${system}.default; }; # List of all hosts bellow. diff --git a/.config/linux/system/module/common/Font.nix b/.config/linux/system/module/common/Font.nix index e8ede32..f09088b 100644 --- a/.config/linux/system/module/common/Font.nix +++ b/.config/linux/system/module/common/Font.nix @@ -1,6 +1,6 @@ -{ pkgs, inputs, ... }: { +{ pkgs, specialArgs, ... }: rec { fonts.packages = with pkgs; [ - inputs.applefonts.packages.${pkgs.system}.default + specialArgs.applefont (nerdfonts.override { fonts = [ "Terminus" ]; }) ]; }