woah this vm shit is so so cool

This commit is contained in:
CherryKitten 2024-03-24 19:02:23 +01:00
parent 26ccd2af15
commit 4d9ede5faa
Signed by: sammy
GPG key ID: 98D8F75FB0658276
7 changed files with 190 additions and 119 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
result
*.qcow2

View file

@ -8,42 +8,47 @@
}; };
}; };
outputs = inputs @ { outputs =
self, inputs @ { self
nixpkgs, , nixpkgs
nixpkgs-unstable, , nixpkgs-unstable
home-manager, , home-manager
... , ...
}: let }:
mkHost = hostname: graphical: { let
imports = [ system = "x86_64-linux";
./hosts/${hostname}/configuration.nix mkHost = hostname: {
./modules/common imports = [
(import "${home-manager}/nixos") ./hosts/${hostname}/configuration.nix
( ./modules/common
if graphical (import "${home-manager}/nixos")
then ./modules/graphical ];
else null
)
];
deployment = { deployment = {
targetUser = "root"; targetUser = "root";
targetHost = hostname; targetHost = hostname;
allowLocalDeployment = true; allowLocalDeployment = true;
};
};
in {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
colmena = {
meta = {
nixpkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [];
}; };
}; };
in
{
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
colmena = {
meta = {
nixpkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ ];
};
};
bengal = mkHost "bengal" true; bengal = mkHost "bengal";
};
nixosConfigurations.test = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./hosts/test-vm/configuration.nix
(import "${home-manager}/nixos")
];
};
}; };
};
} }

View file

@ -12,6 +12,8 @@
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
cherrykitten.graphical.enable = true;
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
networking.hostName = "bengal"; networking.hostName = "bengal";

View file

@ -0,0 +1,39 @@
{ config, lib, pkgs, ... }: {
imports = [
../../modules/common
../../modules/graphical
];
cherrykitten.graphical.enable = false;
users.users.admin = {
isNormalUser = true;
extraGroups = [ "wheel" ];
password = "admin";
group = "admin";
};
users.groups.admin = { };
virtualisation.vmVariant = {
# following configuration is added only when building VM with build-vm
virtualisation = {
memorySize = 8192;
cores = 6;
graphics = true;
};
};
services.openssh = {
enable = true;
settings.PasswordAuthentication = lib.mkForce true;
};
networking.firewall.allowedTCPPorts = [ 22 ];
environment.systemPackages = with pkgs; [
htop
];
system.stateVersion = "23.10";
}

View file

@ -1,49 +1,63 @@
{ lib
, config
, pkgs
, ...
}:
let
cfg = config.cherrykitten.common;
in
{ {
lib,
config,
pkgs,
...
}: {
imports = [ imports = [
../users ../users
./security.nix ./security.nix
./yubikey.nix ./yubikey.nix
../graphical
]; ];
nix.settings.experimental-features = ["nix-command" "flakes"]; options.cherrykitten.common = {
test = lib.mkOption {
time.timeZone = "Europe/Berlin"; type = lib.types.str;
default = "nya";
i18n.defaultLocale = "en_US.UTF-8"; example = "nyanya";
console = {
font = "Lat2-Terminus16";
keyMap = lib.mkForce "de";
useXkbConfig = true; # use xkb.options in tty.
};
fonts = {
enableDefaultFonts = true;
packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
monaspace
nerdfonts
];
fontconfig = {
defaultFonts.emoji = ["Noto Emoji"];
defaultFonts.serif = ["Monaspace Xenon" "FiraCode Nerd Font" "Hack Nerd Font" "NotoSans Nerd Font"];
defaultFonts.sansSerif = ["Monaspace Xenon" "FiraCode Nerd Font" "Hack Nerd Font" "NotoSerif Nerd Font"];
defaultFonts.monospace = ["Monaspace Xenon" "FiraCode Nerd Font" "Hack Nerd Font"];
}; };
}; };
# Packages used on all systems config = {
environment.systemPackages = with pkgs; [ nix.settings.experimental-features = [ "nix-command" "flakes" ];
git
openssl time.timeZone = "Europe/Berlin";
rsync
pinentry i18n.defaultLocale = "en_US.UTF-8";
wget console = {
]; font = "Lat2-Terminus16";
keyMap = lib.mkForce "de";
useXkbConfig = true; # use xkb.options in tty.
};
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
monaspace
nerdfonts
];
fontconfig = {
defaultFonts.emoji = [ "Noto Emoji" ];
defaultFonts.serif = [ "Monaspace Xenon" "FiraCode Nerd Font" "Hack Nerd Font" "NotoSans Nerd Font" ];
defaultFonts.sansSerif = [ "Monaspace Xenon" "FiraCode Nerd Font" "Hack Nerd Font" "NotoSerif Nerd Font" ];
defaultFonts.monospace = [ "Monaspace Xenon" "FiraCode Nerd Font" "Hack Nerd Font" ];
};
};
# Packages used on all systems
environment.systemPackages = with pkgs; [
git
openssl
rsync
pinentry
wget
];
};
} }

View file

@ -1,54 +1,63 @@
{ pkgs
, config
, lib
, ...
}:
let
cfg = config.cherrykitten.graphical;
in
{ {
pkgs, options.cherrykitten.graphical = {
config, enable = lib.mkEnableOption (lib.mdDoc "graphical stuffs");
lib,
...
}: {
services.xserver = {
enable = true;
displayManager.sddm.enable = true;
desktopManager.plasma5.enable = true;
desktopManager.plasma5.bigscreen.enable = true;
libinput.enable = true;
xkb.layout = "de";
xkb.options = "caps:escape";
}; };
home-manager.users.sammy = { config = lib.mkIf cfg.enable {
programs = { services.xserver = {
librewolf.enable = true; enable = true;
displayManager.sddm.enable = true;
desktopManager.plasma5.enable = true;
desktopManager.plasma5.bigscreen.enable = true;
libinput.enable = true;
kitty = { xkb.layout = "de";
enable = true; xkb.options = "caps:escape";
theme = "Catppuccin-Mocha"; };
font = {
name = "Monaspace Xenon"; home-manager.users.sammy = {
size = 12; programs = {
}; librewolf.enable = true;
settings = {
# Seti-UI + Custom kitty = {
"symbol_map U+E5FA-U+E62B" = "Symbols Nerd Font"; enable = true;
# Devicons theme = "Catppuccin-Mocha";
"symbol_map U+E700-U+E7C5" = "Symbols Nerd Font"; font = {
# Font Awesome name = "Monaspace Xenon";
"symbol_map U+F000-U+F2E0" = "Symbols Nerd Font"; size = 12;
# Font Awesome Extension };
"symbol_map U+E200-U+E2A9" = "Symbols Nerd Font"; settings = {
# Material Design Icons # Seti-UI + Custom
"symbol_map U+F500-U+FD46" = "Symbols Nerd Font"; "symbol_map U+E5FA-U+E62B" = "Symbols Nerd Font";
# Weather # Devicons
"symbol_map U+E300-U+E3EB" = "Symbols Nerd Font"; "symbol_map U+E700-U+E7C5" = "Symbols Nerd Font";
# Octicons # Font Awesome
"symbol_map U+F400-U+F4A8,U+2665,U+26A1,U+F27C" = "Symbols Nerd Font"; "symbol_map U+F000-U+F2E0" = "Symbols Nerd Font";
# Powerline Extra Symbols # Font Awesome Extension
"symbol_map U+E0A3,U+E0B4-U+E0C8,U+E0CC-U+E0D2,U+E0D4" = "Symbols Nerd Font"; "symbol_map U+E200-U+E2A9" = "Symbols Nerd Font";
# IEC Power Symbols # Material Design Icons
"symbol_map U+23FB-U+23FE,U+2b58" = "Symbols Nerd Font"; "symbol_map U+F500-U+FD46" = "Symbols Nerd Font";
# Font Logos # Weather
"symbol_map U+F300-U+F313" = "Symbols Nerd Font"; "symbol_map U+E300-U+E3EB" = "Symbols Nerd Font";
# Pomicons # Octicons
"symbol_map U+E000-U+E00D" = "Symbols Nerd Font"; "symbol_map U+F400-U+F4A8,U+2665,U+26A1,U+F27C" = "Symbols Nerd Font";
# Powerline Extra Symbols
"symbol_map U+E0A3,U+E0B4-U+E0C8,U+E0CC-U+E0D2,U+E0D4" = "Symbols Nerd Font";
# IEC Power Symbols
"symbol_map U+23FB-U+23FE,U+2b58" = "Symbols Nerd Font";
# Font Logos
"symbol_map U+F300-U+F313" = "Symbols Nerd Font";
# Pomicons
"symbol_map U+E000-U+E00D" = "Symbols Nerd Font";
};
}; };
}; };
}; };

View file

@ -12,7 +12,7 @@
}; };
}; };
home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true;
home-manager.users = { home-manager.users = {
sammy.imports = [./sammy.nix]; sammy.imports = [./sammy.nix];
}; };