move out some common host settings to hosts/common.nix
This commit is contained in:
parent
f30ff9962c
commit
79a0495760
@ -17,6 +17,7 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./modules
|
./modules
|
||||||
|
./hosts/common.nix
|
||||||
./hosts/Yura-PC
|
./hosts/Yura-PC
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@ -24,6 +25,7 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./modules
|
./modules
|
||||||
|
./hosts/common.nix
|
||||||
./hosts/vm
|
./hosts/vm
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@ -34,6 +36,7 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./modules
|
./modules
|
||||||
|
./hosts/common.nix
|
||||||
./hosts/vm
|
./hosts/vm
|
||||||
];
|
];
|
||||||
format = "proxmox";
|
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,7 +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;
|
mods.kb-input.enable = true;
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
@ -49,24 +49,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;
|
||||||
@ -76,12 +58,6 @@
|
|||||||
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;
|
||||||
|
|
||||||
@ -103,7 +79,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";
|
||||||
@ -285,17 +261,6 @@
|
|||||||
yt-dlp
|
yt-dlp
|
||||||
];
|
];
|
||||||
|
|
||||||
# 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;
|
||||||
|
31
hosts/common.nix
Normal file
31
hosts/common.nix
Normal 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;
|
||||||
|
}
|
@ -2,14 +2,14 @@
|
|||||||
# 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 =
|
||||||
[ # 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;
|
mods.kb-input.enable = true;
|
||||||
|
|
||||||
# boot.kernelParams = [ "console=tty0" ];
|
# boot.kernelParams = [ "console=tty0" ];
|
||||||
proxmox.qemuConf.bios = "ovmf";
|
proxmox.qemuConf.bios = "ovmf";
|
||||||
@ -30,7 +30,8 @@
|
|||||||
|
|
||||||
environment.etc.hosts.mode = "0644";
|
environment.etc.hosts.mode = "0644";
|
||||||
|
|
||||||
networking.hostName = "nixos"; # Define your hostname.
|
# managed by cloud-init
|
||||||
|
# networking.hostName = "nixos"; # Define your hostname.
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
# Configure network proxy if necessary
|
# Configure network proxy if necessary
|
||||||
@ -40,24 +41,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;
|
||||||
@ -67,25 +50,15 @@
|
|||||||
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
|
# VM services
|
||||||
services.xserver.xkb = {
|
services.cloud-init.enable = true;
|
||||||
layout = "us";
|
|
||||||
variant = "";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
|
||||||
services.printing.enable = true;
|
|
||||||
|
|
||||||
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.openssh.settings.PasswordAuthentication = false;
|
||||||
|
services.openssh.settings.KbdInteractiveAuthentication = false;
|
||||||
services.flatpak.enable = true;
|
services.flatpak.enable = true;
|
||||||
|
|
||||||
|
|
||||||
# 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 = {
|
users.groups = {
|
||||||
cazzzer = {
|
cazzzer = {
|
||||||
gid = 1000;
|
gid = 1000;
|
||||||
@ -116,19 +89,6 @@
|
|||||||
programs.htop.enable = true;
|
programs.htop.enable = true;
|
||||||
programs.wireshark.enable = true;
|
programs.wireshark.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:
|
# List packages installed in system profile. To search, run:
|
||||||
# $ nix search wget
|
# $ nix search wget
|
||||||
|
|
||||||
@ -169,38 +129,8 @@
|
|||||||
whois
|
whois
|
||||||
yt-dlp
|
yt-dlp
|
||||||
zfs
|
zfs
|
||||||
# wget
|
|
||||||
];
|
];
|
||||||
|
|
||||||
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
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
@ -208,5 +138,4 @@
|
|||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "24.11"; # Did you read the comment?
|
system.stateVersion = "24.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{...}: {
|
{ ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./common
|
./mods
|
||||||
./workarounds
|
./workarounds
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{...}: {
|
{ ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./kb-input.nix
|
./kb-input.nix
|
||||||
];
|
];
|
@ -4,10 +4,10 @@
|
|||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cfg = config.common.kb-input;
|
cfg = config.mods.kb-input;
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
common.kb-input = {
|
mods.kb-input = {
|
||||||
enable = lib.mkEnableOption "input method and custom keyboard layout";
|
enable = lib.mkEnableOption "input method and custom keyboard layout";
|
||||||
};
|
};
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user