diff --git a/config/projects.nix b/config/projects.nix index 1d9235b..54f786d 100644 --- a/config/projects.nix +++ b/config/projects.nix @@ -1,3 +1,8 @@ +{ homeDirectory }: + +let + homePath = path: "${homeDirectory}/${path}"; +in { projects = { nix-config = { @@ -6,7 +11,7 @@ windows = [ { name = "nix"; - path = "/Users/yanlin/.config/nix"; + path = "${homeDirectory}/.config/nix"; ai = true; git = true; shell = true; @@ -20,7 +25,7 @@ windows = [ { name = "homelab"; - path = "/Users/yanlin/Documents/Projects/Homelab-deploy"; + path = homePath "Documents/Projects/Homelab-deploy"; ai = true; git = true; shell = true; @@ -34,7 +39,7 @@ windows = [ { name = "note"; - path = "/Users/yanlin/Obsidian/Personal"; + path = homePath "Obsidian/Personal"; ai = true; git = true; shell = false; @@ -48,7 +53,7 @@ windows = [ { name = "pro"; - path = "/Users/yanlin/Documents/Programs"; + path = homePath "Documents/Programs"; ai = true; git = true; shell = false; @@ -62,14 +67,14 @@ windows = [ { name = "code"; - path = "/Users/yanlin/Documents/Projects/personal-blog"; + path = homePath "Documents/Projects/personal-blog"; ai = true; git = true; shell = true; } { name = "content"; - path = "/Users/yanlin/Documents/Projects/personal-blog/content"; + path = homePath "Documents/Projects/personal-blog/content"; ai = true; git = false; } @@ -82,7 +87,7 @@ windows = [ { name = "homepage"; - path = "/Users/yanlin/Documents/Projects/Homepage/"; + path = homePath "Documents/Projects/Homepage"; ai = true; git = true; shell = true; @@ -96,14 +101,14 @@ windows = [ { name = "code"; - path = "/Users/yanlin/Documents/Projects/Material Design Shortcut/MDShortcut-code"; + path = homePath "Documents/Projects/Material Design Shortcut/MDShortcut-code"; ai = true; git = true; shell = true; } { name = "paper"; - path = "/Users/yanlin/Documents/Projects/Material Design Shortcut/MDShortcut-paper"; + path = homePath "Documents/Projects/Material Design Shortcut/MDShortcut-paper"; ai = true; git = true; shell = false; @@ -117,14 +122,14 @@ windows = [ { name = "code"; - path = "/Users/yanlin/Documents/Projects/AI systems & infrastructure/Codes"; + path = homePath "Documents/Projects/AI systems & infrastructure/Codes"; ai = true; git = true; shell = true; } { name = "slides"; - path = "/Users/yanlin/Documents/Projects/AI systems & infrastructure/Slides"; + path = homePath "Documents/Projects/AI systems & infrastructure/Slides"; ai = true; git = true; shell = false; @@ -138,7 +143,7 @@ windows = [ { name = "group"; - path = "/Users/yanlin/Documents/Projects/DAKI3 Semester Project Group"; + path = homePath "Documents/Projects/DAKI3 Semester Project Group"; ai = true; git = true; shell = false; @@ -152,7 +157,7 @@ windows = [ { name = "slides"; - path = "/Users/yanlin/Documents/Projects/Material Project Group Meeting"; + path = homePath "Documents/Projects/Material Project Group Meeting"; ai = true; git = true; shell = false; @@ -166,14 +171,14 @@ windows = [ { name = "code"; - path = "/Users/yanlin/Documents/Projects/Inverse Design of Disordered Materials/DiffDisMatter-dev"; + path = homePath "Documents/Projects/Inverse Design of Disordered Materials/DiffDisMatter-dev"; ai = true; git = true; shell = true; } { name = "paper"; - path = "/Users/yanlin/Documents/Projects/Inverse Design of Disordered Materials/mc-denoising-paper"; + path = homePath "Documents/Projects/Inverse Design of Disordered Materials/mc-denoising-paper"; ai = true; git = true; shell = false; diff --git a/modules/firefox.nix b/modules/firefox.nix index 8ba403d..211679a 100644 --- a/modules/firefox.nix +++ b/modules/firefox.nix @@ -2,7 +2,7 @@ { # Create userChrome.css to hide Firefox View button - home.file.".mozilla/firefox/yanlin/chrome/userChrome.css".text = '' + home.file."${config.home.homeDirectory}/.mozilla/firefox/yanlin/chrome/userChrome.css".text = '' /* Hide Firefox View button */ #firefox-view-button { display: none !important; diff --git a/modules/termscp.nix b/modules/termscp.nix index 8e64f61..9b36e67 100644 --- a/modules/termscp.nix +++ b/modules/termscp.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: { home.file."Library/Application Support/termscp/config.toml".text = '' @@ -6,7 +6,7 @@ # Generated by Nix - see modules/termscp.nix for customization [user_interface] - text_editor = "/Users/yanlin/.nix-profile/bin/nvim" + text_editor = "${config.home.homeDirectory}/.nix-profile/bin/nvim" default_protocol = "SFTP" show_hidden_files = true check_for_updates = true @@ -15,7 +15,7 @@ notification_threshold = 536870912 [remote] - ssh_config = "/Users/yanlin/.ssh/config" + ssh_config = "${config.home.homeDirectory}/.ssh/config" [remote.ssh_keys] ''; diff --git a/modules/zsh.nix b/modules/zsh.nix index 4e91085..f23c3a2 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: let - projectsConfig = import ../config/projects.nix; - projectLauncher = "/Users/yanlin/.config/nix/scripts/project-launcher.sh"; + projectsConfig = import ../config/projects.nix { homeDirectory = config.home.homeDirectory; }; + projectLauncher = "${config.home.homeDirectory}/.config/nix/scripts/project-launcher.sh"; in { programs.zsh = {