From f454e55e80a3fc9e66120ae0dac1c903d172134c Mon Sep 17 00:00:00 2001 From: htran Date: Sun, 18 Jun 2023 02:06:08 -0700 Subject: [PATCH] std actually works now --- .gitignore | 1 + native_configs/starship/starship.toml | 2 +- nix-conf/home-manager/base/shells.nix | 11 +++++--- nix/cells/repo/home-configs/default.nix | 3 ++- nix/cells/repo/home-profiles/default.nix | 34 ++++++++++++++++-------- nix/cells/repo/home-profiles/neovim.nix | 2 +- nix/cells/repo/home-profiles/shells.nix | 13 ++++++--- 7 files changed, 44 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index b2be92b..726d2d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ result +.direnv diff --git a/native_configs/starship/starship.toml b/native_configs/starship/starship.toml index ab52873..3334c74 100644 --- a/native_configs/starship/starship.toml +++ b/native_configs/starship/starship.toml @@ -5,7 +5,7 @@ symbol = " " [c] disabled = false -commmands = [ [ 'cc', '--version' ], [ 'gcc', '--version' ], [ 'clang', '--version' ] ] +# commands = [ [ 'cc', '--version' ], [ 'gcc', '--version' ], [ 'clang', '--version' ] ] detect_extensions = ["c", "h", "cc", "cpp", "hh", "hpp"] [conda] diff --git a/nix-conf/home-manager/base/shells.nix b/nix-conf/home-manager/base/shells.nix index 3f9c06f..e5bd1f1 100644 --- a/nix-conf/home-manager/base/shells.nix +++ b/nix-conf/home-manager/base/shells.nix @@ -70,10 +70,13 @@ in { settings = let native = builtins.fromTOML (builtins.readFile "${proj_root.config.path}/starship/starship.toml"); patch-nix = pkgs.lib.recursiveUpdate native { - c.commands = [ - ["nix" "run" "nixpkgs#clang" "--" "--version"] - ["nix" "run" "nixpkgs#gcc" "--" "--version"] - ]; + # WARNING: home-manager fails on here for some reason. Likely not at the + # validation phase (type-checking), but at evaluation phaase (stringify) + # c.commands = [ + # ["nix" "run" "nixpkgs#clang" "--" "--version"] + # ["nix" "run" "nixpkgs#gcc" "--" "--version"] + # ]; + c.commands = "fuk"; }; in patch-nix; diff --git a/nix/cells/repo/home-configs/default.nix b/nix/cells/repo/home-configs/default.nix index b2964a5..4384ab5 100644 --- a/nix/cells/repo/home-configs/default.nix +++ b/nix/cells/repo/home-configs/default.nix @@ -16,11 +16,12 @@ base-modules = [ home-profiles.alacritty - home-profiles.git + # home-profiles.git home-profiles.ssh home-profiles.shells ({config.programs.home-manager.enable = true;}) home-profiles.nix-index + home-profiles.neovim ]; in { homeConfigurations.htran = home-config { diff --git a/nix/cells/repo/home-profiles/default.nix b/nix/cells/repo/home-profiles/default.nix index d26c2c2..3092407 100644 --- a/nix/cells/repo/home-profiles/default.nix +++ b/nix/cells/repo/home-profiles/default.nix @@ -8,6 +8,7 @@ _imports @ { # TODO: I don't think abstracting namespace away is a good idea in this case namespace = "repo"; imports = _imports // {inherit namespace;}; + inherit (cell) home-modules; in { neovim = import ./neovim.nix imports; nerd_font_module = { @@ -15,11 +16,11 @@ in { pkgs, ... }: { - fonts.fontconfig.enable = true; - home.packages = [ + config.fonts.fontconfig.enable = true; + config.home.packages = [ (pkgs.nerdfonts.override {fonts = ["Hack"];}) ]; - "${namespace}".alacritty.font.family = "Hack Nerd Font Mono"; + config."${namespace}".alacritty.font.family = "Hack Nerd Font Mono"; }; secrets = { @@ -99,8 +100,12 @@ in { co = "checkout"; b = "branch"; }; + cfg = config."${namespace}".profile.git; in { - options."${namespace}".git = { + imports = [ + home-modules.git + ]; + options."${namespace}".profile.git = { aliases = lib.mkOption { type = lib.types.attrs; default = {}; @@ -135,11 +140,16 @@ in { example = [".direnv" "node_modules"]; }; }; + # WARNING: This should be completed wtf + config."${namespace}".git = { + inherit (cfg) name email ignores aliases; + enable = true; + }; }; git-htran = { imports = [inputs.cells.repo.home-profiles.git]; - config."${namespace}".git = { + config."${namespace}".profile.git = { name = "htran"; email = "htran@egihosting.com"; }; @@ -147,8 +157,10 @@ in { git-pegasust = { imports = [inputs.cells.repo.home-profiles.git]; - config.git."${namespace}".name = "pegasust"; - config.git."${namespace}".email = "pegasucksgg@gmail.com"; + config."${namespace}".profile.git = { + email = "pegasucksgg@gmail.com"; + name = "pegasust"; + }; }; dev-packages = let pkgs = inputs.nixpkgs; in { @@ -170,7 +182,7 @@ in { imports = [ inputs.nix-index-database.hmModules.nix-index ]; - programs.nix-index = { + config.programs.nix-index = { enable = true; enableBashIntegration = true; enableZshIntegration = true; @@ -179,9 +191,9 @@ in { # digital garden stack zk = { - xdg.configFile."zk/config.toml".source = "${inputs.self}/native_configs/zk/config.toml"; - # NB: lib.mkMerge - home.packages = [ + config.xdg.configFile."zk/config.toml".source = "${inputs.self}/native_configs/zk/config.toml"; + # NB: this is done with lib.mkMerge + config.home.packages = [ inputs.nixpkgs.zk ]; }; diff --git a/nix/cells/repo/home-profiles/neovim.nix b/nix/cells/repo/home-profiles/neovim.nix index eb49566..16f9c91 100644 --- a/nix/cells/repo/home-profiles/neovim.nix +++ b/nix/cells/repo/home-profiles/neovim.nix @@ -83,7 +83,7 @@ in { extraLuaConfig = builtins.readFile "${inputs.self}/native_configs/neovim/init.lua"; plugins = let inherit - (inputs.nixpkgs-latest.vimPlugins) + (inputs.nixpkgs-latest.legacyPackages.${system}.vimPlugins) plenary-nvim nvim-treesitter nvim-treesitter-textobjects diff --git a/nix/cells/repo/home-profiles/shells.nix b/nix/cells/repo/home-profiles/shells.nix index ac8fd1a..dd06096 100644 --- a/nix/cells/repo/home-profiles/shells.nix +++ b/nix/cells/repo/home-profiles/shells.nix @@ -69,10 +69,15 @@ in { settings = let native = builtins.fromTOML (builtins.readFile "${inputs.self}/native_configs/starship/starship.toml"); patch-nix = pkgs.lib.recursiveUpdate native { - c.commands = [ - ["nix" "run" "nixpkgs#clang" "--" "--version"] - ["nix" "run" "nixpkgs#gcc" "--" "--version"] - ]; + # WARNING: home-manager fails on here for some reason. Likely not at the + # validation phase (type-checking), but at evaluation phaase (stringify) + # I'm thinking when `settings` are evaluated, it has some sort of + # recursive processing before it gets turned into a toml + # c.commands = [ + # ["nix" "run" "nixpkgs#clang" "--" "--version"] + # ["nix" "run" "nixpkgs#gcc" "--" "--version"] + # ]; + c.disabled = true; }; in patch-nix;