moving toward a multi-machine configuration !
This commit is contained in:
parent
6cc7df17a7
commit
4cef631a8c
18 changed files with 250 additions and 181 deletions
38
machines/desktop.nix
Normal file
38
machines/desktop.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
config,
|
||||
pkgs ? import (config.root + /pkgs),
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.dconf.enable = true;
|
||||
|
||||
systemd = {
|
||||
defaultUnit = "graphical.target";
|
||||
};
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
audio.enable = true;
|
||||
pulse.enable = true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
};
|
||||
wireplumber.enable = true;
|
||||
};
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-color-emoji
|
||||
liberation_ttf
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
mplus-outline-fonts.githubRelease
|
||||
dina-font
|
||||
proggyfonts
|
||||
font-awesome
|
||||
];
|
||||
|
||||
time.timeZone = "Europe/Paris";
|
||||
i18n.defaultLocale = pkgs.lib.mkDefault "fr_FR.UTF-8";
|
||||
}
|
||||
31
machines/memere/default.nix
Normal file
31
machines/memere/default.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
pkgs ? import <nixpkgs>, # Do not use jail.nix packages
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
/etc/nixos/security.nix
|
||||
/etc/nixos/nix.nix
|
||||
./users.nix
|
||||
];
|
||||
|
||||
services.desktopManager.gnome.enable = true;
|
||||
services.gnome = {
|
||||
core-apps.enable = true;
|
||||
core-shell.enable = true;
|
||||
gnome-software.enable = true;
|
||||
};
|
||||
|
||||
nix.nixPath = [
|
||||
"nixos-config=/etc/nixos/machines/memere/default.nix"
|
||||
"nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
|
||||
"/nix/var/nix/profiles/per-user/root/channels"
|
||||
];
|
||||
|
||||
networking.hostName = "pepere";
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
i18n.defaultLocale = "fr_FR.UTF-8";
|
||||
}
|
||||
24
machines/memere/users.nix
Normal file
24
machines/memere/users.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
source = import (config.root + /npins);
|
||||
home-manager = source.home-manager;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(import "${home-manager}/nixos")
|
||||
];
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
|
||||
users.users.memere.isNormalUser = true;
|
||||
home-manager.users.memere =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ ];
|
||||
programs.bash.enable = true;
|
||||
|
||||
# The state version is required and should stay at the version you
|
||||
# originally installed.
|
||||
home.stateVersion = "26.05";
|
||||
};
|
||||
}
|
||||
60
machines/niczos/bootloader.nix
Normal file
60
machines/niczos/bootloader.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
boot = {
|
||||
loader = {
|
||||
grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
efiInstallAsRemovable = true;
|
||||
enableCryptodisk = true;
|
||||
device = "nodev";
|
||||
extraConfig = ''
|
||||
source (crypto0)/os/arch/boot/grub/grub.cfg
|
||||
'';
|
||||
};
|
||||
efi.efiSysMountPoint = "/boot/efi";
|
||||
};
|
||||
initrd = {
|
||||
luks = {
|
||||
devices.safe = {
|
||||
device = "/dev/disk/by-uuid/16fe9b20-c31d-4b51-9b06-670713597c07";
|
||||
preLVM = true;
|
||||
bypassWorkqueues = true;
|
||||
};
|
||||
};
|
||||
systemd = {
|
||||
initrdBin = with pkgs; [
|
||||
cryptsetup
|
||||
];
|
||||
};
|
||||
kernelModules = [
|
||||
"cryptd"
|
||||
"uas"
|
||||
"usbcore"
|
||||
"usb_storage"
|
||||
"vfat"
|
||||
"nls_cp437"
|
||||
"nls_iso8859_1"
|
||||
];
|
||||
availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"rtsx_pci_sdmmc"
|
||||
"dm_crypt"
|
||||
"crypto_user"
|
||||
];
|
||||
supportedFilesystems = [
|
||||
"btrfs"
|
||||
"vfat"
|
||||
"luks"
|
||||
];
|
||||
};
|
||||
kernel.sysctl."kernel.sysrq" = 1;
|
||||
};
|
||||
}
|
||||
80
machines/niczos/default.nix
Normal file
80
machines/niczos/default.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
pkgs = import /etc/nixos/pkgs/jailed-packages.nix;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
/etc/nixos/security.nix
|
||||
/etc/nixos/nix.nix
|
||||
/etc/nixos/machines/desktop.nix
|
||||
./bootloader.nix
|
||||
./hardware-configuration.nix
|
||||
./hardware.nix
|
||||
./kernel.nix
|
||||
./security.nix
|
||||
./users.nix
|
||||
];
|
||||
|
||||
nix.nixPath = [
|
||||
"nixos-config=/etc/nixos/machines/niczos/default.nix"
|
||||
"nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
|
||||
"/nix/var/nix/profiles/per-user/root/channels"
|
||||
];
|
||||
|
||||
networking.hostName = "niczos";
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
systemd = {
|
||||
services."getty@tty1" = {
|
||||
overrideStrategy = "asDropin";
|
||||
serviceConfig.ExecStart = [
|
||||
""
|
||||
"@${pkgs.util-linux}/sbin/agetty agetty --login-program ${config.services.getty.loginProgram} --autologin zo --noclear --keep-baud %I 115200,38400,9600 $TERM"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
steam.enable = true;
|
||||
fuse.userAllowOther = true;
|
||||
};
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
storageDriver = "btrfs";
|
||||
};
|
||||
|
||||
# Waydroid configuration
|
||||
virtualisation.waydroid = {
|
||||
enable = true;
|
||||
package = pkgs.waydroid-nftables.unjailed;
|
||||
};
|
||||
security = {
|
||||
rtkit.enable = true;
|
||||
wrappers = {
|
||||
waydroid = {
|
||||
source = "${pkgs.waydroid}/bin/waydroid";
|
||||
capabilities = "cap_net_admin=ep";
|
||||
enable = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
program = "waydroid";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.curl
|
||||
pkgs.wget
|
||||
pkgs.cryptsetup
|
||||
pkgs.cachix
|
||||
];
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
system.copySystemConfiguration = true;
|
||||
system.stateVersion = "26.05";
|
||||
}
|
||||
45
machines/niczos/hardware-configuration.nix
Normal file
45
machines/niczos/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# 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,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.kernelParams = [ "i915.modeset=1" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.blacklistedKernelModules = [ "nouveau" ];
|
||||
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/mapper/safe";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=os/nix" ];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/games" = {
|
||||
device = "/dev/mapper/safe";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"ssd"
|
||||
"lazytime"
|
||||
"subvol=game"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/boot/efi" = {
|
||||
device = "/dev/disk/by-uuid/4FD7-458E";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
81
machines/niczos/hardware.nix
Normal file
81
machines/niczos/hardware.nix
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
services.printing.enable = true;
|
||||
services.printing.drivers = [
|
||||
pkgs.epson-escpr
|
||||
pkgs.epsonscan2
|
||||
];
|
||||
|
||||
boot = {
|
||||
kernelParams = [
|
||||
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
|
||||
"nvidia.NVreg_TemporaryFilePath=/var/tmp"
|
||||
"usb-storage.quirks=152d:0578:u"
|
||||
];
|
||||
};
|
||||
|
||||
hardware = {
|
||||
enableRedistributableFirmware = lib.mkDefault true;
|
||||
|
||||
########## Printers and scanners ##########
|
||||
sane.enable = true;
|
||||
|
||||
######### Nvidia Quadro RTX 3000m #########
|
||||
graphics.enable = true;
|
||||
nvidia = {
|
||||
open = false; # Not compatible with current GPU
|
||||
modesetting.enable = false;
|
||||
powerManagement.enable = true; # Should be false cause GPU too old, but fixes hibernate/suspend issues
|
||||
powerManagement.finegrained = false; # GPU too old
|
||||
nvidiaSettings = true;
|
||||
prime = {
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
###########################################
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
settings = {
|
||||
General = {
|
||||
# Shows battery charge of connected devices on supported
|
||||
# Bluetooth adapters. Defaults to 'false'.
|
||||
Experimental = true;
|
||||
FastConnectable = true;
|
||||
};
|
||||
Policy = {
|
||||
AutoEnable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.thermald.enable = lib.mkDefault true;
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||
|
||||
# RAM Management
|
||||
zramSwap.enable = true;
|
||||
systemd.oomd = {
|
||||
enable = true; # OOM Killer !!!
|
||||
enableUserSlices = true;
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/var/lib/swapfile";
|
||||
size = 16 * 1024; # 16 GiB
|
||||
}
|
||||
];
|
||||
}
|
||||
9
machines/niczos/kernel.nix
Normal file
9
machines/niczos/kernel.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
let
|
||||
sources = import /etc/nixos/npins/default.nix;
|
||||
cachy-source = import sources.nix-cachyos-kernel;
|
||||
cachy-kernel =
|
||||
cachy-source.outputs.legacyPackages.x86_64-linux.linuxPackages-cachyos-bore-lto-x86_64-v3;
|
||||
in
|
||||
{
|
||||
boot.kernelPackages = cachy-kernel;
|
||||
}
|
||||
7
machines/niczos/security.nix
Normal file
7
machines/niczos/security.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
# Classic deny all
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 1716 ];
|
||||
allowedUDPPorts = [ 1716 ];
|
||||
};
|
||||
}
|
||||
55
machines/niczos/users.nix
Normal file
55
machines/niczos/users.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
source = import /etc/nixos/npins;
|
||||
home-manager = source.home-manager;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(import "${home-manager}/nixos")
|
||||
];
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
|
||||
users.users.zo = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"audio"
|
||||
"video"
|
||||
"network"
|
||||
"docker"
|
||||
];
|
||||
packages = [ pkgs.home-manager ];
|
||||
shell = pkgs.bash;
|
||||
};
|
||||
|
||||
users.users.raphou406 = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
"audio"
|
||||
"video"
|
||||
"network"
|
||||
];
|
||||
shell = pkgs.bash;
|
||||
};
|
||||
|
||||
users.users.flake = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
"audio"
|
||||
"video"
|
||||
"network"
|
||||
];
|
||||
shell = pkgs.bash;
|
||||
};
|
||||
|
||||
users.users.ella = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
"audio"
|
||||
"video"
|
||||
"network"
|
||||
];
|
||||
shell = pkgs.bash;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue