diff --git a/modules/nixos/system/default.nix b/modules/nixos/system/default.nix index 6e7421ea..37c35a03 100644 --- a/modules/nixos/system/default.nix +++ b/modules/nixos/system/default.nix @@ -10,6 +10,7 @@ ./logind.nix ./logs.nix ./misc.nix + ./modern.nix ./monitoring.nix ./oomd.nix ./printing.nix diff --git a/modules/nixos/system/modern.nix b/modules/nixos/system/modern.nix new file mode 100644 index 00000000..a8d6ba8c --- /dev/null +++ b/modules/nixos/system/modern.nix @@ -0,0 +1,25 @@ +# to quite an opinionated stance i think all these options help create a more +# modern nixos feel this happens by removing parts of the system i don't really +# like i.e. perl, mutable /etc, activation scripts etc. a lot of these options +# are also directly needed by each other to work. +# +# WARNING: some of these options are experimental meaning they will and can +# break things. so use at your own risk +{ + # We enable Systemd in the initrd so we can use it to mount the root + # filesystem this will remove Perl form the activation + boot.initrd.systemd.enable = true; + + # Declarative user management + # either use this or systemd-sysusers :D + services.userborn.enable = true; + + system = { + # nixos-init will going to make our system more robust in principal + # see + nixos-init.enable = true; + + # mount /etc as a read-only overlay filesystem + etc.overlay.enable = true; + }; +} diff --git a/modules/nixos/system/size.nix b/modules/nixos/system/size.nix index 1f05da96..b6cf9149 100644 --- a/modules/nixos/system/size.nix +++ b/modules/nixos/system/size.nix @@ -3,19 +3,6 @@ let inherit (lib) mkForce; in { - boot = { - # this can break things, particularly if you use containers - # personally I don't so it should be fine to disable this - enableContainers = false; - - # We enable Systemd in the initrd so we can use it to mount the root - # filesystem this will remove Perl form the activation - initrd.systemd.enable = true; - }; - - # Declarative user management - services.userborn.enable = true; - environment = { # disable stub-ld, this exists to kill dynamically linked executables, since they cannot work # on NixOS, however we know that so we don't need to see the warning @@ -26,8 +13,6 @@ in defaultPackages = mkForce [ ]; }; - system.etc.overlay.enable = true; - programs = { # this is on by default. but i don't use nano nano.enable = false;