Compare commits
18 Commits
feature/ol
...
feature/ho
Author | SHA1 | Date | |
---|---|---|---|
b3ca6dbac3
|
|||
83bfc367f6
|
|||
042a3c5a71
|
|||
74f9b65585
|
|||
80b743816c
|
|||
d43c8112ff
|
|||
781b159461
|
|||
b5d11fe2d7
|
|||
5559e6bc95
|
|||
c8f9d65f2d
|
|||
d880a8d159
|
|||
cc77980436
|
|||
a9066b0f9c
|
|||
79a0495760
|
|||
f30ff9962c
|
|||
00af4d57aa
|
|||
0fdd9efff2
|
|||
d7c234db82
|
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
6
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
6
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
</profile>
|
||||||
|
</component>
|
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
7
.idea/misc.xml
generated
Normal file
7
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Black">
|
||||||
|
<option name="sdkName" value="Python 3.12" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
|
||||||
|
</project>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/nix-conf.iml" filepath="$PROJECT_DIR$/.idea/nix-conf.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
8
.idea/nix-conf.iml
generated
Normal file
8
.idea/nix-conf.iml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="PYTHON_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="jdk" jdkName="Python 3.12" jdkType="Python SDK" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
7
.idea/vcs.xml
generated
Normal file
7
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
43
flake.lock
generated
43
flake.lock
generated
@@ -1,12 +1,48 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"nixlib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1736643958,
|
||||||
|
"narHash": "sha256-tmpqTSWVRJVhpvfSN9KXBvKEXplrwKnSZNAoNPf/S/s=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "1418bc28a52126761c02dd3d89b2d8ca0f521181",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixos-generators": {
|
||||||
|
"inputs": {
|
||||||
|
"nixlib": "nixlib",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1737057290,
|
||||||
|
"narHash": "sha256-3Pe0yKlCc7EOeq1X/aJVDH0CtNL+tIBm49vpepwL1MQ=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixos-generators",
|
||||||
|
"rev": "d002ce9b6e7eb467cd1c6bb9aef9c35d191b5453",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixos-generators",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1734424634,
|
"lastModified": 1738142207,
|
||||||
"narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=",
|
"narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33",
|
"rev": "9d3ae807ebd2981d593cddd0080856873139aa40",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -18,6 +54,7 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"nixos-generators": "nixos-generators",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
54
flake.nix
54
flake.nix
@@ -1,4 +1,3 @@
|
|||||||
# /etc/nixos/flake.nix
|
|
||||||
{
|
{
|
||||||
description = "flake for Yura-PC";
|
description = "flake for Yura-PC";
|
||||||
|
|
||||||
@@ -6,16 +5,65 @@
|
|||||||
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";
|
||||||
|
};
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs }: {
|
outputs = { self, nixpkgs, nixos-generators, home-manager }: {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
Yura-PC = nixpkgs.lib.nixosSystem {
|
Yura-PC = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./configuration.nix
|
./modules
|
||||||
|
./hosts/common.nix
|
||||||
|
./hosts/Yura-PC
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
VM = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./modules
|
||||||
|
./hosts/common.nix
|
||||||
|
./hosts/vm
|
||||||
|
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.users.jdoe = import ./home.nix;
|
||||||
|
|
||||||
|
# Optionally, use home-manager.extraSpecialArgs to pass
|
||||||
|
# arguments to home.nix
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
router = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./modules
|
||||||
|
./hosts/common.nix
|
||||||
|
./hosts/router
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# 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/proxmox.nix
|
||||||
|
./hosts/vm
|
||||||
|
];
|
||||||
|
format = "proxmox";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ lib, config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
# <nixpkgs/nixos/modules/profiles/qemu-guest.nix>
|
# <nixpkgs/nixos/modules/profiles/qemu-guest.nix>
|
||||||
];
|
];
|
||||||
|
mods.kb-input.enable = true;
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
@@ -22,34 +23,16 @@
|
|||||||
"sysrq_always_enabled=1"
|
"sysrq_always_enabled=1"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# https://nixos.wiki/wiki/OSX-KVM
|
||||||
|
boot.extraModprobeConfig = ''
|
||||||
|
options kvm_amd nested=1
|
||||||
|
options kvm_amd emulate_invalid_guest_state=0
|
||||||
|
options kvm ignore_msrs=1
|
||||||
|
'';
|
||||||
|
|
||||||
boot.loader.timeout = 3;
|
boot.loader.timeout = 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.kernels.linux_6_8;
|
|
||||||
# boot.kernelPackages = pkgs.linuxPackages_6_8;
|
|
||||||
# boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_6;
|
|
||||||
boot.kernelPackages = pkgs.linuxKernel.packages.linux_zen;
|
|
||||||
# nix-prefetch-git --url https://github.com/zen-kernel/zen-kernel.git --rev v6.8.9-zen1 --fetch-submodules
|
|
||||||
# boot.kernelPackages = let
|
|
||||||
# version = "6.8.9";
|
|
||||||
# suffix = "zen1"; # use "lqx1" for linux_lqx
|
|
||||||
# in pkgs.linuxKernel.packagesFor (pkgs.linux_zen.override {
|
|
||||||
# inherit version suffix;
|
|
||||||
# modDirVersion = lib.versions.pad 3 "${version}-${suffix}";
|
|
||||||
# src = pkgs.fetchFromGitHub {
|
|
||||||
# owner = "zen-kernel";
|
|
||||||
# repo = "zen-kernel";
|
|
||||||
# rev = "v${version}-${suffix}";
|
|
||||||
# sha256 = "1wva92wk0pxii4f6hn27kssgrz8yy38kk38w2wm5hh1qyz3ij1vj";
|
|
||||||
# };
|
|
||||||
# });
|
|
||||||
|
|
||||||
boot.extraModulePackages = with config.boot.kernelPackages; [ zfs ];
|
|
||||||
|
|
||||||
# https://discourse.nixos.org/t/dev-zfs-has-the-wrong-permissions-after-rebooting/48737
|
|
||||||
# environment.etc."tmpfiles.d/zfs.conf".text = ''
|
|
||||||
# z /dev/zfs 0666 - - -
|
|
||||||
# '';
|
|
||||||
|
|
||||||
# https://nixos.wiki/wiki/Accelerated_Video_Playback
|
# https://nixos.wiki/wiki/Accelerated_Video_Playback
|
||||||
hardware.graphics = {
|
hardware.graphics = {
|
||||||
@@ -58,7 +41,8 @@
|
|||||||
intel-media-driver # LIBVA_DRIVER_NAME=iHD
|
intel-media-driver # LIBVA_DRIVER_NAME=iHD
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
# environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; # Force intel-media-driver
|
|
||||||
|
environment.etc.hosts.mode = "0644";
|
||||||
|
|
||||||
networking.hostName = "Yura-PC"; # Define your hostname.
|
networking.hostName = "Yura-PC"; # Define your hostname.
|
||||||
networking.hostId = "110a2814"; # Required for ZFS.
|
networking.hostId = "110a2814"; # Required for ZFS.
|
||||||
@@ -71,24 +55,6 @@
|
|||||||
# Enable networking
|
# Enable networking
|
||||||
networking.networkmanager.enable = true;
|
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.
|
# Enable the X11 windowing system.
|
||||||
# You can disable this if you're only using the Wayland session.
|
# You can disable this if you're only using the Wayland session.
|
||||||
services.xserver.enable = false;
|
services.xserver.enable = false;
|
||||||
@@ -98,17 +64,11 @@
|
|||||||
services.displayManager.sddm.wayland.enable = true;
|
services.displayManager.sddm.wayland.enable = true;
|
||||||
services.desktopManager.plasma6.enable = true;
|
services.desktopManager.plasma6.enable = true;
|
||||||
|
|
||||||
# Configure keymap in X11
|
|
||||||
services.xserver.xkb = {
|
|
||||||
layout = "us";
|
|
||||||
variant = "";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
|
||||||
# Enable sound with pipewire.
|
# Enable sound with pipewire.
|
||||||
hardware.pulseaudio.enable = false;
|
services.pulseaudio.enable = false;
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -125,7 +85,7 @@
|
|||||||
|
|
||||||
# services.qemuGuest.enable = true;
|
# services.qemuGuest.enable = true;
|
||||||
# services.spice-vdagentd.enable = true;
|
# services.spice-vdagentd.enable = true;
|
||||||
services.sshd.enable = true;
|
services.openssh.enable = true;
|
||||||
services.flatpak.enable = true;
|
services.flatpak.enable = true;
|
||||||
# services.geoclue2.enable = true;
|
# services.geoclue2.enable = true;
|
||||||
location.provider = "geoclue2";
|
location.provider = "geoclue2";
|
||||||
@@ -133,37 +93,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;
|
||||||
@@ -181,10 +110,7 @@
|
|||||||
group = "cazzzer";
|
group = "cazzzer";
|
||||||
extraGroups = [ "networkmanager" "wheel" "docker" "wireshark" "geoclue" ];
|
extraGroups = [ "networkmanager" "wheel" "docker" "wireshark" "geoclue" ];
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
python312Packages.torch
|
# Python
|
||||||
|
|
||||||
kdePackages.kate
|
|
||||||
kdePackages.yakuake
|
|
||||||
python3
|
python3
|
||||||
poetry
|
poetry
|
||||||
|
|
||||||
@@ -197,23 +123,19 @@
|
|||||||
pnpm
|
pnpm
|
||||||
bun
|
bun
|
||||||
|
|
||||||
# yin_yang deps, f*** this packaging s***
|
# Nix
|
||||||
python312Packages.systemd
|
nixd
|
||||||
python312Packages.pyside6
|
|
||||||
python312Packages.dateutils
|
|
||||||
python312Packages.psutil
|
|
||||||
libnotify
|
|
||||||
# thunderbird
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
hardware.bluetooth.powerOnBoot = false;
|
hardware.bluetooth.powerOnBoot = false;
|
||||||
# Install firefox.
|
# Install firefox.
|
||||||
programs.firefox.enable = true;
|
# programs.firefox.enable = true;
|
||||||
programs.kdeconnect.enable = true;
|
programs.kdeconnect.enable = true;
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
programs.git.enable = true;
|
programs.git.enable = true;
|
||||||
|
programs.git.lfs.enable = true;
|
||||||
# https://nixos.wiki/wiki/Git
|
# https://nixos.wiki/wiki/Git
|
||||||
programs.git.package = pkgs.git.override { withLibsecret = true; };
|
programs.git.package = pkgs.git.override { withLibsecret = true; };
|
||||||
programs.lazygit.enable = true;
|
programs.lazygit.enable = true;
|
||||||
@@ -222,6 +144,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;
|
||||||
@@ -229,7 +154,6 @@
|
|||||||
virtualisation.docker.package = pkgs.docker_27;
|
virtualisation.docker.package = pkgs.docker_27;
|
||||||
virtualisation.docker.storageDriver = "zfs";
|
virtualisation.docker.storageDriver = "zfs";
|
||||||
|
|
||||||
|
|
||||||
# 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 = {
|
||||||
@@ -256,31 +180,6 @@
|
|||||||
|
|
||||||
# For JetBrains stuff
|
# For JetBrains stuff
|
||||||
# https://github.com/NixOS/nixpkgs/issues/240444
|
# https://github.com/NixOS/nixpkgs/issues/240444
|
||||||
curl
|
|
||||||
expat
|
|
||||||
fontconfig
|
|
||||||
freetype
|
|
||||||
fuse
|
|
||||||
fuse3
|
|
||||||
glib
|
|
||||||
icu
|
|
||||||
libclang.lib
|
|
||||||
libdbusmenu
|
|
||||||
libsecret
|
|
||||||
libxcrypt-legacy
|
|
||||||
libxml2
|
|
||||||
nss
|
|
||||||
openssl
|
|
||||||
python3
|
|
||||||
stdenv.cc.cc
|
|
||||||
xorg.libX11
|
|
||||||
xorg.libXcursor
|
|
||||||
xorg.libXext
|
|
||||||
xorg.libXi
|
|
||||||
xorg.libXrender
|
|
||||||
xorg.libXtst
|
|
||||||
xz
|
|
||||||
zlib
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# attempt to fix flatpak firefox cjk fonts
|
# attempt to fix flatpak firefox cjk fonts
|
||||||
@@ -288,44 +187,51 @@
|
|||||||
# "Noto Serif"
|
# "Noto Serif"
|
||||||
# "DejaVu Serif"
|
# "DejaVu Serif"
|
||||||
# ];
|
# ];
|
||||||
|
# fonts.fontconfig.defaultFonts.sansSerif = [
|
||||||
|
# "Noto Sans"
|
||||||
|
# "DejaVu Sans"
|
||||||
|
# ];
|
||||||
|
|
||||||
|
workarounds.flatpak.enable = true;
|
||||||
|
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; [
|
environment.systemPackages = with pkgs; [
|
||||||
level-zero
|
darkman
|
||||||
oneDNN
|
|
||||||
python312Packages.torch
|
|
||||||
# zfs
|
|
||||||
# fish
|
|
||||||
|
|
||||||
bat
|
|
||||||
# bluez
|
|
||||||
# docker_27
|
|
||||||
# docker-compose
|
|
||||||
dust
|
dust
|
||||||
efibootmgr
|
efibootmgr
|
||||||
eza
|
eza
|
||||||
fastfetch
|
fastfetch
|
||||||
fd
|
fd
|
||||||
# flatpak
|
ffmpeg
|
||||||
kdePackages.flatpak-kcm
|
host-spawn # for flatpaks
|
||||||
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.clion
|
||||||
# jetbrains.webstorm
|
jetbrains.pycharm-professional
|
||||||
|
jetbrains.webstorm
|
||||||
|
android-studio
|
||||||
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
|
||||||
@@ -334,28 +240,12 @@
|
|||||||
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.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
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
# started in user sessions.
|
# started in user sessions.
|
||||||
# programs.mtr.enable = true;
|
# programs.mtr.enable = true;
|
||||||
@@ -370,7 +260,8 @@
|
|||||||
# services.openssh.enable = true;
|
# services.openssh.enable = true;
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# Open ports in the firewall.
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
# networking.nftables.enable = true;
|
||||||
|
networking.firewall.allowedTCPPorts = [ 8080 ];
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
# Or disable the firewall altogether.
|
# Or disable the firewall altogether.
|
||||||
# networking.firewall.enable = false;
|
# networking.firewall.enable = false;
|
38
hosts/common.nix
Normal file
38
hosts/common.nix
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{ config, pkgs, inputs, ... }: {
|
||||||
|
imports = [
|
||||||
|
inputs.home-manager.nixosModules.home-manager
|
||||||
|
];
|
||||||
|
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
|
||||||
|
# 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;
|
||||||
|
}
|
576
hosts/router/default.nix
Normal file
576
hosts/router/default.nix
Normal file
@@ -0,0 +1,576 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
domain = "cazzzer.com";
|
||||||
|
ldomain = "l.${domain}";
|
||||||
|
|
||||||
|
if_wan = "wan";
|
||||||
|
if_lan = "lan";
|
||||||
|
if_lan10 = "lan.10";
|
||||||
|
if_lan20 = "lan.20";
|
||||||
|
|
||||||
|
wan_ip4 = "192.168.1.61/24";
|
||||||
|
wan_gw4 = "192.168.1.254";
|
||||||
|
|
||||||
|
lan_p4 = "10.19.1"; # .0/24
|
||||||
|
lan10_p4 = "10.19.10"; # .0/24
|
||||||
|
lan20_p4 = "10.19.20"; # .0/24
|
||||||
|
|
||||||
|
pd_from_wan = ""; # ::/60
|
||||||
|
lan_p6 = "${pd_from_wan}9"; # ::/64
|
||||||
|
lan10_p6 = "${pd_from_wan}a"; # ::/64
|
||||||
|
lan20_p6 = "${pd_from_wan}2"; # ::/64
|
||||||
|
|
||||||
|
ula_p = "fdab:07d3:581d"; # ::/48
|
||||||
|
lan_ula_p = "${ula_p}:0001"; # ::/64
|
||||||
|
lan10_ula_p = "${ula_p}:0010"; # ::/64
|
||||||
|
lan20_ula_p = "${ula_p}:0020"; # ::/64
|
||||||
|
lan_ula_addr = "${lan_ula_p}::1";
|
||||||
|
lan10_ula_addr = "${lan10_ula_p}::1";
|
||||||
|
lan20_ula_addr = "${lan20_ula_p}::1";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ # Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# Bootloader.
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = false;
|
||||||
|
boot.kernelParams = [
|
||||||
|
"sysrq_always_enabled=1"
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.loader.systemd-boot.configurationLimit = 5;
|
||||||
|
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12;
|
||||||
|
boot.growPartition = true;
|
||||||
|
|
||||||
|
environment.etc.hosts.mode = "0644";
|
||||||
|
networking.hostName = "grouter";
|
||||||
|
|
||||||
|
# It is impossible to do multiple prefix requests with networkd,
|
||||||
|
# so I use dhcpcd for this
|
||||||
|
# https://github.com/systemd/systemd/issues/22571
|
||||||
|
networking.dhcpcd.enable = true;
|
||||||
|
# https://github.com/systemd/systemd/issues/22571#issuecomment-2094905496
|
||||||
|
# https://gist.github.com/csamsel/0f8cca3b2e64d7e4cc47819ec5ba9396
|
||||||
|
networking.dhcpcd.extraConfig = ''
|
||||||
|
duid
|
||||||
|
ipv6only
|
||||||
|
nodhcp6
|
||||||
|
noipv6rs
|
||||||
|
nohook resolv.conf, yp, hostname, ntp
|
||||||
|
option rapid_commit
|
||||||
|
|
||||||
|
interface ${if_wan}
|
||||||
|
ipv6rs
|
||||||
|
dhcp6
|
||||||
|
|
||||||
|
# this doesn't play well with networkd
|
||||||
|
# ia_na
|
||||||
|
# ia_pd 1 ${if_lan}/0
|
||||||
|
# ia_pd 2 ${if_lan10}/0
|
||||||
|
# ia_pd 3 ${if_lan20}/0
|
||||||
|
|
||||||
|
# request the leases just for routing (so that the att box knows we're here)
|
||||||
|
# actual ip assignments are static, based on $pd_from_wan
|
||||||
|
ia_pd 1 -
|
||||||
|
ia_pd 2 -
|
||||||
|
# ia_pd 3 -
|
||||||
|
# ia_pd 4 -
|
||||||
|
# ia_pd 5 -
|
||||||
|
# ia_pd 6 -
|
||||||
|
# ia_pd 7 -
|
||||||
|
# ia_pd 8 -
|
||||||
|
'';
|
||||||
|
|
||||||
|
networking.useNetworkd = true;
|
||||||
|
systemd.network.enable = true;
|
||||||
|
systemd.network = {
|
||||||
|
# Global options
|
||||||
|
config.networkConfig = {
|
||||||
|
IPv4Forwarding = true;
|
||||||
|
IPv6Forwarding = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# This is applied by udev, not networkd
|
||||||
|
# https://nixos.wiki/wiki/Systemd-networkd
|
||||||
|
# https://nixos.org/manual/nixos/stable/#sec-rename-ifs
|
||||||
|
links = {
|
||||||
|
"10-wan" = {
|
||||||
|
matchConfig.PermanentMACAddress = "bc:24:11:4f:c9:c4";
|
||||||
|
linkConfig.Name = if_wan;
|
||||||
|
};
|
||||||
|
"10-lan" = {
|
||||||
|
matchConfig.PermanentMACAddress = "bc:24:11:83:d8:de";
|
||||||
|
linkConfig.Name = if_lan;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
netdevs = {
|
||||||
|
"10-vlan10" = {
|
||||||
|
netdevConfig = {
|
||||||
|
Kind = "vlan";
|
||||||
|
Name = if_lan10;
|
||||||
|
};
|
||||||
|
vlanConfig.Id = 10;
|
||||||
|
};
|
||||||
|
"10-vlan20" = {
|
||||||
|
netdevConfig = {
|
||||||
|
Kind = "vlan";
|
||||||
|
Name = if_lan20;
|
||||||
|
};
|
||||||
|
vlanConfig.Id = 20;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networks = {
|
||||||
|
"10-wan" = {
|
||||||
|
matchConfig.Name = if_wan;
|
||||||
|
networkConfig = {
|
||||||
|
# start a DHCP Client for IPv4 Addressing/Routing
|
||||||
|
# DHCP = "ipv4";
|
||||||
|
# accept Router Advertisements for Stateless IPv6 Autoconfiguraton (SLAAC)
|
||||||
|
# let dhcpcd handle this
|
||||||
|
Address = [ wan_ip4 ];
|
||||||
|
IPv6AcceptRA = false;
|
||||||
|
};
|
||||||
|
routes = [ { Gateway = wan_gw4; } ];
|
||||||
|
# make routing on this interface a dependency for network-online.target
|
||||||
|
linkConfig.RequiredForOnline = "routable";
|
||||||
|
};
|
||||||
|
"20-lan" = {
|
||||||
|
matchConfig.Name = "lan";
|
||||||
|
vlan = [
|
||||||
|
if_lan10
|
||||||
|
if_lan20
|
||||||
|
];
|
||||||
|
networkConfig = {
|
||||||
|
IPv4Forwarding = true;
|
||||||
|
IPv6SendRA = true;
|
||||||
|
Address = [ "${lan_p4}.1/24" ];
|
||||||
|
};
|
||||||
|
ipv6Prefixes = [
|
||||||
|
{
|
||||||
|
# AddressAutoconfiguration = false;
|
||||||
|
Prefix = "${lan_p6}::/64";
|
||||||
|
Assign = true;
|
||||||
|
# Token = [ "static:::1" "eui64" ];
|
||||||
|
Token = [ "static:::1" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Prefix = "${lan_ula_p}::/64";
|
||||||
|
Assign = true;
|
||||||
|
Token = [ "static:::1" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
ipv6SendRAConfig = {
|
||||||
|
Managed = true;
|
||||||
|
OtherInformation = true;
|
||||||
|
EmitDNS = true;
|
||||||
|
DNS = [ lan_ula_addr ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"30-vlan10" = {
|
||||||
|
matchConfig.Name = if_lan10;
|
||||||
|
networkConfig = {
|
||||||
|
IPv6SendRA = true;
|
||||||
|
Address = [ "${lan10_p4}.1/24" ];
|
||||||
|
};
|
||||||
|
ipv6Prefixes = [
|
||||||
|
{
|
||||||
|
Prefix = "${lan10_p6}::/64";
|
||||||
|
Assign = true;
|
||||||
|
Token = [ "static:::1" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Prefix = "${lan10_ula_p}::/64";
|
||||||
|
Assign = true;
|
||||||
|
Token = [ "static:::1" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"30-vlan20" = {
|
||||||
|
matchConfig.Name = if_lan20;
|
||||||
|
networkConfig = {
|
||||||
|
IPv6SendRA = true;
|
||||||
|
Address = [ "${lan20_p4}.1/24" ];
|
||||||
|
};
|
||||||
|
ipv6Prefixes = [
|
||||||
|
{
|
||||||
|
Prefix = "${lan20_p6}::/64";
|
||||||
|
Assign = true;
|
||||||
|
Token = [ "static:::1" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Prefix = "${lan20_ula_p}::/64";
|
||||||
|
Assign = true;
|
||||||
|
Token = [ "static:::1" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.enable = false;
|
||||||
|
networking.nftables.enable = true;
|
||||||
|
networking.nftables.tables.firewall = {
|
||||||
|
family = "inet";
|
||||||
|
content = ''
|
||||||
|
define WAN_IF = "${if_wan}"
|
||||||
|
define LAN_IF = "${if_lan}"
|
||||||
|
define LAN_IPV4_SUBNET = ${lan_p4}.0/24
|
||||||
|
define LAN_IPV6_SUBNET = ${lan_p6}::/64
|
||||||
|
define LAN_IPV6_ULA = ${lan_ula_p}::/64
|
||||||
|
define LAN_IPV4_HOST = ${lan_p4}.100
|
||||||
|
define LAN_IPV6_HOST = ${lan_p6}::1:1000
|
||||||
|
|
||||||
|
define ALLOWED_TCP_PORTS = { ssh, https, 19999 }
|
||||||
|
define ALLOWED_UDP_PORTS = { domain }
|
||||||
|
|
||||||
|
chain input {
|
||||||
|
type filter hook input priority filter; policy drop;
|
||||||
|
|
||||||
|
# Allow established and related connections
|
||||||
|
ct state established,related accept
|
||||||
|
|
||||||
|
# Allow all traffic from loopback interface
|
||||||
|
iifname lo accept
|
||||||
|
|
||||||
|
# Allow ICMPv6 on link local addrs
|
||||||
|
ip6 nexthdr icmpv6 ip6 saddr fe80::/10 accept
|
||||||
|
ip6 nexthdr icmpv6 ip6 daddr fe80::/10 accept # TODO: not sure if necessary
|
||||||
|
|
||||||
|
# Allow all ICMPv6 from LAN
|
||||||
|
iifname $LAN_IF ip6 saddr { $LAN_IPV6_SUBNET, $LAN_IPV6_ULA } ip6 nexthdr icmpv6 accept
|
||||||
|
# Allow DHCPv6 client traffic
|
||||||
|
ip6 daddr { fe80::/10, ff02::/16 } udp dport dhcpv6-server accept
|
||||||
|
|
||||||
|
# Allow all ICMP from LAN
|
||||||
|
iifname $LAN_IF ip saddr $LAN_IPV4_SUBNET ip protocol icmp accept
|
||||||
|
|
||||||
|
# Allow specific services from LAN
|
||||||
|
iifname $LAN_IF ip saddr $LAN_IPV4_SUBNET tcp dport $ALLOWED_TCP_PORTS accept
|
||||||
|
iifname $LAN_IF ip6 saddr { $LAN_IPV6_SUBNET, $LAN_IPV6_ULA } tcp dport $ALLOWED_TCP_PORTS accept
|
||||||
|
iifname $LAN_IF ip saddr $LAN_IPV4_SUBNET udp dport $ALLOWED_UDP_PORTS accept
|
||||||
|
iifname $LAN_IF ip6 saddr { $LAN_IPV6_SUBNET, $LAN_IPV6_ULA } udp dport $ALLOWED_UDP_PORTS accept
|
||||||
|
|
||||||
|
# Allow SSH from WAN (if needed)
|
||||||
|
iifname $WAN_IF tcp dport ssh accept
|
||||||
|
}
|
||||||
|
|
||||||
|
chain forward {
|
||||||
|
type filter hook forward priority filter; policy drop;
|
||||||
|
|
||||||
|
# Allow established and related connections
|
||||||
|
ct state established,related accept
|
||||||
|
|
||||||
|
# Port forwarding
|
||||||
|
iifname $WAN_IF tcp dport https ip daddr $LAN_IPV4_HOST accept
|
||||||
|
|
||||||
|
# Allowed IPv6 ports
|
||||||
|
iifname $WAN_IF tcp dport https ip6 daddr $LAN_IPV6_HOST accept
|
||||||
|
|
||||||
|
# Allow traffic from LAN to WAN
|
||||||
|
iifname $LAN_IF ip saddr $LAN_IPV4_SUBNET oifname $WAN_IF accept
|
||||||
|
iifname $LAN_IF ip6 saddr $LAN_IPV6_SUBNET oifname $WAN_IF accept
|
||||||
|
}
|
||||||
|
|
||||||
|
chain output {
|
||||||
|
# Accept anything out of self by default
|
||||||
|
type filter hook output priority filter; policy accept;
|
||||||
|
}
|
||||||
|
|
||||||
|
chain prerouting {
|
||||||
|
# Initial step, accept by default
|
||||||
|
type nat hook prerouting priority dstnat; policy accept;
|
||||||
|
|
||||||
|
# Port forwarding
|
||||||
|
iifname $WAN_IF tcp dport https dnat ip to $LAN_IPV4_HOST
|
||||||
|
}
|
||||||
|
|
||||||
|
chain postrouting {
|
||||||
|
# Last step, accept by default
|
||||||
|
type nat hook postrouting priority srcnat; policy accept;
|
||||||
|
|
||||||
|
# Masquerade LAN addrs
|
||||||
|
# theoretically shouldn't need to check the input interface here,
|
||||||
|
# as it would be filtered by the forwarding rules
|
||||||
|
oifname $WAN_IF ip saddr $LAN_IPV4_SUBNET masquerade
|
||||||
|
|
||||||
|
# Optional IPv6 masquerading (big L if enabled)
|
||||||
|
# oifname $WAN_IF ip6 saddr $LAN_IPV6_ULA masquerade
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.kea.dhcp4.enable = true;
|
||||||
|
services.kea.dhcp4.settings = {
|
||||||
|
interfaces-config.interfaces = [
|
||||||
|
if_lan
|
||||||
|
];
|
||||||
|
dhcp-ddns.enable-updates = true;
|
||||||
|
ddns-qualifying-suffix = "default.${ldomain}";
|
||||||
|
subnet4 = [
|
||||||
|
{
|
||||||
|
id = 1;
|
||||||
|
subnet = "${lan_p4}.0/24";
|
||||||
|
ddns-qualifying-suffix = "lan.${ldomain}";
|
||||||
|
pools = [ { pool = "${lan_p4}.100 - ${lan_p4}.199"; } ];
|
||||||
|
option-data = [
|
||||||
|
{
|
||||||
|
name = "routers";
|
||||||
|
data = "${lan_p4}.1";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "domain-name-servers";
|
||||||
|
data = "${lan_p4}.1";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
reservations = [
|
||||||
|
{
|
||||||
|
hw-address = "bc:24:11:b7:27:4d";
|
||||||
|
hostname = "archy";
|
||||||
|
ip-address = "${lan_p4}.69";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.kea.dhcp6.enable = true;
|
||||||
|
services.kea.dhcp6.settings = {
|
||||||
|
interfaces-config.interfaces = [
|
||||||
|
if_lan
|
||||||
|
];
|
||||||
|
# TODO: https://kea.readthedocs.io/en/latest/arm/ddns.html#dual-stack-environments
|
||||||
|
dhcp-ddns.enable-updates = true;
|
||||||
|
ddns-qualifying-suffix = "default6.${ldomain}";
|
||||||
|
subnet6 = [
|
||||||
|
{
|
||||||
|
id = 1;
|
||||||
|
interface = if_lan;
|
||||||
|
subnet = "${lan_p6}::/64";
|
||||||
|
ddns-qualifying-suffix = "lan6.${ldomain}";
|
||||||
|
rapid-commit = true;
|
||||||
|
pools = [ { pool = "${lan_p6}::1:1000/116"; } ];
|
||||||
|
reservations = [
|
||||||
|
{
|
||||||
|
duid = "00:04:59:c3:ce:9a:08:cf:fb:b7:fe:74:9c:e3:b7:44:bf:01";
|
||||||
|
hostname = "archy";
|
||||||
|
ip-addresses = [ "${lan_p6}::69" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.kea.dhcp-ddns.enable = true;
|
||||||
|
services.kea.dhcp-ddns.settings = {
|
||||||
|
forward-ddns = {
|
||||||
|
ddns-domains = [
|
||||||
|
{
|
||||||
|
name = "${ldomain}.";
|
||||||
|
dns-servers = [
|
||||||
|
{
|
||||||
|
ip-address = "::1";
|
||||||
|
port = 1053;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.resolved.enable = false;
|
||||||
|
networking.resolvconf.enable = true;
|
||||||
|
networking.resolvconf.useLocalResolver = true;
|
||||||
|
|
||||||
|
services.adguardhome.enable = true;
|
||||||
|
services.adguardhome.mutableSettings = false;
|
||||||
|
services.adguardhome.settings = {
|
||||||
|
dns = {
|
||||||
|
bootstrap_dns = [ "1.1.1.1" "9.9.9.9" ];
|
||||||
|
upstream_dns = [
|
||||||
|
"quic://p0.freedns.controld.com" # Default upstream
|
||||||
|
"[/${ldomain}/][::1]:1053" # Local domains to Knot (ddns)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
# https://adguard-dns.io/kb/general/dns-filtering-syntax/
|
||||||
|
user_rules = [
|
||||||
|
# DNS rewrites
|
||||||
|
"|grouter.${domain}^$dnsrewrite=${lan_ula_addr}"
|
||||||
|
|
||||||
|
# Allowed exceptions
|
||||||
|
"@@||googleads.g.doubleclick.net"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.knot.enable = true;
|
||||||
|
services.knot.settings = {
|
||||||
|
server = {
|
||||||
|
# listen = "0.0.0.0@1053";
|
||||||
|
listen = "::1@1053";
|
||||||
|
};
|
||||||
|
# TODO: templates
|
||||||
|
zone = [
|
||||||
|
{
|
||||||
|
domain = ldomain;
|
||||||
|
storage = "/var/lib/knot/zones";
|
||||||
|
file = "${ldomain}.zone";
|
||||||
|
acl = [ "allow_localhost_update" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
acl = [
|
||||||
|
{
|
||||||
|
id = "allow_localhost_update";
|
||||||
|
address = [ "::1" "127.0.0.1" ];
|
||||||
|
action = [ "update" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
# Ensure the zone file exists
|
||||||
|
system.activationScripts.knotZoneFile = ''
|
||||||
|
ZONE_DIR="/var/lib/knot/zones"
|
||||||
|
ZONE_FILE="$ZONE_DIR/${ldomain}.zone"
|
||||||
|
|
||||||
|
# Create the directory if it doesn't exist
|
||||||
|
mkdir -p "$ZONE_DIR"
|
||||||
|
|
||||||
|
# Check if the zone file exists
|
||||||
|
if [ ! -f "$ZONE_FILE" ]; then
|
||||||
|
# Create the zone file with a basic SOA record
|
||||||
|
# Serial; Refresh; Retry; Expire; Negative Cache TTL;
|
||||||
|
echo "${ldomain}. 3600 SOA ns.${ldomain}. admin.${ldomain}. 1 86400 900 691200 3600" > "$ZONE_FILE"
|
||||||
|
echo "Created new zone file: $ZONE_FILE"
|
||||||
|
else
|
||||||
|
echo "Zone file already exists: $ZONE_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure proper ownership and permissions
|
||||||
|
chown -R knot:knot "/var/lib/knot"
|
||||||
|
chmod 644 "$ZONE_FILE"
|
||||||
|
'';
|
||||||
|
|
||||||
|
# https://wiki.nixos.org/wiki/Prometheus
|
||||||
|
services.prometheus = {
|
||||||
|
enable = true;
|
||||||
|
exporters = {
|
||||||
|
# TODO: DNS, Kea, Knot, other exporters
|
||||||
|
node = {
|
||||||
|
enable = true;
|
||||||
|
enabledCollectors = [ "systemd" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "node";
|
||||||
|
static_configs = [{
|
||||||
|
targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ];
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# https://wiki.nixos.org/wiki/Grafana#Declarative_configuration
|
||||||
|
services.grafana = {
|
||||||
|
enable = true;
|
||||||
|
settings.server.http_port = 3001;
|
||||||
|
provision = {
|
||||||
|
enable = true;
|
||||||
|
datasources.settings.datasources = [
|
||||||
|
{
|
||||||
|
name = "Prometheus";
|
||||||
|
type = "prometheus";
|
||||||
|
url = "http://localhost:${toString config.services.prometheus.port}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.caddy = {
|
||||||
|
enable = true;
|
||||||
|
virtualHosts."grouter.${domain}".extraConfig = ''
|
||||||
|
reverse_proxy localhost:${toString config.services.grafana.settings.server.http_port}
|
||||||
|
tls internal
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# services.netdata.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.
|
||||||
|
# Useful for debugging with wireshark.
|
||||||
|
services.displayManager.sddm.enable = false;
|
||||||
|
services.displayManager.sddm.wayland.enable = true;
|
||||||
|
services.desktopManager.plasma6.enable = true;
|
||||||
|
# No need for audio in VM
|
||||||
|
services.pipewire.enable = false;
|
||||||
|
|
||||||
|
# VM services
|
||||||
|
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" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.firefox.enable = true;
|
||||||
|
programs.fish.enable = true;
|
||||||
|
programs.git.enable = true;
|
||||||
|
programs.neovim.enable = true;
|
||||||
|
programs.bat.enable = true;
|
||||||
|
programs.htop.enable = true;
|
||||||
|
programs.wireshark.enable = true;
|
||||||
|
programs.wireshark.package = pkgs.wireshark; # wireshark-cli by default
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
dust
|
||||||
|
eza
|
||||||
|
fastfetch
|
||||||
|
fd
|
||||||
|
kdePackages.filelight
|
||||||
|
kdePackages.kate
|
||||||
|
kdePackages.yakuake
|
||||||
|
ldns
|
||||||
|
lsof
|
||||||
|
micro
|
||||||
|
mpv
|
||||||
|
ripgrep
|
||||||
|
rustscan
|
||||||
|
starship
|
||||||
|
tealdeer
|
||||||
|
waypipe
|
||||||
|
whois
|
||||||
|
];
|
||||||
|
|
||||||
|
# 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. It‘s 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?
|
||||||
|
}
|
37
hosts/router/hardware-configuration.nix
Normal file
37
hosts/router/hardware-configuration.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/f222513b-ded1-49fa-b591-20ce86a2fe7f";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/12CE-A600";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0022" "dmask=0022" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp6s18.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
131
hosts/vm/default.nix
Normal file
131
hosts/vm/default.nix
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
# 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 = false;
|
||||||
|
|
||||||
|
# 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.systemd-boot.configurationLimit = 5;
|
||||||
|
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12;
|
||||||
|
|
||||||
|
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.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; [
|
||||||
|
dust
|
||||||
|
eza
|
||||||
|
fastfetch
|
||||||
|
fd
|
||||||
|
host-spawn # for flatpaks
|
||||||
|
kdePackages.flatpak-kcm
|
||||||
|
kdePackages.filelight
|
||||||
|
kdePackages.kate
|
||||||
|
kdePackages.yakuake
|
||||||
|
ldns
|
||||||
|
micro
|
||||||
|
mpv
|
||||||
|
ripgrep
|
||||||
|
starship
|
||||||
|
tealdeer
|
||||||
|
waypipe
|
||||||
|
whois
|
||||||
|
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. It‘s 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?
|
||||||
|
}
|
37
hosts/vm/hardware-configuration.nix
Normal file
37
hosts/vm/hardware-configuration.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/da85e220-e2b0-443a-9a0c-a9516b8e5030";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/3F96-8974";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0022" "dmask=0022" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp6s18.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
11
hosts/vm/proxmox.nix
Normal file
11
hosts/vm/proxmox.nix
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# boot.kernelParams = [ "console=tty0" ];
|
||||||
|
proxmox.qemuConf.bios = "ovmf";
|
||||||
|
proxmox.qemuExtraConf = {
|
||||||
|
machine = "q35";
|
||||||
|
# efidisk0 = "local-lvm:vm-9999-disk-1";
|
||||||
|
cpu = "host";
|
||||||
|
};
|
||||||
|
}
|
6
modules/default.nix
Normal file
6
modules/default.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{ ... }: {
|
||||||
|
imports = [
|
||||||
|
./mods
|
||||||
|
./workarounds
|
||||||
|
];
|
||||||
|
}
|
5
modules/mods/default.nix
Normal file
5
modules/mods/default.nix
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{ ... }: {
|
||||||
|
imports = [
|
||||||
|
./kb-input.nix
|
||||||
|
];
|
||||||
|
}
|
42
modules/mods/kb-input.nix
Normal file
42
modules/mods/kb-input.nix
Normal 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 ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
5
modules/workarounds/default.nix
Normal file
5
modules/workarounds/default.nix
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./flatpak.nix
|
||||||
|
];
|
||||||
|
}
|
44
modules/workarounds/flatpak.nix
Normal file
44
modules/workarounds/flatpak.nix
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# https://github.com/knightpp/nixos-cfg/blob/main/modules/workarounds/flatpak.nix
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.workarounds.flatpak;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
workarounds.flatpak = {
|
||||||
|
enable = lib.mkEnableOption "flatpak workaround";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
system.fsPackages = [pkgs.bindfs];
|
||||||
|
fileSystems = let
|
||||||
|
mkRoSymBind = path: {
|
||||||
|
device = path;
|
||||||
|
fsType = "fuse.bindfs";
|
||||||
|
options = ["ro" "resolve-symlinks" "x-gvfs-hide"];
|
||||||
|
};
|
||||||
|
aggregated = pkgs.buildEnv {
|
||||||
|
name = "system-fonts-and-icons";
|
||||||
|
paths = builtins.attrValues {
|
||||||
|
inherit (pkgs.kdePackages) breeze;
|
||||||
|
inherit
|
||||||
|
(pkgs)
|
||||||
|
noto-fonts
|
||||||
|
noto-fonts-emoji
|
||||||
|
noto-fonts-cjk-sans
|
||||||
|
noto-fonts-cjk-serif
|
||||||
|
;
|
||||||
|
};
|
||||||
|
pathsToLink = ["/share/fonts" "/share/icons"];
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
# Create an FHS mount to support flatpak host icons/fonts
|
||||||
|
"/usr/share/icons" = mkRoSymBind "${aggregated}/share/icons";
|
||||||
|
"/usr/share/fonts" = mkRoSymBind "${aggregated}/share/fonts";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user