summaryrefslogtreecommitdiff
path: root/system-profiles
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-11-02 00:15:19 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-11-02 00:15:19 +0100
commit86ccf1964b5e30ead1b5f0d8ad376f9aa655d684 (patch)
treee15c0c338518c34c1e7066a1bded2ade641564f2 /system-profiles
parent42984e77041cfc95d333319bef0b2d8f441f56d3 (diff)
downloadnixos-86ccf1964b5e30ead1b5f0d8ad376f9aa655d684.tar
nixos-86ccf1964b5e30ead1b5f0d8ad376f9aa655d684.tar.gz
nixos-86ccf1964b5e30ead1b5f0d8ad376f9aa655d684.tar.bz2
nixos-86ccf1964b5e30ead1b5f0d8ad376f9aa655d684.tar.xz
nixos-86ccf1964b5e30ead1b5f0d8ad376f9aa655d684.zip
tmpfs-root system-profile
Diffstat (limited to 'system-profiles')
-rw-r--r--system-profiles/nfsroot.nix11
-rw-r--r--system-profiles/tmpfs-root.nix12
2 files changed, 17 insertions, 6 deletions
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 @@
1{ config, pkgs, lib, flakeInputs, ... }: 1{ config, pkgs, lib, flake, flakeInputs, ... }:
2 2
3with lib; 3with lib;
4 4
5let 5let
6 cfg = config.nfsroot; 6 cfg = config.nfsroot;
7in { 7in {
8 imports = with flake.nixosModules.systemProfiles; [
9 tmpfs-root
10 ];
11
8 options = { 12 options = {
9 nfsroot = { 13 nfsroot = {
10 storeDevice = mkOption { 14 storeDevice = mkOption {
@@ -34,11 +38,6 @@ in {
34 then [] 38 then []
35 else [ pkgs.grub2 pkgs.syslinux ]); 39 else [ pkgs.grub2 pkgs.syslinux ]);
36 40
37 fileSystems."/" = mkImageMediaOverride
38 { fsType = "tmpfs";
39 options = [ "mode=0755" ];
40 };
41
42 # In stage 1, mount a tmpfs on top of /nix/store (the squashfs 41 # In stage 1, mount a tmpfs on top of /nix/store (the squashfs
43 # image) to make this a live CD. 42 # image) to make this a live CD.
44 fileSystems."/nix/.ro-store" = mkImageMediaOverride 43 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 @@
1{ ... }: {
2 config = {
3 fileSystems."/" = {
4 fsType = "tmpfs";
5 options = [ "mode=0755" ];
6 };
7
8 security.sudo.extraConfig = ''
9 Defaults lecture = never
10 '';
11 };
12}