-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome-lite.nix
More file actions
52 lines (46 loc) · 1.21 KB
/
home-lite.nix
File metadata and controls
52 lines (46 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ config, pkgs, lib, ... }:
{
home.username = "ubuntu";
home.homeDirectory = "/home/ubuntu";
home.stateVersion = "24.11";
nixpkgs.config.allowUnfree = true;
home.packages = with pkgs; [
git
vim
htop
curl
wget
jq
go
nodejs
];
programs.bash = {
enable = true;
bashrcExtra = ''
source /etc/profile.d/nix.sh
export XDG_DATA_DIRS="$HOME/.nix-profile/share:$XDG_DATA_DIRS"
'';
};
systemd.user.services.opencode = {
Unit = {
Description = "OpenCode Server";
After = [ "network.target" ];
};
Service = {
WorkingDirectory = "%h";
ExecStart = "%h/.nix-profile/bin/opencode serve --hostname 0.0.0.0 --port 4096";
Restart = "always";
RestartSec = 5;
Environment = "HOME=%h";
EnvironmentFile = "-%h/.config/opencode/provider.env";
};
Install.WantedBy = [ "default.target" ];
};
# clone m3db and pre-download dependencies
home.activation.cloneM3DB = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
if [ ! -d "$HOME/m3" ]; then
$DRY_RUN_CMD ${pkgs.git}/bin/git clone https://github.com/m3db/m3 $HOME/m3
$DRY_RUN_CMD sh -c "cd $HOME/m3 && ${pkgs.go}/bin/go mod download"
fi
'';
}