From 2fcbfd8d885fc02bcd8c3d792037695efc04cb91 Mon Sep 17 00:00:00 2001 From: Zhongheng Liu Date: Mon, 12 Aug 2024 09:27:59 +0800 Subject: [PATCH] refactor: move common variables referenced into common/variables.nix In the future, should have independent variable files for home-manager and nixos-specific, in their respective directories. --- common/variables.nix | 27 +++++++++++++++++++++++++++ home-manager/stvnliu/home.nix | 2 +- nixos/variables.nix | 19 ------------------- 3 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 common/variables.nix delete mode 100644 nixos/variables.nix diff --git a/common/variables.nix b/common/variables.nix new file mode 100644 index 0000000..b3a062b --- /dev/null +++ b/common/variables.nix @@ -0,0 +1,27 @@ +{ + tmconfig, + pkgs, + lib, + ... +}: { + # Type definitions for nix variables used in this configuration + options = with lib; + with types; { + myUserName = mkOption {type = str;}; + myHostName = mkOption {type = str;}; + myWallPaperPathString = mkOption {type = str;}; + myDisplayName = mkOption {type = str;}; + myEmail = mkOption {type = str;}; + displayScale = mkOption {type = int;}; + }; + + # Default values for this configuration + config = rec { + myUserName = "stvnliu"; + myHostName = "homelab-nix"; + displayScale = 2; + myWallPaperPathString = "/home/${myUserName}/wallpaper.png"; + myDisplayName = "Zhongheng Liu"; + myEmail = "z.liu@outlook.com.gr"; + }; +} diff --git a/home-manager/stvnliu/home.nix b/home-manager/stvnliu/home.nix index 594f74e..79a91dc 100644 --- a/home-manager/stvnliu/home.nix +++ b/home-manager/stvnliu/home.nix @@ -16,7 +16,7 @@ #./swaywm.nix ./hypr ./shells - ./variables.nix + ../../common/variables.nix ./mako.nix ./wechat ./editors.nix diff --git a/nixos/variables.nix b/nixos/variables.nix deleted file mode 100644 index fdf47b4..0000000 --- a/nixos/variables.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - # Type definitions for nix variables used in this configuration - options = with lib; - with types; { - myUserName = mkOption {type = str;}; - myHostName = mkOption {type = str;}; - }; - - # Default values for this configuration - config = { - myUserName = "stvnliu"; - myHostName = "homelab-nix"; - }; -}