diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | modules/home-manager/core/shell.nix | 69 | ||||
-rw-r--r-- | modules/snorlax/default.nix | 2 | ||||
-rw-r--r-- | modules/snorlax/uvm-guests/cpanel.nix | 36 | ||||
-rw-r--r-- | modules/snorlax/uvm-guests/default.nix | 4 | ||||
-rw-r--r-- | modules/snorlax/uvm.nix | 6 |
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" - ]; -} |