From f83806a307d0c22409c2efb552cdfaa314d9aa0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 10 Jan 2024 14:01:18 +0100 Subject: [PATCH] go: Separate file --- hm/common.nix | 1 - hm/dev/default.nix | 3 ++- hm/dev/go.nix | 19 +++++++++++++++++++ hm/homealone.nix | 1 - options.nix | 1 + 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 hm/dev/go.nix diff --git a/hm/common.nix b/hm/common.nix index 41a3f62..e90acfd 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -336,7 +336,6 @@ # TODO Session variables only get reloaded on login I think. sessionPath = [ "${config.home.homeDirectory}/.local/bin" - "${config.home.sessionVariables.GOPATH}" "${config.home.homeDirectory}/.config/dotfiles/hm/scripts" # Not Nix path otherwise it gets converted into store, # and then every time you want to modify a script you have to rebuild and re-login... ]; diff --git a/hm/dev/default.nix b/hm/dev/default.nix index fe7cf20..6216240 100644 --- a/hm/dev/default.nix +++ b/hm/dev/default.nix @@ -1,7 +1,8 @@ { pkgs, config, ... }: { imports = [ ./c.nix - ./python.nix ./common.nix + ./go.nix + ./python.nix ]; } diff --git a/hm/dev/go.nix b/hm/dev/go.nix new file mode 100644 index 0000000..5ae60ad --- /dev/null +++ b/hm/dev/go.nix @@ -0,0 +1,19 @@ +# Untested post-nix +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.frogeye.dev.go { + frogeye = { + direnv = { + GOPATH = "${config.xdg.cacheHome}/go"; + }; + }; + home = { + packages = with pkgs; [ + go + ]; + sessionPath = [ + "${config.home.sessionVariables.GOPATH}" + ]; + }; + }; +} diff --git a/hm/homealone.nix b/hm/homealone.nix index 5dcb184..519dc28 100644 --- a/hm/homealone.nix +++ b/hm/homealone.nix @@ -6,7 +6,6 @@ direnv = { CARGOHOME = "${config.xdg.cacheHome}/cargo"; # There are config in there that we can version if one want DASHT_DOCSETS_DIR = "${config.xdg.cacheHome}/dash_docsets"; - GOPATH = "${config.xdg.cacheHome}/go"; GRADLE_USER_HOME = "${config.xdg.cacheHome}/gradle"; MIX_ARCHIVES = "${config.xdg.cacheHome}/mix/archives"; MONO_GAC_PREFIX = "${config.xdg.cacheHome}/mono"; diff --git a/options.nix b/options.nix index c8871c4..a60985d 100644 --- a/options.nix +++ b/options.nix @@ -36,6 +36,7 @@ c = lib.mkEnableOption "C/C++ dev stuff"; docker = lib.mkEnableOption "Docker dev stuff"; fpga = lib.mkEnableOption "FPGA dev stuff"; + go = lib.mkEnableOption "Python dev stuff"; perl = lib.mkEnableOption "Perl dev stuff"; php = lib.mkEnableOption "PHP dev stuff"; python = lib.mkEnableOption "Python dev stuff";