refactor, add common modules

This commit is contained in:
Yuri Tatishchev 2025-01-08 21:28:04 -08:00
parent 00af4d57aa
commit f30ff9962c
Signed by: CaZzzer
GPG Key ID: E0EBF441EA424369
10 changed files with 144 additions and 117 deletions

37
flake.lock generated
View File

@ -1,5 +1,41 @@
{ {
"nodes": { "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1735834308, "lastModified": 1735834308,
@ -18,6 +54,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View File

@ -1,4 +1,3 @@
# /etc/nixos/flake.nix
{ {
description = "flake for Yura-PC"; description = "flake for Yura-PC";
@ -6,24 +5,39 @@
nixpkgs = { nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable"; 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 = { nixosConfigurations = {
Yura-PC = nixpkgs.lib.nixosSystem { Yura-PC = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./modules ./modules
./configuration.nix ./hosts/Yura-PC
]; ];
}; };
VM = nixpkgs.lib.nixosSystem { VM = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./modules ./modules
./configuration-vm.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/vm
];
format = "proxmox";
};
};
}; };
} }

View File

@ -10,6 +10,7 @@
./hardware-configuration.nix ./hardware-configuration.nix
# <nixpkgs/nixos/modules/profiles/qemu-guest.nix> # <nixpkgs/nixos/modules/profiles/qemu-guest.nix>
]; ];
common.kb-input.enable = true;
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@ -110,37 +111,6 @@
security.pam.services.sddm.enableGnomeKeyring = true; security.pam.services.sddm.enableGnomeKeyring = true;
# security.pam.services.sddm.gnupg.enable = 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). # Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true; # services.xserver.libinput.enable = true;
@ -158,9 +128,6 @@
group = "cazzzer"; group = "cazzzer";
extraGroups = [ "networkmanager" "wheel" "docker" "wireshark" "geoclue" ]; extraGroups = [ "networkmanager" "wheel" "docker" "wireshark" "geoclue" ];
packages = with pkgs; [ packages = with pkgs; [
kdePackages.kate
kdePackages.yakuake
python3 python3
poetry poetry
@ -191,6 +158,9 @@
programs.gnupg.agent.pinentryPackage = pkgs.pinentry-qt; programs.gnupg.agent.pinentryPackage = pkgs.pinentry-qt;
# programs.starship.enable = true; # programs.starship.enable = true;
programs.wireshark.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 # https://nixos.wiki/wiki/Docker
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
@ -263,13 +233,19 @@
# ]; # ];
workarounds.flatpak.enable = true; 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.fontDir.enable = true;
# fonts.fontconfig.allowBitmaps = false; # fonts.fontconfig.allowBitmaps = false;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bat
# bluez
darkman darkman
dust dust
efibootmgr efibootmgr
@ -277,16 +253,15 @@
fastfetch fastfetch
fd fd
ffmpeg ffmpeg
# flatpak
host-spawn # for flatpaks host-spawn # for flatpaks
kdePackages.flatpak-kcm
kdePackages.filelight kdePackages.filelight
# git kdePackages.flatpak-kcm
kdePackages.kate
kdePackages.yakuake
gcr gcr
gnome-keyring # config for this and some others gnome-keyring # config for this and some others
gnumake gnumake
helix helix
htop
jetbrains-toolbox # or maybe do invidual ones? jetbrains-toolbox # or maybe do invidual ones?
# jetbrains.rust-rover # jetbrains.rust-rover
# jetbrains.pycharm-professional # jetbrains.pycharm-professional
@ -295,11 +270,7 @@
mediainfo mediainfo
micro micro
mpv mpv
neofetch
# neovim
nextcloud-client nextcloud-client
noto-fonts-cjk-sans
noto-fonts-cjk-serif
lxqt.pavucontrol-qt lxqt.pavucontrol-qt
pinentry pinentry
rbw rbw
@ -308,15 +279,10 @@
starship starship
tealdeer tealdeer
tela-circle-icon-theme tela-circle-icon-theme
fantasque-sans-mono
jetbrains-mono
virt-viewer virt-viewer
waypipe waypipe
whois whois
# wireshark
yt-dlp 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.package = pkgs.nixFlakes;

View File

@ -7,8 +7,12 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hardware-configuration-vm.nix # ./hardware-configuration-vm.nix
]; ];
common.kb-input.enable = true;
# boot.kernelParams = [ "console=tty0" ];
proxmox.qemuConf.bios = "ovmf";
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@ -19,7 +23,7 @@
"sysrq_always_enabled=1" "sysrq_always_enabled=1"
]; ];
boot.loader.timeout = 3; # boot.loader.timeout = lib.mkForce 3;
boot.loader.systemd-boot.configurationLimit = 5; boot.loader.systemd-boot.configurationLimit = 5;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12; boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12;
boot.extraModulePackages = with config.boot.kernelPackages; [ zfs ]; boot.extraModulePackages = with config.boot.kernelPackages; [ zfs ];
@ -77,37 +81,6 @@
services.sshd.enable = true; services.sshd.enable = true;
services.flatpak.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). # Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true; # services.xserver.libinput.enable = true;
@ -119,25 +92,17 @@
}; };
}; };
users.users.cazzzer = { users.users.cazzzer = {
password = "";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPWgEzbEjbbu96MVQzkiuCrw+UGYAXN4sRe2zM6FVopq cazzzer@Yura-PC"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIApFeLVi3BOquL0Rt+gQK2CutNHaBDQ0m4PcGWf9Bc43 cazzzer@Yura-TPX13"
];
isNormalUser = true; isNormalUser = true;
description = "Yura"; description = "Yura";
uid = 1000; uid = 1000;
group = "cazzzer"; group = "cazzzer";
extraGroups = [ "networkmanager" "wheel" "docker" "wireshark" ]; extraGroups = [ "wheel" "docker" "wireshark" ];
packages = with pkgs; [
# Python
# python3
# poetry
# Haskell
# haskellPackages.ghc
# haskellPackages.stack
# Node
# nodejs_22
# pnpm
# bun
];
}; };
# Install firefox. # Install firefox.
@ -147,6 +112,10 @@
programs.lazygit.enable = true; programs.lazygit.enable = true;
programs.neovim.enable = true; programs.neovim.enable = true;
programs.bat.enable = true;
programs.htop.enable = true;
programs.wireshark.enable = true;
# https://discourse.nixos.org/t/firefox-does-not-use-kde-window-decorations-and-cursor/32132/3 # https://discourse.nixos.org/t/firefox-does-not-use-kde-window-decorations-and-cursor/32132/3
# programs.dconf.enable = true; # programs.dconf.enable = true;
# programs.firefox = { # programs.firefox = {
@ -166,50 +135,43 @@
# https://github.com/flatpak/flatpak/issues/2861 # https://github.com/flatpak/flatpak/issues/2861
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
workarounds.flatpak.enable = true; # workarounds.flatpak.enable = true;
fonts.packages = with pkgs; [ nerd-fonts.fantasque-sans-mono ]; 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; [ environment.systemPackages = with pkgs; [
bat
# bluez
darkman darkman
dust dust
efibootmgr efibootmgr
eza eza
fastfetch fastfetch
fd fd
# flatpak
host-spawn # for flatpaks host-spawn # for flatpaks
kdePackages.flatpak-kcm kdePackages.flatpak-kcm
kdePackages.filelight kdePackages.filelight
kdePackages.kate kdePackages.kate
kdePackages.yakuake kdePackages.yakuake
# git
gnumake gnumake
helix helix
htop
mediainfo mediainfo
micro micro
mpv mpv
neofetch
# neovim
noto-fonts-cjk-sans
noto-fonts-cjk-serif
ripgrep ripgrep
starship starship
tealdeer tealdeer
tela-circle-icon-theme tela-circle-icon-theme
fantasque-sans-mono
jetbrains-mono
waypipe waypipe
whois whois
# wireshark
yt-dlp yt-dlp
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. zfs
# wget # wget
]; ];
# nix.package = pkgs.nixFlakes;
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.etc."current-system-packages".text = environment.etc."current-system-packages".text =

View File

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

View File

@ -0,0 +1,42 @@
{
pkgs,
config,
lib,
...
}: let
cfg = config.common.kb-input;
in {
options = {
common.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 ];
};
};
}

View File

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