How to Run DogeBox on Windows WSL
Download:
https://github.com/nix-community/NixOS-WSL/releases/download/2405.5.4/nixos-wsl.tar.gz
Open CMD (Command Prompt) and run:
wsl --install --no-distribution
On CMD go to the directory were you did download the file nixos-wsl.tar.gz above, example:
cd C:\Users\YOUR-USERNAME\Downloads
Run:
wsl --import NixOS $env:USERPROFILE\NixOS\ nixos-wsl.tar.gz --version 2
wsl -d NixOS
sudo nix-channel --update
Edit configuration file /etc/nixos/configuration.nix
:
nix-shell -p vim
sudo vi /etc/nixos/configuration.nix
change it from:
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
# NixOS-WSL specific options are documented on the NixOS-WSL repository:
# https://github.com/nix-community/NixOS-WSL
{ config, lib, pkgs, ... }:
{
imports = [
# include NixOS-WSL modules
<nixos-wsl/modules>
];
wsl.enable = true;
wsl.defaultUser = "nixos";
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}
to:
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
# NixOS-WSL specific options are documented on the NixOS-WSL repository:
# https://github.com/nix-community/NixOS-WSL
{ config, lib, pkgs, ... }:
{
imports = [
# include NixOS-WSL modules
<nixos-wsl/modules>
] ++ lib.optionals (builtins.pathExists "/home/nixos/data/nix/dogebox.nix") [
/home/nixos/data/nix/dogebox.nix
];
wsl.enable = true;
wsl.defaultUser = "nixos";
environment.systemPackages = [ pkgs.git pkgs.vim ];
security.wrappers.dbx = {
source = "/home/nixos/dogeboxd/build/dbx";
owner = "nixos";
group = "users";
};
security.wrappers.dogeboxd = {
source = "/home/nixos/dogeboxd/build/dogeboxd";
capabilities = "cap_net_bind_service=+ep";
owner = "nixos";
group = "users";
};
security.wrappers._dbxroot = {
source = "/home/nixos/dogeboxd/build/_dbxroot";
owner = "root";
group = "root";
setuid = true;
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}
Run:
sudo nixos-rebuild switch
cd /home/nixos
git clone https://github.com/dogeorg/dogeboxd.git
git clone https://github.com/dogeorg/dpanel.git
git clone https://github.com/dogeorg/dkm.git
cd dogeboxd
nix-shell
make dev
Now let that CMD window open, and open a new one and run:
wsl -d NixOS
Get the WSL local IP Address running the command:
ip addr show
The IP should be visible on ´eth0:´ were it says inet
something like 172.27.223.62/20
but you will need only the 172.27.223.62
Now run:
cd /home/nixos/dkm
nix-shell
make dev
Let the two CMD windows open and open your browser and put your DogeBox local IP with the Port 8080
, example:
http://172.27.223.62:8080
and follow the browser instructions 🙂