Compare commits

...

4 Commits

12 changed files with 307 additions and 345 deletions

View File

@ -1,250 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ lib, config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration-vm.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.plymouth.enable = true;
boot.plymouth.theme = "breeze";
boot.kernelParams = [
"sysrq_always_enabled=1"
];
boot.loader.timeout = 3;
boot.loader.systemd-boot.configurationLimit = 5;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12;
boot.extraModulePackages = with config.boot.kernelPackages; [ zfs ];
environment.etc.hosts.mode = "0644";
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Los_Angeles";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = false;
# Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
services.qemuGuest.enable = true;
services.spice-vdagentd.enable = true;
services.sshd.enable = true;
services.flatpak.enable = true;
services.xserver.xkb.extraLayouts = {
minimak-4 = {
description = "English (US, Minimak-4)";
languages = [ "eng" ];
# symbolsFile = /etc/nixos/minimak;
symbolsFile = ./minimak;
};
minimak-8 = {
description = "English (US, Minimak-8)";
languages = [ "eng" ];
# symbolsFile = /etc/nixos/minimak;
symbolsFile = ./minimak;
};
minimak-12 = {
description = "English (US, Minimak-12)";
languages = [ "eng" ];
# symbolsFile = /etc/nixos/minimak;
symbolsFile = ./minimak;
};
};
i18n.inputMethod = {
type = "fcitx5";
enable = true;
fcitx5.waylandFrontend = true;
fcitx5.plasma6Support = true;
fcitx5.addons = with pkgs; [
fcitx5-mozc
];
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.groups = {
cazzzer = {
gid = 1000;
};
};
users.users.cazzzer = {
isNormalUser = true;
description = "Yura";
uid = 1000;
group = "cazzzer";
extraGroups = [ "networkmanager" "wheel" "docker" "wireshark" ];
packages = with pkgs; [
# Python
# python3
# poetry
# Haskell
# haskellPackages.ghc
# haskellPackages.stack
# Node
# nodejs_22
# pnpm
# bun
];
};
# Install firefox.
programs.firefox.enable = true;
programs.fish.enable = true;
programs.git.enable = true;
programs.lazygit.enable = true;
programs.neovim.enable = true;
# https://discourse.nixos.org/t/firefox-does-not-use-kde-window-decorations-and-cursor/32132/3
# programs.dconf.enable = true;
# programs.firefox = {
# enable = true;
# preferences = {
# "widget.use-xdg-desktop-portal.file-picker" = 1;
# "widget.use-xdg-desktop-portal.mime-handler" = 1;
# };
# };
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
# https://github.com/flatpak/flatpak/issues/2861
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
workarounds.flatpak.enable = true;
fonts.packages = with pkgs; [ nerd-fonts.fantasque-sans-mono ];
environment.systemPackages = with pkgs; [
bat
# bluez
darkman
dust
efibootmgr
eza
fastfetch
fd
# flatpak
host-spawn # for flatpaks
kdePackages.flatpak-kcm
kdePackages.filelight
kdePackages.kate
kdePackages.yakuake
# git
gnumake
helix
htop
mediainfo
micro
mpv
neofetch
# neovim
noto-fonts-cjk-sans
noto-fonts-cjk-serif
ripgrep
starship
tealdeer
tela-circle-icon-theme
fantasque-sans-mono
jetbrains-mono
waypipe
whois
# wireshark
yt-dlp
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
];
# nix.package = pkgs.nixFlakes;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.etc."current-system-packages".text =
let
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages);
formatted = builtins.concatStringsSep "\n" sortedUnique;
in
formatted;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ 8080 ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment?
}

43
flake.lock generated
View File

@ -1,12 +1,48 @@
{
"nodes": {
"nixlib": {
"locked": {
"lastModified": 1734829460,
"narHash": "sha256-dPhc+f2wkmhMqMIfq+hColJdysgVxKP9ilZ5bR0NRZI=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "0a31e8d833173ae63e43fd9dbff1ccf09c4f778c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixos-generators": {
"inputs": {
"nixlib": "nixlib",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1734915500,
"narHash": "sha256-A7CTIQ8SW0hfbhKlwK+vSsu4pD+Oaelw3v6goX6go+U=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "051d1b2dda3b2e81b38d82e2b691e5c2f4d335f4",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-generators",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1735834308,
"narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=",
"lastModified": 1736012469,
"narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6df24922a1400241dae323af55f30e4318a6ca65",
"rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d",
"type": "github"
},
"original": {
@ -18,6 +54,7 @@
},
"root": {
"inputs": {
"nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs"
}
}

View File

@ -1,4 +1,3 @@
# /etc/nixos/flake.nix
{
description = "flake for Yura-PC";
@ -6,24 +5,42 @@
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs }: {
outputs = { self, nixpkgs, nixos-generators }: {
nixosConfigurations = {
Yura-PC = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./modules
./configuration.nix
./hosts/common.nix
./hosts/Yura-PC
];
};
VM = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./modules
./configuration-vm.nix
./hosts/common.nix
./hosts/vm
];
};
};
# https://github.com/nix-community/nixos-generators?tab=readme-ov-file#using-in-a-flake
packages.x86_64-linux = {
proxmox = nixos-generators.nixosGenerate {
system = "x86_64-linux";
modules = [
./modules
./hosts/common.nix
./hosts/vm
];
format = "proxmox";
};
};
};
}

View File

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ lib, config, pkgs, ... }:
{ config, lib, pkgs, ... }:
{
imports =
@ -10,6 +10,7 @@
./hardware-configuration.nix
# <nixpkgs/nixos/modules/profiles/qemu-guest.nix>
];
mods.kb-input.enable = true;
# Bootloader.
boot.loader.systemd-boot.enable = true;
@ -48,24 +49,6 @@
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Los_Angeles";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = false;
@ -75,12 +58,6 @@
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
@ -102,7 +79,7 @@
# services.qemuGuest.enable = true;
# services.spice-vdagentd.enable = true;
services.sshd.enable = true;
services.openssh.enable = true;
services.flatpak.enable = true;
# services.geoclue2.enable = true;
location.provider = "geoclue2";
@ -110,37 +87,6 @@
security.pam.services.sddm.enableGnomeKeyring = true;
# security.pam.services.sddm.gnupg.enable = true;
services.xserver.xkb.extraLayouts = {
minimak-4 = {
description = "English (US, Minimak-4)";
languages = [ "eng" ];
# symbolsFile = /etc/nixos/minimak;
symbolsFile = ./minimak;
};
minimak-8 = {
description = "English (US, Minimak-8)";
languages = [ "eng" ];
# symbolsFile = /etc/nixos/minimak;
symbolsFile = ./minimak;
};
minimak-12 = {
description = "English (US, Minimak-12)";
languages = [ "eng" ];
# symbolsFile = /etc/nixos/minimak;
symbolsFile = ./minimak;
};
};
i18n.inputMethod = {
type = "fcitx5";
enable = true;
fcitx5.waylandFrontend = true;
fcitx5.plasma6Support = true;
fcitx5.addons = with pkgs; [
fcitx5-mozc
];
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
@ -158,9 +104,6 @@
group = "cazzzer";
extraGroups = [ "networkmanager" "wheel" "docker" "wireshark" "geoclue" ];
packages = with pkgs; [
kdePackages.kate
kdePackages.yakuake
python3
poetry
@ -191,6 +134,9 @@
programs.gnupg.agent.pinentryPackage = pkgs.pinentry-qt;
# programs.starship.enable = true;
programs.wireshark.enable = true;
programs.wireshark.package = pkgs.wireshark; # wireshark-cli by default
programs.bat.enable = true;
programs.htop.enable = true;
# https://nixos.wiki/wiki/Docker
virtualisation.docker.enable = true;
@ -263,13 +209,19 @@
# ];
workarounds.flatpak.enable = true;
fonts.packages = with pkgs; [ nerd-fonts.fantasque-sans-mono ];
fonts.packages = with pkgs; [
fantasque-sans-mono
nerd-fonts.fantasque-sans-mono
noto-fonts
noto-fonts-emoji
noto-fonts-cjk-sans
noto-fonts-cjk-serif
jetbrains-mono
];
# fonts.fontDir.enable = true;
# fonts.fontconfig.allowBitmaps = false;
environment.systemPackages = with pkgs; [
bat
# bluez
darkman
dust
efibootmgr
@ -277,16 +229,15 @@
fastfetch
fd
ffmpeg
# flatpak
host-spawn # for flatpaks
kdePackages.flatpak-kcm
kdePackages.filelight
# git
kdePackages.flatpak-kcm
kdePackages.kate
kdePackages.yakuake
gcr
gnome-keyring # config for this and some others
gnumake
helix
htop
jetbrains-toolbox # or maybe do invidual ones?
# jetbrains.rust-rover
# jetbrains.pycharm-professional
@ -295,11 +246,7 @@
mediainfo
micro
mpv
neofetch
# neovim
nextcloud-client
noto-fonts-cjk-sans
noto-fonts-cjk-serif
lxqt.pavucontrol-qt
pinentry
rbw
@ -308,28 +255,12 @@
starship
tealdeer
tela-circle-icon-theme
fantasque-sans-mono
jetbrains-mono
virt-viewer
waypipe
whois
# wireshark
yt-dlp
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
];
# nix.package = pkgs.nixFlakes;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.etc."current-system-packages".text =
let
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages);
formatted = builtins.concatStringsSep "\n" sortedUnique;
in
formatted;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;

31
hosts/common.nix Normal file
View File

@ -0,0 +1,31 @@
{ config, pkgs, ... }: {
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Set your time zone.
time.timeZone = "America/Los_Angeles";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.etc."current-system-packages".text =
let
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages);
formatted = builtins.concatStringsSep "\n" sortedUnique;
in
formatted;
}

148
hosts/vm/default.nix Normal file
View File

@ -0,0 +1,148 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
# ./hardware-configuration-vm.nix
];
mods.kb-input.enable = true;
# boot.kernelParams = [ "console=tty0" ];
proxmox.qemuConf.bios = "ovmf";
proxmox.qemuExtraConf = {
machine = "q35";
# efidisk0 = "local-lvm:vm-9999-disk-1";
cpu = "host";
};
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.plymouth.enable = true;
boot.plymouth.theme = "breeze";
boot.kernelParams = [
"sysrq_always_enabled=1"
];
# boot.loader.timeout = lib.mkForce 3;
boot.loader.systemd-boot.configurationLimit = 5;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12;
boot.extraModulePackages = with config.boot.kernelPackages; [ zfs ];
environment.etc.hosts.mode = "0644";
# managed by cloud-init
# networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = false;
# Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
services.flatpak.enable = true;
# VM services
services.cloud-init.enable = true;
services.cloud-init.network.enable = false;
services.qemuGuest.enable = true;
services.spice-vdagentd.enable = true;
services.openssh.enable = true;
services.openssh.settings.PasswordAuthentication = false;
services.openssh.settings.KbdInteractiveAuthentication = false;
security.sudo.wheelNeedsPassword = false;
users.groups = {
cazzzer = {
gid = 1000;
};
};
users.users.cazzzer = {
password = "";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPWgEzbEjbbu96MVQzkiuCrw+UGYAXN4sRe2zM6FVopq cazzzer@Yura-PC"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIApFeLVi3BOquL0Rt+gQK2CutNHaBDQ0m4PcGWf9Bc43 cazzzer@Yura-TPX13"
];
isNormalUser = true;
description = "Yura";
uid = 1000;
group = "cazzzer";
extraGroups = [ "wheel" "docker" "wireshark" ];
};
# Install firefox.
programs.firefox.enable = true;
programs.fish.enable = true;
programs.git.enable = true;
programs.lazygit.enable = true;
programs.neovim.enable = true;
programs.bat.enable = true;
programs.htop.enable = true;
programs.wireshark.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
# https://github.com/flatpak/flatpak/issues/2861
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
# workarounds.flatpak.enable = true;
fonts.packages = with pkgs; [
noto-fonts-cjk-sans
noto-fonts-cjk-serif
fantasque-sans-mono
nerd-fonts.fantasque-sans-mono
jetbrains-mono
];
environment.systemPackages = with pkgs; [
darkman
dust
efibootmgr
eza
fastfetch
fd
host-spawn # for flatpaks
kdePackages.flatpak-kcm
kdePackages.filelight
kdePackages.kate
kdePackages.yakuake
gnumake
helix
mediainfo
micro
mpv
ripgrep
starship
tealdeer
tela-circle-icon-theme
waypipe
whois
yt-dlp
zfs
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment?
}

View File

@ -1,5 +1,6 @@
{ ... }: {
imports = [
./mods
./workarounds
];
}

5
modules/mods/default.nix Normal file
View File

@ -0,0 +1,5 @@
{ ... }: {
imports = [
./kb-input.nix
];
}

42
modules/mods/kb-input.nix Normal file
View File

@ -0,0 +1,42 @@
{
pkgs,
config,
lib,
...
}: let
cfg = config.mods.kb-input;
in {
options = {
mods.kb-input = {
enable = lib.mkEnableOption "input method and custom keyboard layout";
};
};
config = lib.mkIf cfg.enable {
services.xserver.xkb.extraLayouts = {
minimak-4 = {
description = "English (US, Minimak-4)";
languages = [ "eng" ];
symbolsFile = ./minimak;
};
minimak-8 = {
description = "English (US, Minimak-8)";
languages = [ "eng" ];
symbolsFile = ./minimak;
};
minimak-12 = {
description = "English (US, Minimak-12)";
languages = [ "eng" ];
symbolsFile = ./minimak;
};
};
i18n.inputMethod = {
type = "fcitx5";
enable = true;
fcitx5.waylandFrontend = true;
fcitx5.plasma6Support = true;
fcitx5.addons = [ pkgs.fcitx5-mozc ];
};
};
}