Skip to content

Commit

Permalink
make some work related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishrb committed Oct 3, 2024
1 parent d0020c5 commit 9a880cd
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 60 deletions.
3 changes: 3 additions & 0 deletions apps/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# install NixOS on a machine
installer = import ./installer.nix { inherit pkgs; };

# script to pull ollama models
ollama = import ./ollama.nix { inherit pkgs; };

# neovim
nvim = import ./nvim.nix { inherit system inputs; };
}
15 changes: 15 additions & 0 deletions apps/ollama.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ pkgs, ... }:
{

type = "app";

program = builtins.toString (
pkgs.writeShellScript "ollama" ''
# code assistant model: deepseek-coder-v2, qwen2.5-coder, ..
${pkgs.ollama}/bin/ollama pull deepseek-coder-v2
# general purpose model: mistral, qwen:7b, qwen:14b, ..
${pkgs.ollama}/bin/ollama pull mistral
''
);
}
12 changes: 6 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
fullName = "Christoph Herb";
gitName = fullName;
gitEmail = "52382992+chrishrb@users.noreply.github.com";
gitWorkEmail = "christoph.herb@maibornwolff.de";
gitWorkEmail = "c.herb@chargecloud.de";
dotfilesRepo = "git@github.com:chrishrb/nix-dots.git";
};

Expand All @@ -113,18 +113,18 @@
};

# Contains my full Mac system builds, including home-manager
# darwin-rebuild switch --flake .#mw
# darwin-rebuild switch --flake .#cc
darwinConfigurations = {
mw = import ./hosts/mw { inherit inputs globals overlays; };
mb-pro-cc = import ./hosts/mb-pro-cc { inherit inputs globals overlays; };
macbook-christoph = import ./hosts/macbook-christoph { inherit inputs globals overlays; };
};

# For quickly applying home-manager settings with:
# home-manager switch --flake .#mw
# home-manager switch --flake .#cc
homeConfigurations = {
ambush = nixosConfigurations.ambush.config.home-manager.users."christoph".home;
mw = darwinConfigurations.mw.config.home-manager.users."christoph.herb".home;
macbook-christoph = darwinConfigurations.mw.config.home-manager.users."christophherb".home;
mb-pro-cc = darwinConfigurations.mb-pro-cc.config.home-manager.users."christophherb".home;
macbook-christoph = darwinConfigurations.cc.config.home-manager.users."christophherb".home;
};

# Programs that can be run by calling this flake
Expand Down
19 changes: 11 additions & 8 deletions hosts/mw/default.nix → hosts/mb-pro-cc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs.darwin.lib.darwinSystem {
../../modules/common
../../modules/darwin
(globals // {
user = "christoph.herb";
user = "christophherb";
})
inputs.home-manager.darwinModules.home-manager
inputs.nix-homebrew.darwinModules.nix-homebrew
Expand All @@ -19,28 +19,31 @@ inputs.darwin.lib.darwinSystem {
nixpkgs.overlays = overlays;

# Darwin specific
networking.hostName = "MB-GDWLXJMCPF";
networking.hostName = "mb-pro-cc";

# Turn on all features related to desktop and graphical apps
gui.enable = true;
work.enable = true;

# Programs and services
colima.enable = true;
alacritty.enable = true;
chrisNvim.enable = true;
dotfiles.enable = true;
drawio.enable = true;
dotfiles.enable = false;
drawio.enable = false;
chrome.enable = true;
zoom.enable = true;

# languaages
python.enable = true;
lua.enable = true;
devops.enable = true;
go.enable = true;
java.enable = true;
go.enable = false;
java.enable = false;
web.enable = true;
ai.enable = true;
discord.enable = true;
latex.enable = true;
discord.enable = false;
latex.enable = false;
nixlang.enable = true;
}
];
Expand Down
18 changes: 14 additions & 4 deletions modules/common/applications/chrisNvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,20 @@ in
home-manager.users.${config.user} = {
imports = [ chrisNvim.homeModule ];

chrisNvim = {
enable = config.chrisNvim.enable;
packageNames = [ "chrisNvim" "chrisNvimLocalAI" ];
chrisNvim = (let
inherit (chrisNvim) utils packageDefinitions;
in {
enable = config.chrisNvim.enable;
packageNames = [ "chrisNvim" ];

packages = {
chrisNvim = utils.mergeCatDefs packageDefinitions.chrisNvim ({ pkgs, ... }: {
categories = {
aiAdapter = if (config.work.enable) then "ollama" else "copilot";
};
});
};
});
};
};
};
}
1 change: 1 addition & 0 deletions modules/common/applications/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
./chrome.nix
./discord.nix
./drawio.nix
./zoom.nix
];
}
19 changes: 19 additions & 0 deletions modules/common/applications/zoom.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ config, pkgs, lib, ... }: {

options = {
zoom = {
enable = lib.mkEnableOption {
description = "Enable Zoom.";
default = false;
};
};
};

config = lib.mkIf (config.gui.enable && config.zoom.enable) {
unfreePackages = [ "zoom" ];
home-manager.users.${config.user} = {
home.packages = with pkgs; [ zoom-us ];
};
};

}
6 changes: 6 additions & 0 deletions modules/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
default = false;
};
};
work = {
enable = lib.mkEnableOption {
description = "Enable work specific brews/casks etc.";
default = false;
};
};
homePath = lib.mkOption {
type = lib.types.path;
description = "Path of user's home directory.";
Expand Down
38 changes: 0 additions & 38 deletions modules/common/nvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -265,44 +265,6 @@ let
php = false;
aiAdapter = "copilot";

# this does not have an associated category of plugins,
# but lua can still check for it
lspDebugMode = false;
};
};
chrisNvimLocalAI =
{ pkgs, ... }:
{
# see :help nixCats.flake.outputs.settings
settings = {
# will check for config in the store rather than .config
wrapRc = true;
configDirName = "chrishrb-nvim-local-ai";
aliases = [
"viml"
"vl"
];
# caution: this option must be the same for all packages.
# nvimSRC = inputs.neovim;
};
# see :help nixCats.flake.outputs.packageDefinitions
categories = {
lazy = true;
generalBuildInputs = true;
general = true;
debug = true;

# languages
go = true;
python = true;
web = true;
java = true;
javaExtras = extraJavaItems pkgs;
devops = true;
latex = false;
php = false;
aiAdapter = "ollama";

# this does not have an associated category of plugins,
# but lua can still check for it
lspDebugMode = false;
Expand Down
1 change: 1 addition & 0 deletions modules/common/nvim/lua/chrishrb/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ local plugins = {
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
enabled = nixCats("aiAdapter") == "copilot",
config = function ()
require("copilot").setup({})
end
Expand Down
2 changes: 1 addition & 1 deletion modules/common/programming/web.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

config = lib.mkIf config.web.enable {
home-manager.users.${config.user}.home.packages = with pkgs; [
nodejs_22
nodejs_18
nodePackages.pnpm
yarn
];
Expand Down
8 changes: 5 additions & 3 deletions modules/darwin/homebrew.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@
"tiles"
"skim" # open pdfs

# Browsers
#"google-chrome"

# other
"bitwarden"
"spotify"
"logi-options+"
"keepassxc"
"notunes" # disable autolaunch of music app

] ++ lib.optionals config.work.enable [

"tunnelblick"
"microsoft-teams"
];
};

Expand Down

0 comments on commit 9a880cd

Please sign in to comment.