nixos: Minor tweaks
This commit is contained in:
		@@ -10,7 +10,7 @@ in
 | 
			
		||||
{
 | 
			
		||||
  options.my.dynamic-motd = with lib.types; {
 | 
			
		||||
    enable = mkBoolOpt' true "Whether to enable the dynamic message of the day PAM module.";
 | 
			
		||||
    services = mkOpt' (listOf str) [ "login" "ssh" ] "PAM services to enable the dynamic message of the day module for.";
 | 
			
		||||
    services = mkOpt' (listOf str) [ "login" "sshd" ] "PAM services to enable the dynamic message of the day module for.";
 | 
			
		||||
    script = mkOpt' (nullOr lines) null "Script that generates message of the day.";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -17,6 +17,7 @@ in
 | 
			
		||||
        # Explicitly unset fallback DNS (Nix module will not allow for a blank config)
 | 
			
		||||
        extraConfig = ''
 | 
			
		||||
          FallbackDNS=
 | 
			
		||||
          Cache=no-negative
 | 
			
		||||
        '';
 | 
			
		||||
      };
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -109,6 +109,10 @@ in
 | 
			
		||||
          # These are set in environment.etc by the sshd module, but because their mode needs to be changed,
 | 
			
		||||
          # setup-etc will copy them instead of symlinking
 | 
			
		||||
          "/etc/ssh/authorized_keys.d"
 | 
			
		||||
 | 
			
		||||
          # Auto-generated (on activation?)
 | 
			
		||||
          "/root/.nix-channels"
 | 
			
		||||
          "/root/.nix-defexpr"
 | 
			
		||||
        ];
 | 
			
		||||
        persistence.config = {
 | 
			
		||||
          # In impermanence the key in `environment.persistence.*` (aka name passed the attrsOf submodule) sets the
 | 
			
		||||
 
 | 
			
		||||
@@ -44,27 +44,37 @@ in
 | 
			
		||||
          _module.args.name = lib.mkForce user'.name;
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
      tmproot.persistence.config =
 | 
			
		||||
      let
 | 
			
		||||
        perms = {
 | 
			
		||||
          mode = "0700";
 | 
			
		||||
          user = user.name;
 | 
			
		||||
          group = user.group;
 | 
			
		||||
      tmproot = {
 | 
			
		||||
        unsaved.ignore = [
 | 
			
		||||
          # Auto-generated (on activation?)
 | 
			
		||||
          "/home/${user'.name}/.nix-profile"
 | 
			
		||||
          "/home/${user'.name}/.nix-defexpr"
 | 
			
		||||
 | 
			
		||||
          "/home/${user'.name}/.config/fish/fish_variables"
 | 
			
		||||
        ];
 | 
			
		||||
        persistence.config =
 | 
			
		||||
        let
 | 
			
		||||
          perms = {
 | 
			
		||||
            mode = "0700";
 | 
			
		||||
            user = user.name;
 | 
			
		||||
            group = user.group;
 | 
			
		||||
          };
 | 
			
		||||
        in
 | 
			
		||||
        {
 | 
			
		||||
          files = map (file: {
 | 
			
		||||
            inherit file;
 | 
			
		||||
            parentDirectory = perms;
 | 
			
		||||
          }) [
 | 
			
		||||
            "/home/${user'.name}/.bash_history"
 | 
			
		||||
          ];
 | 
			
		||||
          directories = map (directory: {
 | 
			
		||||
            inherit directory;
 | 
			
		||||
          } // perms) [
 | 
			
		||||
            # Persist all of fish; it's not easy to persist just the history fish won't let you move it to a different
 | 
			
		||||
            # directory. Also it does some funny stuff and can't really be a symlink it seems.
 | 
			
		||||
            "/home/${user'.name}/.local/share/fish"
 | 
			
		||||
          ];
 | 
			
		||||
        };
 | 
			
		||||
      in {
 | 
			
		||||
        files = map (file: {
 | 
			
		||||
          inherit file;
 | 
			
		||||
          parentDirectory = perms;
 | 
			
		||||
        }) [
 | 
			
		||||
          "/home/${user'.name}/.bash_history"
 | 
			
		||||
        ];
 | 
			
		||||
        directories = map (directory: {
 | 
			
		||||
          inherit directory;
 | 
			
		||||
        } // perms) [
 | 
			
		||||
          # Persist all of fish; it's not easy to persist just the history fish won't let you move it to a different
 | 
			
		||||
          # directory. Also it does some funny stuff and can't really be a symlink it seems.
 | 
			
		||||
          "/home/${user'.name}/.local/share/fish"
 | 
			
		||||
        ];
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user