summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Ras <jras@hostnet.nl>2025-02-12 08:54:11 +0100
committerJasper Ras <jras@hostnet.nl>2025-02-12 08:54:11 +0100
commit7ad2810efcbb84dc8e904ba69a09d3ffddea19bc (patch)
tree3257f70b60d8feeb5ebc6b3774ca8ac0c7aaa119
parent07f84bb581e369ff79100f0417e9d277f3c1fb61 (diff)
argh
-rw-r--r--.gitignore1
-rw-r--r--modules/home-manager/core/shell.nix69
-rw-r--r--modules/snorlax/default.nix2
-rw-r--r--modules/snorlax/uvm-guests/cpanel.nix36
-rw-r--r--modules/snorlax/uvm-guests/default.nix4
-rw-r--r--modules/snorlax/uvm.nix6
6 files changed, 111 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f9be8df
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+!*
diff --git a/modules/home-manager/core/shell.nix b/modules/home-manager/core/shell.nix
new file mode 100644
index 0000000..183b9ae
--- /dev/null
+++ b/modules/home-manager/core/shell.nix
@@ -0,0 +1,69 @@
+{ pkgs, lib, ... }:
+{
+ programs.zsh = {
+ enable = true;
+ defaultKeymap = "emacs";
+ initExtra = ''
+ # https://github.com/jeffreytse/zsh-vi-mode
+ source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
+ '';
+ shellAliases = {
+ g = "git";
+ };
+ };
+
+ programs.starship = {
+ enable = true;
+ settings = {
+ directory.style = "blue";
+
+ format = lib.concatStrings [
+ "$username"
+ "$hostname"
+ "$directory"
+ "$git_branch"
+ "$git_state"
+ "$git_status"
+ "$cmd_duration"
+ "$line_break"
+ "$python"
+ "$openstack"
+ "$character"
+ ];
+
+ character = {
+ success_symbol = "[❯](purple)";
+ error_symbol = "[❯](red)";
+ vimcmd_symbol = "[❮](green)";
+ };
+
+ git_branch = {
+ format = "[$branch]($style)";
+ style = "bright-black";
+ };
+
+ git_status = {
+ format =
+ "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)";
+ style = "cyan";
+ conflicted = "​";
+ untracked = "​";
+ modified = "​";
+ staged = "​";
+ renamed = "​";
+ deleted = "​";
+ stashed = "≡";
+ };
+
+ git_state = {
+ format = "'([$state( $progress_current/$progress_total)]($style))' ";
+ style = "bright-black";
+ };
+
+ cmd_duration = {
+ format = "[$duration]($style) ";
+ style = "yellow";
+ };
+ };
+ };
+}
diff --git a/modules/snorlax/default.nix b/modules/snorlax/default.nix
index 11deb13..5266987 100644
--- a/modules/snorlax/default.nix
+++ b/modules/snorlax/default.nix
@@ -5,7 +5,7 @@
./git.nix
./samba.nix
./nginx.nix
- ./uvm.nix
+ ./uvm-guests
./networking.nix
../core
diff --git a/modules/snorlax/uvm-guests/cpanel.nix b/modules/snorlax/uvm-guests/cpanel.nix
new file mode 100644
index 0000000..51bc0d2
--- /dev/null
+++ b/modules/snorlax/uvm-guests/cpanel.nix
@@ -0,0 +1,36 @@
+{ pkgs, ... }:
+{
+ microvm.autostart = [ "cpanel" ];
+ microvm.vms = {
+ cpanel = {
+ # The package set to use for the microvm. This also determines the microvm's architecture.
+ # Defaults to the host system's package set if not given.
+ pkgs = import pkgs { system = "x86_64-linux"; };
+
+ # (Optional) A set of special arguments to be passed to the MicroVM's NixOS modules.
+ #specialArgs = {};
+
+ # The configuration for the MicroVM.
+ # Multiple definitions will be merged as expected.
+ config = {
+ networking.hostName = "cpanel";
+
+ # It is highly recommended to share the host's nix-store
+ # with the VMs to prevent building huge images.
+ microvm.shares = [{
+ source = "/nix/store";
+ mountPoint = "/nix/.ro-store";
+ tag = "ro-store";
+ proto = "virtiofs";
+ }];
+
+ microvm.interfaces = [{
+ type = "bridge";
+ }];
+
+ # Any other configuration for your MicroVM
+ # [...]
+ };
+ };
+ };
+}
diff --git a/modules/snorlax/uvm-guests/default.nix b/modules/snorlax/uvm-guests/default.nix
new file mode 100644
index 0000000..39b0611
--- /dev/null
+++ b/modules/snorlax/uvm-guests/default.nix
@@ -0,0 +1,4 @@
+{ ... }:
+{
+ imports = [ ./cpanel.nix ];
+}
diff --git a/modules/snorlax/uvm.nix b/modules/snorlax/uvm.nix
deleted file mode 100644
index 9abd85a..0000000
--- a/modules/snorlax/uvm.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ ... }:
-{
- microvm.autostart = [
- "test1"
- ];
-}