woah this vm shit is so so cool
This commit is contained in:
parent
26ccd2af15
commit
4d9ede5faa
7 changed files with 190 additions and 119 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
result
|
||||
*.qcow2
|
71
flake.nix
71
flake.nix
|
@ -8,42 +8,47 @@
|
|||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
home-manager,
|
||||
...
|
||||
}: let
|
||||
mkHost = hostname: graphical: {
|
||||
imports = [
|
||||
./hosts/${hostname}/configuration.nix
|
||||
./modules/common
|
||||
(import "${home-manager}/nixos")
|
||||
(
|
||||
if graphical
|
||||
then ./modules/graphical
|
||||
else null
|
||||
)
|
||||
];
|
||||
outputs =
|
||||
inputs @ { self
|
||||
, nixpkgs
|
||||
, nixpkgs-unstable
|
||||
, home-manager
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
mkHost = hostname: {
|
||||
imports = [
|
||||
./hosts/${hostname}/configuration.nix
|
||||
./modules/common
|
||||
(import "${home-manager}/nixos")
|
||||
];
|
||||
|
||||
deployment = {
|
||||
targetUser = "root";
|
||||
targetHost = hostname;
|
||||
allowLocalDeployment = true;
|
||||
};
|
||||
};
|
||||
in {
|
||||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
||||
colmena = {
|
||||
meta = {
|
||||
nixpkgs = import nixpkgs {
|
||||
system = "x86_64-linux";
|
||||
overlays = [];
|
||||
deployment = {
|
||||
targetUser = "root";
|
||||
targetHost = hostname;
|
||||
allowLocalDeployment = true;
|
||||
};
|
||||
};
|
||||
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")
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
cherrykitten.graphical.enable = true;
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
networking.hostName = "bengal";
|
||||
|
|
39
hosts/test-vm/configuration.nix
Normal file
39
hosts/test-vm/configuration.nix
Normal 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";
|
||||
}
|
|
@ -1,49 +1,63 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.cherrykitten.common;
|
||||
in
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
../users
|
||||
./security.nix
|
||||
./yubikey.nix
|
||||
../graphical
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
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"];
|
||||
options.cherrykitten.common = {
|
||||
test = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "nya";
|
||||
example = "nyanya";
|
||||
};
|
||||
};
|
||||
|
||||
# Packages used on all systems
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
openssl
|
||||
rsync
|
||||
pinentry
|
||||
wget
|
||||
];
|
||||
config = {
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
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
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,54 +1,63 @@
|
|||
{ pkgs
|
||||
, config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.cherrykitten.graphical;
|
||||
in
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
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";
|
||||
options.cherrykitten.graphical = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "graphical stuffs");
|
||||
};
|
||||
|
||||
home-manager.users.sammy = {
|
||||
programs = {
|
||||
librewolf.enable = true;
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.sddm.enable = true;
|
||||
desktopManager.plasma5.enable = true;
|
||||
desktopManager.plasma5.bigscreen.enable = true;
|
||||
libinput.enable = true;
|
||||
|
||||
kitty = {
|
||||
enable = true;
|
||||
theme = "Catppuccin-Mocha";
|
||||
font = {
|
||||
name = "Monaspace Xenon";
|
||||
size = 12;
|
||||
};
|
||||
settings = {
|
||||
# Seti-UI + Custom
|
||||
"symbol_map U+E5FA-U+E62B" = "Symbols Nerd Font";
|
||||
# Devicons
|
||||
"symbol_map U+E700-U+E7C5" = "Symbols Nerd Font";
|
||||
# Font Awesome
|
||||
"symbol_map U+F000-U+F2E0" = "Symbols Nerd Font";
|
||||
# Font Awesome Extension
|
||||
"symbol_map U+E200-U+E2A9" = "Symbols Nerd Font";
|
||||
# Material Design Icons
|
||||
"symbol_map U+F500-U+FD46" = "Symbols Nerd Font";
|
||||
# Weather
|
||||
"symbol_map U+E300-U+E3EB" = "Symbols Nerd Font";
|
||||
# Octicons
|
||||
"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";
|
||||
xkb.layout = "de";
|
||||
xkb.options = "caps:escape";
|
||||
};
|
||||
|
||||
home-manager.users.sammy = {
|
||||
programs = {
|
||||
librewolf.enable = true;
|
||||
|
||||
kitty = {
|
||||
enable = true;
|
||||
theme = "Catppuccin-Mocha";
|
||||
font = {
|
||||
name = "Monaspace Xenon";
|
||||
size = 12;
|
||||
};
|
||||
settings = {
|
||||
# Seti-UI + Custom
|
||||
"symbol_map U+E5FA-U+E62B" = "Symbols Nerd Font";
|
||||
# Devicons
|
||||
"symbol_map U+E700-U+E7C5" = "Symbols Nerd Font";
|
||||
# Font Awesome
|
||||
"symbol_map U+F000-U+F2E0" = "Symbols Nerd Font";
|
||||
# Font Awesome Extension
|
||||
"symbol_map U+E200-U+E2A9" = "Symbols Nerd Font";
|
||||
# Material Design Icons
|
||||
"symbol_map U+F500-U+FD46" = "Symbols Nerd Font";
|
||||
# Weather
|
||||
"symbol_map U+E300-U+E3EB" = "Symbols Nerd Font";
|
||||
# Octicons
|
||||
"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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users = {
|
||||
sammy.imports = [./sammy.nix];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue