From 86ccf1964b5e30ead1b5f0d8ad376f9aa655d684 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 2 Nov 2022 00:15:19 +0100 Subject: tmpfs-root system-profile --- system-profiles/nfsroot.nix | 11 +++++------ system-profiles/tmpfs-root.nix | 12 ++++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 system-profiles/tmpfs-root.nix (limited to 'system-profiles') diff --git a/system-profiles/nfsroot.nix b/system-profiles/nfsroot.nix index 92cf98de..ab028de3 100644 --- a/system-profiles/nfsroot.nix +++ b/system-profiles/nfsroot.nix @@ -1,10 +1,14 @@ -{ config, pkgs, lib, flakeInputs, ... }: +{ config, pkgs, lib, flake, flakeInputs, ... }: with lib; let cfg = config.nfsroot; in { + imports = with flake.nixosModules.systemProfiles; [ + tmpfs-root + ]; + options = { nfsroot = { storeDevice = mkOption { @@ -34,11 +38,6 @@ in { then [] else [ pkgs.grub2 pkgs.syslinux ]); - fileSystems."/" = mkImageMediaOverride - { fsType = "tmpfs"; - options = [ "mode=0755" ]; - }; - # In stage 1, mount a tmpfs on top of /nix/store (the squashfs # image) to make this a live CD. fileSystems."/nix/.ro-store" = mkImageMediaOverride diff --git a/system-profiles/tmpfs-root.nix b/system-profiles/tmpfs-root.nix new file mode 100644 index 00000000..d0b3be76 --- /dev/null +++ b/system-profiles/tmpfs-root.nix @@ -0,0 +1,12 @@ +{ ... }: { + config = { + fileSystems."/" = { + fsType = "tmpfs"; + options = [ "mode=0755" ]; + }; + + security.sudo.extraConfig = '' + Defaults lecture = never + ''; + }; +} -- cgit v1.2.3