Refactoring the config
This commit is contained in:
parent
9c3fc1879c
commit
0e866b1cb0
24 changed files with 355 additions and 304 deletions
21
hosts/iso/default.nix
Normal file
21
hosts/iso/default.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ pkgs, lib, ... }:
|
||||
let
|
||||
calamares-auto-start = pkgs.makeAutostartItem { name = "io.calamares.calamares"; package = pkgs.calamares-nixos; };
|
||||
in {
|
||||
# VMs
|
||||
services.spice-vdagentd.enable = true;
|
||||
services.qemuGuest.enable = true;
|
||||
|
||||
# Calamares for graphical installation
|
||||
environment.systemPackages = with pkgs; [
|
||||
libsForQt5.kpmcore
|
||||
calamares-nixos
|
||||
calamares-auto-start
|
||||
calamares-nixos-extensions
|
||||
];
|
||||
|
||||
networking.hostName = "lyes-iso";
|
||||
networking.wireless.enable = lib.mkForce false;
|
||||
|
||||
# services.displayManager.autoLogin.user = lib.mkForce "lyes";
|
||||
}
|
||||
117
hosts/lyes-pc/default.nix
Normal file
117
hosts/lyes-pc/default.nix
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
# Networking
|
||||
networking.hostName = "lyes-pc";
|
||||
|
||||
# Kernel
|
||||
# boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# Boot
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.systemd-boot.configurationLimit = 10;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.systemd-boot.extraEntries = {
|
||||
"fedora.conf" = ''
|
||||
title Fedora
|
||||
efi /EFI/fedora/grubx64.efi
|
||||
'';
|
||||
};
|
||||
boot.kernelParams = [ "quiet" ];
|
||||
|
||||
# Reboot Timeout
|
||||
systemd.extraConfig = ''
|
||||
DefaultTimeoutStopSec=10s
|
||||
'';
|
||||
|
||||
# Swap
|
||||
zramSwap.enable = true;
|
||||
|
||||
# Filesystem
|
||||
fileSystems = {
|
||||
"/".options = [ "compress=zstd:1" ];
|
||||
"/home".options = [ "compress=zstd:1" ];
|
||||
"/nix".options = [ "compress=zstd:1" "noatime" ];
|
||||
};
|
||||
|
||||
# Optimisation
|
||||
|
||||
# nixpkgs.hostPlatform = {
|
||||
# gcc.arch = "tigerlake";
|
||||
# gcc.tune = "tigerlake";
|
||||
# system = "x86_64-linux";
|
||||
# };
|
||||
|
||||
# nix.settings.system-features = [ "gccarch-tigerlake" "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||
|
||||
# # Increasing the limit of files to help with compilation
|
||||
# security.pam.loginLimits = [{
|
||||
# domain = "*";
|
||||
# type = "soft";
|
||||
# item = "nofile";
|
||||
# value = "8192";
|
||||
# }];
|
||||
|
||||
# # Resources Limit
|
||||
# nix.settings = {
|
||||
# max-jobs = 7;
|
||||
# cores = 2;
|
||||
# };
|
||||
|
||||
# # OOM configuration
|
||||
# systemd = {
|
||||
# # Create a separate slice for nix-daemon that is
|
||||
# # memory-managed by the userspace systemd-oomd killer
|
||||
# slices."nix-daemon".sliceConfig = {
|
||||
# ManagedOOMMemoryPressure = "kill";
|
||||
# ManagedOOMMemoryPressureLimit = "50%";
|
||||
# };
|
||||
# services."nix-daemon".serviceConfig.Slice = "nix-daemon.slice";
|
||||
|
||||
# # If a kernel-level OOM event does occur anyway,
|
||||
# # strongly prefer killing nix-daemon child processes
|
||||
# services."nix-daemon".serviceConfig.OOMScoreAdjust = 1000;
|
||||
|
||||
# services."nix-daemon".serviceConfig.MemoryHigh = "16G";
|
||||
# services."nix-daemon".serviceConfig.MemoryMax = "20G";
|
||||
# };
|
||||
|
||||
# Disabling failing test
|
||||
nixpkgs.overlays = [ (final: prev: {
|
||||
# orc = prev.orc.overrideAttrs (_: { doCheck = false; });
|
||||
# gsl = prev.gsl.overrideAttrs (_: { doCheck = false; });
|
||||
fprintd = prev.fprintd.overrideAttrs (super: {
|
||||
# doCheck = false;
|
||||
# buildInputs = super.buildInputs or [ ] ++ (with pkgs; [ libpam-wrapper (pkgs.python3.withPackages (python-pkgs: [ python-pkgs.pycairo python-pkgs.dbus-python python-pkgs.python-dbusmock ])) ]);
|
||||
mesonCheckFlags = [
|
||||
# PAM related checks are timing out
|
||||
"--no-suite" "fprintd"
|
||||
];
|
||||
});
|
||||
libsrtp = prev.libsrtp.overrideAttrs (_: {
|
||||
mesonFlags = [
|
||||
"-Dcrypto-library=openssl"
|
||||
"-Dcrypto-library-kdf=disabled"
|
||||
"-Ddoc=disabled"
|
||||
"-Dtests=disabled"
|
||||
];
|
||||
});
|
||||
# # haskellPackages.crypton = pkgs.haskell.lib.overrideCabal prev.crypton (_: { doCheck = false; });
|
||||
# # haskellPackages.cryptonite = pkgs.haskell.lib.overrideCabal prev.cryptonite (_: { doCheck = false; });
|
||||
}) ];
|
||||
|
||||
# nixpkgs.config.packageOverrides = pkgs: {
|
||||
# haskellPackages = pkgs.haskellPackages.override {
|
||||
# overrides = hsSelf: hsSuper: {
|
||||
# crypton = pkgs.haskell.lib.overrideCabal hsSuper.crypton (_: { doCheck = false; });
|
||||
# cryptonite = pkgs.haskell.lib.overrideCabal hsSuper.cryptonite (_: { doCheck = false; });
|
||||
# crypton-x509-validation = pkgs.haskell.lib.overrideCabal hsSuper.crypton-x509-validation (oa: { doCheck = false; });
|
||||
# tls = pkgs.haskell.lib.overrideCabal hsSuper.tls (oa: { doCheck = false; });
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
}
|
||||
54
hosts/lyes-pc/hardware-configuration.nix
Normal file
54
hosts/lyes-pc/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# 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 + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/2a1aab81-a8df-4781-8946-f00ac1d48db7";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=nixos_root" ];
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."luks-8d74423e-0529-46e3-87b9-b948c568a6c3".device = "/dev/disk/by-uuid/8d74423e-0529-46e3-87b9-b948c568a6c3";
|
||||
|
||||
fileSystems."/home" =
|
||||
{ device = "/dev/disk/by-uuid/2a1aab81-a8df-4781-8946-f00ac1d48db7";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=home" ];
|
||||
};
|
||||
|
||||
fileSystems."/nix" =
|
||||
{ device = "/dev/disk/by-uuid/2a1aab81-a8df-4781-8946-f00ac1d48db7";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=nixos_nix" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/94CB-9035";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
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.wlp9s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
# high-resolution display
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue