Skip to content

Commit

Permalink
feat(virt): enabled KVM virtualization
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Nov 11, 2024
1 parent 26b4f55 commit cb2a8eb
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 88 deletions.
175 changes: 87 additions & 88 deletions hosts/pc/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,14 @@ rec {

sound.wittano.enable = true;

virtualisation.docker.wittano.enable = true;
hardware = {
trackpoint.emulateWheel = true;
keyboard.zsa.enable = true;

virtualization.wittano = mkIf (!boot.loader.grub.wittano.enableMultiBoot) {
virtualization.wittano = {
enable = true;
enableWindowsVM = true;
enableWindowsVM = false;
};
nvidia.enable = true;
samba.enable = true;
Expand Down Expand Up @@ -193,9 +194,13 @@ rec {
};

# Home-manager
home-manager =
let
commonConfig = {
home-manager = {
extraSpecialArgs = { inherit pkgs unstable lib inputs; };
useUserPackages = true;
backupFileExtension = "backup";
users.wittano = mkMerge [
# Common modules
{
imports = [
inputs.catppuccin.homeManagerModules.catppuccin
inputs.nixvim.homeManagerModules.nixvim
Expand Down Expand Up @@ -266,92 +271,86 @@ rec {
# Security
bitwarden
];
};
in
{
extraSpecialArgs = { inherit pkgs unstable lib inputs; };
useUserPackages = true;
backupFileExtension = "backup";
users.wittano = mkMerge [
{
programs = {
jetbrains.ides = [ "go" "fork" "python" "cpp" "jvm" ];
git.wittano.enable = true;
rofi.wittano.enable = true;

games.enable = true;
lutris.enable = true;

tmux.wittano.enable = true;
neovim.wittano.enable = true;

fish.shellAliases = {
# Projects
pnix = "cd $HOME/nix-dotfiles";
plab = "cd $HOME/projects/server/home-lab";

# Nix
nfu = "nix flake update";
nfc = "nix flake check";
repl = "nix repl -f '<nixpkgs>'";

# systemd
scs = "sudo systemctl status";
scst = "sudo systemctl stop";
scsta = "sudo systemctl start";
sce = "sudo systemctl enable --now";
scr = "sudo systemctl restart";
sdb = "systemd-analyze blame";
};
};

desktop.autostart = {
desktopName = "openbox";
scriptPath = ".config/openbox/autostart";
programs = [
"vivaldi"
"spotify"
"vesktop"
"thunderbird"
"steam"
"signal-desktop --use-tray-icon --no-sandbox"
];
}
# Wittano configuration
{
programs = {
jetbrains.ides = [ "go" "fork" "python" "cpp" "jvm" ];
git.wittano.enable = true;
rofi.wittano.enable = true;

games.enable = true;
lutris.enable = true;

tmux.wittano.enable = true;
neovim.wittano.enable = true;

fish.shellAliases = {
# Projects
pnix = "cd $HOME/nix-dotfiles";
plab = "cd $HOME/projects/server/home-lab";

# Nix
nfu = "nix flake update";
nfc = "nix flake check";
repl = "nix repl -f '<nixpkgs>'";

# systemd
scs = "sudo systemctl status";
scst = "sudo systemctl stop";
scsta = "sudo systemctl start";
sce = "sudo systemctl enable --now";
scr = "sudo systemctl restart";
sdb = "systemd-analyze blame";
};
};

gtk.gtk3.bookmarks = [
"file://${environment.variables.NIX_DOTFILES} Nix configuration"
"file://${environment.variables.NIX_DOTFILES}/dotfiles Dotfiles"
desktop.autostart = {
desktopName = "openbox";
scriptPath = ".config/openbox/autostart";
programs = [
"vivaldi"
"spotify"
"vesktop"
"thunderbird"
"steam"
"signal-desktop --use-tray-icon --no-sandbox"
];
};

home.packages = with pkgs; [
# Utilities
sshs

# Tilling WM
timeNotify
showVolume

# Apps
unstable.figma-linux # Figma
# Web browser
vivaldi

# Apps
gnome.pomodoro

# Social media
# telegram-desktop
unstable.freetube # Youtube desktop
fixedSignal # Signal desktop
# element-desktop # matrix communicator
vesktop
# irssi # IRC chat
unstable.streamlink-twitch-gui-bin
];
}
commonConfig
];
};
gtk.gtk3.bookmarks = [
"file://${environment.variables.NIX_DOTFILES} Nix configuration"
"file://${environment.variables.NIX_DOTFILES}/dotfiles Dotfiles"
];

home.packages = with pkgs; [
# Utilities
sshs

# Tilling WM
timeNotify
showVolume

# Apps
unstable.figma-linux # Figma
# Web browser
vivaldi

# Apps
gnome.pomodoro

# Social media
# telegram-desktop
unstable.freetube # Youtube desktop
fixedSignal # Signal desktop
# element-desktop # matrix communicator
vesktop
# irssi # IRC chat
unstable.streamlink-twitch-gui-bin
];
}
];
};

# Programs
services.locate = {
Expand All @@ -374,7 +373,6 @@ rec {
};
};

virtualisation.docker.wittano.enable = true;

services = {
udisks2 = {
Expand Down Expand Up @@ -416,4 +414,5 @@ rec {
package = pkgs.catppuccin-sddm-corners;
};
};

}
23 changes: 23 additions & 0 deletions lib/link.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ lib, ... }:
with lib;
{
mkLinks = links:
let
mkScript = src: dest: ''
DIR=$(dirname ${dest})
mkdir -p "$DIR"
if [ -e "${dest}" ]; then
unlink ${dest} || rm ${dest}
fi
ln -s ${src} ${dest}
'';
in
trivial.pipe links [
(builtins.filter (x: x.active or false))
(builtins.map (x: mkScript x.src x.dest))
(builtins.concatStringsSep "\n\n")
];
}

0 comments on commit cb2a8eb

Please sign in to comment.