From 4feef7b1c143475db0c92d65f6b91dd5b304e6c2 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Tue, 2 Jan 2024 20:58:18 +0100 Subject: [PATCH] sperate boot into option --- modules/boot/default.nix | 7 +++++++ modules/boot/systemd/default.nix | 24 ++++++++++++++++++++++++ modules/default.nix | 1 + modules/nix/default.nix | 1 + systems/inugami/default.nix | 7 ------- systems/kami/default.nix | 21 ++------------------- systems/tuny/default.nix | 9 +-------- systems/tuny/hardware-configuration.nix | 9 --------- systems/yokai/default.nix | 2 -- 9 files changed, 36 insertions(+), 45 deletions(-) create mode 100644 modules/boot/default.nix create mode 100644 modules/boot/systemd/default.nix diff --git a/modules/boot/default.nix b/modules/boot/default.nix new file mode 100644 index 0000000..469f0e3 --- /dev/null +++ b/modules/boot/default.nix @@ -0,0 +1,7 @@ +{ ... }: + +{ + imports = [ + ./systemd + ]; +} diff --git a/modules/boot/systemd/default.nix b/modules/boot/systemd/default.nix new file mode 100644 index 0000000..de79e05 --- /dev/null +++ b/modules/boot/systemd/default.nix @@ -0,0 +1,24 @@ +{ config, lib, ... }: + +let cfg = config.jopejoe1.boot.systemd; +in { + options.jopejoe1.boot.systemd = { + enable = lib.mkEnableOption "Enable Systemd boot"; + }; + + config = lib.mkIf cfg.enable { + boot = { + loader = { + systemd-boot = { + enable = true; + configurationLimit = 10; + editor = false; + }; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; + }; + }; + }; +} diff --git a/modules/default.nix b/modules/default.nix index 9b2bc2b..b399889 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -6,6 +6,7 @@ ./audio ./auto-update ./bluetooth + ./boot ./events ./kodi ./local diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 4bb4985..b0998b4 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -67,6 +67,7 @@ in { system.stateVersion = "24.05"; services.openssh.enable = true; + systemd.services.nix-daemon.serviceConfig.LimitNOFILE = lib.mkForce 1048576000; }; } diff --git a/systems/inugami/default.nix b/systems/inugami/default.nix index ecc6fee..7760ca5 100644 --- a/systems/inugami/default.nix +++ b/systems/inugami/default.nix @@ -40,11 +40,4 @@ }; powerManagement.cpuFreqGovernor = "ondemand"; - - programs = { - git = { - enable = true; - lfs.enable = true; - }; - }; } diff --git a/systems/kami/default.nix b/systems/kami/default.nix index 1f0bafa..cdb1e47 100644 --- a/systems/kami/default.nix +++ b/systems/kami/default.nix @@ -28,6 +28,7 @@ repo-sync.enable = true; jopejoe1.enable = true; root.enable = true; + boot.systemd.enable = true; }; networking = { @@ -55,17 +56,6 @@ boot = { kernelPackages = pkgs.linuxPackages_testing; - loader = { - systemd-boot = { - enable = true; - configurationLimit = 10; - editor = false; - }; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot/efi"; - }; - }; }; time.timeZone = "Europe/Berlin"; @@ -109,18 +99,11 @@ xwayland.enable = true; kdeconnect.enable = true; gamemode.enable = true; - git = { - enable = true; - lfs.enable = true; - }; }; console = { enable = true; keyMap = "de"; }; - nix.settings.system-features = - [ "gccarch-alderlake" "benchmark" "big-parallel" "kvm" "nixos-test" ]; - systemd.services.nix-daemon.serviceConfig.LimitNOFILE = - lib.mkForce 1048576000; + nix.settings.system-features = [ "gccarch-alderlake" "benchmark" "big-parallel" "kvm" "nixos-test" ]; } diff --git a/systems/tuny/default.nix b/systems/tuny/default.nix index ac6caf2..0e3999e 100644 --- a/systems/tuny/default.nix +++ b/systems/tuny/default.nix @@ -16,17 +16,10 @@ jopejoe1.enable = true; nix.enable = true; root.enable = true; + boot.systemd.enable = true; }; networking = { hostName = "tuny"; }; - boot.loader.grub.device = "/dev/sda"; - - programs = { - git = { - enable = true; - lfs.enable = true; - }; - }; environment.systemPackages = with pkgs; [ mixxx ]; diff --git a/systems/tuny/hardware-configuration.nix b/systems/tuny/hardware-configuration.nix index 8637b21..f563227 100644 --- a/systems/tuny/hardware-configuration.nix +++ b/systems/tuny/hardware-configuration.nix @@ -1,6 +1,3 @@ -# 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, ... }: { @@ -28,13 +25,7 @@ swapDevices = [{ device = "/dev/disk/by-uuid/8569ee66-b939-4ce8-a94a-dca7df5e301b"; }]; - # 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..useDHCP`. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = diff --git a/systems/yokai/default.nix b/systems/yokai/default.nix index 5b4193c..0986fe0 100644 --- a/systems/yokai/default.nix +++ b/systems/yokai/default.nix @@ -50,8 +50,6 @@ kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; loader = { generic-extlinux-compatible.enable = true; - systemd-boot.configurationLimit = 10; - systemd-boot.editor = false; }; }; }